]>
Commit | Line | Data |
---|---|---|
c16c7808 SS |
1 | /* SPDX-License-Identifier: LGPL-2.1+ |
2 | * Copyright © 2019 VMware, Inc. | |
3 | */ | |
4 | ||
5 | #pragma once | |
6 | ||
7 | #include "conf-parser.h" | |
8 | #include "macro.h" | |
9 | ||
10 | typedef struct NextHop NextHop; | |
11 | typedef struct NetworkConfigSection NetworkConfigSection; | |
12 | ||
13 | #include "networkd-network.h" | |
14 | #include "networkd-util.h" | |
15 | ||
16 | struct NextHop { | |
17 | Network *network; | |
18 | NetworkConfigSection *section; | |
19 | ||
20 | Link *link; | |
21 | ||
22 | unsigned char protocol; | |
23 | ||
24 | int family; | |
25 | uint32_t oif; | |
26 | uint32_t id; | |
27 | ||
28 | union in_addr_union gw; | |
29 | ||
30 | LIST_FIELDS(NextHop, nexthops); | |
31 | }; | |
32 | ||
33 | extern const struct hash_ops nexthop_hash_ops; | |
34 | ||
35 | int nexthop_new(NextHop **ret); | |
36 | void nexthop_free(NextHop *nexthop); | |
c16c7808 SS |
37 | int nexthop_remove(NextHop *nexthop, Link *link, link_netlink_message_handler_t callback); |
38 | ||
c133770a YW |
39 | int link_set_nexthop(Link *link); |
40 | ||
c16c7808 SS |
41 | int nexthop_get(Link *link, NextHop *in, NextHop **ret); |
42 | int nexthop_add(Link *link, NextHop *in, NextHop **ret); | |
43 | int nexthop_add_foreign(Link *link, NextHop *in, NextHop **ret); | |
44 | bool nexthop_equal(NextHop *r1, NextHop *r2); | |
45 | ||
46 | int nexthop_section_verify(NextHop *nexthop); | |
47 | ||
48 | DEFINE_NETWORK_SECTION_FUNCTIONS(NextHop, nexthop_free); | |
49 | ||
50 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id); | |
51 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway); |