2000-09-27 04:55:05 +00:00
|
|
|
/* epan.h
|
Give libethereal its own configuration file, and have that configuration
file, rather than the top-level Ethereal configuration file, check for
"inet_aton()", "inet_pton()", and "inet_ntop()". Then make its
Makefile.am include the appropriate object files if necessary.
Otherwise, they don't get built and put into libethereal, and therefore
attempts to link with anything in libethereal that uses them fail on
platforms that lack ethem, causing the build to fail.
That means a bunch of things need to be fixed to cope with libethereal
having its own "config.h" file; this means removing the include of
"config.h" from some libethereal header files. Move the definitions of
the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so
"resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure
script (so we don't have to include it in "plugins.h" to check whether
HAVE_DLFCN_H is defined).
Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for
now, define that in the top-level configuration file, and have Ethereal
and Tethereal pass it as an argument to "epan_init()" - that should be
cleaned up at some point.
Remove from the top-level configure script checks for things used only
in libethereal.
svn path=/trunk/; revision=2498
2000-10-16 23:18:05 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-09-27 04:55:05 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark Protocol Analyzer Library
|
2000-09-27 04:55:05 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
|
2002-08-28 20:41:00 +00:00
|
|
|
*
|
2001-12-18 19:09:08 +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-12-18 19:09:08 +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-12-18 19:09:08 +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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2000-09-27 04:55:05 +00:00
|
|
|
*/
|
|
|
|
|
2012-10-18 21:14:43 +00:00
|
|
|
#ifndef __EPAN_H__
|
|
|
|
#define __EPAN_H__
|
2000-09-27 04:55:05 +00:00
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2000-09-28 03:16:29 +00:00
|
|
|
#include <glib.h>
|
2001-12-18 19:09:08 +00:00
|
|
|
#include "frame_data.h"
|
|
|
|
#include "column_info.h"
|
2007-05-07 17:55:42 +00:00
|
|
|
#include "register.h"
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2001-12-18 19:09:08 +00:00
|
|
|
typedef struct _epan_dissect_t epan_dissect_t;
|
2001-11-21 23:16:26 +00:00
|
|
|
|
2001-12-18 19:09:08 +00:00
|
|
|
#include "dfilter/dfilter.h"
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2011-09-11 19:09:02 +00:00
|
|
|
/**
|
|
|
|
@mainpage Wireshark EPAN the packet analyzing engine. Source code can be found in the epan directory
|
|
|
|
|
|
|
|
@section Introduction
|
|
|
|
|
|
|
|
XXX
|
|
|
|
|
|
|
|
@b Sections:
|
|
|
|
- \ref proto_pub
|
|
|
|
*/
|
2012-10-18 21:14:43 +00:00
|
|
|
/*
|
2011-09-11 19:09:02 +00:00
|
|
|
Ref 1
|
|
|
|
Epan
|
2012-10-18 21:14:43 +00:00
|
|
|
Ethereal Packet ANalyzer (XXX - is this correct?) the packet analyzing engine. Source code can be found in the epan directory.
|
2011-09-11 19:09:02 +00:00
|
|
|
|
2012-10-18 21:14:43 +00:00
|
|
|
Protocol-Tree - Keep data of the capture file protocol information.
|
2011-09-11 19:09:02 +00:00
|
|
|
|
2012-10-18 21:14:43 +00:00
|
|
|
Dissectors - The various protocol dissectors in epan/dissectors.
|
2011-09-11 19:09:02 +00:00
|
|
|
|
2012-10-18 21:14:43 +00:00
|
|
|
Plugins - Some of the protocol dissectors are implemented as plugins. Source code can be found at plugins.
|
2011-09-11 19:09:02 +00:00
|
|
|
|
|
|
|
Display-Filters - the display filter engine at epan/dfilter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ref2 for further edits - delete when done
|
|
|
|
\section Introduction
|
|
|
|
|
|
|
|
This document describes the data structures and the functions exported by the CACE Technologies AirPcap library.
|
|
|
|
The AirPcap library provides low-level access to the AirPcap driver including advanced capabilities such as channel setting,
|
|
|
|
link type control and WEP configuration.<br>
|
|
|
|
This manual includes the following sections:
|
|
|
|
|
|
|
|
\note throughout this documentation, \e device refers to a physical USB AirPcap device, while \e adapter is an open API
|
|
|
|
instance. Most of the AirPcap API operations are adapter-specific but some of them, like setting the channel, are
|
|
|
|
per-device and will be reflected on all the open adapters. These functions will have "Device" in their name, e.g.
|
|
|
|
AirpcapSetDeviceChannel().
|
|
|
|
|
|
|
|
\b Sections:
|
|
|
|
|
|
|
|
- \ref airpcapfuncs
|
|
|
|
- \ref airpcapdefs
|
|
|
|
- \ref radiotap
|
|
|
|
*/
|
2010-08-29 10:47:38 +00:00
|
|
|
/** init the whole epan module, this is used to be called only once in a program */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2008-06-23 20:17:08 +00:00
|
|
|
void epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_data),
|
|
|
|
void (*register_all_handoffs_func)(register_cb cb, gpointer client_data),
|
2007-05-07 17:55:42 +00:00
|
|
|
register_cb cb,
|
|
|
|
void *client_data,
|
2010-01-28 18:45:46 +00:00
|
|
|
void (*report_failure_fcn_p)(const char *, va_list),
|
|
|
|
void (*report_open_failure_fcn_p)(const char *, int, gboolean),
|
|
|
|
void (*report_read_failure_fcn_p)(const char *, int),
|
|
|
|
void (*report_write_failure_fcn_p)(const char *, int));
|
2009-02-15 21:47:57 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** cleanup the whole epan module, this is used to be called only once in a program */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2000-09-27 04:55:05 +00:00
|
|
|
void epan_cleanup(void);
|
2009-02-15 21:47:57 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/**
|
2009-02-25 10:05:04 +00:00
|
|
|
* Initialize the table of conversations. Conversations are identified by
|
|
|
|
* their endpoints; they are used for protocols such as IP, TCP, and UDP,
|
|
|
|
* where packets contain endpoint information but don't contain a single
|
|
|
|
* value indicating to which flow the packet belongs.
|
|
|
|
*/
|
2000-09-27 04:55:05 +00:00
|
|
|
void epan_conversation_init(void);
|
2009-09-06 18:25:23 +00:00
|
|
|
void epan_conversation_cleanup(void);
|
2009-02-15 21:47:57 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/**
|
2009-02-25 10:05:04 +00:00
|
|
|
* Initialize the table of circuits. Circuits are identified by a
|
|
|
|
* circuit ID; they are used for protocols where packets *do* contain
|
|
|
|
* a circuit ID value indicating to which flow the packet belongs.
|
|
|
|
*
|
|
|
|
* We might want to make a superclass for both endpoint-specified
|
|
|
|
* conversations and circuit ID-specified circuits, so we can attach
|
|
|
|
* information either to a circuit or a conversation with common
|
|
|
|
* code.
|
|
|
|
*/
|
2002-10-22 08:44:33 +00:00
|
|
|
void epan_circuit_init(void);
|
2009-09-06 18:25:23 +00:00
|
|
|
void epan_circuit_cleanup(void);
|
2000-10-06 10:11:40 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** A client will create one epan_t for an entire dissection session.
|
2000-09-27 04:55:05 +00:00
|
|
|
* A single epan_t will be used to analyze the entire sequence of packets,
|
|
|
|
* sequentially, in a single session. A session corresponds to a single
|
|
|
|
* packet trace file. The reaons epan_t exists is that some packets in
|
|
|
|
* some protocols cannot be decoded without knowledge of previous packets.
|
|
|
|
* This inter-packet "state" is stored in the epan_t.
|
|
|
|
*/
|
2005-08-02 07:30:38 +00:00
|
|
|
/* XXX - NOTE: epan_t, epan_new and epan_free are currently unused! */
|
2000-09-27 04:55:05 +00:00
|
|
|
typedef struct epan_session epan_t;
|
|
|
|
|
|
|
|
epan_t*
|
|
|
|
epan_new(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
epan_free(epan_t*);
|
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC const gchar*
|
2006-06-13 08:18:50 +00:00
|
|
|
epan_get_version(void);
|
2000-09-27 04:55:05 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** initialize an existing single packet dissection */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2009-08-13 19:42:46 +00:00
|
|
|
epan_dissect_t*
|
2010-04-03 18:18:50 +00:00
|
|
|
epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const gboolean proto_tree_visible);
|
2009-08-13 19:42:46 +00:00
|
|
|
|
2010-09-23 01:14:44 +00:00
|
|
|
/** get a new single packet dissection
|
2010-08-29 10:47:38 +00:00
|
|
|
* should be freed using epan_dissect_free() after packet dissection completed
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2001-12-18 19:09:08 +00:00
|
|
|
epan_dissect_t*
|
2010-04-03 18:18:50 +00:00
|
|
|
epan_dissect_new(const gboolean create_proto_tree, const gboolean proto_tree_visible);
|
2000-09-27 04:55:05 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** Indicate whether we should fake protocols or not */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2009-08-11 18:08:03 +00:00
|
|
|
void
|
2010-04-03 18:18:50 +00:00
|
|
|
epan_dissect_fake_protocols(epan_dissect_t *edt, const gboolean fake_protocols);
|
2009-08-11 18:08:03 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** run a single packet dissection */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2001-12-18 19:09:08 +00:00
|
|
|
void
|
2012-10-16 21:50:57 +00:00
|
|
|
epan_dissect_run(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
2001-12-18 19:09:08 +00:00
|
|
|
const guint8* data, frame_data *fd, column_info *cinfo);
|
2000-09-27 04:55:05 +00:00
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2012-10-20 19:27:24 +00:00
|
|
|
void
|
|
|
|
epan_dissect_run_with_taps(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
|
|
|
|
const guint8* data, frame_data *fd, column_info *cinfo);
|
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** Prime a proto_tree using the fields/protocols used in a dfilter. */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2001-12-18 19:09:08 +00:00
|
|
|
void
|
2005-08-02 07:30:38 +00:00
|
|
|
epan_dissect_prime_dfilter(epan_dissect_t *edt, const dfilter_t *dfcode);
|
2000-09-27 04:55:05 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** fill the dissect run output into the packet list columns */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2001-12-18 19:09:08 +00:00
|
|
|
void
|
2010-04-03 18:18:50 +00:00
|
|
|
epan_dissect_fill_in_columns(epan_dissect_t *edt, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
|
2000-09-27 04:55:05 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** releases resources attached to the packet dissection. DOES NOT free the actual pointer */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2009-08-13 19:42:46 +00:00
|
|
|
void
|
|
|
|
epan_dissect_cleanup(epan_dissect_t* edt);
|
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** free a single packet dissection */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2000-09-27 04:55:05 +00:00
|
|
|
void
|
2000-10-06 10:11:40 +00:00
|
|
|
epan_dissect_free(epan_dissect_t* edt);
|
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/** Sets custom column */
|
2009-08-25 21:10:35 +00:00
|
|
|
const gchar *
|
2010-09-22 20:56:14 +00:00
|
|
|
epan_custom_set(epan_dissect_t *edt, int id, gint occurrence,
|
2010-09-23 06:00:22 +00:00
|
|
|
gchar *result, gchar *expr, const int size);
|
2010-07-15 02:07:16 +00:00
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/**
|
2010-07-15 02:07:16 +00:00
|
|
|
* Get compile-time information for libraries used by libwireshark.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2010-07-15 02:07:16 +00:00
|
|
|
void
|
|
|
|
epan_get_compiled_version_info(GString *str);
|
|
|
|
|
2010-08-29 10:47:38 +00:00
|
|
|
/**
|
2010-07-15 02:07:16 +00:00
|
|
|
* Get runtime information for libraries used by libwireshark.
|
|
|
|
*/
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC
|
2010-07-15 02:07:16 +00:00
|
|
|
void
|
|
|
|
epan_get_runtime_version_info(GString *str);
|
2009-08-25 21:10:35 +00:00
|
|
|
|
2011-12-29 00:08:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2012-10-18 21:14:43 +00:00
|
|
|
#endif /* __EPAN_H__ */
|