1999-11-10 17:23:55 +00:00
|
|
|
/* packet-ypserv.c
|
|
|
|
* Routines for ypserv dissection
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-11-10 17:23:55 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-05-30 06:01:02 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
1999-11-10 17:23:55 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from packet-smb.c
|
|
|
|
*
|
2001-12-23 21:36:58 +00:00
|
|
|
* 2001 Ronnie Sahlberg <See AUTHORS for email>
|
2001-03-17 21:16:56 +00:00
|
|
|
* Added all remaining dissectors for this protocol
|
|
|
|
*
|
1999-11-10 17:23:55 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "packet-rpc.h"
|
|
|
|
#include "packet-ypserv.h"
|
|
|
|
|
|
|
|
static int proto_ypserv = -1;
|
2002-10-23 21:17:03 +00:00
|
|
|
static int hf_ypserv_procedure_v1 = -1;
|
|
|
|
static int hf_ypserv_procedure_v2 = -1;
|
1999-11-11 20:18:46 +00:00
|
|
|
static int hf_ypserv_domain = -1;
|
|
|
|
static int hf_ypserv_servesdomain = -1;
|
|
|
|
static int hf_ypserv_map = -1;
|
|
|
|
static int hf_ypserv_key = -1;
|
2001-03-17 21:16:56 +00:00
|
|
|
static int hf_ypserv_peer = -1;
|
|
|
|
static int hf_ypserv_more = -1;
|
|
|
|
static int hf_ypserv_ordernum = -1;
|
|
|
|
static int hf_ypserv_transid = -1;
|
|
|
|
static int hf_ypserv_prog = -1;
|
|
|
|
static int hf_ypserv_port = -1;
|
1999-11-11 20:18:46 +00:00
|
|
|
static int hf_ypserv_value = -1;
|
1999-11-12 15:12:23 +00:00
|
|
|
static int hf_ypserv_status = -1;
|
2001-03-17 21:16:56 +00:00
|
|
|
static int hf_ypserv_map_parms = -1;
|
|
|
|
static int hf_ypserv_xfrstat = -1;
|
1999-11-11 20:18:46 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_ypserv = -1;
|
2001-03-17 21:16:56 +00:00
|
|
|
static gint ett_ypserv_map_parms = -1;
|
|
|
|
|
|
|
|
static const value_string ypstat[] =
|
|
|
|
{
|
|
|
|
{ 1, "YP_TRUE" },
|
|
|
|
{ 2, "YP_NOMORE" },
|
|
|
|
{ 0, "YP_FALSE" },
|
|
|
|
{ -1, "YP_NOMAP" },
|
|
|
|
{ -2, "YP_NODOM" },
|
|
|
|
{ -3, "YP_NOKEY" },
|
|
|
|
{ -4, "YP_BADOP" },
|
|
|
|
{ -5, "YP_BADDB" },
|
|
|
|
{ -6, "YP_YPERR" },
|
|
|
|
{ -7, "YP_BADARGS" },
|
|
|
|
{ -8, "YP_VERS" },
|
|
|
|
{ 0, NULL },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string xfrstat[] =
|
|
|
|
{
|
|
|
|
{ 1, "YPXFR_SUCC" },
|
|
|
|
{ 2, "YPXFR_AGE" },
|
|
|
|
{ -1, "YPXFR_NOMAP" },
|
|
|
|
{ -2, "YPXFR_NODOM" },
|
|
|
|
{ -3, "YPXFR_RSRC" },
|
|
|
|
{ -4, "YPXFR_RPC" },
|
|
|
|
{ -5, "YPXFR_MADDR" },
|
|
|
|
{ -6, "YPXFR_YPERR" },
|
|
|
|
{ -7, "YPXFR_BADARGS" },
|
|
|
|
{ -8, "YPXFR_DBM" },
|
|
|
|
{ -9, "YPXFR_FILE" },
|
|
|
|
{ -10, "YPXFR_SKEW" },
|
|
|
|
{ -11, "YPXFR_CLEAR" },
|
|
|
|
{ -12, "YPXFR_FORCE" },
|
|
|
|
{ -13, "YPXFR_XFRERR" },
|
|
|
|
{ -14, "YPXFR_REFUSED" },
|
|
|
|
{ 0, NULL },
|
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_domain_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
1999-11-11 20:18:46 +00:00
|
|
|
{
|
|
|
|
if ( tree )
|
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb,tree,hf_ypserv_domain,offset,NULL);
|
1999-11-11 20:18:46 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-11 20:18:46 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_domain_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
1999-11-11 20:18:46 +00:00
|
|
|
{
|
|
|
|
if ( tree )
|
|
|
|
{
|
2001-03-17 21:16:56 +00:00
|
|
|
proto_tree_add_boolean(tree, hf_ypserv_servesdomain, tvb,
|
|
|
|
offset, 4, tvb_get_ntohl(tvb,offset));
|
1999-11-11 20:18:46 +00:00
|
|
|
}
|
1999-11-12 15:12:23 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
offset += 4;
|
1999-11-11 20:18:46 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_match_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
1999-11-11 20:18:46 +00:00
|
|
|
{
|
|
|
|
if ( tree )
|
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_domain, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_key, offset, NULL);
|
1999-11-11 20:18:46 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-11 20:18:46 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_match_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
1999-11-11 20:18:46 +00:00
|
|
|
{
|
|
|
|
if ( tree )
|
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_value,offset, NULL);
|
1999-11-11 20:18:46 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-11 20:18:46 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_first_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
1999-11-11 20:18:46 +00:00
|
|
|
{
|
2002-02-20 21:02:46 +00:00
|
|
|
/*
|
|
|
|
* XXX - does Sun's "yp.x" lie, and claim that the argument to a
|
|
|
|
* FIRST call is a "ypreq_key" rather than a "ypreq_nokey"?
|
|
|
|
* You presumably need the key for NEXT, as "next" is "next
|
|
|
|
* after some entry", and the key tells you which entry, but
|
|
|
|
* you don't need a key for FIRST, as there's only one entry that
|
|
|
|
* is the first entry.
|
|
|
|
*
|
|
|
|
* The NIS server originally used DBM, which has a "firstkey()"
|
|
|
|
* call, with no argument, and a "nextkey()" argument, with
|
|
|
|
* a key argument. (Heck, it might *still* use DBM.)
|
|
|
|
*
|
|
|
|
* Given that, and given that at least one FIRST call from a Sun
|
|
|
|
* running Solaris 8 (the Sun on which I'm typing this, in fact)
|
|
|
|
* had a "ypreq_nokey" as the argument, I'm assuming that "yp.x"
|
|
|
|
* is buggy.
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-11 20:18:46 +00:00
|
|
|
if ( tree )
|
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_domain, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, NULL);
|
1999-11-11 20:18:46 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-11 20:18:46 +00:00
|
|
|
return offset;
|
|
|
|
}
|
1999-11-10 17:23:55 +00:00
|
|
|
|
1999-11-12 15:12:23 +00:00
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_firstnext_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
1999-11-12 15:12:23 +00:00
|
|
|
if ( tree )
|
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
|
1999-11-12 15:12:23 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_value, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_key, offset, NULL);
|
1999-11-12 15:12:23 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-12 15:12:23 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_next_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
1999-11-12 15:12:23 +00:00
|
|
|
if ( tree )
|
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_domain, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_key, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
return offset;
|
|
|
|
}
|
1999-11-12 15:12:23 +00:00
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_xfr_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
2002-02-02 03:02:06 +00:00
|
|
|
proto_item *sub_item=NULL;
|
|
|
|
proto_tree *sub_tree=NULL;
|
|
|
|
int start_offset = offset;
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
if(tree){
|
2002-02-02 03:02:06 +00:00
|
|
|
sub_item = proto_tree_add_item(tree, hf_ypserv_map_parms, tvb,
|
|
|
|
offset, -1, FALSE);
|
|
|
|
if(sub_item)
|
|
|
|
sub_tree = proto_item_add_subtree(sub_item, ett_ypserv_map_parms);
|
2000-01-22 05:49:08 +00:00
|
|
|
}
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, sub_tree, hf_ypserv_domain, offset, NULL);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, sub_tree, hf_ypserv_map, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, sub_tree, hf_ypserv_ordernum, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, sub_tree, hf_ypserv_peer, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-02 01:32:46 +00:00
|
|
|
proto_tree_add_item(tree, hf_ypserv_transid, tvb, offset, 4, FALSE);
|
2001-03-17 21:16:56 +00:00
|
|
|
offset += 4;
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_prog, offset);
|
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_port, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-02-02 03:02:06 +00:00
|
|
|
if(sub_item)
|
|
|
|
proto_item_set_len(sub_item, offset - start_offset);
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_xfr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
2002-04-02 01:32:46 +00:00
|
|
|
proto_tree_add_item(tree, hf_ypserv_transid, tvb, offset, 4, FALSE);
|
2001-03-17 21:16:56 +00:00
|
|
|
offset += 4;
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_xfrstat, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_ypreq_nokey(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_domain, offset, NULL);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_ypresp_all(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
2002-02-20 21:02:46 +00:00
|
|
|
guint32 more;
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-02-20 21:02:46 +00:00
|
|
|
for (;;) {
|
|
|
|
more = tvb_get_ntohl(tvb, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_more, offset);
|
2002-02-20 21:02:46 +00:00
|
|
|
if (!more)
|
|
|
|
break;
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_value, offset, NULL);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_key, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_ypresp_master(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_peer, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_ypresp_order(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_ordernum, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2002-04-03 13:24:13 +00:00
|
|
|
dissect_ypresp_maplist(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
|
2001-03-17 21:16:56 +00:00
|
|
|
{
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
|
2001-03-17 21:16:56 +00:00
|
|
|
while(tvb_get_ntohl(tvb,offset)){
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_more, offset);
|
|
|
|
offset = dissect_rpc_string(tvb, tree, hf_ypserv_map, offset, NULL);
|
2001-03-17 21:16:56 +00:00
|
|
|
|
|
|
|
}
|
2002-04-03 13:24:13 +00:00
|
|
|
offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_more, offset);
|
1999-11-12 15:12:23 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-11-10 17:23:55 +00:00
|
|
|
/* proc number, "proc name", dissect_request, dissect_reply */
|
2001-01-18 09:55:10 +00:00
|
|
|
/* NULL as function pointer means: type of arguments is "void". */
|
1999-11-11 20:18:46 +00:00
|
|
|
|
|
|
|
/* someone please get me a version 1 trace */
|
2002-10-23 21:17:03 +00:00
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static const vsff ypserv1_proc[] = {
|
1999-11-11 20:18:46 +00:00
|
|
|
{ 0, "NULL", NULL, NULL },
|
|
|
|
{ YPPROC_DOMAIN, "DOMAIN",
|
|
|
|
NULL, NULL },
|
|
|
|
{ YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK",
|
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_MATCH, "MATCH",
|
2001-03-17 21:16:56 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_FIRST, "FIRST",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_NEXT, "NEXT",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_XFR, "XFR",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_CLEAR, "CLEAR",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_ALL, "ALL",
|
2001-03-17 21:16:56 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_MASTER, "MASTER",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_ORDER, "ORDER",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_MAPLIST, "MAPLIST",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
|
|
|
{ 0, NULL, NULL, NULL }
|
1999-11-10 17:23:55 +00:00
|
|
|
};
|
2002-10-23 21:17:03 +00:00
|
|
|
|
2002-10-24 20:59:21 +00:00
|
|
|
static const value_string ypserv1_proc_vals[] = {
|
2002-10-23 21:17:03 +00:00
|
|
|
{ YPPROC_DOMAIN, "DOMAIN" },
|
|
|
|
{ YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK" },
|
|
|
|
{ YPPROC_MATCH, "MATCH" },
|
|
|
|
{ YPPROC_FIRST, "FIRST" },
|
|
|
|
{ YPPROC_NEXT, "NEXT" },
|
|
|
|
{ YPPROC_XFR, "XFR" },
|
|
|
|
{ YPPROC_CLEAR, "CLEAR" },
|
|
|
|
{ YPPROC_ALL, "ALL" },
|
|
|
|
{ YPPROC_MASTER, "MASTER" },
|
|
|
|
{ YPPROC_ORDER, "ORDER" },
|
|
|
|
{ YPPROC_MAPLIST, "MAPLIST" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
1999-11-10 17:23:55 +00:00
|
|
|
|
2002-10-24 20:59:21 +00:00
|
|
|
/* end of YPServ version 1 */
|
|
|
|
|
|
|
|
/* proc number, "proc name", dissect_request, dissect_reply */
|
|
|
|
/* NULL as function pointer means: type of arguments is "void". */
|
|
|
|
|
2001-03-17 21:16:56 +00:00
|
|
|
static const vsff ypserv2_proc[] = {
|
1999-11-11 20:18:46 +00:00
|
|
|
{ 0, "NULL", NULL, NULL },
|
|
|
|
{ YPPROC_DOMAIN, "DOMAIN",
|
|
|
|
dissect_domain_call, dissect_domain_reply },
|
|
|
|
{ YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK",
|
|
|
|
dissect_domain_call, dissect_domain_reply },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_MATCH, "MATCH",
|
1999-11-12 15:12:23 +00:00
|
|
|
dissect_match_call, dissect_match_reply },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_FIRST, "FIRST",
|
2001-03-17 21:16:56 +00:00
|
|
|
dissect_first_call, dissect_firstnext_reply },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_NEXT, "NEXT",
|
1999-11-12 15:12:23 +00:00
|
|
|
dissect_next_call, dissect_firstnext_reply },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_XFR, "XFR",
|
2001-03-17 21:16:56 +00:00
|
|
|
dissect_xfr_call, dissect_xfr_reply },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_CLEAR, "CLEAR",
|
1999-11-11 20:18:46 +00:00
|
|
|
NULL, NULL },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_ALL, "ALL",
|
2001-03-17 21:16:56 +00:00
|
|
|
dissect_ypreq_nokey, dissect_ypresp_all },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_MASTER, "MASTER",
|
2001-03-17 21:16:56 +00:00
|
|
|
dissect_ypreq_nokey, dissect_ypresp_master },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_ORDER, "ORDER",
|
2001-03-17 21:16:56 +00:00
|
|
|
dissect_ypreq_nokey, dissect_ypresp_order },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ YPPROC_MAPLIST, "MAPLIST",
|
2001-03-17 21:16:56 +00:00
|
|
|
dissect_domain_call, dissect_ypresp_maplist },
|
1999-11-11 20:18:46 +00:00
|
|
|
{ 0, NULL, NULL, NULL }
|
1999-11-10 17:23:55 +00:00
|
|
|
};
|
2002-10-24 20:59:21 +00:00
|
|
|
|
|
|
|
static const value_string ypserv2_proc_vals[] = {
|
|
|
|
{ YPPROC_DOMAIN, "DOMAIN" },
|
|
|
|
{ YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK" },
|
|
|
|
{ YPPROC_MATCH, "MATCH" },
|
|
|
|
{ YPPROC_FIRST, "FIRST" },
|
|
|
|
{ YPPROC_NEXT, "NEXT" },
|
|
|
|
{ YPPROC_XFR, "XFR" },
|
|
|
|
{ YPPROC_CLEAR, "CLEAR" },
|
|
|
|
{ YPPROC_ALL, "ALL" },
|
|
|
|
{ YPPROC_MASTER, "MASTER" },
|
|
|
|
{ YPPROC_ORDER, "ORDER" },
|
|
|
|
{ YPPROC_MAPLIST, "MAPLIST" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
1999-11-10 17:23:55 +00:00
|
|
|
/* end of YPServ version 2 */
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_ypserv(void)
|
|
|
|
{
|
2001-03-17 21:16:56 +00:00
|
|
|
/*static struct true_false_string okfailed = { "Ok", "Failed" };*/
|
1999-11-12 15:12:23 +00:00
|
|
|
static struct true_false_string yesno = { "Yes", "No" };
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-11 20:18:46 +00:00
|
|
|
static hf_register_info hf[] = {
|
2002-10-23 21:17:03 +00:00
|
|
|
{ &hf_ypserv_procedure_v1, {
|
|
|
|
"V1 Procedure", "ypserv.procedure_v1", FT_UINT32, BASE_DEC,
|
|
|
|
VALS(ypserv1_proc_vals), 0, "V1 Procedure", HFILL }},
|
|
|
|
{ &hf_ypserv_procedure_v2, {
|
|
|
|
"V2 Procedure", "ypserv.procedure_v2", FT_UINT32, BASE_DEC,
|
|
|
|
VALS(ypserv2_proc_vals), 0, "V2 Procedure", HFILL }},
|
1999-11-11 20:18:46 +00:00
|
|
|
{ &hf_ypserv_domain, {
|
|
|
|
"Domain", "ypserv.domain", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Domain", HFILL }},
|
1999-11-11 20:18:46 +00:00
|
|
|
{ &hf_ypserv_servesdomain, {
|
|
|
|
"Serves Domain", "ypserv.servesdomain", FT_BOOLEAN, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
&yesno, 0, "Serves Domain", HFILL }},
|
1999-11-11 20:18:46 +00:00
|
|
|
{ &hf_ypserv_map, {
|
|
|
|
"Map Name", "ypserv.map", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Map Name", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_peer, {
|
|
|
|
"Peer Name", "ypserv.peer", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Peer Name", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_more, {
|
|
|
|
"More", "ypserv.more", FT_BOOLEAN, BASE_NONE,
|
2001-06-18 02:18:27 +00:00
|
|
|
&yesno, 0, "More", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_ordernum, {
|
|
|
|
"Order Number", "ypserv.ordernum", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Order Number for XFR", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_transid, {
|
|
|
|
"Host Transport ID", "ypserv.transid", FT_IPv4, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Host Transport ID to use for XFR Callback", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_prog, {
|
|
|
|
"Program Number", "ypserv.prog", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Program Number to use for XFR Callback", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_port, {
|
|
|
|
"Port", "ypserv.port", FT_UINT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Port to use for XFR Callback", HFILL }},
|
1999-11-11 20:18:46 +00:00
|
|
|
{ &hf_ypserv_key, {
|
|
|
|
"Key", "ypserv.key", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Key", HFILL }},
|
1999-11-11 20:18:46 +00:00
|
|
|
{ &hf_ypserv_value, {
|
|
|
|
"Value", "ypserv.value", FT_STRING, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "Value", HFILL }},
|
1999-11-12 15:12:23 +00:00
|
|
|
{ &hf_ypserv_status, {
|
2001-03-17 21:16:56 +00:00
|
|
|
"Status", "ypserv.status", FT_INT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
VALS(ypstat) , 0, "Status", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_map_parms, {
|
|
|
|
"YP Map Parameters", "ypserv.map_parms", FT_NONE, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
NULL, 0, "YP Map Parameters", HFILL }},
|
2001-03-17 21:16:56 +00:00
|
|
|
{ &hf_ypserv_xfrstat, {
|
|
|
|
"Xfrstat", "ypserv.xfrstat", FT_INT32, BASE_DEC,
|
2001-06-18 02:18:27 +00:00
|
|
|
VALS(xfrstat), 0, "Xfrstat", HFILL }},
|
1999-11-11 20:18:46 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_ypserv,
|
2001-03-17 21:16:56 +00:00
|
|
|
&ett_ypserv_map_parms,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
1999-11-11 20:18:46 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_ypserv = proto_register_protocol("Yellow Pages Service",
|
|
|
|
"YPSERV", "ypserv");
|
1999-11-11 20:18:46 +00:00
|
|
|
proto_register_field_array(proto_ypserv, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2000-04-04 06:46:41 +00:00
|
|
|
}
|
1999-11-10 17:23:55 +00:00
|
|
|
|
2000-04-04 06:46:41 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_ypserv(void)
|
|
|
|
{
|
1999-11-10 17:23:55 +00:00
|
|
|
/* Register the protocol as RPC */
|
1999-11-16 11:44:20 +00:00
|
|
|
rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv);
|
1999-11-10 17:23:55 +00:00
|
|
|
/* Register the procedure tables */
|
2002-10-23 21:17:03 +00:00
|
|
|
rpc_init_proc_table(YPSERV_PROGRAM, 1, ypserv1_proc,
|
|
|
|
hf_ypserv_procedure_v1);
|
|
|
|
rpc_init_proc_table(YPSERV_PROGRAM, 2, ypserv2_proc,
|
|
|
|
hf_ypserv_procedure_v2);
|
1999-11-10 17:23:55 +00:00
|
|
|
}
|