/***
This file is part of systemd.
Copyright 2013 Tom Gundersen <teg@jklm.no>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#pragma once
#include "list.h"
#include "networkd-link.h"
#include "networkd.h"
struct netdev_join_callback {
};
typedef enum NetDevKind {
} NetDevKind;
typedef enum NetDevState {
} NetDevState;
typedef enum NetDevCreateType {
struct NetDev {
int n_ref;
char *filename;
char *description;
char *ifname;
int ifindex;
};
#include "networkd-netdev-bond.h"
#include "networkd-netdev-bridge.h"
#include "networkd-netdev-dummy.h"
#include "networkd-netdev-ipvlan.h"
#include "networkd-netdev-macvlan.h"
#include "networkd-netdev-tunnel.h"
#include "networkd-netdev-tuntap.h"
#include "networkd-netdev-veth.h"
#include "networkd-netdev-vlan.h"
#include "networkd-netdev-vxlan.h"
struct NetDevVTable {
/* How much memory does an object of this unit type need */
/* Config file sections this netdev kind understands, separated
* by NUL chars */
const char *sections;
/* This should reset all type-specific variables. This should
* not allocate memory, and is called with zero-initialized
* data. It should hence only initialize variables that need
* to be set != 0. */
/* This should free all kind-specific variables. It should be
* idempotent. */
/* fill in message to create netdev */
/* specifies if netdev is independent, or a master device or a stacked device */
/* create netdev, if not done via rtnl */
/* perform additional configuration after netdev has been createad */
/* verify that compulsory configuration options were specified */
};
/* For casting a netdev into the various netdev kinds */
return NULL; \
\
return (MixedCase*) n; \
}
/* For casting the various netdev kinds into a netdev */
int config_parse_netdev_kind(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);
/* gperf */
/* Macros which append INTERFACE= to the message */
({ \
_n ? log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", _n->ifname, ##__VA_ARGS__) : \
})
#define log_netdev_debug_errno(netdev, error, ...) log_netdev_full(netdev, LOG_DEBUG, error, ##__VA_ARGS__)
#define log_netdev_info_errno(netdev, error, ...) log_netdev_full(netdev, LOG_INFO, error, ##__VA_ARGS__)
#define log_netdev_notice_errno(netdev, error, ...) log_netdev_full(netdev, LOG_NOTICE, error, ##__VA_ARGS__)
#define log_netdev_warning_errno(netdev, error, ...) log_netdev_full(netdev, LOG_WARNING, error, ##__VA_ARGS__)
#define log_netdev_error_errno(netdev, error, ...) log_netdev_full(netdev, LOG_ERR, error, ##__VA_ARGS__)