]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/networkd-nexthop.h
network: move link_request_set_nexthop() to networkd-nexthop.c
[thirdparty/systemd.git] / src / network / networkd-nexthop.h
CommitLineData
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
10typedef struct NextHop NextHop;
11typedef struct NetworkConfigSection NetworkConfigSection;
12
13#include "networkd-network.h"
14#include "networkd-util.h"
15
16struct 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
33extern const struct hash_ops nexthop_hash_ops;
34
35int nexthop_new(NextHop **ret);
36void nexthop_free(NextHop *nexthop);
c16c7808
SS
37int nexthop_remove(NextHop *nexthop, Link *link, link_netlink_message_handler_t callback);
38
c133770a
YW
39int link_set_nexthop(Link *link);
40
c16c7808
SS
41int nexthop_get(Link *link, NextHop *in, NextHop **ret);
42int nexthop_add(Link *link, NextHop *in, NextHop **ret);
43int nexthop_add_foreign(Link *link, NextHop *in, NextHop **ret);
44bool nexthop_equal(NextHop *r1, NextHop *r2);
45
46int nexthop_section_verify(NextHop *nexthop);
47
48DEFINE_NETWORK_SECTION_FUNCTIONS(NextHop, nexthop_free);
49
50CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id);
51CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway);