2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2015-08-27 13:59:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/***
|
2018-06-12 17:15:23 +02:00
|
|
|
Copyright © 2014 Intel Corporation. All rights reserved.
|
2015-08-27 13:59:06 +02:00
|
|
|
***/
|
|
|
|
|
2019-05-08 16:13:21 +02:00
|
|
|
#include <linux/neighbour.h>
|
|
|
|
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "conf-parser.h"
|
2020-09-29 17:17:22 +02:00
|
|
|
#include "ether-addr-util.h"
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "list.h"
|
|
|
|
#include "macro.h"
|
2019-03-01 05:27:47 +01:00
|
|
|
#include "networkd-util.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
typedef struct Network Network;
|
|
|
|
typedef struct FdbEntry FdbEntry;
|
|
|
|
typedef struct Link Link;
|
2018-11-12 06:54:04 +01:00
|
|
|
typedef struct NetworkConfigSection NetworkConfigSection;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-05-08 16:13:21 +02:00
|
|
|
typedef enum NeighborCacheEntryFlags {
|
|
|
|
NEIGHBOR_CACHE_ENTRY_FLAGS_USE = NTF_USE,
|
|
|
|
NEIGHBOR_CACHE_ENTRY_FLAGS_SELF = NTF_SELF,
|
|
|
|
NEIGHBOR_CACHE_ENTRY_FLAGS_MASTER = NTF_MASTER,
|
|
|
|
NEIGHBOR_CACHE_ENTRY_FLAGS_ROUTER = NTF_ROUTER,
|
|
|
|
_NEIGHBOR_CACHE_ENTRY_FLAGS_MAX,
|
|
|
|
_NEIGHBOR_CACHE_ENTRY_FLAGS_INVALID = -1,
|
|
|
|
} NeighborCacheEntryFlags;
|
|
|
|
|
2015-08-27 13:59:06 +02:00
|
|
|
struct FdbEntry {
|
|
|
|
Network *network;
|
2018-11-12 06:54:04 +01:00
|
|
|
NetworkConfigSection *section;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-05-06 16:28:52 +02:00
|
|
|
uint32_t vni;
|
|
|
|
|
2019-04-30 11:23:39 +02:00
|
|
|
int family;
|
2015-08-27 13:59:06 +02:00
|
|
|
uint16_t vlan_id;
|
|
|
|
|
2019-07-11 03:44:36 +02:00
|
|
|
struct ether_addr mac_addr;
|
2019-04-30 11:23:39 +02:00
|
|
|
union in_addr_union destination_addr;
|
2019-05-08 16:13:21 +02:00
|
|
|
NeighborCacheEntryFlags fdb_ntf_flags;
|
2015-08-27 13:59:06 +02:00
|
|
|
};
|
|
|
|
|
2020-09-29 18:53:16 +02:00
|
|
|
FdbEntry *fdb_entry_free(FdbEntry *fdb_entry);
|
2016-06-03 19:20:46 +02:00
|
|
|
int fdb_entry_configure(Link *link, FdbEntry *fdb_entry);
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2019-05-08 16:13:21 +02:00
|
|
|
const char* fdb_ntf_flags_to_string(NeighborCacheEntryFlags i) _const_;
|
|
|
|
NeighborCacheEntryFlags fdb_ntf_flags_from_string(const char *s) _pure_;
|
|
|
|
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_fdb_hwaddr);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_fdb_vlan_id);
|
2019-04-30 11:23:39 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_fdb_destination);
|
2019-05-06 16:28:52 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_fdb_vxlan_vni);
|
2019-05-08 16:13:21 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_fdb_ntf_flags);
|