private.h File Reference
#include <fixbuf/public.h>

Go to the source code of this file.

Typedefs

typedef struct fbElementPositions_st fbElementPositions_t
 
typedef struct fbTemplateInfoRecord_st fbTemplateInfoRecord_t
 
typedef struct fbUDPConnSpec_st fbUDPConnSpec_t
 

Macros

#define FB_MSGLEN_MAX   65535
 
#define FB_SSL_ERR_BUFSIZ   512
 
#define IPFIX_ENTERPRISE_BIT   0x8000
 

Functions

gboolean fbCollectMessage (fbCollector_t *collector, uint8_t *msgbase, size_t *msglen, GError **err)
 
gboolean fbCollectMessageBuffer (uint8_t *hdr, size_t b_len, size_t *m_len, GError **err)
 
fbCollector_t * fbCollectorAllocSocket (fbListener_t *listener, void *ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
 
fbCollector_t * fbCollectorAllocTLS (fbListener_t *listener, void *ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
 
void fbCollectorFree (fbCollector_t *collector)
 
int fbCollectorGetFD (const fbCollector_t *collector)
 
gboolean fbCollectorHasTranslator (fbCollector_t *collector)
 
void fbCollectorInterruptSocket (fbCollector_t *collector)
 
void fbCollectorRemoveListenerLastBuf (fBuf_t *fbuf, fbCollector_t *collector)
 
void fbCollectorSetFD (fbCollector_t *collector, int fd)
 
fbConnSpec_t * fbConnSpecCopy (const fbConnSpec_t *spec)
 
void fbConnSpecFree (fbConnSpec_t *spec)
 
gboolean fbConnSpecInitTLS (fbConnSpec_t *spec, gboolean passive, GError **err)
 
gboolean fbConnSpecLookupAI (fbConnSpec_t *spec, gboolean passive, GError **err)
 
void fbExporterFree (fbExporter_t *exporter)
 
uint16_t fbExporterGetMTU (const fbExporter_t *exporter)
 
gboolean fbExportMessage (fbExporter_t *exporter, uint8_t *msgbase, size_t msglen, GError **err)
 
fbTemplate_t * fbInfoElementAllocTypeTemplate2 (fbInfoModel_t *model, gboolean internal, GError **err)
 
gboolean fbInfoElementCopyToTemplate (fbInfoModel_t *model, const fbInfoElement_t *ex_ie, fbTemplateField_t *tmpl_ie, GError **err)
 
gboolean fbInfoElementCopyToTemplateByIdent (const fbInfoModel_t *model, const fbInfoElementSpecId_t *spec, fbTemplateField_t *tmpl_ie, GError **err)
 
gboolean fbInfoElementCopyToTemplateByName (const fbInfoModel_t *model, const fbInfoElementSpec_t *spec, fbTemplateField_t *tmpl_ie, GError **err)
 
void fbInfoElementDebug (gboolean tmpl, const fbInfoElement_t *ie)
 
gboolean fbInfoElementEqual (const fbInfoElement_t *a, const fbInfoElement_t *b)
 
uint32_t fbInfoElementHash (const fbInfoElement_t *ie)
 
const fbInfoElement_t * fbInfoModelAddAlienElement (fbInfoModel_t *model, const fbInfoElement_t *ex_ie)
 
const fbInfoElement_t * fbInfoModelGetElement (const fbInfoModel_t *model, const fbInfoElement_t *ex_ie)
 
gboolean fbInfoModelIsTemplateElementType (const fbTemplate_t *tmpl)
 
void fbListenerAppFree (fbListener_t *listener, void *ctx)
 
gboolean fbListenerCallAppInit (fbListener_t *listener, fbUDPConnSpec_t *spec, GError **err)
 
fbConnSpec_t * fbListenerGetConnSpec (const fbListener_t *listener)
 
void fbListenerRemove (fbListener_t *listener, int fd)
 
void fbListenerRemoveLastBuf (fBuf_t *fbuf, fbListener_t *listener)
 
fbSession_t * fbListenerSetPeerSession (fbListener_t *listener, fbSession_t *session)
 
gboolean fbSessionAddInternalRfc5610Template (fbSession_t *session, GError **err)
 
gboolean fbSessionAddInternalTemplateInfoTemplate (fbSession_t *session, GError **err)
 
void fbSessionClearExtTmplTableFlag (fbSession_t *session)
 
void fbSessionClearIntTmplTableFlag (fbSession_t *session)
 
fbSession_t * fbSessionClone (const fbSession_t *base)
 
int fbSessionExtTmplTableFlagIsSet (fbSession_t *session)
 
fbTemplate_t * fbSessionGetInternalRfc5610Template (fbSession_t *session, uint16_t *tid, GError **err)
 
fbTemplate_t * fbSessionGetInternalTemplateInfoTemplate (fbSession_t *session, uint16_t *tid, GError **err)
 
fbNewTemplateCallback_fn fbSessionGetNewTemplateCallback (const fbSession_t *session)
 
void * fbSessionGetNewTemplateCallbackAppCtx (const fbSession_t *session)
 
uint32_t fbSessionGetSequence (const fbSession_t *session)
 
gboolean fbSessionGetTemplatePair (const fbSession_t *session, uint16_t ext_tid, uint16_t *int_tid, fbTemplate_t **ext_tmpl, fbTemplate_t **int_tmpl, GError **err)
 
int fbSessionIntTmplTableFlagIsSet (fbSession_t *session)
 
void fbSessionSaveTemplateInfo (fbSession_t *session, fbTemplateInfo_t *mdInfo)
 
void fbSessionSetCollector (fbSession_t *session, fbCollector_t *collector)
 
void fbSessionSetSequence (fbSession_t *session, uint32_t sequence)
 
void fbSessionSetTemplateBuffer (fbSession_t *session, fBuf_t *fbuf)
 
void fbSessionSetTemplatePairsDisabled (fbSession_t *session, gboolean disabled)
 
gboolean fbTemplateAllocTemplateInfoTemplates (fbInfoModel_t *model, fbTemplate_t **tmplinfo_v3_tmpl, fbTemplate_t **bl_ie_metadata_tmpl, GError **err)
 
void fbTemplateDebug (const char *label, uint16_t tid, const fbTemplate_t *tmpl)
 
fbTemplateInfo_t * fbTemplateInfoCreateFromRecord (const fbTemplateInfoRecord_t *mdRec, unsigned int mdRecVersion, GError **err)
 
void fbTemplateInfoFillRecord (const fbTemplateInfo_t *mdInfo, fbTemplateInfoRecord_t *mdRec, const fbTemplate_t *stlTemplate, uint16_t stlTid)
 
void fbTemplateInfoRecordClear (fbTemplateInfoRecord_t *mdRec)
 
void fbTemplateInfoRecordInit (fbTemplateInfoRecord_t *mdRec)
 
void fbTemplateInfoSetTemplateId (fbTemplateInfo_t *mdInfo, uint16_t tid)
 
void fbTemplateRelease (fbTemplate_t *tmpl)
 
void fbTemplateRetain (fbTemplate_t *tmpl)
 
gboolean fBufAppendTemplate (fBuf_t *fbuf, uint16_t tmpl_id, const fbTemplate_t *tmpl, gboolean revoked, GError **err)
 
uint16_t fBufGetExportTemplate (const fBuf_t *fbuf)
 
uint16_t fBufGetInternalTemplate (const fBuf_t *fbuf)
 
void fBufRemoveTemplateTcplan (fBuf_t *fbuf, const fbTemplate_t *tmpl)
 
void fBufRewind (fBuf_t *fbuf)
 
void fBufSetSession (fBuf_t *fbuf, fbSession_t *session)
 

Data Structures

struct  fbElementPositions_st
 
struct  fbTemplate_st
 
struct  fbTemplateInfoRecord_st
 
struct  fbUDPConnSpec_st
 
union  fbUDPConnSpec_st.peer
 

Detailed Description

fixbuf IPFIX protocol library private interface.

These calls and structures are intended for the use of libfixbuf modules, and as such are not documented or guaranteed to remain stable in any way. Applications using these calls and structures may have to be modified to track changes to this interface across minor version releases of fixbuf.

Typedef Documentation

◆ fbUDPConnSpec_t

An UDP Connection specifier.

These are managed by the collector. The collector creates one fbUDPConnSpec_t per "UDP session." A UDP session is defined by a unique IP and observation domain."

◆ fbTemplateInfoRecord_t

TemplateInfo options record structure.

This is the form the fbTemplateInfo_t has on the wire.

◆ fbElementPositions_t

fbElementPositions_t supports a variable-sized array that is used to store the index positions of a particular element in Template.

Macro Definition Documentation

◆ IPFIX_ENTERPRISE_BIT

#define IPFIX_ENTERPRISE_BIT   0x8000

define the bit in ID's that marks the Enterprise ID's

◆ FB_MSGLEN_MAX

#define FB_MSGLEN_MAX   65535

definition of the max-size of an fbuf_t buffer, or the default/only size

◆ FB_SSL_ERR_BUFSIZ

#define FB_SSL_ERR_BUFSIZ   512

size of the buffer for OpenSSL error messages

Function Documentation

◆ fBufRewind()

void fBufRewind ( fBuf_t *  fbuf)

fBufRewind

Parameters
fbuf

◆ fBufAppendTemplate()

gboolean fBufAppendTemplate ( fBuf_t *  fbuf,
uint16_t  tmpl_id,
const fbTemplate_t *  tmpl,
gboolean  revoked,
GError **  err 
)

fBufAppendTemplate

Parameters
fbuf
tmpl_id
tmpl
revoked
err
Returns
TRUE on success, FALSE on error

◆ fBufRemoveTemplateTcplan()

void fBufRemoveTemplateTcplan ( fBuf_t *  fbuf,
const fbTemplate_t *  tmpl 
)

fBufRemoveTemplateTcplan

◆ fBufSetSession()

void fBufSetSession ( fBuf_t *  fbuf,
fbSession_t *  session 
)

fBufSetSession

◆ fBufGetExportTemplate()

uint16_t fBufGetExportTemplate ( const fBuf_t *  fbuf)

fBufGetExportTemplate

◆ fBufGetInternalTemplate()

uint16_t fBufGetInternalTemplate ( const fBuf_t *  fbuf)

fBufGetInternalTemplate

◆ fbInfoElementHash()

uint32_t fbInfoElementHash ( const fbInfoElement_t *  ie)

fbInfoElementHash

Parameters
ie

◆ fbInfoElementEqual()

gboolean fbInfoElementEqual ( const fbInfoElement_t *  a,
const fbInfoElement_t *  b 
)

fbInfoElementEqual

Parameters
a
b

◆ fbInfoElementDebug()

void fbInfoElementDebug ( gboolean  tmpl,
const fbInfoElement_t *  ie 
)

fbInfoElementDebug

Parameters
tmpl
ie

◆ fbInfoModelGetElement()

const fbInfoElement_t * fbInfoModelGetElement ( const fbInfoModel_t *  model,
const fbInfoElement_t *  ex_ie 
)

fbInfoModelGetElement

Parameters
model
ex_ie

◆ fbInfoElementCopyToTemplate()

gboolean fbInfoElementCopyToTemplate ( fbInfoModel_t *  model,
const fbInfoElement_t *  ex_ie,
fbTemplateField_t *  tmpl_ie,
GError **  err 
)

fbInfoElementCopyToTemplate

Finds ex_ie in the info model (using its element id and PEN) and updates tmpl_ie to point at it using the length specified in ex_ie. If ex_ie is not in the information model, adds it as an alien element.

Returns TRUE unless the length in ex_ie is invalid for the element's type.

This is only to be used when reading templates from a stream.

Parameters
model
ex_ie
tmpl_ie
err

◆ fbInfoElementCopyToTemplateByName()

gboolean fbInfoElementCopyToTemplateByName ( const fbInfoModel_t *  model,
const fbInfoElementSpec_t *  spec,
fbTemplateField_t *  tmpl_ie,
GError **  err 
)

fbInfoElementCopyToTemplateByName

Finds the element named spec->name in the info model and updates tmpl_ie to point at it using the length spec->len_override.

Returns FALSE if the info model does not contain an element named spec->name. Also returns FALSE if spec->len_override is invalid for the element's type.

Parameters
model
spec
tmpl_ie
err

◆ fbInfoElementCopyToTemplateByIdent()

gboolean fbInfoElementCopyToTemplateByIdent ( const fbInfoModel_t *  model,
const fbInfoElementSpecId_t *  spec,
fbTemplateField_t *  tmpl_ie,
GError **  err 
)

fbInfoElementCopyToTemplateByIdent

Finds the element have the specified spec->enterprise_id and spec->element_id in the info model and updates tmpl_ie to point at it using the length spec->len_override.

Returns FALSE if the info model does not contain an element with the specified ID pair. Also returns FALSE if spec->len_override is invalid for the element's type.

Parameters
model
spec
tmpl_ie
err

◆ fbInfoModelAddAlienElement()

const fbInfoElement_t * fbInfoModelAddAlienElement ( fbInfoModel_t *  model,
const fbInfoElement_t *  ex_ie 
)

fbInfoModelAddAlienElement

Parameters
model
ex_ie
Returns
info_elemnt

◆ fbInfoElementAllocTypeTemplate2()

fbTemplate_t * fbInfoElementAllocTypeTemplate2 ( fbInfoModel_t *  model,
gboolean  internal,
GError **  err 
)

fbInfoElementAllocTypeTemplate2

Parameters
model
internal
err
Returns
tmpl

◆ fbInfoModelIsTemplateElementType()

gboolean fbInfoModelIsTemplateElementType ( const fbTemplate_t *  tmpl)

fbInfoModelIsTemplateElementType

Parameters
tmpl

◆ fbTemplateRetain()

void fbTemplateRetain ( fbTemplate_t *  tmpl)

fbTemplateRetain

Parameters
tmpl

◆ fbTemplateRelease()

void fbTemplateRelease ( fbTemplate_t *  tmpl)

fbTemplateRelease

Parameters
tmpl

◆ fbTemplateDebug()

void fbTemplateDebug ( const char *  label,
uint16_t  tid,
const fbTemplate_t *  tmpl 
)

fbTemplateDebug

Parameters
label
tid
tmpl

◆ fbTemplateInfoCreateFromRecord()

fbTemplateInfo_t * fbTemplateInfoCreateFromRecord ( const fbTemplateInfoRecord_t *  mdRec,
unsigned int  mdRecVersion,
GError **  err 
)

fbTemplateInfoCreateFromRecord

Allocates and initializes a TemplateInfo from data read from a collector.

Parameters
mdRec
mdRecVersion
err

◆ fbTemplateInfoFillRecord()

void fbTemplateInfoFillRecord ( const fbTemplateInfo_t *  mdInfo,
fbTemplateInfoRecord_t *  mdRec,
const fbTemplate_t *  stlTemplate,
uint16_t  stlTid 
)

fbTemplateInfoFillRecord

Parameters
mdInfo
mdRec
stlTemplate
stlTid

◆ fbTemplateInfoSetTemplateId()

void fbTemplateInfoSetTemplateId ( fbTemplateInfo_t *  mdInfo,
uint16_t  tid 
)

fbTemplateInfoSetTemplateId

Parameters
mdInfo
tid

◆ fbTemplateInfoRecordInit()

void fbTemplateInfoRecordInit ( fbTemplateInfoRecord_t *  mdRec)

fbTemplateInfoRecordInit

Initalizes a fbTemplateInfoRecord_t

Parameters
mdRec

◆ fbTemplateInfoRecordClear()

void fbTemplateInfoRecordClear ( fbTemplateInfoRecord_t *  mdRec)

Clears any list data used by a fbTemplateInfoRecord_t.

Parameters
mdRec

◆ fbTemplateAllocTemplateInfoTemplates()

gboolean fbTemplateAllocTemplateInfoTemplates ( fbInfoModel_t *  model,
fbTemplate_t **  tmplinfo_v3_tmpl,
fbTemplate_t **  bl_ie_metadata_tmpl,
GError **  err 
)

Allocates new Templates to describe records that hold TemplateInfo.

Parameters
modelThe info model
tmplinfo_v3_tmplIf non-NULL, its referent is set to the internal template that matches metadata records created by fixbuf v3.0.0
bl_ie_metadata_tmplIf non-NULL, its referent is set to the template that matches basicList-contents records used the subTemplateList on the metadata record created by fixbuf v3.0.0
err
Returns
TRUE on success; FALSE on error

◆ fbSessionGetNewTemplateCallback()

fbNewTemplateCallback_fn fbSessionGetNewTemplateCallback ( const fbSession_t *  session)

Returns the callback function for a given session.

Parameters
session
Returns
the callback function variable in the session

◆ fbSessionGetNewTemplateCallbackAppCtx()

void * fbSessionGetNewTemplateCallbackAppCtx ( const fbSession_t *  session)

Returns the callback function's application context for a given session.

Parameters
session
Returns
the Application context pointer added to the session

◆ fbSessionClone()

fbSession_t * fbSessionClone ( const fbSession_t *  base)

fbSessionClone

Parameters
base

◆ fbSessionGetSequence()

uint32_t fbSessionGetSequence ( const fbSession_t *  session)

fbSessionGetSequence

Parameters
session

◆ fbSessionSetSequence()

void fbSessionSetSequence ( fbSession_t *  session,
uint32_t  sequence 
)

fbSessionSetSequence

Parameters
session
sequence

◆ fbSessionSetTemplateBuffer()

void fbSessionSetTemplateBuffer ( fbSession_t *  session,
fBuf_t *  fbuf 
)

fbSessionSetTemplateBuffer

Parameters
session
fbuf

◆ fbSessionGetTemplatePair()

gboolean fbSessionGetTemplatePair ( const fbSession_t *  session,
uint16_t  ext_tid,
uint16_t *  int_tid,
fbTemplate_t **  ext_tmpl,
fbTemplate_t **  int_tmpl,
GError **  err 
)

Checks for a template pair and finds the associated external and internal templates.

Acts like fbSessionLookupTemplatePair() when ext_tmpl and int_tmpl are NULL. Otherwise:

Sets the referent of ext_tmpl to the external template associated with ext_tid. If no external template exists, sets the referents of all output parameters to zero or NULL and returns FALSE.

If no template pairs are defined or they are disabled (fbSessionSetTemplatePairsDisabled()), sets the referents of int_tmpl and int_tid to the external values and returns TRUE.

If there is no matching internal ID paired with ext_tid or it was explicitly disabled, sets the referents of int_tid and int_tmpl to 0 and NULL and returns TRUE.

If there is a template pair, checks for an interal template having the paired ID. If found, sets the referent of int_tmpl to the value, sets the referent of int_tid to the paired ID, and returns TRUE.

If no internal template having the paired ID exists and the paired ID equals ext_tid, sets the referents of int_tmpl and int_tid to the external values and returns TRUE.

Otherwise, sets an error and returns FALSE.

Parameters
session
ext_tid
int_tid
ext_tmpl
int_tmpl
err

◆ fbSessionSetTemplatePairsDisabled()

void fbSessionSetTemplatePairsDisabled ( fbSession_t *  session,
gboolean  disabled 
)

Sets the flag on a Session that says whether the template-pairs lookup table should be ignored.

If disabled is TRUE, the template-pairs table is ignored and fbSessionLookupTemplatePair() always returns the template ID it is given. If disabled is FALSE, the template-pairs table is used.

Parameters
session
disabled

◆ fbSessionSetCollector()

void fbSessionSetCollector ( fbSession_t *  session,
fbCollector_t *  collector 
)

fbSessionSetCollector

Parameters
session
collector

◆ fbSessionClearIntTmplTableFlag()

void fbSessionClearIntTmplTableFlag ( fbSession_t *  session)

fbSessionClearIntTmplTableFlag

Parameters
session

◆ fbSessionClearExtTmplTableFlag()

void fbSessionClearExtTmplTableFlag ( fbSession_t *  session)

fbSessionClearExtTmplTableFlag

Parameters
session

◆ fbSessionIntTmplTableFlagIsSet()

int fbSessionIntTmplTableFlagIsSet ( fbSession_t *  session)

fbSessionIntTmplTableFlagIsSet

Parameters
session

◆ fbSessionExtTmplTableFlagIsSet()

int fbSessionExtTmplTableFlagIsSet ( fbSession_t *  session)

fbSessionExtTmplTableFlagIsSet

Parameters
session

◆ fbSessionSaveTemplateInfo()

void fbSessionSaveTemplateInfo ( fbSession_t *  session,
fbTemplateInfo_t *  mdInfo 
)

fbSessionSaveTemplateInfo

Parameters
session
mdInfo

◆ fbSessionAddInternalRfc5610Template()

gboolean fbSessionAddInternalRfc5610Template ( fbSession_t *  session,
GError **  err 
)

fbSessionAddInternalRfc5610Template

Adds an internal template for reading RFC5610 records (Info Element Type definitions) unless it already exists. Use fbSessionGetInternalRfc5610Template() to get this template.

Parameters
session
err

◆ fbSessionGetInternalRfc5610Template()

fbTemplate_t * fbSessionGetInternalRfc5610Template ( fbSession_t *  session,
uint16_t *  tid,
GError **  err 
)

fbSessionGetInternalRfc5610Template

Gets the internal template for reading RFC5610 records (InfoElement Type defintions) set by fbSessionAddInternalRfc5610Template(). If tid is not NULL, it referent is set to the Template ID.

Parameters
session
tid
err

◆ fbSessionAddInternalTemplateInfoTemplate()

gboolean fbSessionAddInternalTemplateInfoTemplate ( fbSession_t *  session,
GError **  err 
)

fbSessionAddInternalTemplateInfoTemplate

Adds an internal template for reading TemplateInfo records unless it already exists. Use fbSessionGetInternalTemplateInfoTemplate() to get this Template.

Does not allocate an internal template for the STL that the fbTemplateInfo_t contains since it is not needed: When decoding the TemplateInfo, any existing template-pairs are ignored and the external template is used as the internal template.

Parameters
session
err

◆ fbSessionGetInternalTemplateInfoTemplate()

fbTemplate_t * fbSessionGetInternalTemplateInfoTemplate ( fbSession_t *  session,
uint16_t *  tid,
GError **  err 
)

fbSessionGetInternalTemplateInfoTemplate

Gets the internal template for reading TemplateInfo records. If tid is not NULL, its referent is to the Template ID. This Template is created by fbSessionAddInternalTemplateInfoTemplate().

Parameters
session
tid
err

◆ fbConnSpecLookupAI()

gboolean fbConnSpecLookupAI ( fbConnSpec_t *  spec,
gboolean  passive,
GError **  err 
)

fbConnSpecLookupAI

Parameters
spec
passive
err

◆ fbConnSpecInitTLS()

gboolean fbConnSpecInitTLS ( fbConnSpec_t *  spec,
gboolean  passive,
GError **  err 
)

fbConnSpecInitTLS

Parameters
spec
passive
err

◆ fbConnSpecCopy()

fbConnSpec_t * fbConnSpecCopy ( const fbConnSpec_t *  spec)

fbConnSpecCopy

Parameters
spec

◆ fbConnSpecFree()

void fbConnSpecFree ( fbConnSpec_t *  spec)

fbConnSpecFree

Parameters
spec

◆ fbExporterGetMTU()

uint16_t fbExporterGetMTU ( const fbExporter_t *  exporter)

fbExporterGetMTU

Parameters
exporter

◆ fbExportMessage()

gboolean fbExportMessage ( fbExporter_t *  exporter,
uint8_t *  msgbase,
size_t  msglen,
GError **  err 
)

fbExportMessage

Parameters
exporter
msgbase
msglen
err

◆ fbExporterFree()

void fbExporterFree ( fbExporter_t *  exporter)

fbExporterFree

Parameters
exporter

◆ fbCollectorRemoveListenerLastBuf()

void fbCollectorRemoveListenerLastBuf ( fBuf_t *  fbuf,
fbCollector_t *  collector 
)

fbCollectorRemoveListenerLastBuf

Parameters
fbuf
collector

◆ fbCollectorAllocSocket()

fbCollector_t * fbCollectorAllocSocket ( fbListener_t *  listener,
void *  ctx,
int  fd,
struct sockaddr *  peer,
size_t  peerlen,
GError **  err 
)

fbCollectorAllocSocket

Parameters
listener
ctx
fd
peer
peerlen
err

◆ fbCollectorAllocTLS()

fbCollector_t * fbCollectorAllocTLS ( fbListener_t *  listener,
void *  ctx,
int  fd,
struct sockaddr *  peer,
size_t  peerlen,
GError **  err 
)

fbCollectorAllocTLS

Parameters
listener
ctx
fd
peer
peerlen
err

◆ fbCollectMessage()

gboolean fbCollectMessage ( fbCollector_t *  collector,
uint8_t *  msgbase,
size_t *  msglen,
GError **  err 
)

fbCollectMessage

Parameters
collector
msgbase
msglen
err

◆ fbCollectorGetFD()

int fbCollectorGetFD ( const fbCollector_t *  collector)

fbCollectorGetFD

Parameters
collector

◆ fbCollectorSetFD()

void fbCollectorSetFD ( fbCollector_t *  collector,
int  fd 
)

fbCollectorSetFD

◆ fbCollectorFree()

void fbCollectorFree ( fbCollector_t *  collector)

fbCollectorFree

Parameters
collector

◆ fbCollectorHasTranslator()

gboolean fbCollectorHasTranslator ( fbCollector_t *  collector)

fbCollectorHasTranslator

Parameters
collector

◆ fbCollectMessageBuffer()

gboolean fbCollectMessageBuffer ( uint8_t *  hdr,
size_t  b_len,
size_t *  m_len,
GError **  err 
)

fbCollectMessageBuffer

used for applications that manage their own connection, file reading, etc.

Parameters
hdr
b_len
m_len
err
Returns
TRUE/FALSE

◆ fbListenerAppFree()

void fbListenerAppFree ( fbListener_t *  listener,
void *  ctx 
)

fbListenerAppFree

Parameters
listener
ctx

◆ fbListenerRemoveLastBuf()

void fbListenerRemoveLastBuf ( fBuf_t *  fbuf,
fbListener_t *  listener 
)

fbListenerRemoveLastBuf

Parameters
fbuf
listener

◆ fbListenerRemove()

void fbListenerRemove ( fbListener_t *  listener,
int  fd 
)

fbListenerRemove

Parameters
listener
fd

◆ fbListenerGetConnSpec()

fbConnSpec_t * fbListenerGetConnSpec ( const fbListener_t *  listener)

fbListenerGetConnSpec

Parameters
listener

◆ fbCollectorInterruptSocket()

void fbCollectorInterruptSocket ( fbCollector_t *  collector)

Interrupt the socket for a given collector to stop it from reading more data.

Parameters
collectorpointer to the collector to stop reading from

◆ fbListenerCallAppInit()

gboolean fbListenerCallAppInit ( fbListener_t *  listener,
fbUDPConnSpec_t *  spec,
GError **  err 
)

call appinit from UDP

◆ fbListenerSetPeerSession()

fbSession_t * fbListenerSetPeerSession ( fbListener_t *  listener,
fbSession_t *  session 
)

Set the session on the fbuf and listener.


Data Structure Documentation

◆ fbElementPositions_st

struct fbElementPositions_st

fbElementPositions_t supports a variable-sized array that is used to store the index positions of a particular element in Template.

Data Fields
uint16_t count The length of the array of positions.
uint16_t * positions The list of positions; resized as needed.

◆ fbTemplate_st

struct fbTemplate_st

An IPFIX template or options template structure.

Part of the private interface. Applications should use the fbTemplate calls defined in public.h to manipulate templates instead of accessing this structure directly.

Data Fields
fbInfoModel_t * model Information model (for looking up information elements by spec)
fbTemplateField_t ** ie_ary Ordered array of pointers to information elements in this template.
GHashTable * indices Map of information element to index in ie_ary.
uint16_t * off_cache Field offset cache.

For internal use by the transcoder.

int ref_count Reference count.
uint16_t ie_count Count of information elements in template.
uint16_t scope_count Count of scope information elements in template.

If scope_count is greater than 0, this template is an options template.

uint16_t ie_len Total length of information elements in records described by this template.

If the is_varlen flag is set, this represents the minimum length of the information elements in the record (i.e. with each variable length IE's length set to 0).

uint16_t ie_internal_len Total length required to store this template in memory.

Uses sizeof(fbVarfield_t), sizeof(fbBasicList_t), etc instead of 0 as done with ie_len.

uint16_t tmpl_len Total length of the template record or options template record defining this template.

Used during template input and output.

gboolean is_varlen TRUE if this template contains any variable length IEs.
gboolean contains_list TRUE if this template contains any structured data (lists).
gboolean active TRUE if this template has been activated (is no longer mutable).
gboolean default_length TRUE if any field was created using an fbInfoElementSpec_t with a defaulted length.
void * tmpl_ctx Template context.

Created and owned by the application when the listener calls the fbNewTemplateCallback_fn.

fbTemplateCtxFree_fn ctx_free Callback to free the ctx pointer when template is freed.
void * app_ctx The application's Context pointer for the ctx_free function.
fbElementPositions_t bl Index positions of the FB_BASIC_LIST elements.
fbElementPositions_t stl Index positions of the FB_SUB_TMPL_LIST elements.
fbElementPositions_t stml Index positions of the FB_SUB_TMPL_MULTI_LIST elements.

◆ fbTemplateInfoRecord_st

struct fbTemplateInfoRecord_st

TemplateInfo options record structure.

This is the form the fbTemplateInfo_t has on the wire.

Data Fields
uint16_t tid Template ID.
uint16_t appLabel
uint16_t parentTid
uint8_t padding[2]
fbVarfield_t name Template name.
fbVarfield_t description Template description (optional)
fbSubTemplateList_t blInfoList List of PEN, IE num pairs.

◆ fbUDPConnSpec_st

struct fbUDPConnSpec_st

An UDP Connection specifier.

These are managed by the collector. The collector creates one fbUDPConnSpec_t per "UDP session." A UDP session is defined by a unique IP and observation domain."

Data Fields
fbSession_t * session pointer to the session for this peer address
void * ctx application context.

Created and owned by the app

union fbUDPConnSpec_st.peer peer key to this conn spec
size_t peerlen size of peer
struct fbUDPConnSpec_st * next link to next one in list
struct fbUDPConnSpec_st * prev doubly linked to timeout faster
time_t last_seen last seen time
uint32_t obdomain with peer address this is the key
gboolean reject reject flag

◆ fbUDPConnSpec_st.peer

union fbUDPConnSpec_st.peer

key to this conn spec

Data Fields
struct sockaddr so
struct sockaddr_in ip4
struct sockaddr_in6 ip6