X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b04cf0ea3667e3b319fb35556be0b9ebb4d557ce..d9acf8cb11e30b7d7744cb0dd05e628109cb73f0:/print-ptp.c diff --git a/print-ptp.c b/print-ptp.c index fe39deaf..a41f5a92 100644 --- a/print-ptp.c +++ b/print-ptp.c @@ -189,21 +189,20 @@ #define M_MANAGEMENT 0xD static const struct tok ptp_msg_type[] = { - { M_SYNC ,"sync msg"}, - { M_DELAY_REQ ,"delay req msg"}, - { M_PDELAY_REQ ,"peer delay req msg"}, - { M_PDELAY_RESP ,"peer delay resp msg"}, + { M_SYNC, "sync msg"}, + { M_DELAY_REQ, "delay req msg"}, + { M_PDELAY_REQ, "peer delay req msg"}, + { M_PDELAY_RESP, "peer delay resp msg"}, { M_OTHER, "Other"}, - { M_FOLLOW_UP ,"follow up msg"}, - { M_DELAY_RESP ,"delay resp msg"}, - { M_PDELAY_RESP_FOLLOW_UP ,"pdelay resp fup msg"}, - { M_ANNOUNCE ,"announce msg"}, - { M_SIGNALLING ,"signalling msg"}, - { M_MANAGEMENT ,"management msg"}, + { M_FOLLOW_UP, "follow up msg"}, + { M_DELAY_RESP, "delay resp msg"}, + { M_PDELAY_RESP_FOLLOW_UP, "pdelay resp fup msg"}, + { M_ANNOUNCE, "announce msg"}, + { M_SIGNALLING, "signalling msg"}, + { M_MANAGEMENT, "management msg"}, { 0, NULL} }; - #define PTP_TRUE 1 #define PTP_FALSE !PTP_TRUE @@ -236,29 +235,23 @@ static const struct tok ptp_msg_type[] = { #define PTP_SECURITY_MASK 0x4000 #define PTP_FLAGS_UNKNOWN_MASK 0x18C0 - static const struct tok ptp_flag_values[] = { - { PTP_L161_MASK ,"l1 61"}, - { PTP_L1_59_MASK ,"l1 59"}, - { PTP_UTC_REASONABLE_MASK ,"utc reasonable"}, - { PTP_TIMESCALE_MASK ,"timescale"}, - { PTP_TIME_TRACABLE_MASK ,"time tracable"}, - { PTP_FREQUENCY_TRACABLE_MASK ,"frequency tracable"}, - { PTP_ALTERNATE_MASTER_MASK ,"alternate master"}, - { PTP_TWO_STEP_MASK ,"two step"}, - { PTP_UNICAST_MASK ,"unicast"}, - { PTP_PROFILE_SPEC_1_MASK ,"profile specific 1"}, - { PTP_PROFILE_SPEC_2_MASK ,"profile specific 2"}, - { PTP_SECURITY_MASK ,"security mask"}, - { PTP_FLAGS_UNKNOWN_MASK , "unknown"}, + { PTP_L161_MASK, "l1 61"}, + { PTP_L1_59_MASK, "l1 59"}, + { PTP_UTC_REASONABLE_MASK, "utc reasonable"}, + { PTP_TIMESCALE_MASK, "timescale"}, + { PTP_TIME_TRACABLE_MASK, "time tracable"}, + { PTP_FREQUENCY_TRACABLE_MASK, "frequency tracable"}, + { PTP_ALTERNATE_MASTER_MASK, "alternate master"}, + { PTP_TWO_STEP_MASK, "two step"}, + { PTP_UNICAST_MASK, "unicast"}, + { PTP_PROFILE_SPEC_1_MASK, "profile specific 1"}, + { PTP_PROFILE_SPEC_2_MASK, "profile specific 2"}, + { PTP_SECURITY_MASK, "security mask"}, + { PTP_FLAGS_UNKNOWN_MASK, "unknown"}, {0, NULL} }; -#define PTP_PRINT_MSG_TYPE(e) \ - { \ - ND_PRINT("(%s)", tok2str(ptp_msg_type, "unknown", e)); \ - } - static const char *p_porigin_ts = "preciseOriginTimeStamp"; static const char *p_origin_ts = "originTimeStamp"; static const char *p_recv_ts = "receiveTimeStamp"; @@ -272,8 +265,6 @@ static const char *p_recv_ts = "receiveTimeStamp"; #define PTP_6BYTES_LEN sizeof(uint32_t)+sizeof(uint16_t) #define PTP_UINT64_LEN sizeof(uint64_t) - - static void ptp_print_1(netdissect_options *ndo); static void ptp_print_2(netdissect_options *ndo, const u_char *bp, u_int len);