RTRlib
 All Data Structures Functions Typedefs Enumerations Enumerator Groups Pages
ipv4.h
1 /*
2  * This file is part of RTRlib.
3  *
4  * This file is subject to the terms and conditions of the MIT license.
5  * See the file LICENSE in the top level directory for more details.
6  *
7  * Website: http://rtrlib.realmv6.org/
8 */
9 
10 #ifndef RTR_IPV4_H
11 #define RTR_IPV4_H
12 #include <inttypes.h>
13 #include <stdbool.h>
14 
19 struct ipv4_addr {
20  uint32_t addr;
21 };
22 
31 struct ipv4_addr ipv4_get_bits(const struct ipv4_addr *val, const uint8_t from, const uint8_t number);
32 
40 int ipv4_str_to_addr(const char *str, struct ipv4_addr *ip);
41 
49 int ipv4_addr_to_str(const struct ipv4_addr *ip, char *str, const unsigned int len);
50 
58 bool ipv4_addr_equal(const struct ipv4_addr *a, const struct ipv4_addr *b);
59 
60 #endif
Struct storing an IPv4 address in host byte order.
Definition: ipv4.h:19