]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later |
c16c7808 SS |
2 | * Copyright © 2019 VMware, Inc. |
3 | */ | |
4 | ||
5 | #pragma once | |
6 | ||
75156ccb | 7 | #include <inttypes.h> |
c16c7808 | 8 | |
75156ccb | 9 | #include "sd-netlink.h" |
c16c7808 | 10 | |
75156ccb YW |
11 | #include "conf-parser.h" |
12 | #include "in-addr-util.h" | |
c16c7808 SS |
13 | #include "networkd-util.h" |
14 | ||
75156ccb YW |
15 | typedef struct Link Link; |
16 | typedef struct Manager Manager; | |
17 | typedef struct Network Network; | |
18 | ||
19 | typedef struct NextHop { | |
c16c7808 SS |
20 | Network *network; |
21 | NetworkConfigSection *section; | |
22 | ||
30f10837 | 23 | Manager *manager; |
c16c7808 SS |
24 | Link *link; |
25 | ||
0e9d129c | 26 | uint8_t protocol; |
c16c7808 | 27 | |
c16c7808 | 28 | uint32_t id; |
30f10837 | 29 | bool blackhole; |
8c112218 | 30 | int family; |
c16c7808 | 31 | union in_addr_union gw; |
2ddd52d1 | 32 | int onlink; |
75156ccb | 33 | } NextHop; |
c16c7808 | 34 | |
75156ccb | 35 | NextHop *nexthop_free(NextHop *nexthop); |
0992f9fb | 36 | |
13ffa39f | 37 | void network_drop_invalid_nexthops(Network *network); |
c16c7808 | 38 | |
f345918d | 39 | int link_set_nexthops(Link *link); |
25b82b6e YW |
40 | int link_drop_nexthops(Link *link); |
41 | int link_drop_foreign_nexthops(Link *link); | |
c133770a | 42 | |
324e3422 | 43 | int manager_get_nexthop_by_id(Manager *manager, uint32_t id, NextHop **ret); |
454c87b5 YW |
44 | int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message, Manager *m); |
45 | ||
c16c7808 SS |
46 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id); |
47 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway); | |
f1923efc | 48 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_family); |
2ddd52d1 | 49 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_onlink); |
30f10837 | 50 | CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_blackhole); |