Skip to content

Commit

Permalink
Merge pull request #4208 from lucasec/t6630
Browse files Browse the repository at this point in the history
T6630: ntp: fix timestamp nested under ptp
  • Loading branch information
c-po authored Dec 2, 2024
2 parents c887126 + 67f51b6 commit a4dfb3d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions data/templates/chrony/chrony.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ binddevice {{ interface }}
{% endif %}
{% endif %}

{% if ptp.timestamp.interface is vyos_defined %}
{% if timestamp.interface is vyos_defined %}
# Enable hardware timestamping on the specified interfaces
{% for iface, iface_config in ptp.timestamp.interface.items() %}
{% for iface, iface_config in timestamp.interface.items() %}
{% if iface == "all" %}
{% set iface = "*" %}
{% endif %}
Expand Down
96 changes: 48 additions & 48 deletions interface-definitions/service_ntp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,72 @@
#include <include/generic-interface.xml.i>
#include <include/listen-address.xml.i>
#include <include/interface/vrf.xml.i>
<node name="ptp">
<node name="timestamp">
<properties>
<help>Enable Precision Time Protocol (PTP) transport</help>
<help>Enable timestamping of packets in the NIC hardware</help>
</properties>
<children>
#include <include/port-number.xml.i>
<leafNode name="port">
<defaultValue>319</defaultValue>
</leafNode>
<node name="timestamp">
<tagNode name="interface">
<properties>
<help>Enable timestamping of packets in the NIC hardware</help>
<help>Interface to enable timestamping on</help>
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
<list>all</list>
</completionHelp>
<valueHelp>
<format>all</format>
<description>Select all interfaces</description>
</valueHelp>
<valueHelp>
<format>txt</format>
<description>Interface name</description>
</valueHelp>
<constraint>
#include <include/constraint/interface-name.xml.i>
<regex>all</regex>
</constraint>
</properties>
<children>
<tagNode name="interface">
<leafNode name="receive-filter">
<properties>
<help>Interface to enable timestamping on</help>
<help>Selects which inbound packets are timestamped by the NIC</help>
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
<list>all</list>
<list>all ntp ptp none</list>
</completionHelp>
<valueHelp>
<format>all</format>
<description>Select all interfaces</description>
<description>All packets are timestamped</description>
</valueHelp>
<valueHelp>
<format>txt</format>
<description>Interface name</description>
<format>ntp</format>
<description>Only NTP packets are timestamped</description>
</valueHelp>
<valueHelp>
<format>ptp</format>
<description>Only PTP or NTP packets using the PTP transport are timestamped</description>
</valueHelp>
<valueHelp>
<format>none</format>
<description>No packet is timestamped</description>
</valueHelp>
<constraint>
#include <include/constraint/interface-name.xml.i>
<regex>all</regex>
<regex>(all|ntp|ptp|none)</regex>
</constraint>
</properties>
<children>
<leafNode name="receive-filter">
<properties>
<help>Selects which inbound packets are timestamped by the NIC</help>
<completionHelp>
<list>all ntp ptp none</list>
</completionHelp>
<valueHelp>
<format>all</format>
<description>All packets are timestamped</description>
</valueHelp>
<valueHelp>
<format>ntp</format>
<description>Only NTP packets are timestamped</description>
</valueHelp>
<valueHelp>
<format>ptp</format>
<description>Only PTP or NTP packets using the PTP transport are timestamped</description>
</valueHelp>
<valueHelp>
<format>none</format>
<description>No packet is timestamped</description>
</valueHelp>
<constraint>
<regex>(all|ntp|ptp|none)</regex>
</constraint>
</properties>
</leafNode>
</children>
</tagNode>
</leafNode>
</children>
</node>
</tagNode>
</children>
</node>
<node name="ptp">
<properties>
<help>Enable Precision Time Protocol (PTP) transport</help>
</properties>
<children>
#include <include/port-number.xml.i>
<leafNode name="port">
<defaultValue>319</defaultValue>
</leafNode>
</children>
</node>
<leafNode name="leap-second">
Expand Down
2 changes: 1 addition & 1 deletion smoketest/scripts/cli/test_service_ntp.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def test_offload_timestamp_default(self):
self.cli_set(base_path + ['server', server, 'ptp'])

self.cli_set(base_path + ['ptp', 'port', ptp_port])
self.cli_set(base_path + ['ptp', 'timestamp', 'interface', 'all'])
self.cli_set(base_path + ['timestamp', 'interface', 'all'])

# commit changes
self.cli_commit()
Expand Down

0 comments on commit a4dfb3d

Please sign in to comment.