Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
inet_ipv4.h
1 /* inet_ipv4.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef __INET_IPV4_H__
11 #define __INET_IPV4_H__
12 
13 #include <glib.h>
14 
15 typedef guint32 ws_in4_addr; /* 32 bit IPv4 address, in network byte order */
16 
17 /*
18  * We define these in *network byte order*, unlike the C library. Therefore
19  * it uses a different prefix than INADDR_* to make the distinction more obvious.
20  */
21 #define WS_IN4_LOOPBACK ((ws_in4_addr)GUINT32_TO_BE(0x7f000001))
22 
28 #define in4_addr_is_local_network_control_block(addr) \
29  ((addr & 0xffffff00) == 0xe0000000)
30 
35 #define in4_addr_is_multicast(addr) \
36  ((addr & 0xf0000000) == 0xe0000000)
37 
38 #endif