summary refs log tree commit diff
path: root/src/libnm-platform/nm-platform.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2025-02-12 13:46:50 +0100
committerMichael Biebl <biebl@debian.org>2025-02-12 13:46:50 +0100
commit8bdf070ff046f482f6eb5e2b15ebc216f5d1e3da (patch)
treef706478d189d54c6532e8863d4b0d5ff5575af60 /src/libnm-platform/nm-platform.h
parent818258cf34b83fbc754633295e1052d4752d7b15 (diff)
New upstream version 1.51.90 upstream/1.51.90
Diffstat (limited to 'src/libnm-platform/nm-platform.h')
-rw-r--r--src/libnm-platform/nm-platform.h46
1 files changed, 42 insertions, 4 deletions
diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h
index 22bf0fdb..1c8a26b3 100644
--- a/src/libnm-platform/nm-platform.h
+++ b/src/libnm-platform/nm-platform.h
@@ -529,9 +529,9 @@ typedef union {
 
 #undef __NMPlatformIPRoute_COMMON
 
-#define NM_PLATFORM_IP4_ROUTE_INIT(...) (&((const NMPlatformIP4Route){__VA_ARGS__}))
+#define NM_PLATFORM_IP4_ROUTE_INIT(...) (&((const NMPlatformIP4Route) {__VA_ARGS__}))
 
-#define NM_PLATFORM_IP6_ROUTE_INIT(...) (&((const NMPlatformIP6Route){__VA_ARGS__}))
+#define NM_PLATFORM_IP6_ROUTE_INIT(...) (&((const NMPlatformIP6Route) {__VA_ARGS__}))
 
 typedef struct {
     /* struct fib_rule_uid_range */
@@ -880,6 +880,12 @@ typedef struct {
 } _nm_alignas(NMPlatformObject) NMPlatformLnkIpIp;
 
 typedef struct {
+    guint16 mode;
+    bool    private_flag : 1;
+    bool    vepa : 1;
+} _nm_alignas(NMPlatformObject) NMPlatformLnkIpvlan;
+
+typedef struct {
     int       parent_ifindex;
     in_addr_t local;
     in_addr_t remote;
@@ -1315,6 +1321,7 @@ typedef struct {
     int (*ip_route_get)(NMPlatform   *self,
                         int           addr_family,
                         gconstpointer address,
+                        guint32       fwmark,
                         int           oif_ifindex,
                         NMPObject   **out_route);
 
@@ -1935,6 +1942,27 @@ nm_platform_link_macvlan_add(NMPlatform                 *self,
                                 out_link);
 }
 
+static inline int
+nm_platform_link_ipvlan_add(NMPlatform                *self,
+                            const char                *name,
+                            int                        parent,
+                            const NMPlatformLnkIpvlan *props,
+                            const NMPlatformLink     **out_link)
+{
+    g_return_val_if_fail(props, -NME_BUG);
+    g_return_val_if_fail(parent > 0, -NME_BUG);
+
+    return nm_platform_link_add(self,
+                                NM_LINK_TYPE_IPVLAN,
+                                name,
+                                parent,
+                                NULL,
+                                0,
+                                0,
+                                props,
+                                out_link);
+}
+
 gboolean nm_platform_link_delete(NMPlatform *self, int ifindex);
 
 gboolean nm_platform_link_set_netns(NMPlatform *self, int ifindex, int netns_fd);
@@ -2117,6 +2145,8 @@ const NMPlatformLnkMacsec *
 nm_platform_link_get_lnk_macsec(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
 const NMPlatformLnkMacvlan *
 nm_platform_link_get_lnk_macvlan(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
+const NMPlatformLnkIpvlan *
+nm_platform_link_get_lnk_ipvlan(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
 const NMPlatformLnkMacvlan *
 nm_platform_link_get_lnk_macvtap(NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
 const NMPlatformLnkSit *
@@ -2404,6 +2434,7 @@ gboolean nm_platform_ip_route_flush(NMPlatform *self, int addr_family, int ifind
 int nm_platform_ip_route_get(NMPlatform   *self,
                              int           addr_family,
                              gconstpointer address,
+                             guint32       fwmark,
                              int           oif_ifindex,
                              NMPObject   **out_route);
 
@@ -2432,6 +2463,7 @@ const char *nm_platform_lnk_ipip_to_string(const NMPlatformLnkIpIp *lnk, char *b
 const char *nm_platform_lnk_macsec_to_string(const NMPlatformLnkMacsec *lnk, char *buf, gsize len);
 const char *
 nm_platform_lnk_macvlan_to_string(const NMPlatformLnkMacvlan *lnk, char *buf, gsize len);
+const char *nm_platform_lnk_ipvlan_to_string(const NMPlatformLnkIpvlan *lnk, char *buf, gsize len);
 const char *nm_platform_lnk_sit_to_string(const NMPlatformLnkSit *lnk, char *buf, gsize len);
 const char *nm_platform_lnk_tun_to_string(const NMPlatformLnkTun *lnk, char *buf, gsize len);
 const char *nm_platform_lnk_vlan_to_string(const NMPlatformLnkVlan *lnk, char *buf, gsize len);
@@ -2484,6 +2516,7 @@ int nm_platform_lnk_infiniband_cmp(const NMPlatformLnkInfiniband *a,
 int nm_platform_lnk_ip6tnl_cmp(const NMPlatformLnkIp6Tnl *a, const NMPlatformLnkIp6Tnl *b);
 int nm_platform_lnk_ipip_cmp(const NMPlatformLnkIpIp *a, const NMPlatformLnkIpIp *b);
 int nm_platform_lnk_macsec_cmp(const NMPlatformLnkMacsec *a, const NMPlatformLnkMacsec *b);
+int nm_platform_lnk_ipvlan_cmp(const NMPlatformLnkIpvlan *a, const NMPlatformLnkIpvlan *b);
 int nm_platform_lnk_macvlan_cmp(const NMPlatformLnkMacvlan *a, const NMPlatformLnkMacvlan *b);
 int nm_platform_lnk_sit_cmp(const NMPlatformLnkSit *a, const NMPlatformLnkSit *b);
 int nm_platform_lnk_tun_cmp(const NMPlatformLnkTun *a, const NMPlatformLnkTun *b);
@@ -2558,6 +2591,7 @@ void nm_platform_lnk_ip6tnl_hash_update(const NMPlatformLnkIp6Tnl *obj, NMHashSt
 void nm_platform_lnk_ipip_hash_update(const NMPlatformLnkIpIp *obj, NMHashState *h);
 void nm_platform_lnk_macsec_hash_update(const NMPlatformLnkMacsec *obj, NMHashState *h);
 void nm_platform_lnk_macvlan_hash_update(const NMPlatformLnkMacvlan *obj, NMHashState *h);
+void nm_platform_lnk_ipvlan_hash_update(const NMPlatformLnkIpvlan *obj, NMHashState *h);
 void nm_platform_lnk_sit_hash_update(const NMPlatformLnkSit *obj, NMHashState *h);
 void nm_platform_lnk_tun_hash_update(const NMPlatformLnkTun *obj, NMHashState *h);
 void nm_platform_lnk_vlan_hash_update(const NMPlatformLnkVlan *obj, NMHashState *h);
@@ -2621,6 +2655,10 @@ gboolean nm_platform_ethtool_set_channels(NMPlatform                   *self,
                                           int                           ifindex,
                                           const NMEthtoolChannelsState *channels);
 
+gboolean nm_platform_ethtool_get_fec_mode(NMPlatform *self, int ifindex, uint32_t *fec_mode);
+
+gboolean nm_platform_ethtool_set_fec_mode(NMPlatform *self, int ifindex, uint32_t fec_mode);
+
 gboolean
 nm_platform_ethtool_get_link_pause(NMPlatform *self, int ifindex, NMEthtoolPauseState *pause);
 
@@ -2657,7 +2695,7 @@ void     nm_platform_ip6_dadfailed_set(NMPlatform            *self,
 static inline NMPlatformIP4Address *
 nm_platform_ip4_address_init_loopback_addr1(NMPlatformIP4Address *a)
 {
-    *a = ((NMPlatformIP4Address){
+    *a = ((NMPlatformIP4Address) {
         .address      = NM_IPV4LO_ADDR1,
         .peer_address = NM_IPV4LO_ADDR1,
         .ifindex      = NM_LOOPBACK_IFINDEX,
@@ -2669,7 +2707,7 @@ nm_platform_ip4_address_init_loopback_addr1(NMPlatformIP4Address *a)
 static inline NMPlatformIP6Address *
 nm_platform_ip6_address_init_loopback(NMPlatformIP6Address *a)
 {
-    *a = ((NMPlatformIP6Address){
+    *a = ((NMPlatformIP6Address) {
         .address = IN6ADDR_LOOPBACK_INIT,
         .ifindex = NM_LOOPBACK_IFINDEX,
         .plen    = 128,