RTRlib
 All Data Structures Functions Typedefs Enumerations Enumerator Groups Pages
ipv6.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_IPV6_H
23 #define RTR_IPV6_H
24 #include <sys/types.h>
25 #include <stdbool.h>
26 #include <stdint.h>
27 
28 
33 struct ipv6_addr {
34  uint32_t addr[4];
35 };
36 
44 bool ipv6_addr_equal(const struct ipv6_addr *a, const struct ipv6_addr *b);
45 
54 struct ipv6_addr ipv6_get_bits(const struct ipv6_addr *val, const uint8_t first_bit, const uint8_t quantity);
55 
63 int ipv6_addr_to_str(const struct ipv6_addr *ip_addr, char *b, const unsigned int len);
64 
72 int ipv6_str_to_addr(const char *a, struct ipv6_addr *ip);
73 
81 void ipv6_addr_to_host_byte_order(const uint32_t *src, uint32_t *dest);
82 
83 #endif
The ip_addr struct stores a IPv4 or IPv6 address in host byte order.
Definition: ip.h:44
Struct holding an IPv6 address in host byte order.
Definition: ipv6.h:33
void ipv6_addr_to_host_byte_order(const uint32_t *src, uint32_t *dest)
Definition: ipv6.c:211