wireshark/epan/dfilter/dfilter.h

66 lines
1.5 KiB
C
Raw Normal View History

/* dfilter.h
*
* $Id: dfilter.h,v 1.1 2001/02/01 20:21:18 gram Exp $
*/
#ifndef DFILTER_H
#define DFILTER_H
#include <glib.h>
#include "epan.h"
#include "proto.h"
/* Passed back to user */
typedef struct _dfilter_t dfilter_t;
/* Module-level initialization */
void
dfilter_init(void);
/* Module-level cleanup */
void
dfilter_cleanup(void);
/* Compiles a string to a dfilter_t.
* On success, sets the dfilter* pointed to by dfp
* to either a NULL pointer (if the filter is a null
* filter, as generated by an all-blank string) or to
* a pointer to the newly-allocated dfilter_t
* structure.
*
* On failure, dfilter_error_msg points to an
* appropriate error message. This error message is
* a global string, so another invocation of
* dfilter_compile() will clear it. The dfilter*
* will be set to NULL after a failure.
*
* Returns TRUE on success, FALSE on failure.
*/
gboolean
dfilter_compile(gchar *text, dfilter_t **dfp);
/* Frees all memory used by dfilter, and frees
* the dfilter itself. */
void
dfilter_free(dfilter_t *df);
/* dfilter_error_msg is NULL if there was no error during dfilter_compile,
* otherwise it points to a displayable error message. */
extern gchar *dfilter_error_msg;
/* Apply compiled dfilter */
gboolean
dfilter_apply_edt(dfilter_t *df, epan_dissect_t* edt);
/* Apply compiled dfilter */
gboolean
dfilter_apply(dfilter_t *df, tvbuff_t *tvb, proto_tree *tree);
/* Print bytecode of dfilter to stdout */
void
dfilter_dump(dfilter_t *df);
#endif