aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-08-20 02:17:14 -0700
committerGuy Harris <gharris@sonic.net>2021-08-20 02:18:19 -0700
commit4e80643cc01454e3f7bef64e30cf6bf784c6b7d3 (patch)
tree880565cf997e84977cf50637537c44f1a8fcbac6 /wiretap
parentebf5da61c6c42724535687ccb69189e7cb4df387 (diff)
Move LINKTYPE_WIRESHARK_UPPER_PDU definitions to a separate header.
Have wsutil/exported_pdu_tlvs.h define the LINKTYPE_WIRESHARK_UPPER_PDU TLV type and length values, as well as the port type values written to files in EXP_PDU_TAG_PORT_TYPE TLVs. Update the comment that describes the LINKTYPE_WIRESHARK_UPPER_PDU TLVs to more completely and correctly reflect reality (it was moved from epan/exported_pdu.h to wsutil/exported_pdu_tlvs.h). Rename those port type values from OLD_PT_ to EXP_PDU_PT_; there is nothing "old" about them - yes, they originally had the same numerical values as the PT_ enum values in libwireshark, but that's no longer the case, and the two are now defined independently. Rename routines that map between libwireshark PT_ values and EXP_PDU_PT_ values to remove "old" from the name while we're at it. Don't include epan/exported_pdu.h if we only need the LINKTYPE_WIRESHARK_UPPER_PDU definitions - just include wsutil/exported_pdu_tlvs.h. In extcap/udpdump.c, include wsutil/exported_pdu_tlvs.h rather than defining the TLV types ourselves.
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/busmaster.c2
-rw-r--r--wiretap/candump.c2
-rw-r--r--wiretap/nettrace_3gpp_32_423.c12
3 files changed, 8 insertions, 8 deletions
diff --git a/wiretap/busmaster.c b/wiretap/busmaster.c
index f5686df7f6..eacfb12efb 100644
--- a/wiretap/busmaster.c
+++ b/wiretap/busmaster.c
@@ -12,8 +12,8 @@
#include "config.h"
#include <wtap-int.h>
#include <file_wrappers.h>
-#include <epan/exported_pdu.h>
#include <epan/dissectors/packet-socketcan.h>
+#include <wsutil/exported_pdu_tlvs.h>
#include "busmaster.h"
#include "busmaster_priv.h"
#include <inttypes.h>
diff --git a/wiretap/candump.c b/wiretap/candump.c
index 031996f59f..572dbc8c1a 100644
--- a/wiretap/candump.c
+++ b/wiretap/candump.c
@@ -12,7 +12,7 @@
#include <config.h>
#include <wtap-int.h>
#include <file_wrappers.h>
-#include <epan/exported_pdu.h>
+#include <wsutil/exported_pdu_tlvs.h>
#include <string.h>
#include <inttypes.h>
#include <errno.h>
diff --git a/wiretap/nettrace_3gpp_32_423.c b/wiretap/nettrace_3gpp_32_423.c
index ac50976565..2793620b91 100644
--- a/wiretap/nettrace_3gpp_32_423.c
+++ b/wiretap/nettrace_3gpp_32_423.c
@@ -24,7 +24,7 @@
#include "wtap-int.h"
#include "file_wrappers.h"
-#include <epan/exported_pdu.h>
+#include <wsutil/exported_pdu_tlvs.h>
#include <wsutil/buffer.h>
#include "wsutil/tempfile.h"
#include "wsutil/os_version_info.h"
@@ -196,15 +196,15 @@ nettrace_parse_address(char* curr_pos, char* next_pos, gboolean is_src_addr, exp
scan_found = sscanf(curr_pos, ", %*s %*s %5u, %*s %*s %4s", &port, transp_str);
if (scan_found == 2) {
/* Only add port_type once */
- if (exported_pdu_info->ptype == OLD_PT_NONE) {
+ if (exported_pdu_info->ptype == EXP_PDU_PT_NONE) {
if (g_ascii_strncasecmp(transp_str, "udp", 3) == 0) {
- exported_pdu_info->ptype = OLD_PT_UDP;
+ exported_pdu_info->ptype = EXP_PDU_PT_UDP;
}
else if (g_ascii_strncasecmp(transp_str, "tcp", 3) == 0) {
- exported_pdu_info->ptype = OLD_PT_TCP;
+ exported_pdu_info->ptype = EXP_PDU_PT_TCP;
}
else if (g_ascii_strncasecmp(transp_str, "sctp", 4) == 0) {
- exported_pdu_info->ptype = OLD_PT_SCTP;
+ exported_pdu_info->ptype = EXP_PDU_PT_SCTP;
}
}
if (is_src_addr) {
@@ -262,7 +262,7 @@ nettrace_msg_to_packet(nettrace_3gpp_32_423_file_info_t *file_info, wtap_rec *re
/* Clear for each iteration */
exported_pdu_info.presence_flags = 0;
- exported_pdu_info.ptype = OLD_PT_NONE;
+ exported_pdu_info.ptype = EXP_PDU_PT_NONE;
prev_pos = curr_pos = curr_pos + 4;
/* Look for the end of the tag first */