1.sockaddr_in6
\support\sdk\c\blip\lib6lowpan\ip.h
struct sockaddr_in6 {
uint16_t sin6_port;
struct in6_addr sin6_addr;
};
2.in6_addr
\support\sdk\c\blip\lib6lowpan\ip.h
// update to use netinet/in definition of an IPv6 address; this is a
// lot more elegent.
struct in6_addr
{
union
{
uint8_t u6_addr8[16];
uint16_t u6_addr16[8];
uint32_t u6_addr32[4];
} in6_u;
#define s6_addr in6_u.u6_addr8
#define s6_addr16 in6_u.u6_addr16
#define s6_addr32 in6_u.u6_addr32
};
3.dio_prefix_t
\tos\lib\net\rpl\RPL.h
struct dio_prefix_t { // type 8 ; contains prefix information
uint8_t type;
uint8_t option_length;
uint8_t prefix_length;
uint8_t flags_reserved;
nx_uint32_t valid_lifetime;
nx_uint32_t preferred_lifetime;
uint32_t reserved2;
struct in6_addr prefix;
} __attribute__((packed));
4.in6_packet
\support\sdk\c\blip\lib6lowpan\ip.h
struct ip6_packet {
int ip6_inputif;
struct ip_iovec *ip6_data;
struct ip6_hdr ip6_hdr;
};
5.ip6_hdr
\support\sdk\c\blip\lib6lowpan\ip.h
/*
* Definition for internet protocol version 6.
* RFC 2460
* @(#)ip.h 8.1 (Berkeley) 6/10/93
*/
struct ip6_hdr {
union {
struct ip6_hdrctl {
uint32_t ip6_un1_flow; /* 20 bits of flow-ID */
uint16_t ip6_un1_plen; /* payload length */
uint8_t ip6_un1_nxt; /* next header */
uint8_t ip6_un1_hlim; /* hop limit */
} ip6_un1;
uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
} ip6_ctlun;
struct in6_addr ip6_src; /* source address */
struct in6_addr ip6_dst; /* destination address */
} __attribute__((packed));
/*
* 未完
*/
By:霜月孤鸟
2016.4.7