private.h File Reference

fixbuf IPFIX protocol library private interface. More...

#include <fixbuf/public.h>

Go to the source code of this file.

Data Structures

struct  fbUDPConnSpec_st
 An UDP Connection specifier. More...
 
struct  fbTemplate_st
 An IPFIX template or options template structure. More...
 

Macros

#define IPFIX_ENTERPRISE_BIT   0x8000
 define the bit in ID's that marks the Enterprise ID's
 
#define IPFIX_REVERSE_PEN   29305
 This is the Private Enterprise Number defined in the IPFIX standard, see RFC 5102, for reverse flow datum.
 
#define FB_MSGLEN_MAX   65535
 definition of the max-size of an fbuf_t buffer, or the default/only size
 

Typedefs

typedef struct fbUDPConnSpec_st fbUDPConnSpec_t
 An UDP Connection specifier. More...
 

Functions

void fBufRewind (fBuf_t *fbuf)
 fBufRewind More...
 
gboolean fBufAppendTemplate (fBuf_t *fbuf, uint16_t tmpl_id, fbTemplate_t *tmpl, gboolean revoked, GError **err)
 fBufAppendTemplate More...
 
void fBufRemoveTemplateTcplan (fBuf_t *fbuf, fbTemplate_t *tmpl)
 fBufRemoveTemplateTcplan More...
 
void fBufSetSession (fBuf_t *fbuf, fbSession_t *session)
 fBufSetSession More...
 
uint32_t fbInfoElementHash (fbInfoElement_t *ie)
 fbInfoElementHash More...
 
gboolean fbInfoElementEqual (const fbInfoElement_t *a, const fbInfoElement_t *b)
 fbInfoElementEqual More...
 
void fbInfoElementDebug (gboolean tmpl, fbInfoElement_t *ie)
 fbInfoElementDebug More...
 
const fbInfoElement_tfbInfoModelGetElement (fbInfoModel_t *model, fbInfoElement_t *ex_ie)
 fbInfoModelGetElement More...
 
gboolean fbInfoElementCopyToTemplate (fbInfoModel_t *model, fbInfoElement_t *ex_ie, fbInfoElement_t *tmpl_ie)
 fbInfoElementCopyToTemplate More...
 
gboolean fbInfoElementCopyToTemplateByName (fbInfoModel_t *model, const char *name, uint16_t len_override, fbInfoElement_t *tmpl_ie)
 fbInfoElementCopyToTemplateByName More...
 
const fbInfoElement_tfbInfoModelAddAlienElement (fbInfoModel_t *model, fbInfoElement_t *ex_ie)
 fbInfoModelAddAlienElement More...
 
void fbTemplateRetain (fbTemplate_t *tmpl)
 fbTemplateRetain More...
 
void fbTemplateRelease (fbTemplate_t *tmpl)
 fbTemplateRelease More...
 
void fbTemplateFree (fbTemplate_t *tmpl)
 fbTemplateFree More...
 
void fbTemplateDebug (const char *label, uint16_t tid, fbTemplate_t *tmpl)
 fbTemplateDebug More...
 
fbNewTemplateCallback_fn fbSessionTemplateCallback (fbSession_t *session)
 Returns the callback function for a given session. More...
 
fbTemplateCtxCallback2_fn fbSessionTemplateCtxCallback (fbSession_t *session)
 Return the ctx callback function for a given session. More...
 
void * fbSessionTemplateCtxCallbackAppCtx (fbSession_t *session)
 Return the ctx callback function's application context for a given session. More...
 
fbSession_tfbSessionClone (fbSession_t *base)
 fbSessionClone More...
 
uint32_t fbSessionGetSequence (fbSession_t *session)
 fbSessionGetSequence More...
 
void fbSessionSetSequence (fbSession_t *session, uint32_t sequence)
 fbSessionSetSequence More...
 
void fbSessionSetTemplateBuffer (fbSession_t *session, fBuf_t *fbuf)
 fbSessionSetTemplateBuffer More...
 
void fbSessionSetCollector (fbSession_t *session, fbCollector_t *collector)
 fbSessionSetCollector More...
 
void fbSessionClearIntTmplTableFlag (fbSession_t *session)
 
void fbSessionClearExtTmplTableFlag (fbSession_t *session)
 
int fbSessionIntTmplTableFlagIsSet (fbSession_t *session)
 
