summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-nexthop.h
blob: 75714e7ef5ff92310b2f3b62511197f433188e0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-License-Identifier: LGPL-2.1-or-later
 * Copyright © 2019 VMware, Inc.
 */

#pragma once

#include <inttypes.h>

#include "sd-netlink.h"

#include "conf-parser.h"
#include "in-addr-util.h"
#include "networkd-util.h"

typedef struct Link Link;
typedef struct Manager Manager;
typedef struct Network Network;

typedef struct NextHop {
        Network *network;
        NetworkConfigSection *section;

        Link *link;

        unsigned char protocol;

        uint32_t id;
        int family;
        union in_addr_union gw;
} NextHop;

NextHop *nexthop_free(NextHop *nexthop);

void network_drop_invalid_nexthops(Network *network);

int link_set_nexthop(Link *link);

int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);

CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_id);
CONFIG_PARSER_PROTOTYPE(config_parse_nexthop_gateway);