]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/networkd-fdb.h
Merge pull request #1058 from spasche/hwdb-logitech-mice
[thirdparty/systemd.git] / src / network / networkd-fdb.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #pragma once
4
5 /***
6 This file is part of systemd.
7
8 Copyright (C) 2014 Intel Corporation. All rights reserved.
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 ***/
23
24 typedef struct FdbEntry FdbEntry;
25
26 #include "networkd.h"
27 #include "networkd-network.h"
28
29 struct FdbEntry {
30 Network *network;
31 unsigned section;
32
33 struct ether_addr *mac_addr;
34 uint16_t vlan_id;
35
36 LIST_FIELDS(FdbEntry, static_fdb_entries);
37 };
38
39 int fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret);
40 void fdb_entry_free(FdbEntry *fdb_entry);
41 int fdb_entry_configure(Link *const link, FdbEntry *const fdb_entry);
42
43 DEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free);
44 #define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep)
45
46 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);
47 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);