ILMI is just SNMP-over-ATM AAL5; if the SNMP dissector is available,

dissect ILMI packets with the SNMP dissector.

svn path=/trunk/; revision=1054
This commit is contained in:
Guy Harris 1999-11-18 07:29:55 +00:00
parent 95d752b466
commit f5831f290a
4 changed files with 62 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
# $Id: Makefile.am,v 1.110 1999/11/17 23:31:22 gram Exp $
# $Id: Makefile.am,v 1.111 1999/11/18 07:29:53 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@zing.org>
@ -196,6 +196,7 @@ EXTRA_ethereal_SOURCES = \
dfilter-grammar.h \
dfilter-scanner.c \
packet-snmp.c \
packet-snmp.h \
snprintf.c \
snprintf.h \
snprintf-imp.h \

View File

@ -1,7 +1,7 @@
/* packet-atm.c
* Routines for ATM packet disassembly
*
* $Id: packet-atm.c,v 1.2 1999/11/16 11:42:25 guy Exp $
* $Id: packet-atm.c,v 1.3 1999/11/18 07:29:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -36,14 +36,18 @@
#include "packet.h"
#include "resolv.h"
#include "packet-snmp.h"
static int proto_atm = -1;
static int proto_atm_lane = -1;
static int proto_ilmi = -1;
static gint ett_atm = -1;
static gint ett_atm_lane = -1;
static gint ett_atm_lane_lc_lan_dest = -1;
static gint ett_atm_lane_lc_lan_dest_rd = -1;
static gint ett_atm_lane_lc_flags = -1;
static gint ett_ilmi = -1;
/*
* See
@ -529,6 +533,12 @@ dissect_atm(const u_char *pd, frame_data *fd, proto_tree *tree)
dissect_lane(pd, offset, fd, tree);
break;
#if defined(HAVE_UCD_SNMP_SNMP_H) || defined(HAVE_SNMP_SNMP_H)
case ATT_HL_ILMI:
dissect_snmp_pdu(pd, offset, fd, tree, "ILMI", proto_ilmi, ett_ilmi);
break;
#endif
default:
if (tree) {
/* Dump it as raw data. */
@ -553,8 +563,10 @@ proto_register_atm(void)
&ett_atm_lane_lc_lan_dest,
&ett_atm_lane_lc_lan_dest_rd,
&ett_atm_lane_lc_flags,
&ett_ilmi,
};
proto_atm = proto_register_protocol("ATM", "atm");
proto_atm_lane = proto_register_protocol("ATM LANE", "lane");
proto_ilmi = proto_register_protocol("ILMI", "ilmi");
proto_register_subtree_array(ett, array_length(ett));
}

View File

@ -2,7 +2,7 @@
* Routines for SNMP (simple network management protocol)
* D.Jorand (c) 1998
*
* $Id: packet-snmp.c,v 1.13 1999/11/16 11:42:58 guy Exp $
* $Id: packet-snmp.c,v 1.14 1999/11/18 07:29:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@ -52,6 +52,8 @@
#include <glib.h>
#include "packet.h"
#include "packet-snmp.h"
#define in_addr_t u_int
static int proto_snmp = -1;
@ -285,6 +287,13 @@ dissect_snmp_error(const u_char *pd, int offset, frame_data *fd,
void
dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
dissect_snmp_pdu(pd, offset, fd, tree, "SNMP", proto_snmp, ett_snmp);
}
void
dissect_snmp_pdu(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, char *proto_name, int proto, gint ett)
{
int length=fd->pkt_len-offset;
u_char *data, *tmp_data;
@ -334,7 +343,7 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
proto_item *item=NULL;
if (check_col(fd, COL_PROTOCOL))
col_add_str(fd, COL_PROTOCOL, "SNMP");
col_add_str(fd, COL_PROTOCOL, proto_name);
/* NOTE: we have to parse the message piece by piece, since the
* capture length may be less than the message length: a 'global'
@ -456,8 +465,8 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
if (tree) {
/* all_length=header_length+pdu_type_length+request_id_length+error_status_length+error_index_length; */
all_length=fd->pkt_len-offset;
item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL);
snmp_tree = proto_item_add_subtree(item, ett_snmp);
item = proto_tree_add_item(tree, proto, offset, all_length, NULL);
snmp_tree = proto_item_add_subtree(item, ett);
proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x"));
offset+=header_length;
proto_tree_add_text(snmp_tree, offset, pdu_type_length, "%s", pdu_type_string);
@ -484,8 +493,8 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
col_add_str(fd, COL_INFO, pdu_type_string);
if(tree) {
all_length=fd->pkt_len-offset;
item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL);
snmp_tree = proto_item_add_subtree(item, ett_snmp);
item = proto_tree_add_item(tree, proto, offset, all_length, NULL);
snmp_tree = proto_item_add_subtree(item, ett);
proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x"));
offset+=header_length;
proto_tree_add_text(snmp_tree, offset, pdu_type_length, "Pdu type: %s", pdu_type_string);

32
packet-snmp.h Normal file
View File

@ -0,0 +1,32 @@
/* packet-snmp.h
* Exported routines for SNMP (simple network management protocol)
* D.Jorand (c) 1998
*
* $Id: packet-snmp.h,v 1.1 1999/11/18 07:29:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
* Copyright 1998 Didier Jorand
*
*
* 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.
*/
/*
* Guts of the SNMP dissector - exported for use by protocols such as
* ILMI.
*/
void dissect_snmp_pdu(const u_char *, int, frame_data *, proto_tree *tree,
char *, int, gint);