Skip to content

Commit eb44d55

Browse files
author
David J. Kordsmeier
committed
refs #100964 Merge remote branch 'origin/100964-wireshark-1.8.6-patch'
* origin/100964-wireshark-1.8.6-patch: Refs #100964 Correct format specifier for size_t (%zd) Refs #100964 Replace calls to deprecated dissector_add/delete() with preferred dissector_add/delete_uint() Refs #100964 Update encoding argument to proto_tree_add_item() to current specifications. Refs #100964 Update patch for building ccn plugin for wireshark to wireshark version 1.8.6 Refs #100919 Ensure that support functions in exttests can cope with =(hex) escaping. Refs #100919 Tweak heuristics for shifting to = (hex) escaping to shift on 0 byte even if next character is printable.
2 parents 2c8bfcc + bb47ade commit eb44d55

File tree

5 files changed

+153
-14
lines changed

5 files changed

+153
-14
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
In order to build the CCN plugin for Wireshark you will first need to install
2+
a Wireshark source distribution. For example, for Ubuntu Linux:
3+
4+
sudo apt-get source wireshark
5+
6+
Then -- in your wireshark source directory you should make a directory
7+
plugins/ccn and copy the contents of the CCN distribution's
8+
ccn/apps/wireshark/ccn there.
9+
10+
Follow the instructions in wireshark file doc/README.plugins
11+
regarding existing Wireshark files that need to be edited to add a new plugin.
12+
13+
The following files (README.plugins sec 3) need to be updated
14+
15+
configure.in
16+
CMakeLists.txt
17+
epan/Makefile.am
18+
Makefile.am
19+
packaging/nsis/Makefile.nmake
20+
packaging/nsis/wireshark.nsi
21+
plugins/Makefile.am
22+
plugins/Makefile.nmake
23+
24+
The patch file wireshark-1.8.6.patch can be applied to make the
25+
necessary changes. It may apply, with offsets, back through 1.8.0.
26+
27+
cd wireshark-1.8.6
28+
patch -p1 < .../ccn/apps/wireshark/wireshark-1.8.6.patch
29+
30+
When you've made the changes per README.plugins or by applying the patch file,
31+
you must run wireshark's "autogen.sh" and "configure" to setup your wireshark build
32+
area, and then recompile wireshark. You *may* be able to get away with only
33+
doing a "make" in the plugins/ccn directory rather than recompiling all of wireshark,
34+
however this has not been extensively tested. Your mileage may vary.
35+

apps/wireshark/ccn/packet-ccn.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ proto_reg_handoff_ccn(void)
229229
initialized = TRUE;
230230
}
231231
if (current_ccn_port != -1) {
232-
dissector_delete("udp.port", current_ccn_port, ccn_handle);
233-
dissector_delete("tcp.port", current_ccn_port, ccn_handle);
232+
dissector_delete_uint("udp.port", current_ccn_port, ccn_handle);
233+
dissector_delete_uint("tcp.port", current_ccn_port, ccn_handle);
234234
}
235-
dissector_add("udp.port", global_ccn_port, ccn_handle);
236-
dissector_add("tcp.port", global_ccn_port, ccn_handle);
235+
dissector_add_uint("udp.port", global_ccn_port, ccn_handle);
236+
dissector_add_uint("tcp.port", global_ccn_port, ccn_handle);
237237
current_ccn_port = global_ccn_port;
238238
}
239239

@@ -511,7 +511,7 @@ dissect_ccn_interest(const unsigned char *ccnb, size_t ccnb_size, tvbuff_t *tvb,
511511
col_append_str(pinfo->cinfo, COL_INFO, ">");
512512
}
513513
titem = proto_tree_add_item(tree, hf_ccn_nonce, tvb,
514-
blob - ccnb, blob_size, FALSE);
514+
blob - ccnb, blob_size, ENC_NA);
515515
}
516516

