1
0
mirror of https://github.com/systemd/systemd synced 2025-12-29 20:34:44 +01:00

Compare commits

..

No commits in common. "7509c7fdf94df385661ab9818df0dc5f0a3b7247" and "565147b7bb2156277a2efaccd920d3ca9c21f8a8" have entirely different histories.

18 changed files with 467 additions and 3244 deletions

View File

@ -4,11 +4,6 @@
#include <linux/btrfs.h> #include <linux/btrfs.h>
#include <linux/types.h> #include <linux/types.h>
#ifdef __KERNEL__
#include <linux/stddef.h>
#else
#include <stddef.h>
#endif
/* /*
* This header contains the structure definitions and constants used * This header contains the structure definitions and constants used
@ -649,15 +644,6 @@ struct btrfs_root_item {
__le64 reserved[8]; /* for future */ __le64 reserved[8]; /* for future */
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));
/*
* Btrfs root item used to be smaller than current size. The old format ends
* at where member generation_v2 is.
*/
static inline __u32 btrfs_legacy_root_item_size(void)
{
return offsetof(struct btrfs_root_item, generation_v2);
}
/* /*
* this is used for both forward and backward root refs * this is used for both forward and backward root refs
*/ */

View File

@ -455,33 +455,10 @@ enum {
enum { enum {
MDBA_MDB_EATTR_UNSPEC, MDBA_MDB_EATTR_UNSPEC,
MDBA_MDB_EATTR_TIMER, MDBA_MDB_EATTR_TIMER,
MDBA_MDB_EATTR_SRC_LIST,
MDBA_MDB_EATTR_GROUP_MODE,
MDBA_MDB_EATTR_SOURCE,
MDBA_MDB_EATTR_RTPROT,
__MDBA_MDB_EATTR_MAX __MDBA_MDB_EATTR_MAX
}; };
#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1) #define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
/* per mdb entry source */
enum {
MDBA_MDB_SRCLIST_UNSPEC,
MDBA_MDB_SRCLIST_ENTRY,
__MDBA_MDB_SRCLIST_MAX
};
#define MDBA_MDB_SRCLIST_MAX (__MDBA_MDB_SRCLIST_MAX - 1)
/* per mdb entry per source attributes
* these are embedded in MDBA_MDB_SRCLIST_ENTRY
*/
enum {
MDBA_MDB_SRCATTR_UNSPEC,
MDBA_MDB_SRCATTR_ADDRESS,
MDBA_MDB_SRCATTR_TIMER,
__MDBA_MDB_SRCATTR_MAX
};
#define MDBA_MDB_SRCATTR_MAX (__MDBA_MDB_SRCATTR_MAX - 1)
/* multicast router types */ /* multicast router types */
enum { enum {
MDB_RTR_TYPE_DISABLED, MDB_RTR_TYPE_DISABLED,
@ -518,8 +495,6 @@ struct br_mdb_entry {
__u8 state; __u8 state;
#define MDB_FLAGS_OFFLOAD (1 << 0) #define MDB_FLAGS_OFFLOAD (1 << 0)
#define MDB_FLAGS_FAST_LEAVE (1 << 1) #define MDB_FLAGS_FAST_LEAVE (1 << 1)
#define MDB_FLAGS_STAR_EXCL (1 << 2)
#define MDB_FLAGS_BLOCKED (1 << 3)
__u8 flags; __u8 flags;
__u16 vid; __u16 vid;
struct { struct {
@ -534,23 +509,10 @@ struct br_mdb_entry {
enum { enum {
MDBA_SET_ENTRY_UNSPEC, MDBA_SET_ENTRY_UNSPEC,
MDBA_SET_ENTRY, MDBA_SET_ENTRY,
MDBA_SET_ENTRY_ATTRS,
__MDBA_SET_ENTRY_MAX, __MDBA_SET_ENTRY_MAX,
}; };
#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1) #define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
/* [MDBA_SET_ENTRY_ATTRS] = {
* [MDBE_ATTR_xxx]
* ...
* }
*/
enum {
MDBE_ATTR_UNSPEC,
MDBE_ATTR_SOURCE,
__MDBE_ATTR_MAX,
};
#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */ /* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
enum { enum {
BRIDGE_XSTATS_UNSPEC, BRIDGE_XSTATS_UNSPEC,

View File

@ -7,23 +7,24 @@
/* This struct should be in sync with struct rtnl_link_stats64 */ /* This struct should be in sync with struct rtnl_link_stats64 */
struct rtnl_link_stats { struct rtnl_link_stats {
__u32 rx_packets; __u32 rx_packets; /* total packets received */
__u32 tx_packets; __u32 tx_packets; /* total packets transmitted */
__u32 rx_bytes; __u32 rx_bytes; /* total bytes received */
__u32 tx_bytes; __u32 tx_bytes; /* total bytes transmitted */
__u32 rx_errors; __u32 rx_errors; /* bad packets received */
__u32 tx_errors; __u32 tx_errors; /* packet transmit problems */
__u32 rx_dropped; __u32 rx_dropped; /* no space in linux buffers */
__u32 tx_dropped; __u32 tx_dropped; /* no space available in linux */
__u32 multicast; __u32 multicast; /* multicast packets received */
__u32 collisions; __u32 collisions;
/* detailed rx_errors: */ /* detailed rx_errors: */
__u32 rx_length_errors; __u32 rx_length_errors;
__u32 rx_over_errors; __u32 rx_over_errors; /* receiver ring buff overflow */
__u32 rx_crc_errors; __u32 rx_crc_errors; /* recved pkt with crc error */
__u32 rx_frame_errors; __u32 rx_frame_errors; /* recv'd frame alignment error */
__u32 rx_fifo_errors; __u32 rx_fifo_errors; /* recv'r fifo overrun */
__u32 rx_missed_errors; __u32 rx_missed_errors; /* receiver missed packet */
/* detailed tx_errors */ /* detailed tx_errors */
__u32 tx_aborted_errors; __u32 tx_aborted_errors;
@ -36,200 +37,29 @@ struct rtnl_link_stats {
__u32 rx_compressed; __u32 rx_compressed;
__u32 tx_compressed; __u32 tx_compressed;
__u32 rx_nohandler; __u32 rx_nohandler; /* dropped, no handler found */
}; };
/** /* The main device statistics structure */
* struct rtnl_link_stats64 - The main device statistics structure.
*
* @rx_packets: Number of good packets received by the interface.
* For hardware interfaces counts all good packets received from the device
* by the host, including packets which host had to drop at various stages
* of processing (even in the driver).
*
* @tx_packets: Number of packets successfully transmitted.
* For hardware interfaces counts packets which host was able to successfully
* hand over to the device, which does not necessarily mean that packets
* had been successfully transmitted out of the device, only that device
* acknowledged it copied them out of host memory.
*
* @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
*
* For IEEE 802.3 devices should count the length of Ethernet Frames
* excluding the FCS.
*
* @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
*
* For IEEE 802.3 devices should count the length of Ethernet Frames
* excluding the FCS.
*
* @rx_errors: Total number of bad packets received on this network device.
* This counter must include events counted by @rx_length_errors,
* @rx_crc_errors, @rx_frame_errors and other errors not otherwise
* counted.
*
* @tx_errors: Total number of transmit problems.
* This counter must include events counter by @tx_aborted_errors,
* @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
* @tx_window_errors and other errors not otherwise counted.
*
* @rx_dropped: Number of packets received but not processed,
* e.g. due to lack of resources or unsupported protocol.
* For hardware interfaces this counter should not include packets
* dropped by the device which are counted separately in
* @rx_missed_errors (since procfs folds those two counters together).
*
* @tx_dropped: Number of packets dropped on their way to transmission,
* e.g. due to lack of resources.
*
* @multicast: Multicast packets received.
* For hardware interfaces this statistic is commonly calculated
* at the device level (unlike @rx_packets) and therefore may include
* packets which did not reach the host.
*
* For IEEE 802.3 devices this counter may be equivalent to:
*
* - 30.3.1.1.21 aMulticastFramesReceivedOK
*
* @collisions: Number of collisions during packet transmissions.
*
* @rx_length_errors: Number of packets dropped due to invalid length.
* Part of aggregate "frame" errors in `/proc/net/dev`.
*
* For IEEE 802.3 devices this counter should be equivalent to a sum
* of the following attributes:
*
* - 30.3.1.1.23 aInRangeLengthErrors
* - 30.3.1.1.24 aOutOfRangeLengthField
* - 30.3.1.1.25 aFrameTooLongErrors
*
* @rx_over_errors: Receiver FIFO overflow event counter.
*
* Historically the count of overflow events. Such events may be
* reported in the receive descriptors or via interrupts, and may
* not correspond one-to-one with dropped packets.
*
* The recommended interpretation for high speed interfaces is -
* number of packets dropped because they did not fit into buffers
* provided by the host, e.g. packets larger than MTU or next buffer
* in the ring was not available for a scatter transfer.
*
* Part of aggregate "frame" errors in `/proc/net/dev`.
*
* This statistics was historically used interchangeably with
* @rx_fifo_errors.
*
* This statistic corresponds to hardware events and is not commonly used
* on software devices.
*
* @rx_crc_errors: Number of packets received with a CRC error.
* Part of aggregate "frame" errors in `/proc/net/dev`.
*
* For IEEE 802.3 devices this counter must be equivalent to:
*
* - 30.3.1.1.6 aFrameCheckSequenceErrors
*
* @rx_frame_errors: Receiver frame alignment errors.
* Part of aggregate "frame" errors in `/proc/net/dev`.
*
* For IEEE 802.3 devices this counter should be equivalent to:
*
* - 30.3.1.1.7 aAlignmentErrors
*
* @rx_fifo_errors: Receiver FIFO error counter.
*
* Historically the count of overflow events. Those events may be
* reported in the receive descriptors or via interrupts, and may
* not correspond one-to-one with dropped packets.
*
* This statistics was used interchangeably with @rx_over_errors.
* Not recommended for use in drivers for high speed interfaces.
*
* This statistic is used on software devices, e.g. to count software
* packet queue overflow (can) or sequencing errors (GRE).
*
* @rx_missed_errors: Count of packets missed by the host.
* Folded into the "drop" counter in `/proc/net/dev`.
*
* Counts number of packets dropped by the device due to lack
* of buffer space. This usually indicates that the host interface
* is slower than the network interface, or host is not keeping up
* with the receive packet rate.
*
* This statistic corresponds to hardware events and is not used
* on software devices.
*
* @tx_aborted_errors:
* Part of aggregate "carrier" errors in `/proc/net/dev`.
* For IEEE 802.3 devices capable of half-duplex operation this counter
* must be equivalent to:
*
* - 30.3.1.1.11 aFramesAbortedDueToXSColls
*
* High speed interfaces may use this counter as a general device
* discard counter.
*
* @tx_carrier_errors: Number of frame transmission errors due to loss
* of carrier during transmission.
* Part of aggregate "carrier" errors in `/proc/net/dev`.
*
* For IEEE 802.3 devices this counter must be equivalent to:
*
* - 30.3.1.1.13 aCarrierSenseErrors
*
* @tx_fifo_errors: Number of frame transmission errors due to device
* FIFO underrun / underflow. This condition occurs when the device
* begins transmission of a frame but is unable to deliver the
* entire frame to the transmitter in time for transmission.
* Part of aggregate "carrier" errors in `/proc/net/dev`.
*
* @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
* old half-duplex Ethernet.
* Part of aggregate "carrier" errors in `/proc/net/dev`.
*
* For IEEE 802.3 devices possibly equivalent to:
*
* - 30.3.2.1.4 aSQETestErrors
*
* @tx_window_errors: Number of frame transmission errors due
* to late collisions (for Ethernet - after the first 64B of transmission).
* Part of aggregate "carrier" errors in `/proc/net/dev`.
*
* For IEEE 802.3 devices this counter must be equivalent to:
*
* - 30.3.1.1.10 aLateCollisions
*
* @rx_compressed: Number of correctly received compressed packets.
* This counters is only meaningful for interfaces which support
* packet compression (e.g. CSLIP, PPP).
*
* @tx_compressed: Number of transmitted compressed packets.
* This counters is only meaningful for interfaces which support
* packet compression (e.g. CSLIP, PPP).
*
* @rx_nohandler: Number of packets received on the interface
* but dropped by the networking stack because the device is
* not designated to receive packets (e.g. backup link in a bond).
*/
struct rtnl_link_stats64 { struct rtnl_link_stats64 {
__u64 rx_packets; __u64 rx_packets; /* total packets received */
__u64 tx_packets; __u64 tx_packets; /* total packets transmitted */
__u64 rx_bytes; __u64 rx_bytes; /* total bytes received */
__u64 tx_bytes; __u64 tx_bytes; /* total bytes transmitted */
__u64 rx_errors; __u64 rx_errors; /* bad packets received */
__u64 tx_errors; __u64 tx_errors; /* packet transmit problems */
__u64 rx_dropped; __u64 rx_dropped; /* no space in linux buffers */
__u64 tx_dropped; __u64 tx_dropped; /* no space available in linux */
__u64 multicast; __u64 multicast; /* multicast packets received */
__u64 collisions; __u64 collisions;
/* detailed rx_errors: */ /* detailed rx_errors: */
__u64 rx_length_errors; __u64 rx_length_errors;
__u64 rx_over_errors; __u64 rx_over_errors; /* receiver ring buff overflow */
__u64 rx_crc_errors; __u64 rx_crc_errors; /* recved pkt with crc error */
__u64 rx_frame_errors; __u64 rx_frame_errors; /* recv'd frame alignment error */
__u64 rx_fifo_errors; __u64 rx_fifo_errors; /* recv'r fifo overrun */
__u64 rx_missed_errors; __u64 rx_missed_errors; /* receiver missed packet */
/* detailed tx_errors */ /* detailed tx_errors */
__u64 tx_aborted_errors; __u64 tx_aborted_errors;
@ -241,7 +71,8 @@ struct rtnl_link_stats64 {
/* for cslip etc */ /* for cslip etc */
__u64 rx_compressed; __u64 rx_compressed;
__u64 tx_compressed; __u64 tx_compressed;
__u64 rx_nohandler;
__u64 rx_nohandler; /* dropped, no handler found */
}; };
/* The struct should be in sync with struct ifmap */ /* The struct should be in sync with struct ifmap */

View File

@ -108,7 +108,7 @@ enum {
L2TP_ATTR_VLAN_ID, /* u16 (not used) */ L2TP_ATTR_VLAN_ID, /* u16 (not used) */
L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */ L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */
L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */ L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */
L2TP_ATTR_DEBUG, /* u32, enum l2tp_debug_flags (not used) */ L2TP_ATTR_DEBUG, /* u32, enum l2tp_debug_flags */
L2TP_ATTR_RECV_SEQ, /* u8 */ L2TP_ATTR_RECV_SEQ, /* u8 */
L2TP_ATTR_SEND_SEQ, /* u8 */ L2TP_ATTR_SEND_SEQ, /* u8 */
L2TP_ATTR_LNS_MODE, /* u8 */ L2TP_ATTR_LNS_MODE, /* u8 */
@ -144,7 +144,6 @@ enum {
L2TP_ATTR_RX_OOS_PACKETS, /* u64 */ L2TP_ATTR_RX_OOS_PACKETS, /* u64 */
L2TP_ATTR_RX_ERRORS, /* u64 */ L2TP_ATTR_RX_ERRORS, /* u64 */
L2TP_ATTR_STATS_PAD, L2TP_ATTR_STATS_PAD,
L2TP_ATTR_RX_COOKIE_DISCARDS, /* u64 */
__L2TP_ATTR_STATS_MAX, __L2TP_ATTR_STATS_MAX,
}; };
@ -178,9 +177,7 @@ enum l2tp_seqmode {
}; };
/** /**
* enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions. * enum l2tp_debug_flags - debug message categories for L2TP tunnels/sessions
*
* Unused.
* *
* @L2TP_MSG_DEBUG: verbose debug (if compiled in) * @L2TP_MSG_DEBUG: verbose debug (if compiled in)
* @L2TP_MSG_CONTROL: userspace - kernel interface * @L2TP_MSG_CONTROL: userspace - kernel interface

View File

@ -12,15 +12,15 @@
* the EXP_n values would be 1981, 2034 and 2043 if still using only * the EXP_n values would be 1981, 2034 and 2043 if still using only
* 11 bit fractions. * 11 bit fractions.
*/ */
extern unsigned long avenrun[]; /* Load averages */ extern unsigned long avenrun[]; /* Load averages */
extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift); extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
#define FSHIFT 11 /* nr of bits of precision */ #define FSHIFT 11 /* nr of bits of precision */
#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */
#define LOAD_FREQ (5*HZ+1) /* 5 sec intervals */ #define LOAD_FREQ (5*HZ+1) /* 5 sec intervals */
#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */ #define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */
#define EXP_5 2014 /* 1/exp(5sec/5min) */ #define EXP_5 2014 /* 1/exp(5sec/5min) */
#define EXP_15 2037 /* 1/exp(5sec/15min) */ #define EXP_15 2037 /* 1/exp(5sec/15min) */
/* /*
* a1 = a0 * e + a * (1 - e) * a1 = a0 * e + a * (1 - e)
@ -28,21 +28,21 @@ extern void get_avenrun(unsigned long *loads, unsigned long offset, int shift);
static inline unsigned long static inline unsigned long
calc_load(unsigned long load, unsigned long exp, unsigned long active) calc_load(unsigned long load, unsigned long exp, unsigned long active)
{ {
unsigned long newload; unsigned long newload;
newload = load * exp + active * (FIXED_1 - exp); newload = load * exp + active * (FIXED_1 - exp);
if (active >= load) if (active >= load)
newload += FIXED_1-1; newload += FIXED_1-1;
return newload / FIXED_1; return newload / FIXED_1;
} }
extern unsigned long calc_load_n(unsigned long load, unsigned long exp, extern unsigned long calc_load_n(unsigned long load, unsigned long exp,
unsigned long active, unsigned int n); unsigned long active, unsigned int n);
#define LOAD_INT(x) ((x) >> FSHIFT) #define LOAD_INT(x) ((x) >> FSHIFT)
#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
extern void calc_global_load(void); extern void calc_global_load(unsigned long ticks);
#endif /* _LINUX_SCHED_LOADAVG_H */ #endif /* _LINUX_SCHED_LOADAVG_H */

View File

@ -129,7 +129,6 @@ struct nlmsgerr {
* @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to
* be used - in the success case - to identify a created * be used - in the success case - to identify a created
* object or operation or similar (binary) * object or operation or similar (binary)
* @NLMSGERR_ATTR_POLICY: policy for a rejected attribute
* @__NLMSGERR_ATTR_MAX: number of attributes * @__NLMSGERR_ATTR_MAX: number of attributes
* @NLMSGERR_ATTR_MAX: highest attribute number * @NLMSGERR_ATTR_MAX: highest attribute number
*/ */
@ -138,7 +137,6 @@ enum nlmsgerr_attrs {
NLMSGERR_ATTR_MSG, NLMSGERR_ATTR_MSG,
NLMSGERR_ATTR_OFFS, NLMSGERR_ATTR_OFFS,
NLMSGERR_ATTR_COOKIE, NLMSGERR_ATTR_COOKIE,
NLMSGERR_ATTR_POLICY,
__NLMSGERR_ATTR_MAX, __NLMSGERR_ATTR_MAX,
NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
@ -333,7 +331,6 @@ enum netlink_attribute_type {
* the index, if limited inside the nesting (U32) * the index, if limited inside the nesting (U32)
* @NL_POLICY_TYPE_ATTR_BITFIELD32_MASK: valid mask for the * @NL_POLICY_TYPE_ATTR_BITFIELD32_MASK: valid mask for the
* bitfield32 type (U32) * bitfield32 type (U32)
* @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64)
* @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment
*/ */
enum netlink_policy_type_attr { enum netlink_policy_type_attr {
@ -349,7 +346,6 @@ enum netlink_policy_type_attr {
NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE, NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE,
NL_POLICY_TYPE_ATTR_BITFIELD32_MASK, NL_POLICY_TYPE_ATTR_BITFIELD32_MASK,
NL_POLICY_TYPE_ATTR_PAD, NL_POLICY_TYPE_ATTR_PAD,
NL_POLICY_TYPE_ATTR_MASK,
/* keep last */ /* keep last */
__NL_POLICY_TYPE_ATTR_MAX, __NL_POLICY_TYPE_ATTR_MAX,

View File

@ -3,11 +3,7 @@
set -eu set -eu
for i in *.h */*.h; do for i in *.h */*.h; do
if [[ $i == 'loadavg.h' ]]; then curl https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/$i -o $i
curl https://raw.githubusercontent.com/torvalds/linux/master/include/linux/sched/$i -o $i
else
curl https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/$i -o $i
fi
sed -i -e 's/__user //g' -e '/^#include <linux\/compiler.h>/ d' $i sed -i -e 's/__user //g' -e '/^#include <linux\/compiler.h>/ d' $i
done done

View File

@ -266,7 +266,7 @@ static int address_set_masquerade(Address *address, bool add) {
if (r < 0) if (r < 0)
return r; return r;
r = fw_add_masquerade(add, AF_INET, &masked, address->prefixlen); r = fw_add_masquerade(add, AF_INET, 0, &masked, address->prefixlen, NULL, NULL, 0);
if (r < 0) if (r < 0)
return r; return r;

View File

@ -100,6 +100,9 @@ int expose_port_flush(ExposePort* l, union in_addr_union *exposed) {
r = fw_add_local_dnat(false, r = fw_add_local_dnat(false,
af, af,
p->protocol, p->protocol,
NULL,
NULL, 0,
NULL, 0,
p->host_port, p->host_port,
exposed, exposed,
p->container_port, p->container_port,
@ -153,6 +156,9 @@ int expose_port_execute(sd_netlink *rtnl, ExposePort *l, union in_addr_union *ex
r = fw_add_local_dnat(true, r = fw_add_local_dnat(true,
af, af,
p->protocol, p->protocol,
NULL,
NULL, 0,
NULL, 0,
p->host_port, p->host_port,
&new_exposed, &new_exposed,
p->container_port, p->container_port,

View File

@ -150,8 +150,6 @@ static const char* const ethtool_link_mode_bit_table[] = {
[ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT] = "400000baselr4-er4-fr4-full", [ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT] = "400000baselr4-er4-fr4-full",
[ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT] = "400000basedr4-full", [ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT] = "400000basedr4-full",
[ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT] = "400000basecr4-full", [ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT] = "400000basecr4-full",
[ETHTOOL_LINK_MODE_100baseFX_Half_BIT] = "100basefx-half",
[ETHTOOL_LINK_MODE_100baseFX_Full_BIT] = "100basefx-full",
}; };
/* Make sure the array is large enough to fit all bits */ /* Make sure the array is large enough to fit all bits */
assert_cc((ELEMENTSOF(ethtool_link_mode_bit_table)-1) / 32 < N_ADVERTISE); assert_cc((ELEMENTSOF(ethtool_link_mode_bit_table)-1) / 32 < N_ADVERTISE);

View File

@ -81,8 +81,12 @@ static int entry_fill_basics(
int fw_add_masquerade( int fw_add_masquerade(
bool add, bool add,
int af, int af,
int protocol,
const union in_addr_union *source, const union in_addr_union *source,
unsigned source_prefixlen) { unsigned source_prefixlen,
const char *out_interface,
const union in_addr_union *destination,
unsigned destination_prefixlen) {
static const xt_chainlabel chain = "POSTROUTING"; static const xt_chainlabel chain = "POSTROUTING";
_cleanup_(iptc_freep) struct xtc_handle *h = NULL; _cleanup_(iptc_freep) struct xtc_handle *h = NULL;
@ -90,14 +94,14 @@ int fw_add_masquerade(
struct ipt_entry_target *t; struct ipt_entry_target *t;
size_t sz; size_t sz;
struct nf_nat_ipv4_multi_range_compat *mr; struct nf_nat_ipv4_multi_range_compat *mr;
int r, protocol = 0; int r;
const char *out_interface = NULL;
const union in_addr_union *destination = NULL;
unsigned destination_prefixlen = 0;
if (af != AF_INET) if (af != AF_INET)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!IN_SET(protocol, 0, IPPROTO_TCP, IPPROTO_UDP))
return -EOPNOTSUPP;
h = iptc_init("nat"); h = iptc_init("nat");
if (!h) if (!h)
return -errno; return -errno;
@ -154,6 +158,11 @@ int fw_add_local_dnat(
bool add, bool add,
int af, int af,
int protocol, int protocol,
const char *in_interface,
const union in_addr_union *source,
unsigned source_prefixlen,
const union in_addr_union *destination,
unsigned destination_prefixlen,
uint16_t local_port, uint16_t local_port,
const union in_addr_union *remote, const union in_addr_union *remote,
uint16_t remote_port, uint16_t remote_port,
@ -168,11 +177,6 @@ int fw_add_local_dnat(
struct nf_nat_ipv4_multi_range_compat *mr; struct nf_nat_ipv4_multi_range_compat *mr;
size_t sz, msz; size_t sz, msz;
int r; int r;
const char *in_interface = NULL;
const union in_addr_union *source = NULL;
unsigned source_prefixlen = 0;
const union in_addr_union *destination = NULL;
unsigned destination_prefixlen = 0;
assert(add || !previous_remote); assert(add || !previous_remote);

View File

@ -11,13 +11,22 @@
int fw_add_masquerade( int fw_add_masquerade(
bool add, bool add,
int af, int af,
int protocol,
const union in_addr_union *source, const union in_addr_union *source,
unsigned source_prefixlen); unsigned source_prefixlen,
const char *out_interface,
const union in_addr_union *destination,
unsigned destination_prefixlen);
int fw_add_local_dnat( int fw_add_local_dnat(
bool add, bool add,
int af, int af,
int protocol, int protocol,
const char *in_interface,
const union in_addr_union *source,
unsigned source_prefixlen,
const union in_addr_union *destination,
unsigned destination_prefixlen,
uint16_t local_port, uint16_t local_port,
const union in_addr_union *remote, const union in_addr_union *remote,
uint16_t remote_port, uint16_t remote_port,
@ -28,8 +37,12 @@ int fw_add_local_dnat(
static inline int fw_add_masquerade( static inline int fw_add_masquerade(
bool add, bool add,
int af, int af,
int protocol,
const union in_addr_union *source, const union in_addr_union *source,
unsigned source_prefixlen) { unsigned source_prefixlen,
const char *out_interface,
const union in_addr_union *destination,
unsigned destination_prefixlen) {
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
@ -37,6 +50,11 @@ static inline int fw_add_local_dnat(
bool add, bool add,
int af, int af,
int protocol, int protocol,
const char *in_interface,
const union in_addr_union *source,
unsigned source_prefixlen,
const union in_addr_union *destination,
unsigned destination_prefixlen,
uint16_t local_port, uint16_t local_port,
const union in_addr_union *remote, const union in_addr_union *remote,
uint16_t remote_port, uint16_t remote_port,

View File

@ -82,7 +82,7 @@ struct args_ismountpoint {
/* /*
* All the ioctls use this structure. * All the ioctls use this structure.
* When sending a path size must account for the total length * When sending a path size must account for the total length
* of the chunk of memory otherwise it is the size of the * of the chunk of memory otherwise is is the size of the
* structure. * structure.
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -243,7 +243,6 @@ enum {
DM_TARGET_MSG_CMD, DM_TARGET_MSG_CMD,
DM_DEV_SET_GEOMETRY_CMD, DM_DEV_SET_GEOMETRY_CMD,
DM_DEV_ARM_POLL_CMD, DM_DEV_ARM_POLL_CMD,
DM_GET_TARGET_VERSION_CMD,
}; };
#define DM_IOCTL 0xfd #define DM_IOCTL 0xfd
@ -266,7 +265,6 @@ enum {
#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl) #define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl) #define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
#define DM_GET_TARGET_VERSION _IOWR(DM_IOCTL, DM_GET_TARGET_VERSION_CMD, struct dm_ioctl)
#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) #define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
@ -274,7 +272,7 @@ enum {
#define DM_VERSION_MAJOR 4 #define DM_VERSION_MAJOR 4
#define DM_VERSION_MINOR 27 #define DM_VERSION_MINOR 27
#define DM_VERSION_PATCHLEVEL 0 #define DM_VERSION_PATCHLEVEL 0
#define DM_VERSION_EXTRA "-ioctl (2020-10-01)" #define DM_VERSION_EXTRA "-ioctl (2019-01-18)"
/* Status bits */ /* Status bits */
#define DM_READONLY_FLAG (1 << 0) /* In/Out */ #define DM_READONLY_FLAG (1 << 0) /* In/Out */

View File

@ -1621,8 +1621,6 @@ enum ethtool_link_mode_bit_indices {
ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87, ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88, ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 88,
ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89, ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
/* must be last entry */ /* must be last entry */
__ETHTOOL_LINK_MODE_MASK_NBITS __ETHTOOL_LINK_MODE_MASK_NBITS
}; };

File diff suppressed because it is too large Load Diff

View File

@ -10,31 +10,31 @@ int main(int argc, char *argv[]) {
int r; int r;
test_setup_logging(LOG_DEBUG); test_setup_logging(LOG_DEBUG);
r = fw_add_masquerade(true, AF_INET, NULL, 0); r = fw_add_masquerade(true, AF_INET, 0, NULL, 0, "foobar", NULL, 0);
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");
r = fw_add_masquerade(true, AF_INET, NULL, 0); r = fw_add_masquerade(true, AF_INET, 0, NULL, 0, "foobar", NULL, 0);
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");
r = fw_add_masquerade(false, AF_INET, NULL, 0); r = fw_add_masquerade(false, AF_INET, 0, NULL, 0, "foobar", NULL, 0);
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");
r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL);
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");
r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL); r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 4), 815, NULL);
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");
r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, &MAKE_IN_ADDR_UNION(1, 2, 3, 4)); r = fw_add_local_dnat(true, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, &MAKE_IN_ADDR_UNION(1, 2, 3, 4));
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");
r = fw_add_local_dnat(false, AF_INET, IPPROTO_TCP, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, NULL); r = fw_add_local_dnat(false, AF_INET, IPPROTO_TCP, NULL, NULL, 0, NULL, 0, 4711, &MAKE_IN_ADDR_UNION(1, 2, 3, 5), 815, NULL);
if (r < 0) if (r < 0)
log_error_errno(r, "Failed to modify firewall: %m"); log_error_errno(r, "Failed to modify firewall: %m");