ie.h File Reference

Fixbuf information element API and registry. More...

#include <fixbuf/autoinc.h>

Go to the source code of this file.

Data Structures

struct  _FixIEKey
 An information element identifier. More...
struct  _FixIE
 An information element in a fixbuf template. More...
struct  _FixIERegistry
 An information element registry. More...

Defines

#define FIX_IE_VARLEN   65535
 Length value defining an information element as variable-length.
#define FIX_IE_F_DEFAULT   0x00000000
 Default treatment flags value.
#define FIX_IE_F_ENDIAN   0x00000001
 Information element endian conversion flag.

Typedefs

typedef _FixIEKey FixIEKey
 An information element identifier.
typedef _FixIE FixIE
 An information element in a fixbuf template.
typedef _FixIERegistry FixIERegistry
 An information element registry.

Functions

FixIERegistryfix_ie_registry_alloc ()
 Allocate a new information element registry.
void fix_ie_registry_free (FixIERegistry *registry)
 Free a previously allocated IE registry.
uint32_t fix_ie_hash (FixIEKey *iek)
 Generate a hash code for an information element key.
gboolean fix_ie_hasheq (FixIEKey *a, FixIEKey *b)
 Determine if two information element keys are equal.
void fix_ie_register (FixIERegistry *ier, char *name, FixIE *ie)
 Register an information element.
gboolean fix_ie_bykey (FixIERegistry *ier, FixIEKey *iek, FixIE *ie, uint16_t len_override, uint32_t flags_override)
 Copy an information element out of the registry looked up by key, optionally overriding length and flags on the IE.
gboolean fix_ie_byname (FixIERegistry *ier, const char *name, FixIE *ie, uint16_t len_override, uint32_t flags_override)
 Copy an information element out of the registry looked up by name, optionally overriding length and flags on the IE.


Detailed Description

Fixbuf information element API and registry.


Define Documentation

#define FIX_IE_F_DEFAULT   0x00000000
 

Default treatment flags value.

Provided for initializer convenience. Corresponds to octet-array semantics.

#define FIX_IE_F_ENDIAN   0x00000001
 

Information element endian conversion flag.

If set, IE is an integer and will be endian-converted on transcode. Only has effect on 2-, 4- or 8-byte integers. This flag is also allowed on 1-byte information elements for semantic consistency.


Typedef Documentation

typedef struct _FixIEKey FixIEKey
 

An information element identifier.

Used in session IE registry.

typedef struct _FixIERegistry FixIERegistry
 

An information element registry.

Created by fix_ie_registry_alloc(), these define IPFIX information elements and can be shared among multiple readers and writers.


Function Documentation

gboolean fix_ie_bykey FixIERegistry ier,
FixIEKey iek,
FixIE ie,
uint16_t  len_override,
uint32_t  flags_override
 

Copy an information element out of the registry looked up by key, optionally overriding length and flags on the IE.

Used by fix_template_add_ie().

Parameters:
ier FixIERegistry to retrieve IE from
iek IEKey to look up
ie Pointer to IE to copy into
len_override if non-zero, override length in copied IE with this value
flags_override if non-zero, override flags in copied IE with this value
Returns:
TRUE if IE found and copied from registry, FALSE if IE not found and copied from key.

gboolean fix_ie_byname FixIERegistry ier,
const char *  name,
FixIE ie,
uint16_t  len_override,
uint32_t  flags_override
 

Copy an information element out of the registry looked up by name, optionally overriding length and flags on the IE.

Used by the FixTemplateSpec mechanism.

Parameters:
ier FixIERegistry to retrieve IE from
name name of IE to look up
ie Pointer to IE to copy into
len_override if non-zero, override length in copied IE with this value
flags_override if non-zero, override flags in copied IE with this value
Returns:
TRUE if IE found and copied from registry, FALSE otherwise

uint32_t fix_ie_hash FixIEKey iek  ) 
 

Generate a hash code for an information element key.

You should have no need to call this directly.

Parameters:
iek information element key to hash
Returns:
a hash code for the key

gboolean fix_ie_hasheq FixIEKey a,
FixIEKey b
 

Determine if two information element keys are equal.

Parameters:
a an IE key to compare
b another IE key to compare
Returns:
TRUE if a and b are equal

void fix_ie_register FixIERegistry ier,
char *  name,
FixIE ie
 

Register an information element.

Add an IE to an IE registry, keyed by name and IEKey. Information elements may not be unregistered from a registry. Typically, name and IE are pointers to static storage.

Parameters:
ier FixIERegistry to register IE with
name name to register IE with. The registry uses this string without copying it. You are responsible for managing storage for the name.
ie pointer to IE to register. The registry uses this pointer without copying it. You are responsible for managing storage for the IE.

FixIERegistry* fix_ie_registry_alloc  ) 
 

Allocate a new information element registry.

Populates the IE registry with IPFIX built-in information elements and CERT (PEN 6871) IEs.

Returns:
a new IE registry.

void fix_ie_registry_free FixIERegistry registry  ) 
 

Free a previously allocated IE registry.

Ensure any readers or writers using the registry have been freed before calling this.

Parameters:
registry an IE registry to free


© 2005-2006 Carnegie Mellon University
Generated Thu Jul 6 16:00:08 2006 for libfixbuf 0.4.1 by Doxygen 1.4.5.