517517
return (1);
@@ -546,7 +546,7 @@ dissect_ccn_contentobject(const unsigned char *ccnb, size_t ccnb_size, tvbuff_t
546546

547547
/* Signature */
548548
l = pco->offset[CCN_PCO_E_Signature] - pco->offset[CCN_PCO_B_Signature];
549-
titem = proto_tree_add_item(tree, hf_ccn_signature, tvb, pco->offset[CCN_PCO_B_Signature], l, FALSE);
549+
titem = proto_tree_add_item(tree, hf_ccn_signature, tvb, pco->offset[CCN_PCO_B_Signature], l, ENC_NA);
550550
signature_tree = proto_item_add_subtree(titem, ett_signature);
551551

552552
/* DigestAlgorithm */
@@ -557,7 +557,7 @@ dissect_ccn_contentobject(const unsigned char *ccnb, size_t ccnb_size, tvbuff_t
557557
pco->offset[CCN_PCO_E_DigestAlgorithm],
558558
&blob, &blob_size);
559559
titem = proto_tree_add_item(signature_tree, hf_ccn_signaturedigestalg, tvb,
560-
blob - ccnb, blob_size, FALSE);
560+
blob - ccnb, blob_size, ENC_NA);
561561
}
562562
/* Witness */
563563
l = pco->offset[CCN_PCO_E_Witness] - pco->offset[CCN_PCO_B_Witness];
@@ -665,7 +665,7 @@ dissect_ccn_contentobject(const unsigned char *ccnb, size_t ccnb_size, tvbuff_t
665665
pco->offset[CCN_PCO_E_FinalBlockID],
666666
&blob, &blob_size);
667667

668-
titem = proto_tree_add_item(signedinfo_tree, hf_ccn_finalblockid, tvb, blob - ccnb, blob_size, FALSE);
668+
titem = proto_tree_add_item(signedinfo_tree, hf_ccn_finalblockid, tvb, blob - ccnb, blob_size, ENC_NA);
669669
}
670670
/* TODO: KeyLocator */
671671
l = pco->offset[CCN_PCO_E_ExtOpt] - pco->offset[CCN_PCO_B_ExtOpt];
@@ -675,7 +675,7 @@ dissect_ccn_contentobject(const unsigned char *ccnb, size_t ccnb_size, tvbuff_t
675675
pco->offset[CCN_PCO_E_ExtOpt],
676676
&blob, &blob_size);
677677

678-
titem = proto_tree_add_item(signedinfo_tree, hf_ccn_extopt, tvb, blob - ccnb, blob_size, FALSE);
678+
titem = proto_tree_add_item(signedinfo_tree, hf_ccn_extopt, tvb, blob - ccnb, blob_size, ENC_NA);
679679
}
680680
/* /SignedInfo */
681681

@@ -687,10 +687,10 @@ dissect_ccn_contentobject(const unsigned char *ccnb, size_t ccnb_size, tvbuff_t
687687
&blob, &blob_size);
688688
titem = proto_tree_add_text(tree, tvb,
689689
pco->offset[CCN_PCO_B_Content], l,
690-
"Content: %d bytes", blob_size);
690+
"Content: %zd bytes", blob_size);
691691
if (blob_size > 0) {
692692
content_tree = proto_item_add_subtree(titem, ett_content);
693-
titem = proto_tree_add_item(content_tree, hf_ccn_contentdata, tvb, blob - ccnb, blob_size, FALSE);
693+
titem = proto_tree_add_item(content_tree, hf_ccn_contentdata, tvb, blob - ccnb, blob_size, ENC_NA);
694694
}
695695

696696
return (ccnb_size);

