typedef struct icmpv6hdr_s
{
uint8 icmp6_type;
uint8 icmp6_code;
uint16 icmp6_cksum;
union {
uint32 un_data32[1];
uint16 un_data16[2];
uint8 un_data8[4];
struct icmpv6_echo {
uint16 identifier;
uint16 sequence;
} u_echo;
struct icmpv6_nd_advt {
uint32 router:1,
solicited:1,
override:1,
reserved:29;
} u_nd_advt;
struct icmpv6_nd_ra {
uint8 hop_limit;
uint8 managed:1,
other:1,
router_pref:2,
reserved:4;
} u_nd_ra;
struct icmpv6_ns {
uint32 reserved; /* reserved */
uint8 taddr[16]; /* target address */
} u_ns;
} icmp6_dataun;
}__attribute__ ((aligned(1), packed))icmp6hdr_t;
c语言中结构体字节对其写法
于 2023-03-27 10:14:25 首次发布