Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-ipv6.h
Go to the documentation of this file.
1 
10 #ifndef __PACKET_IPV6_H__
11 #define __PACKET_IPV6_H__
12 
13 #include <inttypes.h>
14 #include <wsutil/inet_addr.h>
15 #include <epan/conversation.h>
16 
17 #define IPv6_ADDR_SIZE 16
18 #define IPv6_HDR_SIZE 40
19 #define IPv6_FRAGMENT_HDR_SIZE 8
20 
21 /*
22  * Definition for internet protocol version 6.
23  * RFC 2460
24  */
25 struct ws_ip6_hdr {
26  uint32_t ip6h_vc_flow; /* version, class, flow */
27  uint16_t ip6h_plen; /* payload length */
28  uint8_t ip6h_nxt; /* next header */
29  uint8_t ip6h_hlim; /* hop limit */
30  ws_in6_addr ip6h_src; /* source address */
31  ws_in6_addr ip6h_dst; /* destination address */
32 };
33 
34 /*
35  * Extension Headers
36  */
37 
38 struct ws_ip6_ext {
39  unsigned char ip6e_nxt;
40  unsigned char ip6e_len;
41 };
42 
43 /* Routing header */
44 struct ws_ip6_rthdr {
45  uint8_t ip6r_nxt; /* next header */
46  uint8_t ip6r_len; /* length in units of 8 octets */
47  uint8_t ip6r_type; /* routing type */
48  uint8_t ip6r_segleft; /* segments left */
49  /* followed by routing type specific data */
50 };
51 
52 /* Type 0 Routing header */
53 struct ws_ip6_rthdr0 {
54  uint8_t ip6r0_nxt; /* next header */
55  uint8_t ip6r0_len; /* length in units of 8 octets */
56  uint8_t ip6r0_type; /* always zero */
57  uint8_t ip6r0_segleft; /* segments left */
58  uint8_t ip6r0_reserved; /* reserved field */
59  uint8_t ip6r0_slmap[3]; /* strict/loose bit map */
60  /* followed by up to 127 addresses */
61  ws_in6_addr ip6r0_addr[1];
62 };
63 
64 /* Fragment header */
65 struct ws_ip6_frag {
66  uint8_t ip6f_nxt; /* next header */
67  uint8_t ip6f_reserved; /* reserved field */
68  uint16_t ip6f_offlg; /* offset, reserved, and flag */
69  uint32_t ip6f_ident; /* identification */
70 };
71 
72 #define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
73 #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
74 #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
75 
76 struct ipv6_analysis {
77 
78  /* Initial frame starting this conversation
79  */
80  guint32 initial_frame;
81 
82  guint32 stream;
83 };
84 
85 WS_DLL_PUBLIC struct ipv6_analysis *get_ipv6_conversation_data(conversation_t *conv,
86  packet_info *pinfo);
87 
88 #endif
Definition: packet_info.h:44
Definition: conversation.h:220
Definition: inet_addr.h:21
Definition: packet-ipv6.h:76
Definition: stream.c:41
Definition: packet-ipv6.h:38
Definition: packet-ipv6.h:65
Definition: packet-ipv6.h:25
Definition: packet-ipv6.h:53
Definition: packet-ipv6.h:44