apps/wireshark/wireshark-1.8.6.patch

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
diff -r -C3 wireshark-1.8.6/CMakeLists.txt wireshark-1.8.6-ccnx/CMakeLists.txt
2+
*** wireshark-1.8.6/CMakeLists.txt 2012-06-05 09:33:43.000000000 -0700
3+
--- wireshark-1.8.6-ccnx/CMakeLists.txt 2013-05-08 21:08:20.804171104 -0700
4+
***************
5+
*** 409,414 ****
6+
--- 409,415 ----
7+
set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
8+
set(PLUGIN_SRC_DIRS
9+
plugins/asn1
10+
+ plugins/ccn
11+
plugins/docsis
12+
plugins/ethercat
13+
plugins/gryphon
14+
diff -r -C3 wireshark-1.8.6/configure.in wireshark-1.8.6-ccnx/configure.in
15+
*** wireshark-1.8.6/configure.in 2013-03-06 10:32:56.000000000 -0800
16+
--- wireshark-1.8.6-ccnx/configure.in 2013-05-08 21:08:20.804171104 -0700
17+
***************
18+
*** 2096,2101 ****
19+
--- 2096,2102 ----
20+
packaging/svr4/pkginfo
21+
plugins/Makefile
22+
plugins/asn1/Makefile
23+
+ plugins/ccn/Makefile
24+
plugins/docsis/Makefile
25+
plugins/ethercat/Makefile
26+
plugins/gryphon/Makefile
27+
diff -r -C3 wireshark-1.8.6/epan/Makefile.am wireshark-1.8.6-ccnx/epan/Makefile.am
28+
*** wireshark-1.8.6/epan/Makefile.am 2013-02-15 12:22:28.000000000 -0800
29+
--- wireshark-1.8.6-ccnx/epan/Makefile.am 2013-05-08 21:08:20.808171310 -0700
30+
***************
31+
*** 211,216 ****
32+
--- 211,217 ----
33+
-include ../plugins/Custom.make
34+
plugin_src = \
35+
../plugins/asn1/packet-asn1.c \
36+
+ ../plugins/ccn/packet-ccn.c \
37+
../plugins/docsis/packet-bintrngreq.c \
38+
../plugins/docsis/packet-bpkmattr.c \
39+
../plugins/docsis/packet-bpkmreq.c \
40+
diff -r -C3 wireshark-1.8.6/Makefile.am wireshark-1.8.6-ccnx/Makefile.am
41+
*** wireshark-1.8.6/Makefile.am 2012-11-28 15:16:34.000000000 -0800
42+
--- wireshark-1.8.6-ccnx/Makefile.am 2013-05-08 21:08:20.812171515 -0700
43+
***************
44+
*** 274,279 ****
45+
--- 274,280 ----
46+
-include plugins/Custom.make
47+
plugin_ldadd = $(_CUSTOM_plugin_ldadd_) \
48+
-dlopen plugins/asn1/asn1.la \
49+
+ -dlopen plugins/ccn/ccn.la \
50+
-dlopen plugins/docsis/docsis.la \
51+
-dlopen plugins/ethercat/ethercat.la \
52+
-dlopen plugins/gryphon/gryphon.la \
53+
diff -r -C3 wireshark-1.8.6/packaging/nsis/Makefile.nmake wireshark-1.8.6-ccnx/packaging/nsis/Makefile.nmake
54+
*** wireshark-1.8.6/packaging/nsis/Makefile.nmake 2012-07-27 16:36:21.000000000 -0700
55+
--- wireshark-1.8.6-ccnx/packaging/nsis/Makefile.nmake 2013-05-08 21:08:20.812171515 -0700
56+
***************
57+
*** 46,51 ****
58+
--- 46,52 ----
59+
60+
PLUGINS= \
61+
../../plugins/asn1/asn1.dll \
62+
+ ../../plugins/ccn/ccn.dll \
63+
../../plugins/docsis/docsis.dll \
64+
../../plugins/ethercat/ethercat.dll \
65+
../../plugins/gryphon/gryphon.dll \
66+
diff -r -C3 wireshark-1.8.6/packaging/nsis/wireshark.nsi wireshark-1.8.6-ccnx/packaging/nsis/wireshark.nsi
67+
*** wireshark-1.8.6/packaging/nsis/wireshark.nsi 2012-09-23 13:28:33.000000000 -0700
68+
--- wireshark-1.8.6-ccnx/packaging/nsis/wireshark.nsi 2013-05-08 21:10:34.955016008 -0700
69+
***************
70+
*** 819,824 ****
71+
--- 819,825 ----
72+
;-------------------------------------------
73+
SetOutPath '$INSTDIR\plugins\${VERSION}'
74+
File "${STAGING_DIR}\plugins\${VERSION}\asn1.dll"
75+
+ File "${STAGING_DIR}\plugins\${VERSION}\ccn.dll"
76+
File "${STAGING_DIR}\plugins\${VERSION}\docsis.dll"
77+
File "${STAGING_DIR}\plugins\${VERSION}\ethercat.dll"
78+
File "${STAGING_DIR}\plugins\${VERSION}\gryphon.dll"
79+
diff -r -C3 wireshark-1.8.6/plugins/Makefile.am wireshark-1.8.6-ccnx/plugins/Makefile.am
80+
*** wireshark-1.8.6/plugins/Makefile.am 2012-09-27 04:45:19.000000000 -0700
81+
--- wireshark-1.8.6-ccnx/plugins/Makefile.am 2013-05-08 21:08:20.820171923 -0700
82+
***************
83+
*** 24,29 ****
84+
--- 24,30 ----
85+
-include Custom.make
86+
SUBDIRS = $(_CUSTOM_SUBDIRS_) \
87+
asn1 \
88+
+ ccn \
89+
docsis \
90+
ethercat \
91+
gryphon \
92+
diff -r -C3 wireshark-1.8.6/plugins/Makefile.nmake wireshark-1.8.6-ccnx/plugins/Makefile.nmake
93+
*** wireshark-1.8.6/plugins/Makefile.nmake 2012-06-05 09:33:17.000000000 -0700
94+
--- wireshark-1.8.6-ccnx/plugins/Makefile.nmake 2013-05-08 21:08:20.820171923 -0700
95+
***************
96+
*** 8,13 ****
97+
--- 8,14 ----
98+
99+
PLUGIN_LIST = \
100+
asn1 \
101+
+ ccn \
102+
docsis \
103+
ethercat \
104+
gryphon \

csrc/exttests/functions

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ CappedCCNDStart () {
8989
[ ${1:=missing} -ge 0 ] || Fail argument missing or invalid: $1
9090
WHICHCCND=${CCN_LOCAL_PORT:-9695}
9191
ccndsmoketest kill 2>/dev/null
92-
env CCND_DEBUG=1 CCND_CAP=$1 ccnd 2>>ccnd$((WHICHCCND % 10))-capped-$1.out &
92+
env CCND_DEBUG=7 CCND_CAP=$1 ccnd 2>>ccnd$((WHICHCCND % 10))-capped-$1.out &
9393
ccndsmoketest -u localhost -t 50 recv >/dev/null
9494
ccndsmoketest >/dev/null
9595
}
@@ -122,7 +122,7 @@ GenerateRepoTestData () { (
122122
# Given a repo directory, choose a likely versioned name.
123123
GetTestDataVersionedName () {
124124
ccnnamelist $1/repoFile1 | head -n 40 | grep -v %C1.M | tail -n 1 | \
125-
sed -e 's@/%00[^/]*$@@'
125+
sed -e 's@/[%=]00[^/]*$@@'
126126
}
127127

128128
##

csrc/lib/ccn_uri.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ ccn_uri_append_mixedescaped(struct ccn_charbuf *c,
117117
else if (!is_uri_reserved(ch))
118118
ccn_charbuf_append(c, &ch, 1);
119119
else { /* reserved character -- check for following character */
120-
if (i + 1 == size || !is_uri_reserved(data[i + 1]))
120+
if (ch > 0 && (i + 1 == size || !is_uri_reserved(data[i + 1])))
121121
ccn_charbuf_putf(c, "%%%02X", (unsigned)ch);
122122
else {
123123
hexmode = 1;

0 commit comments

Comments
 (0)