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"
|
2010-02-27 19:01:27 +00:00
|
|
|
#include "time_fmt.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
|
2011-05-05 20:48:21 +00:00
|
|
|
#define MAX_IP6_STR_LEN 40
|
2007-01-29 20:25:26 +00:00
|
|
|
#define MAX_ADDR_STR_LEN 256
|
2011-02-11 03:13:24 +00:00
|
|
|
#define VINES_ADDR_LEN 6
|
2011-05-08 10:23:53 +00:00
|
|
|
#define EUI64_STR_LEN 24
|
2005-04-28 09:51:55 +00:00
|
|
|
|
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
|
|
|
|
2009-09-06 14:25:47 +00:00
|
|
|
/* !!Deprecated!! - use ep_address_to_str() */
|
|
|
|
#define address_to_str ep_address_to_str
|
|
|
|
extern gchar* ep_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);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern gchar* bytestring_to_str(const guint8 *, const guint32, const char);
|
2002-12-08 22:53:00 +00:00
|
|
|
extern gchar* ether_to_str(const guint8 *);
|
2011-01-21 02:48:55 +00:00
|
|
|
extern gchar* tvb_ether_to_str(tvbuff_t *tvb, const gint offset);
|
2008-06-25 09:12:35 +00:00
|
|
|
extern const gchar* ip_to_str(const guint8 *);
|
2011-01-13 15:53:30 +00:00
|
|
|
extern const gchar* tvb_ip_to_str(tvbuff_t *tvb, const gint offset);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern void ip_to_str_buf(const guint8 *ad, gchar *buf, const 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 *);
|
2011-01-16 04:33:42 +00:00
|
|
|
extern gchar* tvb_fc_to_str(tvbuff_t *tvb, const gint offset);
|
|
|
|
extern gchar* tvb_fcwwn_to_str (tvbuff_t *tvb, const gint offset);
|
2004-01-10 12:50:19 +00:00
|
|
|
extern gchar* ip6_to_str(const struct e_in6_addr *);
|
2011-01-13 15:53:30 +00:00
|
|
|
extern gchar* tvb_ip6_to_str(tvbuff_t *tvb, const gint offset);
|
2003-12-09 05:06:22 +00:00
|
|
|
extern void ip6_to_str_buf(const struct e_in6_addr *, gchar *);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern gchar* ipx_addr_to_str(const guint32, const guint8 *);
|
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* ipxnet_to_string(const guint8 *ad);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern gchar* ipxnet_to_str_punct(const guint32 ad, const char punct);
|
2011-02-11 03:13:24 +00:00
|
|
|
extern gchar* tvb_vines_addr_to_str(tvbuff_t *tvb, const gint offset);
|
2011-05-08 10:23:53 +00:00
|
|
|
extern gchar* eui64_to_str(const guint64 ad);
|
|
|
|
extern gchar* tvb_eui64_to_str(tvbuff_t *tvb, const gint offset, const guint encoding);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern gchar* time_secs_to_str(const gint32 time_val);
|
|
|
|
extern gchar* time_secs_to_str_unsigned(const guint32);
|
|
|
|
extern gchar* time_msecs_to_str(gint32 time_val);
|
2010-05-21 06:33:25 +00:00
|
|
|
extern gchar* abs_time_to_str(const nstime_t*, const absolute_time_display_e fmt,
|
|
|
|
gboolean show_zone);
|
|
|
|
extern gchar* abs_time_secs_to_str(const time_t, const absolute_time_display_e fmt,
|
|
|
|
gboolean show_zone);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern void display_signed_time(gchar *, int, const gint32, gint32, const to_str_time_res_t);
|
|
|
|
extern void display_epoch_time(gchar *, int, const time_t, gint32, const to_str_time_res_t);
|
2006-12-05 03:19:51 +00:00
|
|
|
|
2010-04-03 18:18:50 +00:00
|
|
|
extern gchar* guint32_to_str(const guint32 u);
|
2010-02-23 19:28:38 +00:00
|
|
|
extern void guint32_to_str_buf(guint32 u, gchar *buf, int buf_len);
|
|
|
|
|
2010-04-03 18:18:50 +00:00
|
|
|
extern gchar* rel_time_to_str(const nstime_t*);
|
|
|
|
extern gchar* rel_time_to_secs_str(const 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
|
|
|
|
2012-04-04 21:54:22 +00:00
|
|
|
extern char *decode_bits_in_field(const guint bit_offset, const gint no_of_bits, const guint64 value);
|
2009-05-15 18:38:13 +00:00
|
|
|
|
2010-04-03 18:18:50 +00:00
|
|
|
extern char *other_decode_bitfield_value(char *buf, const guint32 val, const guint32 mask,
|
|
|
|
const int width);
|
|
|
|
extern char *decode_bitfield_value(char *buf, const guint32 val, const guint32 mask,
|
|
|
|
const int width);
|
|
|
|
extern const char *decode_boolean_bitfield(const guint32 val, const guint32 mask, const int width,
|
2001-04-01 02:47:56 +00:00
|
|
|
const char *truedesc, const char *falsedesc);
|
2010-04-03 18:18:50 +00:00
|
|
|
extern const char *decode_numeric_bitfield(const guint32 val, const guint32 mask, const int width,
|
2001-04-01 02:47:56 +00:00
|
|
|
const char *fmt);
|
|
|
|
|
|
|
|
#endif /* __TO_STR_H__ */
|