Socket Header Files

Socket header files contain data definitions, structures, constants, macros, and options used by socket subroutines.

An application program must include the appropriate header file to make use of structures or other information a particular socket subroutine requires. Commonly used socket header files are:
Item Description
/usr/include/netinet/in.h Defines Internet constants and structures.
/usr/include/arpa/nameser.h Contains Internet name server information.
/usr/include/netdb.h Contains data definitions for socket subroutines.
/usr/include/resolv.h Contains resolver global definitions and variables.
/usr/include/sys/socket.h Contains data definitions and socket structures.
/usr/include/sys/socketvar.h Defines the kernel structure per socket and contains buffer queues.
/usr/include/sys/types.h Contains data type definitions.
/usr/include/sys/un.h Defines structures for the UNIX interprocess communication domain.
/usr/include/sys/ndd_var.h Defines structures for the operating system Network Device Driver (NDD) domain.
/usr/include/sys/atmsock.h Contains constants and structures for the Asynchronous Transfer Mode (ATM) protocol in the operating system NDD domain.

In addition to commonly used socket header files, Internet address translation subroutines require the inclusion of the inet.h file. The inet.h file is located in the /usr/include/arpa directory.