Add an API to get the dissector name from a dissector handle.

svn path=/trunk/; revision=7726
This commit is contained in:
Guy Harris 2003-05-23 22:09:36 +00:00
parent 8a1947f01d
commit f94c7971a5
2 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/* packet.c /* packet.c
* Routines for packet disassembly * Routines for packet disassembly
* *
* $Id: packet.c,v 1.91 2003/04/23 10:20:27 sahlberg Exp $ * $Id: packet.c,v 1.92 2003/05/23 22:09:36 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -1116,11 +1116,18 @@ dissector_handle_get_short_name(dissector_handle_t handle)
return proto_get_protocol_short_name(handle->proto_index); return proto_get_protocol_short_name(handle->proto_index);
} }
/* Get the dissector name for a dissector handle. */
const char *
dissector_handle_get_dissector_name(dissector_handle_t handle)
{
return handle->name;
}
/* Get the index of the protocol for a dissector handle. */ /* Get the index of the protocol for a dissector handle. */
int int
dissector_handle_get_protocol_index(dissector_handle_t handle) dissector_handle_get_protocol_index(dissector_handle_t handle)
{ {
return handle->proto_index; return handle->proto_index;
} }
/* Find a registered dissector by name. */ /* Find a registered dissector by name. */

View File

@ -1,7 +1,7 @@
/* packet.h /* packet.h
* Definitions for packet disassembly structures and routines * Definitions for packet disassembly structures and routines
* *
* $Id: packet.h,v 1.65 2002/11/15 03:10:36 guy Exp $ * $Id: packet.h,v 1.66 2003/05/23 22:09:36 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -213,6 +213,9 @@ extern void new_register_dissector(const char *name, new_dissector_t dissector,
/* Get the short name of the protocol for a dissector handle. */ /* Get the short name of the protocol for a dissector handle. */
extern char *dissector_handle_get_short_name(dissector_handle_t handle); extern char *dissector_handle_get_short_name(dissector_handle_t handle);
/* Get the dissector name for a dissector handle. */
extern const char *dissector_handle_get_dissector_name(dissector_handle_t handle);
/* Get the index of the protocol for a dissector handle. */ /* Get the index of the protocol for a dissector handle. */
extern int dissector_handle_get_protocol_index(dissector_handle_t handle); extern int dissector_handle_get_protocol_index(dissector_handle_t handle);