libnm: sort fields in NMSetting structures by size and alignment

This commit is contained in:
Thomas Haller 2019-12-12 11:51:21 +01:00
parent b93fcddfdf
commit 0de6cd2d68
25 changed files with 134 additions and 155 deletions

View file

@ -135,45 +135,45 @@ typedef struct {
char *pac_file;
GBytes *ca_cert;
char *ca_cert_password;
NMSettingSecretFlags ca_cert_password_flags;
char *ca_path;
char *subject_match;
GSList *altsubject_matches;
char *domain_suffix_match;
GBytes *client_cert;
char *client_cert_password;
NMSettingSecretFlags client_cert_password_flags;
char *phase1_peapver;
char *phase1_peaplabel;
char *phase1_fast_provisioning;
NMSetting8021xAuthFlags phase1_auth_flags;
char *phase2_auth;
char *phase2_autheap;
GBytes *phase2_ca_cert;
char *phase2_ca_cert_password;
NMSettingSecretFlags phase2_ca_cert_password_flags;
char *phase2_ca_path;
char *phase2_subject_match;
GSList *phase2_altsubject_matches;
char *phase2_domain_suffix_match;
GBytes *phase2_client_cert;
char *phase2_client_cert_password;
NMSettingSecretFlags phase2_client_cert_password_flags;
char *password;
NMSettingSecretFlags password_flags;
GBytes *password_raw;
NMSettingSecretFlags password_raw_flags;
char *pin;
NMSettingSecretFlags pin_flags;
GBytes *private_key;
char *private_key_password;
NMSettingSecretFlags private_key_password_flags;
GBytes *phase2_private_key;
char *phase2_private_key_password;
NMSettingSecretFlags phase2_private_key_password_flags;
gboolean system_ca_certs;
int auth_timeout;
gboolean optional;
NMSetting8021xAuthFlags phase1_auth_flags;
NMSettingSecretFlags ca_cert_password_flags;
NMSettingSecretFlags client_cert_password_flags;
NMSettingSecretFlags phase2_ca_cert_password_flags;
NMSettingSecretFlags phase2_client_cert_password_flags;
NMSettingSecretFlags password_flags;
NMSettingSecretFlags password_raw_flags;
NMSettingSecretFlags pin_flags;
NMSettingSecretFlags private_key_password_flags;
NMSettingSecretFlags phase2_private_key_password_flags;
bool optional:1;
bool system_ca_certs:1;
} NMSetting8021xPrivate;
G_DEFINE_TYPE (NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING)

View file

@ -34,10 +34,10 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingBridgePort,
);
typedef struct {
GPtrArray *vlans;
guint16 priority;
guint16 path_cost;
gboolean hairpin_mode;
GPtrArray *vlans;
bool hairpin_mode:1;
} NMSettingBridgePortPrivate;
G_DEFINE_TYPE (NMSettingBridgePort, nm_setting_bridge_port, NM_TYPE_SETTING)

View file

@ -40,18 +40,18 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingBridge,
);
typedef struct {
GPtrArray *vlans;
char * mac_address;
gboolean stp;
guint32 ageing_time;
guint16 priority;
guint16 forward_delay;
guint16 hello_time;
guint16 max_age;
guint32 ageing_time;
guint16 group_forward_mask;
gboolean multicast_snooping;
gboolean vlan_filtering;
guint16 vlan_default_pvid;
GPtrArray *vlans;
guint16 group_forward_mask;
bool multicast_snooping:1;
bool vlan_filtering:1;
bool stp:1;
} NMSettingBridgePrivate;
G_DEFINE_TYPE (NMSettingBridge, nm_setting_bridge, NM_TYPE_SETTING)

View file

@ -34,8 +34,8 @@ typedef struct {
char *number; /* For dialing, duh */
char *username;
char *password;
NMSettingSecretFlags password_flags;
guint32 mtu;
NMSettingSecretFlags password_flags;
} NMSettingCdmaPrivate;
G_DEFINE_TYPE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING)

View file

@ -66,6 +66,8 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingConnection,
);
typedef struct {
GSList *permissions; /* list of Permission structs */
GSList *secondaries; /* secondary connections to activate with the base connection */
char *id;
char *uuid;
char *stable_id;
@ -73,23 +75,21 @@ typedef struct {
char *type;
char *master;
char *slave_type;
NMSettingConnectionAutoconnectSlaves autoconnect_slaves;
GSList *permissions; /* list of Permission structs */
gboolean autoconnect;
char *zone;
guint64 timestamp;
int autoconnect_priority;
int autoconnect_retries;
int multi_connect;
guint64 timestamp;
gboolean read_only;
char *zone;
GSList *secondaries; /* secondary connections to activate with the base connection */
guint gateway_ping_timeout;
NMMetered metered;
NMSettingConnectionLldp lldp;
int auth_retries;
int mdns;
int llmnr;
int wait_device_timeout;
guint gateway_ping_timeout;
NMSettingConnectionAutoconnectSlaves autoconnect_slaves;
NMMetered metered;
NMSettingConnectionLldp lldp;
bool read_only:1;
bool autoconnect:1;
} NMSettingConnectionPrivate;
G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)