int fbSessionExtTmplTableFlagIsSet (fbSession_t *session)
 
gboolean fbConnSpecLookupAI (fbConnSpec_t *spec, gboolean passive, GError **err)
 fbConnSpecLookupAI More...
 
gboolean fbConnSpecInitTLS (fbConnSpec_t *spec, gboolean passive, GError **err)
 fbConnSpecInitTLS More...
 
fbConnSpec_tfbConnSpecCopy (fbConnSpec_t *spec)
 fbConnSpecCopy More...
 
void fbConnSpecFree (fbConnSpec_t *spec)
 fbConnSpecFree More...
 
uint16_t fbExporterGetMTU (fbExporter_t *exporter)
 fbExporterGetMTU More...
 
gboolean fbExportMessage (fbExporter_t *exporter, uint8_t *msgbase, size_t msglen, GError **err)
 fbExportMessage More...
 
void fbExporterFree (fbExporter_t *exporter)
 fbExporterFree More...
 
void fbCollectorRemoveListenerLastBuf (fBuf_t *fbuf, fbCollector_t *collector)
 fbCollectorRemoveListenerLastBuf More...
 
fbCollector_tfbCollectorAllocSocket (fbListener_t *listener, void *ctx, int fd, struct sockaddr *peer, size_t peerlen)
 fbCollectorAllocSocket More...
 
