union sockaddr_union {
struct sockaddr sa;
struct sockaddr_in in4;
struct sockaddr_in6 in6;
struct sockaddr_un un;
struct sockaddr_nl nl;
struct sockaddr_storage storage;
};
通常的套接口地址
struct sockaddr {
sa_family_t sa_family; /* Address Family */
char sa_data[14]; /* Address data. */
};
UNIX本地通讯套接口地址
struct sockaddr_un
{
sa_family_t sun_family;
char sun_path[108]; /* Path name. */
};
NETLINK的套接口地址
struct sockaddr_nl
{
sa_family_t nl_family;
unsigned short nl_pad;
__u32 nl_pid;
__u32 nl_groups;
};
socket编程接口:
<