mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 02:28:18 +02:00
libnm: implement missing "FwMark" property in NMDeviceIPTunnel
This commit is contained in:
parent
b47c94666c
commit
05fa5ba1a9
4 changed files with 47 additions and 1 deletions
|
|
@ -1947,6 +1947,7 @@ global:
|
||||||
libnm_1_46_0 {
|
libnm_1_46_0 {
|
||||||
global:
|
global:
|
||||||
nm_access_point_get_bandwidth;
|
nm_access_point_get_bandwidth;
|
||||||
|
nm_device_ip_tunnel_get_fwmark;
|
||||||
nm_ethtool_optname_is_channels;
|
nm_ethtool_optname_is_channels;
|
||||||
nm_ethtool_optname_is_eee;
|
nm_ethtool_optname_is_eee;
|
||||||
} libnm_1_44_0;
|
} libnm_1_44_0;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_MODE,
|
||||||
PROP_OUTPUT_KEY,
|
PROP_OUTPUT_KEY,
|
||||||
PROP_ENCAPSULATION_LIMIT,
|
PROP_ENCAPSULATION_LIMIT,
|
||||||
PROP_FLOW_LABEL,
|
PROP_FLOW_LABEL,
|
||||||
|
PROP_FWMARK,
|
||||||
PROP_FLAGS, );
|
PROP_FLAGS, );
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -37,6 +38,7 @@ typedef struct {
|
||||||
guint32 mode;
|
guint32 mode;
|
||||||
guint32 flow_label;
|
guint32 flow_label;
|
||||||
guint32 flags;
|
guint32 flags;
|
||||||
|
guint32 fwmark;
|
||||||
guint8 ttl;
|
guint8 ttl;
|
||||||
guint8 tos;
|
guint8 tos;
|
||||||
guint8 encapsulation_limit;
|
guint8 encapsulation_limit;
|
||||||
|
|
@ -236,6 +238,23 @@ nm_device_ip_tunnel_get_flow_label(NMDeviceIPTunnel *device)
|
||||||
return NM_DEVICE_IP_TUNNEL_GET_PRIVATE(device)->flow_label;
|
return NM_DEVICE_IP_TUNNEL_GET_PRIVATE(device)->flow_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_device_ip_tunnel_get_fwmark:
|
||||||
|
* @device: a #NMDeviceIPTunnel
|
||||||
|
*
|
||||||
|
* Returns: the fwmark assigned to tunnel packets. This property applies only
|
||||||
|
* to VTI tunnels.
|
||||||
|
*
|
||||||
|
* Since: 1.46
|
||||||
|
**/
|
||||||
|
guint32
|
||||||
|
nm_device_ip_tunnel_get_fwmark(NMDeviceIPTunnel *device)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail(NM_IS_DEVICE_IP_TUNNEL(device), 0);
|
||||||
|
|
||||||
|
return NM_DEVICE_IP_TUNNEL_GET_PRIVATE(device)->fwmark;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_device_ip_tunnel_get_flags:
|
* nm_device_ip_tunnel_get_flags:
|
||||||
* @device: a #NMDeviceIPTunnel
|
* @device: a #NMDeviceIPTunnel
|
||||||
|
|
@ -334,6 +353,9 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||||
case PROP_FLOW_LABEL:
|
case PROP_FLOW_LABEL:
|
||||||
g_value_set_uint(value, nm_device_ip_tunnel_get_flow_label(device));
|
g_value_set_uint(value, nm_device_ip_tunnel_get_flow_label(device));
|
||||||
break;
|
break;
|
||||||
|
case PROP_FWMARK:
|
||||||
|
g_value_set_uint(value, nm_device_ip_tunnel_get_fwmark(device));
|
||||||
|
break;
|
||||||
case PROP_FLAGS:
|
case PROP_FLAGS:
|
||||||
g_value_set_uint(value, nm_device_ip_tunnel_get_flags(device));
|
g_value_set_uint(value, nm_device_ip_tunnel_get_flags(device));
|
||||||
break;
|
break;
|
||||||
|
|
@ -357,7 +379,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_iptunnel = NML_DBUS_META_I
|
||||||
PROP_FLOW_LABEL,
|
PROP_FLOW_LABEL,
|
||||||
NMDeviceIPTunnel,
|
NMDeviceIPTunnel,
|
||||||
_priv.flow_label),
|
_priv.flow_label),
|
||||||
NML_DBUS_META_PROPERTY_INIT_IGNORE("FwMark", "u"),
|
NML_DBUS_META_PROPERTY_INIT_U("FwMark", PROP_FWMARK, NMDeviceIPTunnel, _priv.fwmark),
|
||||||
NML_DBUS_META_PROPERTY_INIT_S("InputKey",
|
NML_DBUS_META_PROPERTY_INIT_S("InputKey",
|
||||||
PROP_INPUT_KEY,
|
PROP_INPUT_KEY,
|
||||||
NMDeviceIPTunnel,
|
NMDeviceIPTunnel,
|
||||||
|
|
@ -559,6 +581,22 @@ nm_device_ip_tunnel_class_init(NMDeviceIPTunnelClass *klass)
|
||||||
0,
|
0,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NMDeviceIPTunnel:fwmark:
|
||||||
|
*
|
||||||
|
* The fwmark value to assign to tunnel packets. This property applies only
|
||||||
|
* to VTI tunnels.
|
||||||
|
*
|
||||||
|
* Since: 1.46
|
||||||
|
**/
|
||||||
|
obj_properties[PROP_FWMARK] = g_param_spec_uint(NM_DEVICE_IP_TUNNEL_FWMARK,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
0,
|
||||||
|
G_MAXUINT32,
|
||||||
|
0,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMDeviceIPTunnel:flags:
|
* NMDeviceIPTunnel:flags:
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -3188,6 +3188,10 @@ check_dbus_properties:
|
||||||
&& nm_streq(pspec->name, NM_DEVICE_WIREGUARD_FWMARK)) {
|
&& nm_streq(pspec->name, NM_DEVICE_WIREGUARD_FWMARK)) {
|
||||||
g_assert_cmpstr(obj_property_name, ==, "fw-mark");
|
g_assert_cmpstr(obj_property_name, ==, "fw-mark");
|
||||||
expected_property_name = NM_DEVICE_WIREGUARD_FWMARK;
|
expected_property_name = NM_DEVICE_WIREGUARD_FWMARK;
|
||||||
|
} else if (mif == &_nml_dbus_meta_iface_nm_device_iptunnel
|
||||||
|
&& nm_streq(pspec->name, NM_DEVICE_IP_TUNNEL_FWMARK)) {
|
||||||
|
g_assert_cmpstr(obj_property_name, ==, "fw-mark");
|
||||||
|
expected_property_name = NM_DEVICE_IP_TUNNEL_FWMARK;
|
||||||
} else if (NM_IN_SET(mif,
|
} else if (NM_IN_SET(mif,
|
||||||
&_nml_dbus_meta_iface_nm_ip4config,
|
&_nml_dbus_meta_iface_nm_ip4config,
|
||||||
&_nml_dbus_meta_iface_nm_ip6config)
|
&_nml_dbus_meta_iface_nm_ip6config)
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ G_BEGIN_DECLS
|
||||||
#define NM_DEVICE_IP_TUNNEL_OUTPUT_KEY "output-key"
|
#define NM_DEVICE_IP_TUNNEL_OUTPUT_KEY "output-key"
|
||||||
#define NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit"
|
#define NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit"
|
||||||
#define NM_DEVICE_IP_TUNNEL_FLOW_LABEL "flow-label"
|
#define NM_DEVICE_IP_TUNNEL_FLOW_LABEL "flow-label"
|
||||||
|
#define NM_DEVICE_IP_TUNNEL_FWMARK "fwmark"
|
||||||
#define NM_DEVICE_IP_TUNNEL_FLAGS "flags"
|
#define NM_DEVICE_IP_TUNNEL_FLAGS "flags"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -72,6 +73,8 @@ NM_AVAILABLE_IN_1_2
|
||||||
guint8 nm_device_ip_tunnel_get_encapsulation_limit(NMDeviceIPTunnel *device);
|
guint8 nm_device_ip_tunnel_get_encapsulation_limit(NMDeviceIPTunnel *device);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
guint nm_device_ip_tunnel_get_flow_label(NMDeviceIPTunnel *device);
|
guint nm_device_ip_tunnel_get_flow_label(NMDeviceIPTunnel *device);
|
||||||
|
NM_AVAILABLE_IN_1_46
|
||||||
|
guint32 nm_device_ip_tunnel_get_fwmark(NMDeviceIPTunnel *device);
|
||||||
NM_AVAILABLE_IN_1_12
|
NM_AVAILABLE_IN_1_12
|
||||||
NMIPTunnelFlags nm_device_ip_tunnel_get_flags(NMDeviceIPTunnel *device);
|
NMIPTunnelFlags nm_device_ip_tunnel_get_flags(NMDeviceIPTunnel *device);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue