fcbf4cb727
If e.g., an [Address] section has an invalid setting, then previously assigned settings in the section is freed, and only later settings are stored. That may cause partially broken section stored in Network object. This makes if an invalid setting is found, then set 'invalid' flag instead of freeing it. And invalid sections are dropped later by network_verify().
39 lines
896 B
C
39 lines
896 B
C
/* SPDX-License-Identifier: LGPL-2.1+ */
|
|
#pragma once
|
|
|
|
#include "sd-netlink.h"
|
|
|
|
#include "conf-parser.h"
|
|
#include "ether-addr-util.h"
|
|
#include "in-addr-util.h"
|
|
#include "list.h"
|
|
#include "macro.h"
|
|
|
|
typedef struct Neighbor Neighbor;
|
|
|
|
#include "networkd-link.h"
|
|
#include "networkd-network.h"
|
|
#include "networkd-util.h"
|
|
|
|
struct Neighbor {
|
|
Network *network;
|
|
Link *link;
|
|
NetworkConfigSection *section;
|
|
|
|
int family;
|
|
union in_addr_union in_addr;
|
|
bool mac_configured;
|
|
struct ether_addr mac;
|
|
|
|
LIST_FIELDS(Neighbor, neighbors);
|
|
};
|
|
|
|
void neighbor_free(Neighbor *neighbor);
|
|
|
|
DEFINE_NETWORK_SECTION_FUNCTIONS(Neighbor, neighbor_free);
|
|
|
|
int neighbor_configure(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_address);
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_neighbor_hwaddr);
|