Wireshark  4.3.0
The Wireshark network protocol analyzer
addr_and_mask.h
Go to the documentation of this file.
1 
13 #ifndef __ADDR_AND_MASK_H__
14 #define __ADDR_AND_MASK_H__
15 
16 #include <wsutil/inet_ipv4.h>
17 #include <wsutil/inet_ipv6.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif /* __cplusplus */
22 
23 /*
24  * These routines return PREFIX_LEN_OK on success, PREFIX_LEN_TOO_LONG if
25  * the prefix length is too long, and PREFIX_LEN_ZERO if the prefix length
26  * is 0.
27  */
28 
29 #define PREFIX_LEN_OK 0
30 #define PREFIX_LEN_TOO_LONG 1
31 #define PREFIX_LEN_ZERO 2
32 
43 extern int tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, int offset,
44  ws_in4_addr *addr, guint32 prefix_len);
45 
56 extern int tvb_get_ipv6_addr_with_prefix_len(tvbuff_t *tvb, int offset,
57  ws_in6_addr *addr, guint32 prefix_len);
58 
65 guint32 ip_get_subnet_mask(const guint32 mask_length);
66 
67 #ifdef __cplusplus
68 }
69 #endif /* __cplusplus */
70 
71 #endif /* __ADDR_AND_MASK_H__ */
int tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, int offset, ws_in4_addr *addr, guint32 prefix_len)
Definition: addr_and_mask.c:48
int tvb_get_ipv6_addr_with_prefix_len(tvbuff_t *tvb, int offset, ws_in6_addr *addr, guint32 prefix_len)
Definition: addr_and_mask.c:65
guint32 ip_get_subnet_mask(const guint32 mask_length)
Definition: addr_and_mask.c:23
Definition: inet_ipv6.h:21
Definition: tvbuff-int.h:35