RTRlib
 All Data Structures Functions Typedefs Enumerations Enumerator Groups Pages
ipv4.h
1 /*
2  * This file is part of RTRlib.
3  *
4  * RTRlib is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or (at your
7  * option) any later version.
8  *
9  * RTRlib is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with RTRlib; see the file COPYING.LESSER.
16  *
17  * INET group, Hamburg University of Applied Sciences,
18  * CST group, Freie Universitaet Berlin
19  * Website: http://rpki.realmv6.org/
20  */
21 
22 #ifndef RTR_IPV4_H
23 #define RTR_IPV4_H
24 #include <inttypes.h>
25 #include <stdbool.h>
26 
31 struct ipv4_addr {
32  uint32_t addr;
33 };
34 
43 struct ipv4_addr ipv4_get_bits(const struct ipv4_addr *val, const uint8_t from, const uint8_t number);
44 
52 int ipv4_str_to_addr(const char *str, struct ipv4_addr *ip);
53 
61 int ipv4_addr_to_str(const struct ipv4_addr *ip, char *str, const unsigned int len);
62 
70 bool ipv4_addr_equal(const struct ipv4_addr *a, const struct ipv4_addr *b);
71 
72 #endif
Struct storing an IPv4 address in host byte order.
Definition: ipv4.h:31