Skip to content

Commit

Permalink
Switch from underscores to hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
lxnt committed Dec 5, 2019
1 parent 62fba35 commit 5b0a7fc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
30 changes: 15 additions & 15 deletions doc/netplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
"~".
Expand Down Expand Up @@ -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".

Expand Down
24 changes: 12 additions & 12 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/generator/test_tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5b0a7fc

Please sign in to comment.