1 /* SPDX-License-Identifier: LGPL-2.1-or-later
2 * Copyright © 2019 VMware, Inc.
9 #include "sd-netlink.h"
11 #include "conf-parser.h"
13 #include "in-addr-util.h"
14 #include "networkd-util.h"
16 typedef struct Link Link
;
17 typedef struct Manager Manager
;
18 typedef struct Network Network
;
20 typedef struct NextHop
{
24 ConfigSection
*section
;
25 NetworkConfigSource source
;
26 NetworkConfigState state
;
33 union in_addr_union gw
;
35 int onlink
; /* Only used in conf parser and nexthop_section_verify(). */
39 NextHop
*nexthop_free(NextHop
*nexthop
);
41 void network_drop_invalid_nexthops(Network
*network
);
43 int link_drop_managed_nexthops(Link
*link
);
44 int link_drop_foreign_nexthops(Link
*link
);
45 void link_foreignize_nexthops(Link
*link
);
47 int link_request_static_nexthops(Link
*link
, bool only_ipv4
);
49 int manager_get_nexthop_by_id(Manager
*manager
, uint32_t id
, NextHop
**ret
);
50 int manager_rtnl_process_nexthop(sd_netlink
*rtnl
, sd_netlink_message
*message
, Manager
*m
);
52 DEFINE_NETWORK_CONFIG_STATE_FUNCTIONS(NextHop
, nexthop
);
54 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id
);
55 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway
);
56 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_family
);
57 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_onlink
);
58 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_blackhole
);
59 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_group
);