networkd-link.h revision c601ebf79f0c54be14d3c16f0f484c0335cdeec4
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#pragma once
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering/***
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering This file is part of systemd.
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Copyright 2013 Tom Gundersen <teg@jklm.no>
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering systemd is free software; you can redistribute it and/or modify it
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering under the terms of the GNU Lesser General Public License as published by
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering (at your option) any later version.
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering systemd is distributed in the hope that it will be useful, but
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Lesser General Public License for more details.
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering You should have received a copy of the GNU Lesser General Public License
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering***/
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include <endian.h>
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include "sd-dhcp-client.h"
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering#include "sd-dhcp-server.h"
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering#include "sd-dhcp6-client.h"
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering#include "sd-ipv4ll.h"
25300b5a1fcf54674a69d0f4ab08925be00b0227Lennart Poettering#include "sd-lldp.h"
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include "sd-ndisc.h"
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poetteringtypedef struct Link Link;
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poetteringtypedef enum LinkState {
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_PENDING,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_ENSLAVING,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_SETTING_ADDRESSES,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_SETTING_ROUTES,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_CONFIGURED,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_UNMANAGED,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_FAILED,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_STATE_LINGER,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering _LINK_STATE_MAX,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering _LINK_STATE_INVALID = -1
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering} LinkState;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringtypedef enum LinkOperationalState {
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_OPERSTATE_OFF,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_OPERSTATE_NO_CARRIER,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_OPERSTATE_DORMANT,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_OPERSTATE_CARRIER,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_OPERSTATE_DEGRADED,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LINK_OPERSTATE_ROUTABLE,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering _LINK_OPERSTATE_MAX,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering _LINK_OPERSTATE_INVALID = -1
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering} LinkOperationalState;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include "networkd.h"
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include "networkd-network.h"
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include "networkd-address.h"
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringstruct Link {
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Manager *manager;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering int n_ref;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering int ifindex;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering char *ifname;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering char *state_file;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering struct ether_addr mac;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering struct in6_addr ipv6ll_address;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering uint32_t mtu;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering struct udev_device *udev_device;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering unsigned flags;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering uint8_t kernel_operstate;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Network *network;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LinkState state;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LinkOperationalState operstate;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering unsigned link_messages;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering unsigned enslaving;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Set *addresses;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Set *addresses_foreign;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Set *routes;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Set *routes_foreign;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_dhcp_client *dhcp_client;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_dhcp_lease *dhcp_lease;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering char *lease_file;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering uint16_t original_mtu;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering unsigned dhcp4_messages;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool dhcp4_configured;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool dhcp6_configured;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering unsigned ndisc_messages;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool ndisc_configured;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_ipv4ll *ipv4ll;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool ipv4ll_address:1;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool ipv4ll_route:1;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool static_configured;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering LIST_HEAD(Address, pool_addresses);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_dhcp_server *dhcp_server;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_ndisc *ndisc_router_discovery;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_dhcp6_client *dhcp6_client;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool rtnl_extended_attrs;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering sd_lldp *lldp;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering char *lldp_file;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Hashmap *bound_by_links;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Hashmap *bound_to_links;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering};
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart PoetteringLink *link_unref(Link *link);
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9Lennart PoetteringLink *link_ref(Link *link);
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9Lennart Poetteringint link_get(Manager *m, int ifindex, Link **ret);
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9Lennart Poetteringint link_add(Manager *manager, sd_netlink_message *message, Link **ret);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringvoid link_drop(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_address_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_route_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringvoid link_enter_failed(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_initialized(Link *link, struct udev_device *device);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringvoid link_check_ready(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringvoid link_update_operstate(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_update(Link *link, sd_netlink_message *message);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringvoid link_dirty(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringvoid link_clean(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_save(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_carrier_reset(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_has_carrier(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_ipv6ll_gained(Link *link, const struct in6_addr *address);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_set_mtu(Link *link, uint32_t mtu);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_set_hostname(Link *link, const char *hostname);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_set_timezone(Link *link, const char *timezone);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint ipv4ll_configure(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint dhcp4_configure(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint dhcp6_configure(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint dhcp6_request_address(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint ndisc_configure(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_lldp_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_ipv4ll_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_ipv6ll_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_dhcp4_server_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_dhcp4_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_dhcp6_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringbool link_ipv6_accept_ra_enabled(Link *link);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringconst char* link_state_to_string(LinkState s) _const_;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart PoetteringLinkState link_state_from_string(const char *s) _pure_;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringconst char* link_operstate_to_string(LinkOperationalState s) _const_;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart PoetteringLinkOperationalState link_operstate_from_string(const char *s) _pure_;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringextern const sd_bus_vtable link_vtable[];
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringint link_send_changed(Link *link, const char *property, ...) _sentinel_;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define _cleanup_link_unref_ _cleanup_(link_unrefp)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering/* Macros which append INTERFACE= to the message */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_full(link, level, error, ...) \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering ({ \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering Link *_l = (link); \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering _l ? log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", _l->ifname, ##__VA_ARGS__) : \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering log_internal(level, error, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering }) \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_debug(link, ...) log_link_full(link, LOG_DEBUG, 0, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_info(link, ...) log_link_full(link, LOG_INFO, 0, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_notice(link, ...) log_link_full(link, LOG_NOTICE, 0, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_warning(link, ...) log_link_full(link, LOG_WARNING, 0, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_error(link, ...) log_link_full(link, LOG_ERR, 0, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_debug_errno(link, error, ...) log_link_full(link, LOG_DEBUG, error, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_info_errno(link, error, ...) log_link_full(link, LOG_INFO, error, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_notice_errno(link, error, ...) log_link_full(link, LOG_NOTICE, error, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define log_link_error_errno(link, error, ...) log_link_full(link, LOG_ERR, error, ##__VA_ARGS__)
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9Lennart Poettering#define LOG_LINK_MESSAGE(link, fmt, ...) "MESSAGE=%s: " fmt, (link)->ifname, ##__VA_ARGS__
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9Lennart Poettering#define LOG_LINK_INTERFACE(link) "INTERFACE=%s", (link)->ifname
72c0a2c255b172ebbb2a2b7dab7c9aec4c9582d9Lennart Poettering
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#define ADDRESS_FMT_VAL(address) \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering be32toh((address).s_addr) >> 24, \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering (be32toh((address).s_addr) >> 16) & 0xFFu, \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering (be32toh((address).s_addr) >> 8) & 0xFFu, \
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering be32toh((address).s_addr) & 0xFFu
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering