From a033dc7dc6ddcb8a096a0b44d22477b3bce2a1f1 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Sat, 13 Aug 2022 12:00:40 +0200 Subject: [PATCH] TCP: cleanup ECN related flags The ECN-Echo flag is abbreviated in RFC 3168 using ECE, not ECN. In addition, when displaying the flags, no abbreviations are used. Therefore, do the same for the CWR flag. --- epan/dissectors/packet-tcp.c | 12 ++++++------ epan/dissectors/packet-tcp.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index e7eff5d765..b926e5d5ac 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -168,7 +168,7 @@ static int hf_tcp_flags = -1; static int hf_tcp_flags_res = -1; static int hf_tcp_flags_ns = -1; static int hf_tcp_flags_cwr = -1; -static int hf_tcp_flags_ecn = -1; +static int hf_tcp_flags_ece = -1; static int hf_tcp_flags_urg = -1; static int hf_tcp_flags_ack = -1; static int hf_tcp_flags_push = -1; @@ -714,7 +714,7 @@ static const unit_name_string units_64bit_version = { " (64bits version)", NULL static char * tcp_flags_to_str(wmem_allocator_t *scope, const struct tcpheader *tcph) { - static const char flags[][4] = { "FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECN", "CWR", "NS" }; + static const char flags[][4] = { "FIN", "SYN", "RST", "PSH", "ACK", "URG", "ECE", "CWR", "NS" }; const int maxlength = 64; /* upper bounds, max 53B: 8 * 3 + 2 + strlen("Reserved") + 9 * 2 + 1 */ char *pbuf; @@ -7493,7 +7493,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree_add_boolean(field_tree, hf_tcp_flags_res, tvb, offset + 12, 1, tcph->th_flags); proto_tree_add_boolean(field_tree, hf_tcp_flags_ns, tvb, offset + 12, 1, tcph->th_flags); proto_tree_add_boolean(field_tree, hf_tcp_flags_cwr, tvb, offset + 13, 1, tcph->th_flags); - proto_tree_add_boolean(field_tree, hf_tcp_flags_ecn, tvb, offset + 13, 1, tcph->th_flags); + proto_tree_add_boolean(field_tree, hf_tcp_flags_ece, tvb, offset + 13, 1, tcph->th_flags); proto_tree_add_boolean(field_tree, hf_tcp_flags_urg, tvb, offset + 13, 1, tcph->th_flags); proto_tree_add_boolean(field_tree, hf_tcp_flags_ack, tvb, offset + 13, 1, tcph->th_flags); proto_tree_add_boolean(field_tree, hf_tcp_flags_push, tvb, offset + 13, 1, tcph->th_flags); @@ -8062,11 +8062,11 @@ proto_register_tcp(void) "ECN concealment protection (RFC 3540)", HFILL }}, { &hf_tcp_flags_cwr, - { "Congestion Window Reduced (CWR)", "tcp.flags.cwr", FT_BOOLEAN, 12, TFS(&tfs_set_notset), TH_CWR, + { "Congestion Window Reduced", "tcp.flags.cwr", FT_BOOLEAN, 12, TFS(&tfs_set_notset), TH_CWR, NULL, HFILL }}, - { &hf_tcp_flags_ecn, - { "ECN-Echo", "tcp.flags.ecn", FT_BOOLEAN, 12, TFS(&tfs_set_notset), TH_ECN, + { &hf_tcp_flags_ece, + { "ECN-Echo", "tcp.flags.ece", FT_BOOLEAN, 12, TFS(&tfs_set_notset), TH_ECE, NULL, HFILL }}, { &hf_tcp_flags_urg, diff --git a/epan/dissectors/packet-tcp.h b/epan/dissectors/packet-tcp.h index c4687a9b93..213de33a8d 100644 --- a/epan/dissectors/packet-tcp.h +++ b/epan/dissectors/packet-tcp.h @@ -27,7 +27,7 @@ extern "C" { #define TH_PUSH 0x0008 #define TH_ACK 0x0010 #define TH_URG 0x0020 -#define TH_ECN 0x0040 +#define TH_ECE 0x0040 #define TH_CWR 0x0080 #define TH_NS 0x0100 #define TH_RES 0x0E00 /* 3 reserved bits */