ovn-util: Remove 'store_ipv6' argument from extract_lsp_addresses().
[cascardo/ovs.git] / ovn / lib / ovn-util.h
1 /*
2  * Licensed under the Apache License, Version 2.0 (the "License");
3  * you may not use this file except in compliance with the License.
4  * You may obtain a copy of the License at:
5  *
6  *     http://www.apache.org/licenses/LICENSE-2.0
7  *
8  * Unless required by applicable law or agreed to in writing, software
9  * distributed under the License is distributed on an "AS IS" BASIS,
10  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  */
14
15
16 #ifndef OVN_UTIL_H
17 #define OVN_UTIL_H 1
18
19 #include "lib/packets.h"
20
21 struct ipv4_netaddr {
22     ovs_be32 addr;            /* 192.168.10.123 */
23     ovs_be32 mask;            /* 255.255.255.0 */
24     ovs_be32 network;         /* 192.168.10.0 */
25     unsigned int plen;        /* CIDR Prefix: 24. */
26
27     char *addr_s;             /* "192.168.10.123" */
28     char *network_s;          /* "192.168.10.0" */
29     char *bcast_s;            /* "192.168.10.255" */
30 };
31
32 struct ipv6_netaddr {
33     struct in6_addr addr;     /* fc00::1 */
34     struct in6_addr mask;     /* ffff:ffff:ffff:ffff:: */
35     struct in6_addr network;  /* fc00:: */
36     unsigned int plen;        /* CIDR Prefix: 64 */
37
38     char *addr_s;             /* "fc00::1" */
39     char *network_s;          /* "fc00::" */
40 };
41
42 struct lport_addresses {
43     char *ea_s;
44     struct eth_addr ea;
45     size_t n_ipv4_addrs;
46     struct ipv4_netaddr *ipv4_addrs;
47     size_t n_ipv6_addrs;
48     struct ipv6_netaddr *ipv6_addrs;
49 };
50
51
52 bool extract_lsp_addresses(char *address, struct lport_addresses *);
53 void destroy_lport_addresses(struct lport_addresses *);
54
55 char *alloc_nat_zone_key(const char *key, const char *type);
56 #endif