summaryrefslogtreecommitdiff
path: root/src/network/networkd.h
diff options
context:
space:
mode:
authorAlin Rauta <alin.rauta@intel.com>2014-12-17 07:35:36 -0800
committerTom Gundersen <teg@jklm.no>2014-12-18 15:28:16 +0100
commitb98b483bac585af754e8a22ea890db8486905d8a (patch)
treeed96bde5cfc2ab1670450427e27a722c3a920092 /src/network/networkd.h
parentc2551e7105051f40b2bf77a5c1ecb2e720d78d77 (diff)
networkd: add FDB support
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r--src/network/networkd.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 4cdcd73c5d..a5c5b085ba 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -51,6 +51,7 @@ typedef struct Address Address;
typedef struct Route Route;
typedef struct Manager Manager;
typedef struct AddressPool AddressPool;
+typedef struct FdbEntry FdbEntry;
typedef enum DHCPSupport {
DHCP_SUPPORT_NONE,
@@ -69,6 +70,16 @@ typedef enum LLMNRSupport {
_LLMNR_SUPPORT_INVALID = -1,
} LLMNRSupport;
+struct FdbEntry {
+ Network *network;
+ unsigned section;
+
+ struct ether_addr *mac_addr;
+ uint16_t vlan_id;
+
+ LIST_FIELDS(FdbEntry, static_fdb_entries);
+};
+
struct Network {
Manager *manager;
@@ -113,9 +124,11 @@ struct Network {
LIST_HEAD(Address, static_addresses);
LIST_HEAD(Route, static_routes);
+ LIST_HEAD(FdbEntry, static_fdb_entries);
Hashmap *addresses_by_section;
Hashmap *routes_by_section;
+ Hashmap *fdb_entries_by_section;
bool wildcard_domain;
char **domains, **dns, **ntp;
@@ -327,6 +340,22 @@ int config_parse_label(const char *unit, const char *filename, unsigned line,
const char *section, unsigned section_line, const char *lvalue,
int ltype, const char *rvalue, void *data, void *userdata);
+/* Forwarding database table. */
+int fdb_entry_configure(sd_rtnl *const rtnl, FdbEntry *const fdb_entry, const int ifindex);
+void fdb_entry_free(FdbEntry *fdb_entry);
+int fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free);
+#define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep)
+
+int config_parse_fdb_hwaddr(const char *unit, const char *filename, unsigned line,
+ const char *section, unsigned section_line, const char *lvalue,
+ int ltype, const char *rvalue, void *data, void *userdata);
+
+int config_parse_fdb_vlan_id(const char *unit, const char *filename, unsigned line,
+ const char *section, unsigned section_line, const char *lvalue,
+ int ltype, const char *rvalue, void *data, void *userdata);
+
/* DHCP support */
const char* dhcp_support_to_string(DHCPSupport i) _const_;