networkd-link.h revision 9c0a72f961e00b0447767973e7117e131bea5b5d
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
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 "networkd.h"
typedef enum LinkState {
_LINK_STATE_INVALID = -1
} LinkState;
typedef enum LinkOperationalState {
struct Link {
int n_ref;
int ifindex;
char *ifname;
char *state_file;
struct ether_addr mac;
struct udev_device *udev_device;
unsigned flags;
unsigned link_messages;
unsigned enslaving;
char *lease_file;
unsigned dhcp4_messages;
bool dhcp4_configured;
bool ipv4ll_address;
bool ipv4ll_route;
bool static_configured;
char *lldp_file;
};
/* Macros which append INTERFACE= to the message */
log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", link->ifname, "%-*s: " fmt, IFNAMSIZ, link->ifname, ##__VA_ARGS__)
#define log_link_notice_errno(link, error, ...) log_link_full(link, LOG_NOTICE, error, ##__VA_ARGS__)
#define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__)
#define log_link_struct(link, level, ...) log_struct(level, "INTERFACE=%s", link->ifname, __VA_ARGS__)
#define ADDRESS_FMT_VAL(address) \