View file

@ -49,27 +49,21 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingDcb,
);
typedef struct {
NMSettingDcbFlags app_fcoe_flags;
int app_fcoe_priority;
char * app_fcoe_mode;
NMSettingDcbFlags app_iscsi_flags;
int app_iscsi_priority;
NMSettingDcbFlags app_fip_flags;
int app_fip_priority;
/* Priority Flow Control */
NMSettingDcbFlags pfc_flags;
guint pfc[8];
/* Priority Groups */
NMSettingDcbFlags priority_group_flags;
guint priority_group_id[8];
guint priority_group_bandwidth[8];
guint priority_bandwidth[8];
guint priority_strict[8];
guint priority_traffic_class[8];
int app_fcoe_priority;
int app_iscsi_priority;
int app_fip_priority;
NMSettingDcbFlags app_fcoe_flags;
NMSettingDcbFlags app_iscsi_flags;
NMSettingDcbFlags app_fip_flags;
NMSettingDcbFlags pfc_flags;
NMSettingDcbFlags priority_group_flags;
} NMSettingDcbPrivate;
G_DEFINE_TYPE (NMSettingDcb, nm_setting_dcb, NM_TYPE_SETTING)

View file

@ -41,26 +41,20 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
);
typedef struct {
gboolean auto_config;
char *number; /* For dialing, duh */
char *username;
char *password;
NMSettingSecretFlags password_flags;
/* Restrict connection to certain devices or SIMs */
char *device_id;
char *sim_id;
char *sim_operator_id;
char *apn; /* NULL for dynamic */
char *network_id; /* for manual registration or NULL for automatic */
char *pin;
NMSettingSecretFlags password_flags;
NMSettingSecretFlags pin_flags;
gboolean home_only;
guint32 mtu;
bool auto_config:1;
bool home_only:1;
} NMSettingGsmPrivate;
G_DEFINE_TYPE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING)

View file

@ -35,9 +35,10 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
typedef struct {
char *mac_address;
char *transport_mode;
guint32 mtu;
char *parent;
char *virtual_iface_name;
int p_key;
char *parent, *virtual_iface_name;
guint32 mtu;
} NMSettingInfinibandPrivate;
G_DEFINE_TYPE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING)

View file

@ -3598,27 +3598,27 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingIPConfig,
);
typedef struct {
char *method;
GPtrArray *dns; /* array of IP address strings */
GPtrArray *dns_search; /* array of domain name strings */
GPtrArray *dns_options;/* array of DNS options */
int dns_priority;
GPtrArray *addresses; /* array of NMIPAddress */
GPtrArray *routes; /* array of NMIPRoute */
GPtrArray *dns; /* array of IP address strings */
GPtrArray *dns_search; /* array of domain name strings */
GPtrArray *dns_options; /* array of DNS options */
GPtrArray *addresses; /* array of NMIPAddress */
GPtrArray *routes; /* array of NMIPRoute */
GPtrArray *routing_rules;
gint64 route_metric;
guint32 route_table;
char *method;
char *gateway;
gboolean ignore_auto_routes;
gboolean ignore_auto_dns;
char *dhcp_hostname;
gboolean dhcp_send_hostname;
gboolean never_default;
gboolean may_fail;
char *dhcp_iaid;
gint64 route_metric;
guint dhcp_hostname_flags;
int dns_priority;
int dad_timeout;
int dhcp_timeout;
char *dhcp_iaid;
guint dhcp_hostname_flags;
guint32 route_table;
bool ignore_auto_routes:1;
bool ignore_auto_dns:1;
bool dhcp_send_hostname:1;
bool never_default:1;
bool may_fail:1;
} NMSettingIPConfigPrivate;
G_DEFINE_ABSTRACT_TYPE (NMSettingIPConfig, nm_setting_ip_config, NM_TYPE_SETTING)

View file

