]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-nexthop.h
ethtool: add several new link modes
[thirdparty/systemd.git] / src / network / networkd-nexthop.h
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);
37 int nexthop_configure(NextHop *nexthop, Link *link, link_netlink_message_handler_t callback);
38 int nexthop_remove(NextHop *nexthop, Link *link, link_netlink_message_handler_t callback);
39
40 int nexthop_get(Link *link, NextHop *in, NextHop **ret);
41 int nexthop_add(Link *link, NextHop *in, NextHop **ret);
42 int nexthop_add_foreign(Link *link, NextHop *in, NextHop **ret);
43 bool nexthop_equal(NextHop *r1, NextHop *r2);
44
45 int nexthop_section_verify(NextHop *nexthop);
46
47 DEFINE_NETWORK_SECTION_FUNCTIONS(NextHop, nexthop_free);
48
49 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id);
50 CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway);