diff --git a/doc/netplan.md b/doc/netplan.md index 74f45f960..f7e3a7d72 100644 --- a/doc/netplan.md +++ b/doc/netplan.md @@ -395,10 +395,10 @@ client processes as specified in the netplan YAML. ``NetworkManager`` backends. ``use-domains`` (scalar) - : Takes a boolean, or the special value "route". When true, the domain + : Takes a boolean, or the special value "route". When true, the domain name received from the DHCP server will be used as DNS search domain over this link, similar to the effect of the Domains= setting. If set - to "route", the domain name received from the DHCP server will be + to "route", the domain name received from the DHCP server will be used for routing DNS queries only, but not for searching, similar to the effect of the Domains= setting when the argument is prefixed with "~". @@ -873,47 +873,47 @@ Examples: : Alternate name for the ``key`` field. See above. L2TP-specific keys: - ``local_ip`` (scalar) + ``local`` (scalar) : The IP address of the local interface. Takes an IP address, or the special values "auto", "static", or "dynamic". When an address is set, then the local interface must have the address. If "auto", then one of the addresses on the local interface is used. Similarly, if "static" or "dynamic" is set, then one of the static or dynamic addresses on the local interface is used. Defaults to "auto". - ``peer_tunnel_id`` (scalar) + ``peer-tunnel-id`` (scalar) : Peer tunnel id, required. - ``local_tunnel_id`` (scalar) + ``local-tunnel-id`` (scalar) : Local tunnel id, required. - ``encapsulation_type`` (scalar) + ``encapsulation-type`` (scalar) : The encapsulation type of the tunnel. "udp" or "ip". - ``udp_source_port`` (scalar) + ``udp-source-port`` (scalar) : The UDP source port. Required for udp encapsulation type. - ``udp_destination_port`` (scalar) + ``udp-destination-port`` (scalar) : The UDP destination port. Required for udp encapsulation type. - ``udp_checksum`` (scalar) + ``udp-checksum`` (scalar) : When true, specifies if UDP checksum is calculated for transmitted packets over IPv4. - ``udp6_checksum_tx`` (scalar) + ``udp6-checksum-tx`` (scalar) : When false, skip UDP checksum calculation for transmitted packets over IPv6. - ``udp6_checksum_rx`` (scalar) + ``udp6-checksum-rx`` (scalar) : When false, skip UDP checksum calculation for received packets over IPv6. - ``session_name`` (scalar) + ``session-name`` (scalar) : Session name, required. - ``session_id`` (scalar) + ``session-id`` (scalar) : Local session id, required. - ``peer_session_id`` (scalar) + ``peer-session-id`` (scalar) : Peer session id, required. - ``l2_specific_header`` (scalar) + ``l2-specific-header`` (scalar) : layer2specific header type of the session. One of "none" or "default". Defaults to "default". diff --git a/src/parse.c b/src/parse.c index a24df0e67..fe79d3231 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1633,20 +1633,20 @@ const mapping_entry_handler tunnel_def_handlers[] = { {"keys", YAML_NO_NODE, handle_tunnel_key_mapping}, /* l2tp; reuses tunnel.local_ip and tunnel.remote_ip*/ - {"local_tunnel_id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.local_tunnel_id)}, - {"peer_tunnel_id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.peer_tunnel_id)}, - {"encapsulation_type", YAML_SCALAR_NODE, handle_netdef_str, NULL, netdef_offset(l2tp.encapsulation_type)}, - {"udp_source_port", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp_source_port)}, - {"udp_destination_port", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp_destination_port)}, - {"udp_checksum", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp_checksum)}, - {"udp6_checksum_tx", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp6_checksum_tx)}, - {"udp6_checksum_rx", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp6_checksum_rx)}, + {"local-tunnel-id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.local_tunnel_id)}, + {"peer-tunnel-id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.peer_tunnel_id)}, + {"encapsulation-type", YAML_SCALAR_NODE, handle_netdef_str, NULL, netdef_offset(l2tp.encapsulation_type)}, + {"udp-source-port", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp_source_port)}, + {"udp-destination-port", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp_destination_port)}, + {"udp-checksum", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp_checksum)}, + {"udp6-checksum-tx", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp6_checksum_tx)}, + {"udp6-checksum-rx", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.udp6_checksum_rx)}, /* l2tp session*/ - {"session_name", YAML_SCALAR_NODE, handle_netdef_str, NULL, netdef_offset(l2tp.session_name)}, - {"session_id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.session_id)}, - {"peer_session_id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.peer_session_id)}, - {"l2_specific_header", YAML_SCALAR_NODE, handle_netdef_str, NULL, netdef_offset(l2tp.l2_specific_header)}, + {"session-name", YAML_SCALAR_NODE, handle_netdef_str, NULL, netdef_offset(l2tp.session_name)}, + {"session-id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.session_id)}, + {"peer-session-id", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(l2tp.peer_session_id)}, + {"l2-specific-header", YAML_SCALAR_NODE, handle_netdef_str, NULL, netdef_offset(l2tp.l2_specific_header)}, {NULL} }; diff --git a/tests/generator/test_tunnels.py b/tests/generator/test_tunnels.py index 90415263c..3630b3714 100644 --- a/tests/generator/test_tunnels.py +++ b/tests/generator/test_tunnels.py @@ -53,7 +53,7 @@ def prepare_config_for_mode(renderer, mode, key=None, **kwargs): """.format(key['input'], key['output']) for k,v in kwargs.items(): - config += ' {}: {}\n'.format(k, v) + config += ' {}: {}\n'.format(k.replace('_', '-'), v) return config