diff options
Diffstat (limited to 'src/libnm-platform/nm-platform.h')
-rw-r--r-- | src/libnm-platform/nm-platform.h | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h index 447ef3aa8f..d816513cd0 100644 --- a/src/libnm-platform/nm-platform.h +++ b/src/libnm-platform/nm-platform.h @@ -150,6 +150,21 @@ GBytes *nmp_link_address_get_as_bytes(const NMPLinkAddress *addr); #define NM_PLATFORM_LINK_OTHER_NETNS (-1) +typedef struct { + guint32 tx_queue_length; + guint32 gso_max_size; + guint32 gso_max_segments; + guint32 gro_max_size; +} NMPlatformLinkProps; + +typedef enum { + NM_PLATFORM_LINK_CHANGE_NONE = 0, + NM_PLATFORM_LINK_CHANGE_TX_QUEUE_LENGTH = (1 << 0), + NM_PLATFORM_LINK_CHANGE_GSO_MAX_SIZE = (1 << 1), + NM_PLATFORM_LINK_CHANGE_GSO_MAX_SEGMENTS = (1 << 2), + NM_PLATFORM_LINK_CHANGE_GRO_MAX_SIZE = (1 << 3), +} NMPlatformLinkChangeFlags; + struct _NMPlatformObjWithIfindex { __NMPlatformObjWithIfindex_COMMON; } _nm_alignas(NMPlatformObject); @@ -204,6 +219,8 @@ struct _NMPlatformLink { guint64 tx_packets; guint64 tx_bytes; + NMPlatformLinkProps link_props; + /* @connected is mostly identical to (@n_ifi_flags & IFF_UP). Except for bridge/bond masters, * where we coerce the link as disconnect if it has no slaves. */ bool connected : 1; @@ -1093,9 +1110,14 @@ typedef struct { guint32 mtu, gconstpointer extra_data, const NMPlatformLink **out_link); - - int (*link_change)(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data); - + int (*link_change_extra)(NMPlatform *self, + NMLinkType type, + int ifindex, + gconstpointer extra_data); + gboolean (*link_change)(NMPlatform *self, + int ifindex, + NMPlatformLinkProps *props, + NMPlatformLinkChangeFlags flags); gboolean (*link_delete)(NMPlatform *self, int ifindex); gboolean (*link_refresh)(NMPlatform *self, int ifindex); gboolean (*link_set_netns)(NMPlatform *self, int ifindex, int netns_fd); @@ -1603,8 +1625,10 @@ int nm_platform_link_add(NMPlatform *self, gconstpointer extra_data, const NMPlatformLink **out_link); -int -nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data); +int nm_platform_link_change_extra(NMPlatform *self, + NMLinkType type, + int ifindex, + gconstpointer extra_data); static inline int nm_platform_link_veth_add(NMPlatform *self, @@ -1644,13 +1668,13 @@ nm_platform_link_bridge_add(NMPlatform *self, static inline int nm_platform_link_bridge_change(NMPlatform *self, int ifindex, const NMPlatformLnkBridge *props) { - return nm_platform_link_change(self, NM_LINK_TYPE_BRIDGE, ifindex, props); + return nm_platform_link_change_extra(self, NM_LINK_TYPE_BRIDGE, ifindex, props); } static inline int nm_platform_link_bond_change(NMPlatform *self, int ifindex, const NMPlatformLnkBond *props) { - return nm_platform_link_change(self, NM_LINK_TYPE_BOND, ifindex, props); + return nm_platform_link_change_extra(self, NM_LINK_TYPE_BOND, ifindex, props); } static inline int @@ -1927,6 +1951,11 @@ nm_platform_link_change_flags(NMPlatform *self, int ifindex, unsigned value, gbo return nm_platform_link_change_flags_full(self, ifindex, value, set ? value : 0u); } +gboolean nm_platform_link_change(NMPlatform *self, + int ifindex, + NMPlatformLinkProps *props, + NMPlatformLinkChangeFlags flags); + gboolean nm_platform_link_get_udev_property(NMPlatform *self, int ifindex, const char *name, |