fbCollector_tfbCollectorAllocTLS (fbListener_t *listener, void *ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
 fbCollectorAllocTLS More...
 
gboolean fbCollectMessage (fbCollector_t *collector, uint8_t *msgbase, size_t *msglen, GError **err)
 fbCollectMessage More...
 
int fbCollectorGetFD (fbCollector_t *collector)
 fbCollectorGetFD More...
 
void fbCollectorSetFD (fbCollector_t *collector, int fd)
 fbCollectorSetFD More...
 
void fbCollectorFree (fbCollector_t *collector)
 fbCollectorFree More...
 
gboolean fbCollectorHasTranslator (fbCollector_t *collector)
 fbCollectorHasTranslator More...
 
gboolean fbCollectMessageBuffer (uint8_t *hdr, size_t b_len, size_t *m_len, GError **err)
 fbCollectMessageBuffer More...
 
void fbListenerAppFree (fbListener_t *listener, void *ctx)
 fbListenerAppFree More...
 
void fbListenerRemoveLastBuf (fBuf_t *fbuf, fbListener_t *listener)
 fbListenerRemoveLastBuf More...
 
void fbListenerRemove (fbListener_t *listener, int fd)
 fbListenerRemove More...
 
fbConnSpec_tfbListenerGetConnSpec (fbListener_t *listener)
 fbListenerGetConnSpec More...
 
void fbCollectorInterruptSocket (fbCollector_t *collector)
 Interrupt the socket for a given collector to stop it from reading more data. More...
 
gboolean fbListenerCallAppInit (fbListener_t *listener, fbUDPConnSpec_t *spec, GError **err)
 call appinit from UDP More...
 
fbSession_tfbListenerSetPeerSession (fbListener_t *listener, fbSession_t *session)
 Set the session on the fbuf and listener.
 

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

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."

Function Documentation

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

fbCollectMessage

Parameters
collector
msgbase
msglen
err
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
fbCollector_t* fbCollectorAllocSocket ( fbListener_t listener,
void *  ctx,
int  fd,
struct sockaddr *  peer,
size_t  peerlen 
)

fbCollectorAllocSocket

Parameters
listener
ctx
fd
peer
peerlen
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
void fbCollectorFree ( fbCollector_t collector)

fbCollectorFree

Parameters
collector
int fbCollectorGetFD ( fbCollector_t collector)

fbCollectorGetFD

Parameters
collector
gboolean fbCollectorHasTranslator ( fbCollector_t collector)

fbCollectorHasTranslator

Parameters
collector
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
void fbCollectorRemoveListenerLastBuf ( fBuf_t fbuf,
fbCollector_t collector 
)

fbCollectorRemoveListenerLastBuf

Parameters
fbuf
collector
void fbCollectorSetFD ( fbCollector_t collector,
int  fd 
)

fbCollectorSetFD

fbConnSpec_t* fbConnSpecCopy ( fbConnSpec_t spec)

fbConnSpecCopy

Parameters
spec
void fbConnSpecFree ( fbConnSpec_t spec)

fbConnSpecFree

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

fbConnSpecInitTLS

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

fbConnSpecLookupAI

Parameters
spec
passive
err
void fbExporterFree ( fbExporter_t exporter)

fbExporterFree

Parameters
exporter
uint16_t fbExporterGetMTU ( fbExporter_t exporter)

fbExporterGetMTU

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

fbExportMessage

Parameters
exporter
msgbase
msglen
err
gboolean fbInfoElementCopyToTemplate ( fbInfoModel_t model,
fbInfoElement_t ex_ie,
fbInfoElement_t tmpl_ie 
)

fbInfoElementCopyToTemplate

Parameters
model
ex_ie
tmpl_ie
gboolean fbInfoElementCopyToTemplateByName ( fbInfoModel_t model,
const char *  name,
uint16_t  len_override,
fbInfoElement_t tmpl_ie 
)

fbInfoElementCopyToTemplateByName

Parameters
model
name
len_override
tmpl_ie
void fbInfoElementDebug ( gboolean  tmpl,
fbInfoElement_t ie 
)

fbInfoElementDebug

Parameters
tmpl
ie
gboolean fbInfoElementEqual ( const fbInfoElement_t a,
const fbInfoElement_t b 
)

fbInfoElementEqual

Parameters
a
b
uint32_t fbInfoElementHash ( fbInfoElement_t ie)

fbInfoElementHash

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

fbInfoModelAddAlienElement

Parameters
model
ex_ie
Returns
info_elemnt
const fbInfoElement_t* fbInfoModelGetElement ( fbInfoModel_t model,
fbInfoElement_t ex_ie 
)

fbInfoModelGetElement

Parameters
model
ex_ie
void fbListenerAppFree ( fbListener_t listener,
void *  ctx 
)

fbListenerAppFree

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

call appinit from UDP

fbConnSpec_t* fbListenerGetConnSpec ( fbListener_t listener)

fbListenerGetConnSpec

Parameters
listener
void fbListenerRemove ( fbListener_t listener,
int  fd 
)

fbListenerRemove

Parameters
listener
fd
void fbListenerRemoveLastBuf ( fBuf_t fbuf,
fbListener_t listener 
)

fbListenerRemoveLastBuf

Parameters
fbuf
listener
fbSession_t* fbSessionClone ( fbSession_t base)

fbSessionClone

Parameters
base
uint32_t fbSessionGetSequence ( fbSession_t session)

fbSessionGetSequence

Parameters
session
void fbSessionSetCollector ( fbSession_t session,
fbCollector_t collector 
)

fbSessionSetCollector

Parameters
session
collector
void fbSessionSetSequence ( fbSession_t session,
uint32_t  sequence 
)

fbSessionSetSequence

Parameters
session
sequence
void fbSessionSetTemplateBuffer ( fbSession_t session,
fBuf_t fbuf 
)

fbSessionSetTemplateBuffer

Parameters
session
fbuf
fbNewTemplateCallback_fn fbSessionTemplateCallback ( fbSession_t session)

Returns the callback function for a given session.

Parameters
session
Returns
the callback function variable in the session
fbTemplateCtxCallback2_fn fbSessionTemplateCtxCallback ( fbSession_t session)

Return the ctx callback function for a given session.

Parameters
session
Returns
the Context callback function added to the session
void* fbSessionTemplateCtxCallbackAppCtx ( fbSession_t session)

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

Parameters
session
Returns
the Application context pointer added to the session
void fbTemplateDebug ( const char *  label,
uint16_t  tid,
fbTemplate_t tmpl 
)

fbTemplateDebug

Parameters
label
tid
tmpl
void fbTemplateFree ( fbTemplate_t tmpl)

fbTemplateFree

Parameters
tmpl
void fbTemplateRelease ( fbTemplate_t tmpl)

fbTemplateRelease

Parameters
tmpl
void fbTemplateRetain ( fbTemplate_t tmpl)

fbTemplateRetain

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

fBufAppendTemplate

Parameters
fbuf
tmpl_id
tmpl
revoked
err
Returns
TRUE on success, FALSE on error
void fBufRemoveTemplateTcplan ( fBuf_t fbuf,
fbTemplate_t tmpl 
)

fBufRemoveTemplateTcplan

void fBufRewind ( fBuf_t fbuf)

fBufRewind

Parameters
fbuf
void fBufSetSession ( fBuf_t fbuf,
fbSession_t session 
)

fBufSetSession