Skip to content

Commit 0acd307

Browse files
zhhyu7xiaoxiang781216
authored andcommitted
ip6: add ip6-related definition
adapts to third-party code compilation. in the process of porting ConnMan, we encounter some situations where the structure is not defined, or the returned data types do not match the expectations. Refer to the common implementation of other systems and add relevant definitions. Signed-off-by: zhanghongyu <[email protected]>
1 parent f387b13 commit 0acd307

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

include/netinet/ip6.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,32 @@
3232
* Public Type Definitions
3333
****************************************************************************/
3434

35+
struct ip6_hdr
36+
{
37+
union
38+
{
39+
struct ip6_hdrctl
40+
{
41+
uint32_t ip6_un1_flow; /* 4 bits version, 8 bits TC, 20 bits flow-ID */
42+
uint16_t ip6_un1_plen; /* payload length */
43+
uint8_t ip6_un1_nxt; /* next header */
44+
uint8_t ip6_un1_hlim; /* hop limit */
45+
} ip6_un1;
46+
47+
uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits tclass */
48+
} ip6_ctlun;
49+
50+
struct in6_addr ip6_src; /* source address */
51+
struct in6_addr ip6_dst; /* destination address */
52+
};
53+
54+
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
55+
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
56+
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
57+
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
58+
#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
59+
#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
60+
3561
/****************************************************************************
3662
* Public Function Prototypes
3763
****************************************************************************/

0 commit comments

Comments
 (0)