Socket Domain | ||
|
|
|
PF_UNSPEC | Unspecified | struct sockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; |
PF_LOCAL
PF_UNIX PF_FILE |
BSD
method for accessing local named pipes.
#include <linux/un.h> struct sockaddr_un addr; addr.sun_family = AF_UNIX; strcpy(addr.sun_path, "/tmp/mysocket"); |
#define UNIX_PATH_MAX 108 struct sockaddr_un { sa_family_t sun_family; char sun_path[UNIX_PATH_MAX]; }; |
PF_INET | Internet
IPv4 protocol family
#include <linux/in.h> struct sockaddr_in addr; bzero(&addr, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = htons(9999); if ( inet_aton("127.0.0.1", &addr.sin_addr) == 0 ) perror("Addr conversion"); |
struct sockaddr_in { sa_family_t sin family; unsigned short int sin_port; struct in_addr sin_addr; unsigned char pad[]; }; |
AF_AX25 | Amateur
Radio AX.25
#include <linux/AX25.h> |
typedef struct { char ax25_call[7]; } ax25_address; struct sockaddr_ax25 { sa_family_t sax25_family; ax25_address sax25_call; int sax25_ndigis; }; |
PF_IPX | Novell
Internet Protocol
#include <linux/ipx.h> |
struct sockaddr_ipx { sa_family_t sipx_family; __u16 sipx_port; __u32 sipx_network; unsigned char sipx_node[IPX_NODE_LEN]; __u8 sipx_type; unsigned char sipx_zero; /* pad */ }; |
PF_APPLETALK | Appletalk
DDP
#include <linux/atalk.h> |
struct sockaddr_at { sa_family_t sat_family; u8 sat_port; struct at_addr { u16 s_net; u8 s_node; } sat_addr; char sat_zero[]; }; |
PF_NETROM | Amateur Radio NetROM | |
PF_BRIDGE | Multiprotocol Bridge | |
PF_ATMPVC | ATM PVCs | |
PF_X25 | (Reserved
for X.25 project)
#include <linux/x25.h> |
typedef struct { char x25_addr[16]; } x25_address; struct sockaddr_x25 { sa_family_t sx25_family; /* X.121 Address */ x25_address sx25_addr; }; |
PF_INET6 | IPv6
protocol family
#include <linux/in6.h> struct sockaddr_in6 addr6; bzero(&addr6, sizeof(addr6)); addr6.sin6_family = AF_INET6; addr6.sin6_port = htons(portnum); inet_pton("FF02::8EC:AA", &addr6.sin6_addr); |
struct in6_addr { union { u8 u6_addr8[16]; __u16 u6_addr16[8]; __u32 u6_addr32[4]; #if (~0UL) > 0xffffffff #ifndef __RELAX_IN6_ADDR_ALIGNMENT /* Alas, protocols do not respect 64bit alignment. rsvp/pim/... are broken. However, it is good idea to force correct alignment always, when it is possible. */ __u64 u6_addr64[2]; #endif #endif } in6_u; #define s6_addr in6_u.u6_addr8 #define s6_addr16 in6_u.u6_addr16 #define s6_addr32 in6_u.u6_addr32 #define s6_addr64 in6_u.u6_addr64 }; struct sockaddr_in6 { unsigned short int sin6_family; __u16 sin6_port; __u32 sin6_flowinfo; struct in6_addr sin6_addr; }; |
PF_ROSE | Amateur
Radio X.25 PLP
#include <linux/rose.h> |
typedef struct { char rose_addr[5]; } rose_address; struct sockaddr_rose { sa_family_t srose_family; rose_address srose_addr; ax25_address srose_call; int srose_ndigis; ax25_address srose_digi; }; struct full_sockaddr_rose { sa_family_t srose_family; rose_address srose_addr; ax25_address srose_call; unsigned int srose_ndigis; ax25_address srose_digis[ROSE_MAX_DIGIS]; }; |
PF_DECnet | (Reserved for DECnet project) | |
PF_NETBEUI | (Reserved
for 802.2LLC project)
#include <linux/netbeui.h> |
#define NB_NAME_LEN 20 struct sockaddr_netbeui { sa_family snb_family; char snb_name[NB_NAME_LEN]; char snb_devhint[IFNAMSIZ]; }; |
PF_SECURITY | Security callback pseudo AF | |
PF_KEY | PF_KEY key management API | |
PF_NETLINK
PF_ROUTE |
Aliases
to emulate 4.4 BSD
#include <linux/netlink.h> |
struct sockaddr_nl { sa_family_t nl_family; unsigned short nl_pad; __u32 nl_pid; __u32 nl_groups; }; |
PF_PACKET | Packet family
#include <linux/if_packet.h> |
struct sockaddr_pkt { unsigned short spkt_family; unsigned char spkt_device[14]; unsigned short spkt_protocol; }; struct sockaddr_ll { unsigned short sll_family; unsigned short sll_protocol; int sll_ifindex; unsigned short sll_hatype; unsigned char sll_pkttype; unsigned char sll_halen; unsigned char sll_addr[8]; }; |
PF_ASH | Ash | |
PF_ECONET | Acorn Econet
#include <linux/if_ec.h> |
struct ec_addr { unsigned char station; /* Station number. */ unsigned char net; /* Network number. */ }; struct sockaddr_ec { unsigned short sec_family; unsigned char port; unsigned char cb; /* Control/flag byte. */ unsigned char type; /* Type of message. */ struct ec_addr addr; unsigned long cookie; }; |
PF_ATMSVC | ATM SVCs | |
PF_SNA | Linux SNA project | |
PF_IRDA | IRDA
sockets
#include <linux/irda.h> |
struct sockaddr_irda { sa_family_t sir_family; unsigned char sir_lsap_sel; /* LSAP/TSAP selector */ unsigned int sir_addr; /* Device address */ char sir_name[25]; /* Usually <service>:IrDA:TinyTP */ }; |