@ -35,18 +35,18 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
typedef struct {
char *parent;
NMIPTunnelMode mode;
char *local;
char *remote;
guint ttl;
guint tos;
gboolean path_mtu_discovery;
char *input_key;
char *output_key;
guint ttl;
guint tos;
guint encapsulation_limit;
guint flow_label;
NMIPTunnelMode mode;
guint32 mtu;
guint32 flags;
bool path_mtu_discovery:1;
} NMSettingIPTunnelPrivate;
G_DEFINE_TYPE (NMSettingIPTunnel, nm_setting_ip_tunnel, NM_TYPE_SETTING)

View file

@ -46,10 +46,10 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
);
typedef struct {
NMSettingIP6ConfigPrivacy ip6_privacy;
NMSettingIP6ConfigAddrGenMode addr_gen_mode;
char *token;
char *dhcp_duid;
NMSettingIP6ConfigPrivacy ip6_privacy;
NMSettingIP6ConfigAddrGenMode addr_gen_mode;
} NMSettingIP6ConfigPrivate;
G_DEFINE_TYPE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING_IP_CONFIG)

View file

@ -42,14 +42,14 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
typedef struct {
char *parent;
NMSettingMacsecMode mode;
bool encrypt:1;
bool send_sci:1;
char *mka_cak;
NMSettingSecretFlags mka_cak_flags;
char *mka_ckn;
int port;
NMSettingMacsecMode mode;
NMSettingSecretFlags mka_cak_flags;
NMSettingMacsecValidation validation;
bool encrypt:1;
bool send_sci:1;
} NMSettingMacsecPrivate;
G_DEFINE_TYPE (NMSettingMacsec, nm_setting_macsec, NM_TYPE_SETTING)

View file

@ -35,8 +35,8 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
typedef struct {
char *parent;
NMSettingMacvlanMode mode;
gboolean promiscuous;
gboolean tap;
bool promiscuous:1;
bool tap:1;
} NMSettingMacvlanPrivate;
G_DEFINE_TYPE (NMSettingMacvlan, nm_setting_macvlan, NM_TYPE_SETTING)

View file

@ -31,8 +31,8 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
typedef struct {
GBytes *ssid;
guint32 channel;
char *dhcp_anycast_addr;
guint32 channel;
} NMSettingOlpcMeshPrivate;
G_DEFINE_TYPE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING)

View file

@ -39,9 +39,9 @@ struct _NMSettingOvsBridge {
char *fail_mode;
char *datapath_type;
gboolean mcast_snooping_enable;
gboolean rstp_enable;
gboolean stp_enable;
bool mcast_snooping_enable:1;
bool rstp_enable:1;
bool stp_enable:1;
};
struct _NMSettingOvsBridgeClass {

View file

@ -39,9 +39,9 @@ struct _NMSettingOvsPort {
NMSetting parent;
char *vlan_mode;
guint tag;
char *lacp;
char *bond_mode;
guint tag;
guint bond_updelay;
guint bond_downdelay;
};

View file

@ -44,24 +44,24 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
);
typedef struct {
gboolean noauth;
gboolean refuse_eap;
gboolean refuse_pap;
gboolean refuse_chap;
gboolean refuse_mschap;
gboolean refuse_mschapv2;
gboolean nobsdcomp;
gboolean nodeflate;
gboolean no_vj_comp;
gboolean require_mppe;
gboolean require_mppe_128;
gboolean mppe_stateful;
gboolean crtscts;
guint32 baud;
guint32 mru;
guint32 mtu;
guint32 lcp_echo_failure;
guint32 lcp_echo_interval;
bool noauth:1;
bool refuse_eap:1;
bool refuse_pap:1;
bool refuse_chap:1;
bool refuse_mschap:1;
bool refuse_mschapv2:1;
bool nobsdcomp:1;
bool nodeflate:1;
bool no_vj_comp:1;
bool require_mppe:1;
bool require_mppe_128:1;
bool mppe_stateful:1;
bool crtscts:1;
} NMSettingPppPrivate;
G_DEFINE_TYPE (NMSettingPpp, nm_setting_ppp, NM_TYPE_SETTING)

View file

@ -34,10 +34,10 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
);
typedef struct {
NMSettingProxyMethod method;
gboolean browser_only;
char *pac_url;
char *pac_script;
NMSettingProxyMethod method;
bool browser_only:1;
} NMSettingProxyPrivate;
G_DEFINE_TYPE (NMSettingProxy, nm_setting_proxy, NM_TYPE_SETTING)

View file

@ -31,11 +31,11 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
);
typedef struct {
guint64 send_delay;
guint baud;
guint bits;
char parity;
guint stopbits;
guint64 send_delay;
char parity;
} NMSettingSerialPrivate;
G_DEFINE_TYPE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING)

View file

