2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2015-08-27 13:59:06 +02:00
|
|
|
#pragma once
|
|
|
|
|
networkd DHCPv4 logging endian fix
On Tue, Feb 10, 2015 at 08:10:43PM +0100, Lennart Poettering wrote:
> Hmm, I think it would be nicer to use be32toh() here instead, since it
> ensures the macro is (to a limited degree) typesafe.
>
> Any chance you could rework that?
From: Paul Martin <paul.martin@codethink.co.uk>
Date: Wed, 11 Feb 2015 11:47:16 +0000
Subject: [PATCH] networkd dhcpv4 logging endian fix
On a big-endian host, systemd-networkd prints out IPv4 network
addresses byte reversed:
Feb 10 16:43:32 hostname systemd-networkd[151]: eth0 : DHCPv4 address 158.1.24.10/16 via 1.1.24.10
The address obtained is 10.24.1.158/16 and the route is
10.24.0.0/16 dev eth0 src 10.24.1.187
The macro ADDRESS_FMT_VAL() unpacks a "struct in_addr" in a
little-endian specific manner.
This patch forces the passed address into host order, then unpacks it.
On an x86 later than i486, compiled with -O2, the only extra overhead
is a single bswap instruction.
2015-02-11 12:50:28 +01:00
|
|
|
#include <endian.h>
|
2019-10-25 09:29:23 +02:00
|
|
|
#include <linux/nl80211.h>
|
networkd DHCPv4 logging endian fix
On Tue, Feb 10, 2015 at 08:10:43PM +0100, Lennart Poettering wrote:
> Hmm, I think it would be nicer to use be32toh() here instead, since it
> ensures the macro is (to a limited degree) typesafe.
>
> Any chance you could rework that?
From: Paul Martin <paul.martin@codethink.co.uk>
Date: Wed, 11 Feb 2015 11:47:16 +0000
Subject: [PATCH] networkd dhcpv4 logging endian fix
On a big-endian host, systemd-networkd prints out IPv4 network
addresses byte reversed:
Feb 10 16:43:32 hostname systemd-networkd[151]: eth0 : DHCPv4 address 158.1.24.10/16 via 1.1.24.10
The address obtained is 10.24.1.158/16 and the route is
10.24.0.0/16 dev eth0 src 10.24.1.187
The macro ADDRESS_FMT_VAL() unpacks a "struct in_addr" in a
little-endian specific manner.
This patch forces the passed address into host order, then unpacks it.
On an x86 later than i486, compiled with -O2, the only extra overhead
is a single bswap instruction.
2015-02-11 12:50:28 +01:00
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "sd-bus.h"
|
2018-08-22 07:30:49 +02:00
|
|
|
#include "sd-device.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
#include "sd-dhcp-client.h"
|
|
|
|
#include "sd-dhcp-server.h"
|
|
|
|
#include "sd-dhcp6-client.h"
|
2015-10-24 22:58:24 +02:00
|
|
|
#include "sd-ipv4ll.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
#include "sd-lldp.h"
|
2015-10-24 22:58:24 +02:00
|
|
|
#include "sd-ndisc.h"
|
2017-05-12 15:48:29 +02:00
|
|
|
#include "sd-radv.h"
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "sd-netlink.h"
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "list.h"
|
2019-03-06 15:54:57 +01:00
|
|
|
#include "log-link.h"
|
2019-03-05 06:39:57 +01:00
|
|
|
#include "network-util.h"
|
2019-05-22 07:49:46 +02:00
|
|
|
#include "networkd-util.h"
|
2019-05-27 01:52:27 +02:00
|
|
|
#include "ordered-set.h"
|
|
|
|
#include "resolve-util.h"
|
2016-04-29 04:52:04 +02:00
|
|
|
#include "set.h"
|
2014-08-06 12:50:53 +02:00
|
|
|
|
|
|
|
typedef enum LinkState {
|
2019-04-15 10:34:00 +02:00
|
|
|
LINK_STATE_PENDING, /* udev has not initialized the link */
|
|
|
|
LINK_STATE_INITIALIZED, /* udev has initialized the link */
|
|
|
|
LINK_STATE_CONFIGURING, /* configuring addresses, routes, etc. */
|
|
|
|
LINK_STATE_CONFIGURED, /* everything is configured */
|
|
|
|
LINK_STATE_UNMANAGED, /* Unmanaged=yes is set */
|
|
|
|
LINK_STATE_FAILED, /* at least one configuration process failed */
|
|
|
|
LINK_STATE_LINGER, /* RTM_DELLINK for the link has been received */
|
2014-08-06 12:50:53 +02:00
|
|
|
_LINK_STATE_MAX,
|
|
|
|
_LINK_STATE_INVALID = -1
|
|
|
|
} LinkState;
|
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
typedef struct Manager Manager;
|
|
|
|
typedef struct Network Network;
|
|
|
|
typedef struct Address Address;
|
2018-08-06 10:28:27 +02:00
|
|
|
typedef struct DUID DUID;
|
2015-08-27 13:59:06 +02:00
|
|
|
|
2016-04-29 04:52:04 +02:00
|
|
|
typedef struct Link {
|
2014-08-06 12:50:53 +02:00
|
|
|
Manager *manager;
|
|
|
|
|
2018-08-27 06:48:04 +02:00
|
|
|
unsigned n_ref;
|
2014-08-06 12:50:53 +02:00
|
|
|
|
|
|
|
int ifindex;
|
2018-10-19 13:12:35 +02:00
|
|
|
int master_ifindex;
|
2014-08-06 12:50:53 +02:00
|
|
|
char *ifname;
|
2019-12-15 14:46:19 +01:00
|
|
|
char **alternative_names;
|
2016-06-09 13:44:31 +02:00
|
|
|
char *kind;
|
2016-02-18 22:49:02 +01:00
|
|
|
unsigned short iftype;
|
2014-08-06 12:50:53 +02:00
|
|
|
char *state_file;
|
|
|
|
struct ether_addr mac;
|
2019-01-07 12:16:19 +01:00
|
|
|
struct ether_addr permanent_mac;
|
2015-11-16 17:43:08 +01:00
|
|
|
struct in6_addr ipv6ll_address;
|
2014-08-06 12:50:53 +02:00
|
|
|
uint32_t mtu;
|
2018-08-22 07:30:49 +02:00
|
|
|
sd_device *sd_device;
|
2020-06-03 09:19:29 +02:00
|
|
|
char *driver;
|
2014-08-06 12:50:53 +02:00
|
|
|
|
2019-07-24 07:46:55 +02:00
|
|
|
/* wlan */
|
2019-10-25 09:29:23 +02:00
|
|
|
enum nl80211_iftype wlan_iftype;
|
2019-07-24 07:46:55 +02:00
|
|
|
char *ssid;
|
2019-07-24 08:16:26 +02:00
|
|
|
struct ether_addr bssid;
|
2019-07-24 07:46:55 +02:00
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
unsigned flags;
|
|
|
|
uint8_t kernel_operstate;
|
|
|
|
|
|
|
|
Network *network;
|
|
|
|
|
|
|
|
LinkState state;
|
|
|
|
LinkOperationalState operstate;
|
2019-06-16 01:58:39 +02:00
|
|
|
LinkCarrierState carrier_state;
|
|
|
|
LinkAddressState address_state;
|
2014-08-06 12:50:53 +02:00
|
|
|
|
2017-12-12 16:25:36 +01:00
|
|
|
unsigned address_messages;
|
|
|
|
unsigned address_label_messages;
|
2018-11-29 04:00:58 +01:00
|
|
|
unsigned neighbor_messages;
|
2017-12-12 16:25:36 +01:00
|
|
|
unsigned route_messages;
|
2019-10-04 21:40:51 +02:00
|
|
|
unsigned nexthop_messages;
|
2017-12-12 16:25:36 +01:00
|
|
|
unsigned routing_policy_rule_messages;
|
|
|
|
unsigned routing_policy_rule_remove_messages;
|
2020-02-10 12:53:00 +01:00
|
|
|
unsigned tc_messages;
|
2014-08-06 12:50:53 +02:00
|
|
|
unsigned enslaving;
|
|
|
|
|
2015-09-23 01:53:29 +02:00
|
|
|
Set *addresses;
|
2015-09-30 14:01:44 +02:00
|
|
|
Set *addresses_foreign;
|
2019-04-19 09:53:34 +02:00
|
|
|
Set *neighbors;
|
|
|
|
Set *neighbors_foreign;
|
2015-10-25 14:46:21 +01:00
|
|
|
Set *routes;
|
|
|
|
Set *routes_foreign;
|
2019-10-04 21:40:51 +02:00
|
|
|
Set *nexthops;
|
|
|
|
Set *nexthops_foreign;
|
2018-12-01 00:54:45 +01:00
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
sd_dhcp_client *dhcp_client;
|
2019-06-07 08:31:07 +02:00
|
|
|
sd_dhcp_lease *dhcp_lease, *dhcp_lease_old;
|
2019-07-16 19:14:27 +02:00
|
|
|
Set *dhcp_routes;
|
2014-08-06 12:50:53 +02:00
|
|
|
char *lease_file;
|
2018-04-20 16:33:00 +02:00
|
|
|
uint32_t original_mtu;
|
2014-08-08 12:12:17 +02:00
|
|
|
unsigned dhcp4_messages;
|
2019-07-22 04:25:31 +02:00
|
|
|
bool dhcp4_route_failed:1;
|
|
|
|
bool dhcp4_route_retrying:1;
|
2019-07-22 04:24:15 +02:00
|
|
|
bool dhcp4_configured:1;
|
|
|
|
bool dhcp6_configured:1;
|
network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:
- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
new configuration options have been added to networkd to make this
configurable.
- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
message, and has direct, friendly acessor functions for the singleton RA
properties, as well as an iterative interface to iterate through known and
unsupported options. The router object may either be retrieved from the wire,
or generated from raw data. In many ways the sd-ndisc API now matches the
sd-lldp API, except that no implicit database of seen data is kept. (Note
that sd-ndisc actually had a half-written, but unused implementaiton of such
a store, which is removed now.)
- sd-ndisc will now collect the reception timestamps of RA, which is useful to
make sd_ndisc_router fully descriptive of what it covers.
Fixes: #1079
2016-06-02 20:38:12 +02:00
|
|
|
|
networkd: ndisc - handle router advertisement in userspace
Router Discovery is a core part of IPv6, which by default is handled by the kernel.
However, the kernel implementation is meant as a fall-back, and to fully support
the protocol a userspace implementation is desired.
The protocol essentially listens for Router Advertisement packets from routers
on the local link and use these to configure the client automatically. The four
main pieces of information are: what kind (if any) of DHCPv6 configuration should
be performed; a default gateway; the prefixes that should be considered to be on
the local link; and the prefixes with which we can preform SLAAC in order to pick
a global IPv6 address.
A lot of additional information is also available, which we do not yet fully
support, but which will eventually allow us to avoid the need for DHCPv6 in the
common case.
Short-term, the reason for wanting this is in userspace was the desire to fully
track all the addresses on links we manage, and that is not possible for addresses
managed by the kernel (as the kernel does not expose to us the fact that it
manages these addresses). Moreover, we would like to support stable privacy
addresses, which will soon be mandated and the legacy MAC-based global addresses
deprecated, to do this well we need to handle the generation in userspace. Lastly,
more long-term we wish to support more RA options than what the kernel exposes.
2015-11-03 13:02:16 +01:00
|
|
|
unsigned ndisc_messages;
|
|
|
|
bool ndisc_configured;
|
2014-08-06 15:54:03 +02:00
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
sd_ipv4ll *ipv4ll;
|
2015-11-10 21:30:59 +01:00
|
|
|
bool ipv4ll_address:1;
|
2014-08-06 12:50:53 +02:00
|
|
|
|
2019-10-04 21:40:51 +02:00
|
|
|
bool addresses_configured:1;
|
|
|
|
bool addresses_ready:1;
|
2019-07-22 04:24:15 +02:00
|
|
|
bool neighbors_configured:1;
|
|
|
|
bool static_routes_configured:1;
|
2019-10-04 21:40:51 +02:00
|
|
|
bool static_routes_ready:1;
|
|
|
|
bool static_nexthops_configured:1;
|
2019-07-22 04:24:15 +02:00
|
|
|
bool routing_policy_rules_configured:1;
|
2020-02-10 12:53:00 +01:00
|
|
|
bool tc_configured:1;
|
2019-07-22 04:24:15 +02:00
|
|
|
bool setting_mtu:1;
|
2019-12-19 19:17:45 +01:00
|
|
|
bool setting_genmode:1;
|
2019-10-29 15:31:58 +01:00
|
|
|
bool ipv6_mtu_set:1;
|
2014-08-08 12:12:17 +02:00
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
LIST_HEAD(Address, pool_addresses);
|
|
|
|
|
|
|
|
sd_dhcp_server *dhcp_server;
|
|
|
|
|
network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:
- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
new configuration options have been added to networkd to make this
configurable.
- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
message, and has direct, friendly acessor functions for the singleton RA
properties, as well as an iterative interface to iterate through known and
unsupported options. The router object may either be retrieved from the wire,
or generated from raw data. In many ways the sd-ndisc API now matches the
sd-lldp API, except that no implicit database of seen data is kept. (Note
that sd-ndisc actually had a half-written, but unused implementaiton of such
a store, which is removed now.)
- sd-ndisc will now collect the reception timestamps of RA, which is useful to
make sd_ndisc_router fully descriptive of what it covers.
Fixes: #1079
2016-06-02 20:38:12 +02:00
|
|
|
sd_ndisc *ndisc;
|
|
|
|
Set *ndisc_rdnss;
|
|
|
|
Set *ndisc_dnssl;
|
|
|
|
|
2017-05-12 15:48:32 +02:00
|
|
|
sd_radv *radv;
|
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
sd_dhcp6_client *dhcp6_client;
|
2014-11-23 05:26:14 +01:00
|
|
|
|
2016-02-21 14:14:08 +01:00
|
|
|
/* This is about LLDP reception */
|
2014-11-23 05:26:14 +01:00
|
|
|
sd_lldp *lldp;
|
2014-12-11 05:29:55 +01:00
|
|
|
char *lldp_file;
|
2015-02-17 13:06:57 +01:00
|
|
|
|
2016-02-21 14:14:08 +01:00
|
|
|
/* This is about LLDP transmission */
|
|
|
|
unsigned lldp_tx_fast; /* The LLDP txFast counter (See 802.1ab-2009, section 9.2.5.18) */
|
2016-05-06 21:27:36 +02:00
|
|
|
sd_event_source *lldp_emit_event_source;
|
2016-02-21 14:14:08 +01:00
|
|
|
|
2015-02-17 13:06:57 +01:00
|
|
|
Hashmap *bound_by_links;
|
|
|
|
Hashmap *bound_to_links;
|
2019-04-15 09:38:45 +02:00
|
|
|
Set *slaves;
|
2019-05-24 22:08:13 +02:00
|
|
|
|
|
|
|
/* For speed meter */
|
|
|
|
struct rtnl_link_stats64 stats_old, stats_new;
|
|
|
|
bool stats_updated;
|
2019-06-14 02:42:51 +02:00
|
|
|
|
2020-06-16 20:35:18 +02:00
|
|
|
/* All kinds of DNS configuration the user configured via D-Bus */
|
2019-05-27 01:52:27 +02:00
|
|
|
struct in_addr_data *dns;
|
|
|
|
unsigned n_dns;
|
|
|
|
OrderedSet *search_domains, *route_domains;
|
|
|
|
|
|
|
|
int dns_default_route;
|
|
|
|
ResolveSupport llmnr;
|
|
|
|
ResolveSupport mdns;
|
|
|
|
DnssecMode dnssec_mode;
|
|
|
|
DnsOverTlsMode dns_over_tls_mode;
|
|
|
|
Set *dnssec_negative_trust_anchors;
|
|
|
|
|
2020-06-16 20:35:18 +02:00
|
|
|
/* Similar, but NTP server configuration */
|
2019-05-27 01:52:27 +02:00
|
|
|
char **ntp;
|
2016-04-29 04:52:04 +02:00
|
|
|
} Link;
|
2014-08-06 12:50:53 +02:00
|
|
|
|
2018-11-28 21:06:52 +01:00
|
|
|
typedef int (*link_netlink_message_handler_t)(sd_netlink*, sd_netlink_message*, Link*);
|
|
|
|
|
2018-08-06 10:28:27 +02:00
|
|
|
DUID *link_get_duid(Link *link);
|
2018-07-02 20:19:15 +02:00
|
|
|
int get_product_uuid_handler(sd_bus_message *m, void *userdata, sd_bus_error *ret_error);
|
2018-08-06 10:28:27 +02:00
|
|
|
|
2019-05-27 01:52:27 +02:00
|
|
|
void link_ntp_settings_clear(Link *link);
|
|
|
|
void link_dns_settings_clear(Link *link);
|
2014-08-06 12:50:53 +02:00
|
|
|
Link *link_unref(Link *link);
|
|
|
|
Link *link_ref(Link *link);
|
2019-05-04 19:43:45 +02:00
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref);
|
2018-11-28 21:06:52 +01:00
|
|
|
DEFINE_TRIVIAL_DESTRUCTOR(link_netlink_destroy_callback, Link, link_unref);
|
2018-10-06 06:55:19 +02:00
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
int link_get(Manager *m, int ifindex, Link **ret);
|
2015-06-12 16:31:33 +02:00
|
|
|
int link_add(Manager *manager, sd_netlink_message *message, Link **ret);
|
2014-08-06 12:50:53 +02:00
|
|
|
void link_drop(Link *link);
|
|
|
|
|
2019-05-09 08:53:01 +02:00
|
|
|
int link_down(Link *link, link_netlink_message_handler_t callback);
|
2017-04-30 13:12:32 +02:00
|
|
|
|
2014-08-06 15:54:03 +02:00
|
|
|
void link_enter_failed(Link *link);
|
2018-08-22 07:30:49 +02:00
|
|
|
int link_initialized(Link *link, sd_device *device);
|
2014-08-06 12:50:53 +02:00
|
|
|
|
2019-05-20 08:59:44 +02:00
|
|
|
void link_set_state(Link *link, LinkState state);
|
2015-09-28 13:38:43 +02:00
|
|
|
void link_check_ready(Link *link);
|
2014-08-06 15:54:03 +02:00
|
|
|
|
2019-02-12 22:32:48 +01:00
|
|
|
void link_update_operstate(Link *link, bool also_update_bond_master);
|
2015-06-12 16:31:33 +02:00
|
|
|
int link_update(Link *link, sd_netlink_message *message);
|
2014-08-06 15:54:03 +02:00
|
|
|
|
2015-09-30 18:17:43 +02:00
|
|
|
void link_dirty(Link *link);
|
|
|
|
void link_clean(Link *link);
|
2014-08-06 12:50:53 +02:00
|
|
|
int link_save(Link *link);
|
|
|
|
|
2015-02-03 15:44:12 +01:00
|
|
|
int link_carrier_reset(Link *link);
|
2014-09-04 14:05:54 +02:00
|
|
|
bool link_has_carrier(Link *link);
|
2014-08-06 12:50:53 +02:00
|
|
|
|
2015-11-16 17:43:08 +01:00
|
|
|
int link_ipv6ll_gained(Link *link, const struct in6_addr *address);
|
2015-11-10 21:30:59 +01:00
|
|
|
|
2019-05-15 09:02:06 +02:00
|
|
|
int link_set_mtu(Link *link, uint32_t mtu);
|
2014-08-08 12:12:17 +02:00
|
|
|
|
2019-08-03 22:09:08 +02:00
|
|
|
bool link_ipv4ll_enabled(Link *link, AddressFamily mask);
|
2019-05-01 08:43:23 +02:00
|
|
|
|
2019-06-03 19:05:26 +02:00
|
|
|
int link_stop_clients(Link *link, bool may_keep_dhcp);
|
2019-05-06 16:06:50 +02:00
|
|
|
|
2014-08-06 12:50:53 +02:00
|
|
|
const char* link_state_to_string(LinkState s) _const_;
|
|
|
|
LinkState link_state_from_string(const char *s) _pure_;
|
|
|
|
|
2019-02-12 04:49:45 +01:00
|
|
|
uint32_t link_get_vrf_table(Link *link);
|
|
|
|
uint32_t link_get_dhcp_route_table(Link *link);
|
|
|
|
uint32_t link_get_ipv6_accept_ra_route_table(Link *link);
|
2019-04-29 07:02:34 +02:00
|
|
|
int link_request_set_routes(Link *link);
|
2019-10-04 21:40:51 +02:00
|
|
|
int link_request_set_nexthop(Link *link);
|
2019-02-12 04:49:45 +01:00
|
|
|
|
2019-10-23 15:32:27 +02:00
|
|
|
int link_reconfigure(Link *link, bool force);
|
2020-04-04 20:07:18 +02:00
|
|
|
int address_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link);
|
2019-07-04 06:52:03 +02:00
|
|
|
|
2019-11-30 07:54:07 +01:00
|
|
|
int log_link_message_full_errno(Link *link, sd_netlink_message *m, int level, int err, const char *msg);
|
|
|
|
#define log_link_message_error_errno(link, m, err, msg) log_link_message_full_errno(link, m, LOG_ERR, err, msg)
|
|
|
|
#define log_link_message_warning_errno(link, m, err, msg) log_link_message_full_errno(link, m, LOG_WARNING, err, msg)
|
|
|
|
#define log_link_message_notice_errno(link, m, err, msg) log_link_message_full_errno(link, m, LOG_NOTICE, err, msg)
|
|
|
|
#define log_link_message_info_errno(link, m, err, msg) log_link_message_full_errno(link, m, LOG_INFO, err, msg)
|
|
|
|
#define log_link_message_debug_errno(link, m, err, msg) log_link_message_full_errno(link, m, LOG_DEBUG, err, msg)
|
|
|
|
|
networkd DHCPv4 logging endian fix
On Tue, Feb 10, 2015 at 08:10:43PM +0100, Lennart Poettering wrote:
> Hmm, I think it would be nicer to use be32toh() here instead, since it
> ensures the macro is (to a limited degree) typesafe.
>
> Any chance you could rework that?
From: Paul Martin <paul.martin@codethink.co.uk>
Date: Wed, 11 Feb 2015 11:47:16 +0000
Subject: [PATCH] networkd dhcpv4 logging endian fix
On a big-endian host, systemd-networkd prints out IPv4 network
addresses byte reversed:
Feb 10 16:43:32 hostname systemd-networkd[151]: eth0 : DHCPv4 address 158.1.24.10/16 via 1.1.24.10
The address obtained is 10.24.1.158/16 and the route is
10.24.0.0/16 dev eth0 src 10.24.1.187
The macro ADDRESS_FMT_VAL() unpacks a "struct in_addr" in a
little-endian specific manner.
This patch forces the passed address into host order, then unpacks it.
On an x86 later than i486, compiled with -O2, the only extra overhead
is a single bswap instruction.
2015-02-11 12:50:28 +01:00
|
|
|
#define ADDRESS_FMT_VAL(address) \
|
|
|
|
be32toh((address).s_addr) >> 24, \
|
|
|
|
(be32toh((address).s_addr) >> 16) & 0xFFu, \
|
|
|
|
(be32toh((address).s_addr) >> 8) & 0xFFu, \
|
|
|
|
be32toh((address).s_addr) & 0xFFu
|