From d1db7f1edfabdc4da52b46b7251e8118fec7a57d Mon Sep 17 00:00:00 2001 From: Uli Heilmeier Date: Fri, 12 Jan 2018 22:12:08 +0100 Subject: NTP: Updated system and peer status codes Used reference: https://tools.ietf.org/html/draft-ietf-ntp-mode-6-cmds-03 http://doc.ntp.org/current-stable/decode.html Bug: 14271 Change-Id: Iab829e31206f99b3458f68c6c65cc6188916a3bb Reviewed-on: https://code.wireshark.org/review/25296 Reviewed-by: Michael Mann --- epan/dissectors/packet-ntp.c | 49 ++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index 6b058015f6..b071e609d1 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -314,13 +314,21 @@ static const value_string ctrl_sys_status_clksource_types[] = { static const value_string ctrl_sys_status_event_types[] = { { 0, "unspecified" }, - { 1, "system restart" }, - { 2, "system or hardware fault" }, - { 3, "system new status word (leap bits or synchronization change)" }, - { 4, "system new synchronization source or stratum (sys.peer or sys.stratum change)" }, - { 5, "system clock reset (offset correction exceeds CLOCK.MAX)" }, - { 6, "system invalid time or date (see NTP spec.)" }, - { 7, "system clock exception (see system clock status word)" }, + { 1, "frequency correction (drift) file not available" }, + { 2, "frequency correction started (frequency stepped)" }, + { 3, "spike detected and ignored, starting stepout timer" }, + { 4, "frequency training started" }, + { 5, "clock synchronized" }, + { 6, "system restart" }, + { 7, "panic stop (required step greater than panic threshold)" }, + { 8, "no system peer" }, + { 9, "leap second insertion/deletion armed" }, + { 10, "leap second disarmed" }, + { 11, "leap second inserted or deleted" }, + { 12, "clock stepped (stepout timer expired)" }, + { 13, "kernel loop discipline status changed" }, + { 14, "leapseconds table loaded from file" }, + { 15, "leapseconds table outdated, updated file needed" }, { 0, NULL} }; @@ -329,13 +337,13 @@ static const value_string ctrl_sys_status_event_types[] = { #define NTPCTRL_PEERSTATUS_AUTHENABLE_MASK 0x4000 #define NTPCTRL_PEERSTATUS_AUTHENTIC_MASK 0x2000 #define NTPCTRL_PEERSTATUS_REACH_MASK 0x1000 -#define NTPCTRL_PEERSTATUS_RESERVED_MASK 0x0800 -#define NTPCTRL_PEERSTATUS_SEL_MASK 0x0700 +#define NTPCTRL_PEERSTATUS_BCAST_MASK 0x0800 +#define NTPCTRL_PEERSTATUS_SEL_MASK 0x0700 #define NTPCTRL_PEERSTATUS_COUNT_MASK 0x00F0 #define NTPCTRL_PEERSTATUS_CODE_MASK 0x000F static const true_false_string tfs_ctrl_peer_status_config = {"configured (peer.config)", "not configured (peer.config)" }; -static const true_false_string tfs_ctrl_peer_status_authenable = { "authentication enabled (peer.authenable", "authentication disabled (peer.authenable" }; +static const true_false_string tfs_ctrl_peer_status_authenable = { "authentication enabled (peer.authenable)", "authentication disabled (peer.authenable)" }; static const true_false_string tfs_ctrl_peer_status_authentic = { "authentication okay (peer.authentic)", "authentication not okay (peer.authentic)" }; static const true_false_string tfs_ctrl_peer_status_reach = {"reachability okay (peer.reach != 0)", "reachability not okay (peer.reach != 0)" }; @@ -353,11 +361,22 @@ static const value_string ctrl_peer_status_selection_types[] = { static const value_string ctrl_peer_status_event_types[] = { { 0, "unspecified" }, - { 1, "peer IP error" }, - { 2, "peer authentication failure (peer.authentic bit was one now zero)" }, + { 1, "association mobilized" }, + { 2, "association demobilized" }, { 3, "peer unreachable (peer.reach was nonzero now zero)" }, { 4, "peer reachable (peer.reach was zero now nonzero)" }, - { 5, "peer clock exception (see peer clock status word)" }, + { 5, "association restarted or timed out" }, + { 6, "no server found (ntpdate mode)" }, + { 7, "rate exceeded (kiss code RATE)" }, + { 8, "access denied (kiss code DENY)" }, + { 9, "leap armed from server LI code" }, + { 10, "become system peer" }, + { 11, "reference clock event (see clock status word)" }, + { 12, "authentication failure" }, + { 13, "popcorn spike suppressor" }, + { 14, "entering interleave mode" }, + { 15, "interleave error (recovered)" }, + { 16, "leapsecond values update from server" }, { 0, NULL} }; @@ -1598,8 +1617,8 @@ proto_register_ntp(void) "Peer Status", "ntp.ctrl.peer_status.reach", FT_BOOLEAN, 16, TFS(&tfs_ctrl_peer_status_reach), NTPCTRL_PEERSTATUS_REACH_MASK, NULL, HFILL }}, { &hf_ntpctrl_peer_status_b4, { - "Peer Status: reserved", "ntp.ctrl.peer_status.reserved", FT_UINT16, BASE_DEC, - NULL, NTPCTRL_PEERSTATUS_RESERVED_MASK, NULL, HFILL }}, + "Peer Status broadcast association", "ntp.ctrl.peer_status.bcast", FT_BOOLEAN, 16, + TFS(&tfs_set_notset), NTPCTRL_PEERSTATUS_BCAST_MASK, NULL, HFILL }}, { &hf_ntpctrl_peer_status_selection, { "Peer Selection", "ntp.ctrl.peer_status.selection", FT_UINT16, BASE_DEC, VALS(ctrl_peer_status_selection_types), NTPCTRL_PEERSTATUS_SEL_MASK, NULL, HFILL }}, -- cgit v1.2.3