常用网络地址

(gdb) ptype struct sockaddr_ll
type = struct sockaddr_ll {
    short unsigned int sll_family;
    __be16 sll_protocol;
    int sll_ifindex;
    short unsigned int sll_hatype;
    unsigned char sll_pkttype;
    unsigned char sll_halen;
    unsigned char sll_addr[8];
}
(gdb) p sizeof(struct sockaddr_ll)
$14 = 20
(gdb) ptype struct sockaddr
type = struct sockaddr {
    sa_family_t sa_family;
    char sa_data[14];
}
(gdb) p sizeof( struct sockaddr)
$15 = 16
(gdb) ptype struct sockaddr_in
type = struct sockaddr_in {
    sa_family_t sin_family;
    in_port_t sin_port;
    struct in_addr sin_addr;
    unsigned char sin_zero[8];
}
(gdb) p sizeof(struct sockaddr_in)
$16 = 16
(gdb) ptype struct sockaddr_in6
type = struct sockaddr_in6 {
    sa_family_t sin6_family;
    in_port_t sin6_port;
    uint32_t sin6_flowinfo;
    struct in6_addr sin6_addr;
    uint32_t sin6_scope_id;
}
(gdb) p sizeof( struct sockaddr_in6)
$17 = 28

你可能感兴趣的:(常用网络地址)