extensions: syntactically compact struct definitions

This commit is contained in:
Jan Engelhardt
2021-07-17 11:32:19 +02:00
parent 81ab0b9586
commit 714998176a
10 changed files with 16 additions and 34 deletions

View File

@@ -37,8 +37,7 @@
/* Structure for the userspace part of ipt_ACCOUNT */ /* Structure for the userspace part of ipt_ACCOUNT */
struct ipt_acc_info { struct ipt_acc_info {
__be32 net_ip; __be32 net_ip, net_mask;
__be32 net_mask;
char table_name[ACCOUNT_TABLE_NAME_LEN]; char table_name[ACCOUNT_TABLE_NAME_LEN];
int32_t table_nr; int32_t table_nr;
}; };
@@ -57,8 +56,5 @@ struct ipt_acc_handle_sockopt {
*/ */
struct ipt_acc_handle_ip { struct ipt_acc_handle_ip {
__be32 ip, __dummy; __be32 ip, __dummy;
uint64_t src_packets; uint64_t src_packets, src_bytes, dst_packets, dst_bytes;
uint64_t src_bytes;
uint64_t dst_packets;
uint64_t dst_bytes;
}; };

View File

@@ -6,8 +6,6 @@ enum {
}; };
struct xt_ipmark_tginfo { struct xt_ipmark_tginfo {
__u32 andmask; __u32 andmask, ormask;
__u32 ormask; __u8 selector, shift;
__u8 selector;
__u8 shift;
}; };

View File

@@ -10,6 +10,5 @@ enum {
}; };
struct xt_PROTO_info { struct xt_PROTO_info {
__u8 mode; __u8 mode, proto;
__u8 proto;
}; };

View File

@@ -6,12 +6,9 @@ enum {
}; };
struct xt_fuzzy_mtinfo { struct xt_fuzzy_mtinfo {
uint32_t minimum_rate; uint32_t minimum_rate, maximum_rate;
uint32_t maximum_rate; uint32_t packets_total, bytes_total;
uint32_t packets_total; uint32_t previous_time, present_time;
uint32_t bytes_total;
uint32_t previous_time;
uint32_t present_time;
uint32_t mean_rate; uint32_t mean_rate;
uint8_t acceptance_rate; uint8_t acceptance_rate;
}; };

View File

@@ -22,8 +22,7 @@ enum {
/* Yup, an address range will be passed in with host-order */ /* Yup, an address range will be passed in with host-order */
struct geoip_subnet4 { struct geoip_subnet4 {
__u32 begin; __u32 begin, end;
__u32 end;
}; };
struct geoip_subnet6 { struct geoip_subnet6 {
@@ -44,8 +43,7 @@ union geoip_country_group {
}; };
struct xt_geoip_match_info { struct xt_geoip_match_info {
__u8 flags; __u8 flags, count;
__u8 count;
__u16 cc[XT_GEOIP_MAX]; __u16 cc[XT_GEOIP_MAX];
/* Used internally by the kernel */ /* Used internally by the kernel */

View File

@@ -1,5 +1,4 @@
#pragma once #pragma once
struct xt_gradm_mtinfo { struct xt_gradm_mtinfo {
__u16 flags; __u16 flags, invflags;
__u16 invflags;
}; };

View File

@@ -18,6 +18,5 @@ enum {
struct xt_iface_mtinfo { struct xt_iface_mtinfo {
char ifname[IFNAMSIZ]; char ifname[IFNAMSIZ];
__u16 flags; __u16 flags, invflags;
__u16 invflags;
}; };

View File

@@ -38,6 +38,5 @@ enum {
}; };
struct ipt_p2p_info { struct ipt_p2p_info {
int cmd; int cmd, debug;
int debug;
}; };

View File

@@ -17,7 +17,6 @@ enum xt_ipv4options_flags {
* @flags: see above * @flags: see above
*/ */
struct xt_ipv4options_mtinfo1 { struct xt_ipv4options_mtinfo1 {
__u32 map; __u32 map, invert;
__u32 invert;
__u8 flags; __u8 flags;
}; };

View File

@@ -19,8 +19,6 @@
#define SCAN_WEIGHT_THRESHOLD SCAN_MAX_COUNT #define SCAN_WEIGHT_THRESHOLD SCAN_MAX_COUNT
struct xt_psd_info { struct xt_psd_info {
__u32 weight_threshold; __u32 weight_threshold, delay_threshold;
__u32 delay_threshold; __u16 lo_ports_weight, hi_ports_weight;
__u16 lo_ports_weight;
__u16 hi_ports_weight;
}; };