aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipsec.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-11 08:18:09 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-11 08:18:09 +0000
commit292e38e2c61edcd14bfa30ca3c72bacda1bcbe32 (patch)
treedb4edef02456a48d0f6d505166ac7d70f6c0f644 /packet-ipsec.c
parent162800efb308901e0c302517be01226130e39b19 (diff)
Add tvbuff class.
Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
Diffstat (limited to 'packet-ipsec.c')
-rw-r--r--packet-ipsec.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/packet-ipsec.c b/packet-ipsec.c
index 8fd2b5d882..eafdb5ce83 100644
--- a/packet-ipsec.c
+++ b/packet-ipsec.c
@@ -1,7 +1,7 @@
/* packet-ipsec.c
* Routines for IPsec/IPComp packet disassembly
*
- * $Id: packet-ipsec.c,v 1.14 2000/04/20 07:05:55 guy Exp $
+ * $Id: packet-ipsec.c,v 1.15 2000/05/11 08:15:14 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -120,20 +120,20 @@ dissect_ah(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (tree) {
/* !!! specify length */
- ti = proto_tree_add_item(tree, proto_ah, offset, advance, NULL);
+ ti = proto_tree_add_item(tree, proto_ah, NullTVB, offset, advance, NULL);
ah_tree = proto_item_add_subtree(ti, ett_ah);
- proto_tree_add_text(ah_tree, offset + offsetof(struct newah, ah_nxt), 1,
+ proto_tree_add_text(ah_tree, NullTVB, offset + offsetof(struct newah, ah_nxt), 1,
"Next Header: %s (0x%02x)", ipprotostr(ah.ah_nxt), ah.ah_nxt);
- proto_tree_add_text(ah_tree, offset + offsetof(struct newah, ah_len), 1,
+ proto_tree_add_text(ah_tree, NullTVB, offset + offsetof(struct newah, ah_len), 1,
"Length: %d", ah.ah_len << 2);
- proto_tree_add_item(ah_tree, hf_ah_spi,
+ proto_tree_add_item(ah_tree, hf_ah_spi, NullTVB,
offset + offsetof(struct newah, ah_spi), 4,
(guint32)ntohl(ah.ah_spi));
- proto_tree_add_item(ah_tree, hf_ah_sequence,
+ proto_tree_add_item(ah_tree, hf_ah_sequence, NullTVB,
offset + offsetof(struct newah, ah_seq), 4,
(guint32)ntohl(ah.ah_seq));
- proto_tree_add_text(ah_tree, offset + sizeof(ah), (ah.ah_len - 1) << 2,
+ proto_tree_add_text(ah_tree, NullTVB, offset + sizeof(ah), (ah.ah_len - 1) << 2,
"ICV");
}
@@ -166,12 +166,12 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
* (ie none)
*/
if(tree) {
- ti = proto_tree_add_item(tree, proto_esp, offset, END_OF_FRAME, NULL);
+ ti = proto_tree_add_item(tree, proto_esp, NullTVB, offset, END_OF_FRAME, NULL);
esp_tree = proto_item_add_subtree(ti, ett_esp);
- proto_tree_add_item(esp_tree, hf_esp_spi,
+ proto_tree_add_item(esp_tree, hf_esp_spi, NullTVB,
offset + offsetof(struct newesp, esp_spi), 4,
(guint32)ntohl(esp.esp_spi));
- proto_tree_add_item(esp_tree, hf_esp_sequence,
+ proto_tree_add_item(esp_tree, hf_esp_sequence, NullTVB,
offset + offsetof(struct newesp, esp_seq), 4,
(guint32)ntohl(esp.esp_seq));
dissect_data(pd, offset + sizeof(struct newesp), fd, esp_tree);
@@ -208,24 +208,24 @@ dissect_ipcomp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
* (ie none)
*/
if (tree) {
- ti = proto_tree_add_item(tree, proto_ipcomp, offset, END_OF_FRAME,
+ ti = proto_tree_add_item(tree, proto_ipcomp, NullTVB, offset, END_OF_FRAME,
NULL);
ipcomp_tree = proto_item_add_subtree(ti, ett_ipcomp);
- proto_tree_add_text(ipcomp_tree,
+ proto_tree_add_text(ipcomp_tree, NullTVB,
offset + offsetof(struct ipcomp, comp_nxt), 1,
"Next Header: %s (0x%02x)",
ipprotostr(ipcomp.comp_nxt), ipcomp.comp_nxt);
- proto_tree_add_item(ipcomp_tree, hf_ipcomp_flags,
+ proto_tree_add_item(ipcomp_tree, hf_ipcomp_flags, NullTVB,
offset + offsetof(struct ipcomp, comp_flags), 1,
ipcomp.comp_flags);
p = val_to_str(ntohs(ipcomp.comp_cpi), cpi2val, "");
if (p[0] == '\0') {
- proto_tree_add_item(ipcomp_tree, hf_ipcomp_cpi,
+ proto_tree_add_item(ipcomp_tree, hf_ipcomp_cpi, NullTVB,
offset + offsetof(struct ipcomp, comp_cpi), 2,
ntohs(ipcomp.comp_cpi));
} else {
- proto_tree_add_uint_format(ipcomp_tree, hf_ipcomp_cpi,
+ proto_tree_add_uint_format(ipcomp_tree, hf_ipcomp_cpi, NullTVB,
offset + offsetof(struct ipcomp, comp_cpi), 2,
ntohs(ipcomp.comp_cpi),
"CPI: %s (0x%04x)",