Skip to content

Commit 67f51b6

Browse files
committed
T6630: ntp: fix timestamp nested under ptp
1 parent efd86e5 commit 67f51b6

File tree

3 files changed

+51
-51
lines changed

3 files changed

+51
-51
lines changed

data/templates/chrony/chrony.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ binddevice {{ interface }}
6767
{% endif %}
6868
{% endif %}
6969

70-
{% if ptp.timestamp.interface is vyos_defined %}
70+
{% if timestamp.interface is vyos_defined %}
7171
# Enable hardware timestamping on the specified interfaces
72-
{% for iface, iface_config in ptp.timestamp.interface.items() %}
72+
{% for iface, iface_config in timestamp.interface.items() %}
7373
{% if iface == "all" %}
7474
{% set iface = "*" %}
7575
{% endif %}

interface-definitions/service_ntp.xml.in

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,72 +13,72 @@
1313
#include <include/generic-interface.xml.i>
1414
#include <include/listen-address.xml.i>
1515
#include <include/interface/vrf.xml.i>
16-
<node name="ptp">
16+
<node name="timestamp">
1717
<properties>
18-
<help>Enable Precision Time Protocol (PTP) transport</help>
18+
<help>Enable timestamping of packets in the NIC hardware</help>
1919
</properties>
2020
<children>
21-
#include <include/port-number.xml.i>
22-
<leafNode name="port">
23-
<defaultValue>319</defaultValue>
24-
</leafNode>
25-
<node name="timestamp">
21+
<tagNode name="interface">
2622
<properties>
27-
<help>Enable timestamping of packets in the NIC hardware</help>
23+
<help>Interface to enable timestamping on</help>
24+
<completionHelp>
25+
<script>${vyos_completion_dir}/list_interfaces</script>
26+
<list>all</list>
27+
</completionHelp>
28+
<valueHelp>
29+
<format>all</format>
30+
<description>Select all interfaces</description>
31+
</valueHelp>
32+
<valueHelp>
33+
<format>txt</format>
34+
<description>Interface name</description>
35+
</valueHelp>
36+
<constraint>
37+
#include <include/constraint/interface-name.xml.i>
38+
<regex>all</regex>
39+
</constraint>
2840
</properties>
2941
<children>
30-
<tagNode name="interface">
42+
<leafNode name="receive-filter">
3143
<properties>
32-
<help>Interface to enable timestamping on</help>
44+
<help>Selects which inbound packets are timestamped by the NIC</help>
3345
<completionHelp>
34-
<script>${vyos_completion_dir}/list_interfaces</script>
35-
<list>all</list>
46+
<list>all ntp ptp none</list>
3647
</completionHelp>
3748
<valueHelp>
3849
<format>all</format>
39-
<description>Select all interfaces</description>
50+
<description>All packets are timestamped</description>
4051
</valueHelp>
4152
<valueHelp>
42-
<format>txt</format>
43-
<description>Interface name</description>
53+
<format>ntp</format>
54+
<description>Only NTP packets are timestamped</description>
55+
</valueHelp>
56+
<valueHelp>
57+
<format>ptp</format>
58+
<description>Only PTP or NTP packets using the PTP transport are timestamped</description>
59+
</valueHelp>
60+
<valueHelp>
61+
<format>none</format>
62+
<description>No packet is timestamped</description>
4463
</valueHelp>
4564
<constraint>
46-
#include <include/constraint/interface-name.xml.i>
47-
<regex>all</regex>
65+
<regex>(all|ntp|ptp|none)</regex>
4866
</constraint>
4967
</properties>
50-
<children>
51-
<leafNode name="receive-filter">
52-
<properties>
53-
<help>Selects which inbound packets are timestamped by the NIC</help>
54-
<completionHelp>
55-
<list>all ntp ptp none</list>
56-
</completionHelp>
57-
<valueHelp>
58-
<format>all</format>
59-
<description>All packets are timestamped</description>
60-
</valueHelp>
61-
<valueHelp>
62-
<format>ntp</format>
63-
<description>Only NTP packets are timestamped</description>
64-
</valueHelp>
65-
<valueHelp>
66-
<format>ptp</format>
67-
<description>Only PTP or NTP packets using the PTP transport are timestamped</description>
68-
</valueHelp>
69-
<valueHelp>
70-
<format>none</format>
71-
<description>No packet is timestamped</description>
72-
</valueHelp>
73-
<constraint>
74-
<regex>(all|ntp|ptp|none)</regex>
75-
</constraint>
76-
</properties>
77-
</leafNode>
78-
</children>
79-
</tagNode>
68+
</leafNode>
8069
</children>
81-
</node>
70+
</tagNode>
71+
</children>
72+
</node>
73+
<node name="ptp">
74+
<properties>
75+
<help>Enable Precision Time Protocol (PTP) transport</help>
76+
</properties>
77+
<children>
78+
#include <include/port-number.xml.i>
79+
<leafNode name="port">
80+
<defaultValue>319</defaultValue>
81+
</leafNode>
8282
</children>
8383
</node>
8484
<leafNode name="leap-second">

smoketest/scripts/cli/test_service_ntp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_offload_timestamp_default(self):
203203
self.cli_set(base_path + ['server', server, 'ptp'])
204204

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

208208
# commit changes
209209
self.cli_commit()

0 commit comments

Comments
 (0)