diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-29 05:47:07 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-29 05:47:07 +0000 |
commit | 7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3 (patch) | |
tree | 3e8a46fe6f7bb69698edb1187655e445bbfda37c /packet-ipsec.c | |
parent | 6f1d3a3be830da628246f7cea77fe9c491470d17 (diff) |
Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also
added packet-clip.c to the Nmake makefile.
svn path=/trunk/; revision=402
Diffstat (limited to 'packet-ipsec.c')
-rw-r--r-- | packet-ipsec.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/packet-ipsec.c b/packet-ipsec.c index c4b54e4e5f..c525d11426 100644 --- a/packet-ipsec.c +++ b/packet-ipsec.c @@ -1,7 +1,7 @@ /* packet-ipsec.c * Routines for IPsec packet disassembly * - * $Id: packet-ipsec.c,v 1.2 1999/07/07 22:51:45 gram Exp $ + * $Id: packet-ipsec.c,v 1.3 1999/07/29 05:46:56 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -41,6 +41,9 @@ #include "packet.h" #include "resolv.h" +static int proto_ah = -1; +static int proto_esp = -1; + struct newah { guint8 ah_nxt; /* Next Header */ guint8 ah_len; /* Length of data + 1, in 32bit */ @@ -85,7 +88,7 @@ dissect_ah(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { /* !!! specify length */ - ti = proto_tree_add_text(tree, offset, advance, "Authentication Header"); + ti = proto_tree_add_item(tree, proto_ah, 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, @@ -129,7 +132,7 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) * (ie none) */ if(tree) { - ti = proto_tree_add_text(tree, 0, 0, "Encapsulated Security Payload"); + ti = proto_tree_add_item(tree, proto_esp, 0, 0, NULL); esp_tree = proto_item_add_subtree(ti, ETT_ESP); proto_tree_add_text(esp_tree, offset + offsetof(struct newesp, esp_spi), 4, "SPI: %08x", (guint32)ntohl(esp.esp_spi)); @@ -137,3 +140,16 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Sequence?: %08x", (guint32)ntohl(esp.esp_seq)); } } + +void +proto_register_ipsec(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "ah.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_ah = proto_register_protocol("Authentication Header", "ah"); + proto_esp = proto_register_protocol("Encapsulated Security Payload", "esp"); + /* proto_register_field_array(proto_ah, hf, array_length(hf));*/ +} |