summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÍñigo Huguet <ihuguet@redhat.com>2023-08-24 12:24:07 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2023-09-12 09:31:18 +0000
commit140abc81ececabeba7db00e08878148aae837410 (patch)
treece673bbf52754d112de1bf193678d2a7ca480489
parent7a0d3f53fa7fa09277c5bf36c6bdf72dc6d808c8 (diff)
nm-settings-nmcli: show proper valid values of ip-tunnel propertiesih/tunnel_mode_doc
Show all valid properties for ip-tunnel.mode, not only 2 examples. Show constants as values suitable for user input in nmcli. That means showing, for example, "ipip (1)" instead of "IP_TUNNEL_MODE_IPIP (1)".
-rw-r--r--src/libnm-core-impl/nm-setting-ip-tunnel.c36
-rw-r--r--src/libnmc-setting/settings-docs.h.in6
-rw-r--r--src/nmcli/gen-metadata-nm-settings-nmcli.xml.in6
3 files changed, 39 insertions, 9 deletions
diff --git a/src/libnm-core-impl/nm-setting-ip-tunnel.c b/src/libnm-core-impl/nm-setting-ip-tunnel.c
index d28eb73fd7..2deebf4276 100644
--- a/src/libnm-core-impl/nm-setting-ip-tunnel.c
+++ b/src/libnm-core-impl/nm-setting-ip-tunnel.c
@@ -593,11 +593,22 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
/**
* NMSettingIPTunnel:mode:
*
- * The tunneling mode, for example %NM_IP_TUNNEL_MODE_IPIP or
- * %NM_IP_TUNNEL_MODE_GRE.
+ * The tunneling mode. Valid values: %NM_IP_TUNNEL_MODE_IPIP,
+ * %NM_IP_TUNNEL_MODE_GRE, %NM_IP_TUNNEL_MODE_SIT, %NM_IP_TUNNEL_MODE_ISATAP,
+ * %NM_IP_TUNNEL_MODE_VTI, %NM_IP_TUNNEL_MODE_IP6IP6, %NM_IP_TUNNEL_MODE_IPIP6,
+ * %NM_IP_TUNNEL_MODE_IP6GRE, %NM_IP_TUNNEL_MODE_VTI6, %NM_IP_TUNNEL_MODE_GRETAP
+ * and %NM_IP_TUNNEL_MODE_IP6GRETAP
*
* Since: 1.2
**/
+ /* ---nmcli---
+ * property: mode
+ * description:
+ * The tunneling mode. Valid values: ipip (1), gre (2), sit (3), isatap (4),
+ * vti (5), ip6ip6 (6), ipip6 (7), ip6gre (8), vti6 (9), gretap (10) and
+ * ip6gretap (11)
+ * ---end---
+ */
_nm_setting_property_define_direct_uint32(properties_override,
obj_properties,
NM_SETTING_IP_TUNNEL_MODE,
@@ -731,10 +742,19 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
* NMSettingIPTunnel:encapsulation-limit:
*
* How many additional levels of encapsulation are permitted to be prepended
- * to packets. This property applies only to IPv6 tunnels. To disable this option, add %NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT to ip-tunnel flags.
+ * to packets. This property applies only to IPv6 tunnels. To disable this option,
+ * add %NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT to ip-tunnel flags.
*
* Since: 1.2
**/
+ /* ---nmcli---
+ * property: encapsulation-limit
+ * description:
+ * How many additional levels of encapsulation are permitted to be prepended
+ * to packets. This property applies only to IPv6 tunnels. To disable this
+ * option, add 0x1 (ip6-ign-encap-limit) to ip-tunnel flags.
+ * ---end---
+ */
_nm_setting_property_define_direct_uint32(properties_override,
obj_properties,
NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT,
@@ -814,6 +834,16 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
*
* Since: 1.12
**/
+ /* ---nmcli---
+ * property: flags
+ * description:
+ * Tunnel flags. Currently, the following values are supported:
+ * 0x1 (ip6-ign-encap-limit), 0x2 (ip6-use-orig-tclass),
+ * 0x4 (ip6-use-orig-flowlabel), 0x8 (ip6-mip6-dev), 0x10 (ip6-rcv-dscp-copy)
+ * and 0x20 (ip6-use-orig-fwmark).
+ * They are valid only for IPv6 tunnels.
+ * ---end---
+ */
_nm_setting_property_define_direct_uint32(properties_override,
obj_properties,
NM_SETTING_IP_TUNNEL_FLAGS,
diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in
index f06c981a78..bdda8e502e 100644
--- a/src/libnmc-setting/settings-docs.h.in
+++ b/src/libnmc-setting/settings-docs.h.in
@@ -219,13 +219,13 @@
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTES N_("Array of IP routes.")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTING_RULES N_("A comma separated list of routing rules for policy routing.")
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_TOKEN N_("Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02 IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode. When set, the token is used as IPv6 interface identifier instead of the hardware address. This only applies to addresses from stateless autoconfiguration, not to IPv6 link local addresses.")
-#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT N_("How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels. To disable this option, add NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT (0x1) to ip-tunnel flags.")
-#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_FLAGS N_("Tunnel flags. Currently, the following values are supported: NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT (0x1), NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_TCLASS (0x2), NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FLOWLABEL (0x4), NM_IP_TUNNEL_FLAG_IP6_MIP6_DEV (0x8), NM_IP_TUNNEL_FLAG_IP6_RCV_DSCP_COPY (0x10), NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FWMARK (0x20). They are valid only for IPv6 tunnels.")
+#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT N_("How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels. To disable this option, add 0x1 (ip6-ign-encap-limit) to ip-tunnel flags.")
+#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_FLAGS N_("Tunnel flags. Currently, the following values are supported: 0x1 (ip6-ign-encap-limit), 0x2 (ip6-use-orig-tclass), 0x4 (ip6-use-orig-flowlabel), 0x8 (ip6-mip6-dev), 0x10 (ip6-rcv-dscp-copy) and 0x20 (ip6-use-orig-fwmark). They are valid only for IPv6 tunnels.")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_FLOW_LABEL N_("The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_FWMARK N_("The fwmark value to assign to tunnel packets. This property can be set to a non zero value only on VTI and VTI6 tunnels.")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_INPUT_KEY N_("The key used for tunnel input packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used.")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_LOCAL N_("The local endpoint of the tunnel; the value can be empty, otherwise it must contain an IPv4 or IPv6 address.")
-#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_MODE N_("The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2).")
+#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_MODE N_("The tunneling mode. Valid values: ipip (1), gre (2), sit (3), isatap (4), vti (5), ip6ip6 (6), ipip6 (7), ip6gre (8), vti6 (9), gretap (10) and ip6gretap (11)")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple fragments.")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_OUTPUT_KEY N_("The key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used.")
#define DESCRIBE_DOC_NM_SETTING_IP_TUNNEL_PARENT N_("If given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface.")
diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in
index ef0973caa3..1e0797abe0 100644
--- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in
+++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in
@@ -620,7 +620,7 @@
<setting name="ip-tunnel" >
<property name="mode"
alias="mode"
- nmcli-description="The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2)." />
+ nmcli-description="The tunneling mode. Valid values: ipip (1), gre (2), sit (3), isatap (4), vti (5), ip6ip6 (6), ipip6 (7), ip6gre (8), vti6 (9), gretap (10) and ip6gretap (11)" />
<property name="parent"
alias="dev"
nmcli-description="If given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface." />
@@ -641,7 +641,7 @@
<property name="output-key"
nmcli-description="The key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used." />
<property name="encapsulation-limit"
- nmcli-description="How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels. To disable this option, add NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT (0x1) to ip-tunnel flags." />
+ nmcli-description="How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels. To disable this option, add 0x1 (ip6-ign-encap-limit) to ip-tunnel flags." />
<property name="flow-label"
nmcli-description="The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels." />
<property name="fwmark"
@@ -649,7 +649,7 @@
<property name="mtu"
nmcli-description="If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple fragments." />
<property name="flags"
- nmcli-description="Tunnel flags. Currently, the following values are supported: NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT (0x1), NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_TCLASS (0x2), NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FLOWLABEL (0x4), NM_IP_TUNNEL_FLAG_IP6_MIP6_DEV (0x8), NM_IP_TUNNEL_FLAG_IP6_RCV_DSCP_COPY (0x10), NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FWMARK (0x20). They are valid only for IPv6 tunnels." />
+ nmcli-description="Tunnel flags. Currently, the following values are supported: 0x1 (ip6-ign-encap-limit), 0x2 (ip6-use-orig-tclass), 0x4 (ip6-use-orig-flowlabel), 0x8 (ip6-mip6-dev), 0x10 (ip6-rcv-dscp-copy) and 0x20 (ip6-use-orig-fwmark). They are valid only for IPv6 tunnels." />
</setting>
<setting name="ipv4" >
<property name="method"