2001-04-01 02:47:56 +00:00
|
|
|
/* to_str.h
|
|
|
|
* Definitions for utilities to convert various other types to strings.
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2001-04-01 02:47:56 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2001-04-01 02:47:56 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-04-01 02:47:56 +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.
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-04-01 02:47:56 +00:00
|
|
|
* 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.
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-04-01 02:47:56 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __TO_STR_H__
|
|
|
|
#define __TO_STR_H__
|
|
|
|
|
2001-09-14 07:10:13 +00:00
|
|
|
#include <glib.h>
|
2001-04-01 02:47:56 +00:00
|
|
|
|
2001-09-14 07:10:13 +00:00
|
|
|
#include "nstime.h"
|
2009-08-21 20:51:13 +00:00
|
|
|
#include <epan/packet_info.h>
|
2001-09-14 07:10:13 +00:00
|
|
|
|
2005-07-04 13:04:53 +00:00
|
|
|
#define GUID_STR_LEN 37
|
2007-01-29 20:25:26 +00:00
|
|
|
#define MAX_IP_STR_LEN 16
|
|
|
|
#define MAX_ADDR_STR_LEN 256
|
2005-04-28 09:51:55 +00:00
|
|
|
|
2001-09-14 07:10:13 +00:00
|
|
|
/*
|
|
|
|
* Resolution of a time stamp.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2005-08-25 21:29:54 +00:00
|
|
|
SECS, /* seconds */
|
|
|
|
DSECS, /* deciseconds */
|
|
|
|
CSECS, /* centiseconds */
|
2001-09-14 07:10:13 +00:00
|
|
|
MSECS, /* milliseconds */
|
|
|
|
USECS, /* microseconds */
|
|
|
|
NSECS /* nanoseconds */
|
|
|
|
} time_res_t;
|
|
|
|
|
2002-08-28 20:41:00 +00:00
|
|
|
/*
|
2001-04-01 02:47:56 +00:00
|
|
|
* These are utility functions which convert various types to strings,
|
2002-08-28 20:41:00 +00:00
|
|
|
* but for which no more specific module applies.
|
2001-04-01 02:47:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct e_in6_addr;
|
2002-12-08 02:32:36 +00:00
|
|
|
|
2005-01-01 12:29:26 +00:00
|
|
|
extern gchar* address_to_str(const address *);
|
2009-07-07 09:42:09 +00:00
|
|
|
extern gchar* se_address_to_str(const address *);
|
2005-08-08 18:50:39 +00:00
|
|
|
extern void address_to_str_buf(const address *addr, gchar *buf, int buf_len);
|
2005-08-28 06:44:06 +00:00
|
|
|
extern gchar* bytestring_to_str(const guint8 *, guint32, char);
|
2002-12-08 22:53:00 +00:00
|
|
|
extern gchar* ether_to_str(const guint8 *);
|
2008-06-25 09:12:35 +00:00
|
|
|
extern const gchar* ip_to_str(const guint8 *);
|
2007-01-29 20:25:26 +00:00
|
|
|
extern void ip_to_str_buf(const guint8 *ad, gchar *buf, int buf_len);
|
2002-12-08 22:53:00 +00:00
|
|
|
extern gchar* fc_to_str(const guint8 *);
|
|
|
|
extern gchar* fcwwn_to_str (const guint8 *);
|
2004-01-10 12:50:19 +00:00
|
|
|
extern gchar* ip6_to_str(const struct e_in6_addr *);
|
2003-12-09 05:06:22 +00:00
|
|
|
extern void ip6_to_str_buf(const struct e_in6_addr *, gchar *);
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
extern gchar* ipx_addr_to_str(guint32, const guint8 *);
|
|
|
|
extern gchar* ipxnet_to_string(const guint8 *ad);
|
|
|
|
extern gchar* ipxnet_to_str_punct(const guint32 ad, char punct);
|
|
|
|
extern gchar* vines_addr_to_str(const guint8 *addrp);
|
2005-08-20 02:33:33 +00:00
|
|
|
extern void vines_addr_to_str_buf(const guint8 *addrp, gchar *buf, int buf_len);
|
2005-04-12 19:59:08 +00:00
|
|
|
extern gchar* time_secs_to_str(gint32);
|
2009-06-25 02:07:17 +00:00
|
|
|
extern gchar* time_secs_to_str_unsigned(guint32);
|
2005-04-12 19:59:08 +00:00
|
|
|
extern gchar* time_msecs_to_str(gint32);
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
extern gchar* abs_time_to_str(nstime_t*);
|
2003-02-12 00:44:04 +00:00
|
|
|
extern gchar* abs_time_secs_to_str(time_t);
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
extern void display_signed_time(gchar *, int, gint32, gint32, time_res_t);
|
2006-12-05 03:19:51 +00:00
|
|
|
extern void display_epoch_time(gchar *, int, time_t, gint32, time_res_t);
|
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
extern gchar* rel_time_to_str(nstime_t*);
|
|
|
|
extern gchar* rel_time_to_secs_str(nstime_t*);
|
2006-03-10 11:58:22 +00:00
|
|
|
extern gchar* guid_to_str(const e_guid_t*);
|
|
|
|
extern gchar* guid_to_str_buf(const e_guid_t*, gchar*, int);
|
2001-04-01 02:47:56 +00:00
|
|
|
|
2005-12-01 20:02:45 +00:00
|
|
|
void tipc_addr_to_str_buf( const guint8 *data, gchar *buf, int buf_len);
|
2001-04-01 02:47:56 +00:00
|
|
|
|
2009-05-15 18:38:13 +00:00
|
|
|
extern char *decode_bits_in_field(gint bit_offset, gint no_of_bits, guint64 value);
|
|
|
|
|
2003-12-08 23:40:13 +00:00
|
|
|
extern char *other_decode_bitfield_value(char *buf, guint32 val, guint32 mask,
|
|
|
|
int width);
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
extern char *decode_bitfield_value(char *buf, guint32 val, guint32 mask,
|
|
|
|
int width);
|
|
|
|
extern const char *decode_boolean_bitfield(guint32 val, guint32 mask, int width,
|
2001-04-01 02:47:56 +00:00
|
|
|
const char *truedesc, const char *falsedesc);
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
extern const char *decode_numeric_bitfield(guint32 val, guint32 mask, int width,
|
2001-04-01 02:47:56 +00:00
|
|
|
const char *fmt);
|
|
|
|
|
|
|
|
#endif /* __TO_STR_H__ */
|