Chapter 3 : Linux Sockets Table

Application

Family

Type

Protocol

Structure

APIs

TCP IPv4 Server

AF_INET

SOCK_STREAM

IPPROTO_TCP

sockaddr_in

TCP IPv4 Client

AF_INET

SOCK_STREAM

IPPROTO_TCP

sockaddr_in

UDP IPv4 Server

AF_INET

SOCK_DGRAM

IPPROTO_UDP

sockaddr_in

UDP IPv4 Client

AF_INET

SOCK_DGRAM

IPPROTO_UDP

sockaddr_in

TCP IPv6 Server

AF_INET6

SOCK_STREAM

IPPROTO_TCP

sockaddr_in6

TCP IPv6 Client

AF_INET6

SOCK_STREAM

IPPROTO_TCP

sockaddr_in6

UDP IPv6 Server

AF_INET6

SOCK_DGRAM

IPPROTO_UDP

sockaddr_in6

UDP IPv6 Client

AF_INET6

SOCK_DGRAM

IPPROTO_UDP

sockaddr_in6

Raw TCP IPv4 Server

AF_INET

SOCK_RAW

IPPROTO_TCP

sockaddr_in

Raw TCP IPv4 Client

AF_INET

SOCK_RAW

IPPROTO_TCP

sockaddr_in

Raw UDP IPv4 Server

AF_INET

SOCK_RAW

IPPROTO_UDP

sockaddr_in

Raw UDP IPv4 Client

AF_INET

SOCK_RAW

IPPROTO_UDP

sockaddr_in

Raw TCP IPv6 Server

AF_INET6

SOCK_RAW

IPPROTO_TCP

sockaddr_in6

Raw TCP IPv6 Client

AF_INET6

SOCK_RAW

IPPROTO_TCP

sockaddr_in6

Raw UDP IPv6 Server

AF_INET6

SOCK_RAW

IPPROTO_UDP

sockaddr_in6

Raw UDP IPv6 Client

AF_INET6

SOCK_RAW

IPPROTO_UDP

sockaddr_in6

x

AF_INET

SOCK_RAW

IPPROTO_RAW

x

AF_INET6

SOCK_RAW

IPPROTO_RAW

Unix Domain Server

AF_UNIX

SOCK_STREAM

0

sockaddr_un

Unix Domain Client

AF_UNIX

SOCK_STREAM

0

sockaddr_un

x

PF_UNIX

SOCK_DGRAM

0

sockaddr_un

x

AF_ALG

SOCK_SEQPACKET

0

sockaddr_alg

x

PF_ROUTE

SOCK_RAW

0

x

PF_PACKET

SOCK_DGRAM

0

sockaddr_ll

x

PF_PACKET

SOCK_DGRAM

htons(ETH_P_PAE)

sockaddr_ll

x

PF_PACKET

SOCK_RAW

htons(ETH_P_PAE)

sockaddr_ll

x

PF_PACKET

SOCK_RAW

htons(ETH_P_ALL)

sockaddr_ll

iwevent

PF_NETLINK

SOCK_RAW

NETLINK_ROUTE

sockaddr_nl

Netlink

PF_NETLINK

SOCK_RAW

NETLINK_USER

sockaddr_nl

ping

ping6

udhcpc

iw

iwconfig

AF_INET

SOCK_DGRAM

0

iwpriv

AF_INET

SOCK_DGRAM

0

iwlist

AF_INET

SOCK_DGRAM

0