2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2018-11-29 04:00:58 +01:00
|
|
|
#pragma once
|
|
|
|
|
2020-09-29 17:17:22 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2018-11-29 04:00:58 +01:00
|
|
|
#include "sd-netlink.h"
|
|
|
|
|
|
|
|
#include "conf-parser.h"
|
|
|
|
#include "ether-addr-util.h"
|
|
|
|
#include "in-addr-util.h"
|
2019-03-01 05:27:47 +01:00
|
|
|
#include "networkd-util.h"
|
2018-11-29 04:00:58 +01:00
|
|
|
|
2020-09-29 17:17:22 +02:00
|
|
|
typedef Manager Manager;
|
|
|
|
typedef Network Network;
|
|
|
|
typedef Link Link;
|
|
|
|
|
2019-04-19 09:53:34 +02:00
|
|
|
union lladdr_union {
|
|
|
|
struct ether_addr mac;
|
|
|
|
union in_addr_union ip;
|
|
|
|
};
|
|
|
|
|
2020-09-29 17:17:22 +02:00
|
|
|
typedef struct Neighbor {
|
2018-11-29 04:00:58 +01:00
|
|
|
Network *network;
|
|
|
|
Link *link;
|
|
|
|
NetworkConfigSection *section;
|
|
|
|
|
|
|
|
int family;
|
|
|
|
union in_addr_union in_addr;
|
2019-04-19 09:53:34 +02:00
|
|
|
union lladdr_union lladdr;
|
2019-07-17 19:43:35 +02:00
|
|
|
size_t lladdr_size;
|
2020-09-29 17:17:22 +02:00
|
|
|
} Neighbor;
|
2018-11-29 04:00:58 +01:00
|
|
|
|
2020-09-29 17:45:19 +02:00
|
|
|
Neighbor *neighbor_free(Neighbor *neighbor);
|
2020-09-29 17:43:06 +02:00
|
|
|
|
2020-10-06 20:21:59 +02:00
|
|
|
void network_drop_invalid_neighbors(Network *network);
|
2018-11-29 04:00:58 +01:00
|
|
|
|
2020-09-29 16:17:43 +02:00
|
|
|
int link_set_neighbors(Link *link);
|
2020-09-29 17:37:39 +02:00
|
|
|
int link_drop_neighbors(Link *link);
|
|
|
|
int link_drop_foreign_neighbors(Link *link);
|
2020-09-29 16:17:43 +02:00
|
|
|
|
2020-09-29 16:20:14 +02:00
|
|
|
int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
|
|
|
|
|
2018-11-29 04:00:58 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_hwaddr);
|
2019-07-10 19:23:41 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_lladdr);
|