$ cat /usr/include/sys/socket.h | grep SOCK_ #define SOCK_STREAM NC_TPI_COTS /* stream socket */ #define SOCK_DGRAM NC_TPI_CLTS /* datagram socket */ #define SOCK_RAW NC_TPI_RAW /* raw-protocol interface */ #define SOCK_STREAM 2 /* stream socket */ #define SOCK_DGRAM 1 /* datagram socket */ #define SOCK_RAW 4 /* raw-protocol interface */ #define SOCK_RDM 5 /* reliably-delivered message */ #define SOCK_SEQPACKET 6 /* sequenced packet stream */ $ cat /usr/include/netinet/in.h | grep IPPROTO_ #define IPPROTO_IP 0 /* dummy for IP */ #define IPPROTO_HOPOPTS 0 /* Hop by hop header for IPv6 */ #define IPPROTO_ICMP 1 /* control message protocol */ #define IPPROTO_IGMP 2 /* group control protocol */ #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ #define IPPROTO_ENCAP 4 /* IP in IP encapsulation */ #define IPPROTO_TCP 6 /* tcp */ #define IPPROTO_EGP 8 /* exterior gateway protocol */ #define IPPROTO_PUP 12 /* pup */ #define IPPROTO_UDP 17 /* user datagram protocol */ #define IPPROTO_IDP 22 /* xns idp */ #define IPPROTO_IPV6 41 /* IPv6 encapsulated in IP */ #define IPPROTO_ROUTING 43 /* Routing header for IPv6 */ #define IPPROTO_FRAGMENT 44 /* Fragment header for IPv6 */ #define IPPROTO_RSVP 46 /* rsvp */ #define IPPROTO_ESP 50 /* IPsec Encap. Sec. Payload */ #define IPPROTO_AH 51 /* IPsec Authentication Hdr. */ #define IPPROTO_ICMPV6 58 /* ICMP for IPv6 */ #define IPPROTO_NONE 59 /* No next header for IPv6 */ #define IPPROTO_DSTOPTS 60 /* Destination options */ #define IPPROTO_HELLO 63 /* "hello" routing protocol */ #define IPPROTO_ND 77 /* UNOFFICIAL net disk proto */ #define IPPROTO_EON 80 /* ISO clnp */ #define IPPROTO_PIM 103 /* PIM routing protocol */ #define IPPROTO_SCTP 132 /* Stream Control */ #define IPPROTO_RAW 255 /* raw IP packet */ #define IPPROTO_MAX 256 $ cat /usr/include/sys/socket.h | grep AF_ #define SO_SRCADDR 0x2001 /* Internal: AF_UNIX source address */ #define SO_FILEP 0x2002 /* Internal: AF_UNIX file pointer */ #define SO_UNIX_CLOSE 0x2003 /* Internal: AF_UNIX peer closed */ #define AF_UNSPEC 0 /* unspecified */ #define AF_UNIX 1 /* local to host (pipes, portals) */ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #define AF_IMPLINK 3 /* arpanet imp addresses */ #define AF_PUP 4 /* pup protocols: e.g. BSP */ #define AF_CHAOS 5 /* mit CHAOS protocols */ #define AF_NS 6 /* XEROX NS protocols */ #define AF_NBS 7 /* nbs protocols */ #define AF_ECMA 8 /* european computer manufacturers */ #define AF_DATAKIT 9 /* datakit protocols */ #define AF_CCITT 10 /* CCITT protocols, X.25 etc */ #define AF_SNA 11 /* IBM SNA */ #define AF_DECnet 12 /* DECnet */ #define AF_DLI 13 /* Direct data link interface */ #define AF_LAT 14 /* LAT */ #define AF_HYLINK 15 /* NSC Hyperchannel */ #define AF_APPLETALK 16 /* Apple Talk */ #define AF_NIT 17 /* Network Interface Tap */ #define AF_802 18 /* IEEE 802.2, also ISO 8802 */ #define AF_OSI 19 /* umbrella for all families used */ #define AF_X25 20 /* CCITT X.25 in particular */ #define AF_OSINET 21 /* AFI = 47, IDI = 4 */ #define AF_GOSIP 22 /* U.S. Government OSI */ #define AF_IPX 23 /* Novell Internet Protocol */ #define AF_ROUTE 24 /* Internal Routing Protocol */ #define AF_LINK 25 /* Link-layer interface */ #define AF_INET6 26 /* Internet Protocol, Version 6 */ #define AF_KEY 27 /* Security Association DB socket */ #define AF_NCA 28 /* NCA socket */ #define AF_POLICY 29 /* Security Policy DB socket */ #define AF_MAX 29 * Common superset of at least AF_INET, AF_INET6 and AF_LINK sockaddr #define PF_UNSPEC AF_UNSPEC #define PF_UNIX AF_UNIX #define PF_INET AF_INET #define PF_IMPLINK AF_IMPLINK #define PF_PUP AF_PUP #define PF_CHAOS AF_CHAOS #define PF_NS AF_NS #define PF_NBS AF_NBS #define PF_ECMA AF_ECMA #define PF_DATAKIT AF_DATAKIT #define PF_CCITT AF_CCITT #define PF_SNA AF_SNA #define PF_DECnet AF_DECnet #define PF_DLI AF_DLI #define PF_LAT AF_LAT #define PF_HYLINK AF_HYLINK #define PF_APPLETALK AF_APPLETALK #define PF_NIT AF_NIT #define PF_802 AF_802 #define PF_OSI AF_OSI #define PF_X25 AF_X25 #define PF_OSINET AF_OSINET #define PF_GOSIP AF_GOSIP #define PF_IPX AF_IPX #define PF_ROUTE AF_ROUTE #define PF_LINK AF_LINK #define PF_INET6 AF_INET6 #define PF_KEY AF_KEY #define PF_NCA AF_NCA #define PF_POLICY AF_POLICY #define PF_MAX AF_MAX