aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ypserv.c
diff options
context:
space:
mode:
authorNathan Neulinger <nneul@umr.edu>1999-11-11 20:18:46 +0000
committerNathan Neulinger <nneul@umr.edu>1999-11-11 20:18:46 +0000
commit119a787b888b040bf59ee591524d2558da88d853 (patch)
treea5cb5964f5d14080c88cb8874b4dabc45c6fdaca /packet-ypserv.c
parent56b9fc48618f6dca51cd45d447ab6f1c2c4031fb (diff)
Additions to bootparams, portmap, and ypserv dissectors
svn path=/trunk/; revision=1013
Diffstat (limited to 'packet-ypserv.c')
-rw-r--r--packet-ypserv.c169
1 files changed, 141 insertions, 28 deletions
diff --git a/packet-ypserv.c b/packet-ypserv.c
index c67def9b12..3d9ffd66d1 100644
--- a/packet-ypserv.c
+++ b/packet-ypserv.c
@@ -1,7 +1,7 @@
/* packet-ypserv.c
* Routines for ypserv dissection
*
- * $Id: packet-ypserv.c,v 1.2 1999/11/10 21:05:11 nneul Exp $
+ * $Id: packet-ypserv.c,v 1.3 1999/11/11 20:18:46 nneul Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -38,40 +38,134 @@
#include "packet-ypserv.h"
static int proto_ypserv = -1;
+static int hf_ypserv_domain = -1;
+static int hf_ypserv_servesdomain = -1;
+static int hf_ypserv_map = -1;
+static int hf_ypserv_key = -1;
+static int hf_ypserv_value = -1;
+
+/* Dissect a domain call */
+int dissect_domain_call(const u_char *pd, int offset, frame_data *fd,
+ proto_tree *tree)
+{
+ if ( tree )
+ {
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_domain);
+ }
+
+ return offset;
+}
+
+int dissect_domain_reply(const u_char *pd, int offset, frame_data *fd,
+ proto_tree *tree)
+{
+ if ( tree )
+ {
+ if ( !BYTES_ARE_IN_FRAME(offset, 1)) return offset;
+ proto_tree_add_item(tree, hf_ypserv_servesdomain,
+ offset, 4, pntohl(&pd[offset]));
+ offset += 4;
+ }
+
+ return offset;
+}
+
+/* Dissect a next call */
+int dissect_next_call(const u_char *pd, int offset, frame_data *fd,
+ proto_tree *tree)
+{
+ if ( tree )
+ {
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_domain);
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_map);
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_key);
+ }
+
+ return offset;
+}
+
+int dissect_first_call(const u_char *pd, int offset, frame_data *fd,
+ proto_tree *tree)
+{
+ if ( tree )
+ {
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_domain);
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_map);
+ }
+
+ return offset;
+}
+
+int dissect_match_call(const u_char *pd, int offset, frame_data *fd,
+ proto_tree *tree)
+{
+ if ( tree )
+ {
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_domain);
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_map);
+ offset = dissect_rpc_string_item(pd,offset,fd,tree,hf_ypserv_key);
+ }
+
+ return offset;
+}
/* proc number, "proc name", dissect_request, dissect_reply */
/* NULL as function pointer means: take the generic one. */
+
+/* someone please get me a version 1 trace */
const vsff ypserv1_proc[] = {
- { 0, "NULL", NULL, NULL },
- { YPPROC_ALL, "ALL", NULL, NULL },
- { YPPROC_CLEAR, "CLEAR", NULL, NULL },
- { YPPROC_DOMAIN, "DOMAIN", NULL, NULL },
- { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK", NULL, NULL },
- { YPPROC_FIRST, "FIRST", NULL, NULL },
- { YPPROC_MAPLIST, "MAPLIST", NULL, NULL },
- { YPPROC_MASTER, "MASTER", NULL, NULL },
- { YPPROC_MATCH, "MATCH", NULL, NULL },
- { YPPROC_NEXT, "NEXT", NULL, NULL },
- { YPPROC_ORDER, "ORDER", NULL, NULL },
- { YPPROC_XFR, "XFR", NULL, NULL },
- { 0, NULL, NULL, NULL }
+ { 0, "NULL", NULL, NULL },
+ { YPPROC_ALL, "ALL",
+ NULL, NULL },
+ { YPPROC_CLEAR, "CLEAR",
+ NULL, NULL },
+ { YPPROC_DOMAIN, "DOMAIN",
+ NULL, NULL },
+ { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK",
+ NULL, NULL },
+ { YPPROC_FIRST, "FIRST",
+ NULL, NULL },
+ { YPPROC_MAPLIST, "MAPLIST",
+ NULL, NULL },
+ { YPPROC_MASTER, "MASTER",
+ NULL, NULL },
+ { YPPROC_MATCH, "MATCH",
+ NULL, NULL },
+ { YPPROC_NEXT, "NEXT",
+ NULL, NULL },
+ { YPPROC_ORDER, "ORDER",
+ NULL, NULL },
+ { YPPROC_XFR, "XFR",
+ NULL, NULL },
+ { 0, NULL, NULL, NULL }
};
-/* end of YPServ version 1 */
+/* end of YPServ version 2 */
const vsff ypserv2_proc[] = {
- { 0, "NULL", NULL, NULL },
- { YPPROC_ALL, "ALL", NULL, NULL },
- { YPPROC_CLEAR, "CLEAR", NULL, NULL },
- { YPPROC_DOMAIN, "DOMAIN", NULL, NULL },
- { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK", NULL, NULL },
- { YPPROC_FIRST, "FIRST", NULL, NULL },
- { YPPROC_MAPLIST, "MAPLIST", NULL, NULL },
- { YPPROC_MASTER, "MASTER", NULL, NULL },
- { YPPROC_MATCH, "MATCH", NULL, NULL },
- { YPPROC_NEXT, "NEXT", NULL, NULL },
- { YPPROC_ORDER, "ORDER", NULL, NULL },
- { YPPROC_XFR, "XFR", NULL, NULL },
- { 0, NULL, NULL, NULL }
+ { 0, "NULL", NULL, NULL },
+ { YPPROC_ALL, "ALL",
+ NULL, NULL },
+ { YPPROC_CLEAR, "CLEAR",
+ NULL, NULL },
+ { YPPROC_DOMAIN, "DOMAIN",
+ dissect_domain_call, dissect_domain_reply },
+ { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK",
+ dissect_domain_call, dissect_domain_reply },
+ { YPPROC_FIRST, "FIRST",
+ dissect_first_call, NULL },
+ { YPPROC_MAPLIST, "MAPLIST",
+ NULL, NULL },
+ { YPPROC_MASTER, "MASTER",
+ NULL, NULL },
+ { YPPROC_MATCH, "MATCH",
+ dissect_match_call, NULL },
+ { YPPROC_NEXT, "NEXT",
+ dissect_next_call, NULL },
+ { YPPROC_ORDER, "ORDER",
+ NULL, NULL },
+ { YPPROC_XFR, "XFR",
+ NULL, NULL },
+ { 0, NULL, NULL, NULL }
};
/* end of YPServ version 2 */
@@ -79,7 +173,26 @@ const vsff ypserv2_proc[] = {
void
proto_register_ypserv(void)
{
+ static hf_register_info hf[] = {
+ { &hf_ypserv_domain, {
+ "Domain", "ypserv.domain", FT_STRING, BASE_DEC,
+ NULL, 0, "Domain" }},
+ { &hf_ypserv_servesdomain, {
+ "Serves Domain", "ypserv.servesdomain", FT_BOOLEAN, BASE_DEC,
+ NULL, 0, "Serves Domain" }},
+ { &hf_ypserv_map, {
+ "Map Name", "ypserv.map", FT_STRING, BASE_DEC,
+ NULL, 0, "Map Name" }},
+ { &hf_ypserv_key, {
+ "Key", "ypserv.key", FT_STRING, BASE_DEC,
+ NULL, 0, "Key" }},
+ { &hf_ypserv_value, {
+ "Value", "ypserv.value", FT_STRING, BASE_DEC,
+ NULL, 0, "Value" }},
+ };
+
proto_ypserv = proto_register_protocol("Yellow Pages Service", "ypserv");
+ proto_register_field_array(proto_ypserv, hf, array_length(hf));
/* Register the protocol as RPC */
rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ETT_YPSERV);