@ -34,12 +34,12 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
);
typedef struct {
NMSettingTunMode mode;
char *owner;
char *group;
gboolean pi;
gboolean vnet_hdr;
gboolean multi_queue;
NMSettingTunMode mode;
bool pi:1;
bool vnet_hdr:1;
bool multi_queue:1;
} NMSettingTunPrivate;
G_DEFINE_TYPE (NMSettingTun, nm_setting_tun, NM_TYPE_SETTING)

View file

@ -36,11 +36,11 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingVlan,
);
typedef struct {
GSList *ingress_priority_map;
GSList *egress_priority_map;
char *parent;
guint32 id;
guint32 flags;
GSList *ingress_priority_map;
GSList *egress_priority_map;
} NMSettingVlanPrivate;
G_DEFINE_TYPE (NMSettingVlan, nm_setting_vlan, NM_TYPE_SETTING)

View file

@ -45,9 +45,9 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
typedef struct {
char *parent;
guint id;
char *local;
char *remote;
guint id;
guint source_port_min;
guint source_port_max;
guint destination_port;
@ -55,11 +55,11 @@ typedef struct {
guint ttl;
guint ageing;
guint limit;
gboolean learning;
gboolean proxy;
gboolean rsc;
gboolean l2_miss;
gboolean l3_miss;
bool learning:1;
bool proxy:1;
bool rsc:1;
bool l2_miss:1;
bool l3_miss:1;
} NMSettingVxlanPrivate;
G_DEFINE_TYPE (NMSettingVxlan, nm_setting_vxlan, NM_TYPE_SETTING)

View file

@ -48,24 +48,24 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWired,
);
typedef struct {
char *port;
guint32 speed;
char *duplex;
gboolean auto_negotiate;
char *device_mac_address;
char *cloned_mac_address;
char *generate_mac_address_mask;
GArray *mac_address_blacklist;
guint32 mtu;
char **s390_subchannels;
char *s390_nettype;
struct {
NMUtilsNamedValue *arr;
guint len;
guint n_alloc;
} s390_options;
NMSettingWiredWakeOnLan wol;
GArray *mac_address_blacklist;
char **s390_subchannels;
char *port;
char *duplex;
char *device_mac_address;
char *cloned_mac_address;
char *generate_mac_address_mask;
char *s390_nettype;
char *wol_password;
NMSettingWiredWakeOnLan wol;
guint32 speed;
guint32 mtu;
bool auto_negotiate:1;
} NMSettingWiredPrivate;
G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)

View file

@ -63,36 +63,26 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWirelessSecurity,
);
typedef struct {
GSList *proto; /* GSList of strings */
GSList *pairwise; /* GSList of strings */
GSList *group; /* GSList of strings */
char *key_mgmt;
char *auth_alg;
GSList *proto; /* GSList of strings */
GSList *pairwise; /* GSList of strings */
GSList *group; /* GSList of strings */
NMSettingWirelessSecurityPmf pmf;
/* LEAP */
char *leap_username;
char *leap_password;
NMSettingSecretFlags leap_password_flags;
/* WEP */
char *wep_key0;
char *wep_key1;
char *wep_key2;
char *wep_key3;
NMSettingSecretFlags wep_key_flags;
NMWepKeyType wep_key_type;
guint32 wep_tx_keyidx;
/* WPA-PSK */
char *psk;
NMSettingSecretFlags leap_password_flags;
NMSettingSecretFlags wep_key_flags;
NMSettingSecretFlags psk_flags;
/* WPS */
NMSettingWirelessSecurityPmf pmf;
NMWepKeyType wep_key_type;
NMSettingWirelessSecurityWpsMethod wps_method;
/* FILS */
NMSettingWirelessSecurityFils fils;
guint32 wep_tx_keyidx;
} NMSettingWirelessSecurityPrivate;
G_DEFINE_TYPE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING)

View file

@ -47,22 +47,22 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWireless,
typedef struct {
GBytes *ssid;
GArray *mac_address_blacklist;
GPtrArray *seen_bssids;
char *mode;
char *band;
guint32 channel;
char *bssid;
guint32 rate;
guint32 tx_power;
char *device_mac_address;
char *cloned_mac_address;
char *generate_mac_address_mask;
GArray *mac_address_blacklist;
GPtrArray *seen_bssids;
guint32 channel;
guint32 rate;
guint32 tx_power;
guint32 mtu;
gboolean hidden;
guint32 powersave;
NMSettingMacRandomization mac_address_randomization;
guint32 wowl;
NMSettingMacRandomization mac_address_randomization;
bool hidden:1;
} NMSettingWirelessPrivate;
G_DEFINE_TYPE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING)