18#include <fixbuf/autoinc.h>
39#define FIXBUF_CHECK_VERSION(major, minor, release) \
40 (FIXBUF_VERSION_MAJOR > (major) || \
41 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
42 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
43 FIXBUF_VERSION_RELEASE >= (release)))
52#define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
58#define FB_ERROR_TMPL 1
74#define FB_ERROR_IPFIX 4
80#define FB_ERROR_BUFSZ 5
84#define FB_ERROR_IMPL 6
93#define FB_ERROR_NLREAD 8
99#define FB_ERROR_NLWRITE 9
103#define FB_ERROR_NOELEMENT 10
107#define FB_ERROR_CONN 11
112#define FB_ERROR_NETFLOWV9 12
116#define FB_ERROR_TRANSMISC 13
120#define FB_ERROR_SFLOW 14
124#define FB_ERROR_SETUP 15
129#define FB_ERROR_LAXSIZE 16
176#define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, \
177 _min_, _max_, _type_, _desc_) \
178 { _ent_, _num_, _len_, _flags_, _type_, _min_, _max_, _name_, _desc_ }
191#define FB_IE_INIT_FULL_SPLIT(_name_, _ent_, _num_, _len_, \
192 _rev_, _endian_, _semantics_, _units_, \
193 _min_, _max_, _type_, _desc_) \
194 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, \
195 (((_rev_) ? FB_IE_F_REVERSIBLE : 0) | \
196 ((_endian_) ? FB_IE_F_ENDIAN : 0) | \
197 (((_semantic) & 0xFF) << 8) | \
198 (((_units_) & 0xFFFF) << 16)), \
199 _min_, _max_, _type_, _desc_)
206#define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
207 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char *)NULL)
215#define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
226#define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
236#define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
243#define FB_IE_F_NONE 0x00000000
252#define FB_IE_F_ENDIAN 0x00000001
269#define FB_IE_F_REVERSIBLE 0x00000040
281#define FB_IE_F_ALIEN 0x00000080
298#define FB_IE_QUANTITY 0x00000100
307#define FB_IE_TOTALCOUNTER 0x00000200
316#define FB_IE_DELTACOUNTER 0x00000300
325#define FB_IE_IDENTIFIER 0x00000400
334#define FB_IE_FLAGS 0x00000500
343#define FB_IE_LIST 0x00000600
353#define FB_IE_SNMPCOUNTER 0x00000700
363#define FB_IE_SNMPGAUGE 0x00000800
373#define FB_IE_DEFAULT 0x00000000
440#define FB_UNITS_BITS 0x00010000
448#define FB_UNITS_OCTETS 0x00020000
456#define FB_UNITS_PACKETS 0x00030000
464#define FB_UNITS_FLOWS 0x00040000
472#define FB_UNITS_SECONDS 0x00050000
481#define FB_UNITS_MILLISECONDS 0x00060000
490#define FB_UNITS_MICROSECONDS 0x00070000
499#define FB_UNITS_NANOSECONDS 0x00080000
508#define FB_UNITS_WORDS 0x00090000
516#define FB_UNITS_MESSAGES 0x000A0000
524#define FB_UNITS_HOPS 0x000B0000
532#define FB_UNITS_ENTRIES 0x000C0000
540#define FB_UNITS_FRAMES 0x000D0000
549#define FB_UNITS_PORTS 0x000E0000
559#define FB_UNITS_INFERRED 0x000F0000
647#define FB_IE_VARLEN 65535
658#define FB_IE_PEN_REVERSE 29305
670#define FB_IE_VENDOR_BIT_REVERSE 0x4000
677#define FB_IE_REVERSE_STR "reverse"
680#define FB_IE_REVERSE_STRLEN 7
685#define FB_CISCO_GENERIC 9999
692#define FB_CISCO_ASA_EVENT_ID 9998
702#define FB_CISCO_ASA_EVENT_XTRA 9997
849#define fbInfoElementCheckIdent(_ie, _enterpriseNumber, _elementId) \
850 ((_elementId) == (_ie)->num && (_enterpriseNumber) == (_ie)->ent)
857#define fbInfoElementGetDescription(_ie) ((_ie)->description)
866#define fbInfoElementGetId(_ie) ((_ie)->num)
873#define fbInfoElementGetLen(_ie) ((_ie)->len)
881#define fbInfoElementGetMax(_ie) ((_ie)->max)
888#define fbInfoElementGetMin(_ie) ((_ie)->min)
895#define fbInfoElementGetName(_ie) ((_ie)->name)
903#define fbInfoElementGetPEN(_ie) ((_ie)->ent)
911#define fbInfoElementGetSemantics(_ie) \
912 ((fbInfoElementSemantics_t)(FB_IE_SEMANTIC((_ie)->flags)))
920#define fbInfoElementGetType(_ie) \
921 ((fbInfoElementDataType_t)((_ie)->type))
929#define fbInfoElementGetUnits(_ie) \
930 ((fbInfoElementUnits_t)(FB_IE_UNITS((_ie)->units)))
938#define fbInfoElementIsAlien(_ie) (!!((_ie)->flags & FB_IE_F_ALIEN))
946#define fbInfoElementIsEndian(_ie) (!!((_ie)->flags & FB_IE_F_ENDIAN))
954#define fbInfoElementIsReversible(_ie) (!!((_ie)->flags & FB_IE_F_REVERSIBLE))
964#define fbInfoElementIsUnsigned(_ie) \
965 ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_UINT_64)
975#define fbInfoElementIsSigned(_ie) \
976 ((_ie)->type >= FB_INT_8 && (_ie)->type <= FB_INT_64)
985#define fbInfoElementIsInteger(_ie) \
986 ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_INT_64)
995#define fbInfoElementIsFloat(_ie) \
996 ((_ie)->type >= FB_FLOAT_32 && (_ie)->type <= FB_FLOAT_64)
1008#define fbInfoElementIsNumber(_ie) \
1009 ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_FLOAT_64)
1017#define fbInfoElementIsIPAddress(_ie) \
1018 ((_ie)->type >= FB_IP4_ADDR && (_ie)->type <= FB_IP6_ADDR)
1028#define fbInfoElementIsDatetime(_ie) \
1029 ((_ie)->type >= FB_DT_SEC && (_ie)->type <= FB_DT_NANOSEC)
1038#define fbInfoElementIsList(_ie) \
1039 ((_ie)->type >= FB_BASIC_LIST && (_ie)->type <= FB_SUB_TMPL_MULTI_LIST)
1047#define fbInfoElementIsPadding(_ie) (210 == (_ie)->num && 0 == (_ie)->ent)
1092#define FB_TEMPLATEFIELD_INIT {NULL, 0, 0, 0, NULL}
1101#define fbTemplateFieldCheckIdent(_field, _enterpriseNumber, _elementId) \
1102 ((_elementId) == (_field)->canon->num && \
1103 (_enterpriseNumber) == (_field)->canon->ent)
1110#define fbTemplateFieldGetIE(_field) ((_field)->canon)
1118#define fbTemplateFieldGetId(_field) ((_field)->canon->num)
1130#define fbTemplateFieldGetLen(_field) ((_field)->len)
1140#define fbTemplateFieldGetMemsize(_field) \
1141 ((FB_IE_VARLEN != (_field)->len) \
1143 : ((FB_BASIC_LIST == (_field)->canon->type) \
1144 ? sizeof(fbBasicList_t) \
1145 : ((FB_SUB_TMPL_LIST == (_field)->canon->type) \
1146 ? sizeof(fbSubTemplateList_t) \
1147 : ((FB_SUB_TMPL_MULTI_LIST == (_field)->canon->type) \
1148 ? sizeof(fbSubTemplateMultiList_t) \
1149 : sizeof(fbVarfield_t)))))
1157#define fbTemplateFieldGetName(_field) ((_field)->canon->name)
1166#define fbTemplateFieldGetOffset(_field) ((_field)->offset)
1174#define fbTemplateFieldGetPEN(_field) ((_field)->canon->ent)
1182#define fbTemplateFieldGetType(_field) \
1183 ((fbInfoElementDataType_t)((_field)->canon->type))
1200#define fbTemplateFieldGetRepeat(_field) ((_field)->midx)
1223#define FB_TEMPLATE_ITER_NULL {NULL, UINT16_MAX}
1420#define FB_RECORD_INIT {NULL, NULL, 0, 0, 0}
1505#define FB_RECORD_VALUE_INIT \
1506 { NULL, NULL, { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } }
1574#define FB_TID_AUTO 0
1589#define FB_TID_MIN_DATA 256
1596#define FB_IESPEC_NULL { NULL, 0, 0 }
1649#define FB_IESPECID_NULL { {0, 0}, 0, 0 }
1844 const char *description,
1846 uint16_t parentTid);
1855#define FB_TMPL_MD_LEVEL_0 0
1862#define FB_TMPL_MD_LEVEL_1 1
1869#define FB_TMPL_MD_LEVEL_NA 0xFF
1892 uint32_t contentEnt,
1893 uint16_t contentNum);
2069#define FB_CONNSPEC_INIT \
2070 { FB_SCTP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
2302 uint16_t numElements);
2334 uint16_t elementLength,
2335 uint16_t numElements);
2502 const void *currentPtr);
2512#define fbBLNext(type, basicList, current) \
2513 ((type *)(fbBasicListGetNextPtr((basicList), (current))))
2550 uint16_t additional);
2686 uint16_t numElements);
2749 const void *currentPtr);
2760#define fbSTLNext(type, subTemplateList, current) \
2761 ((type *)(fbSubTemplateListGetNextPtr((subTemplateList), (current))))
2854 uint16_t additional);
3030 uint16_t numElements);
3162 uint16_t additional);
3214#define fbSTMLNext(subTemplateMultiList, current) \
3215 fbSubTemplateMultiListGetNextEntry((subTemplateMultiList), (current))
3244 uint16_t numElements);
3286 uint16_t additional);
3336 const void *currentPtr);
3347#define fbSTMLEntryNext(type, subTemplateMultiListEntry, current) \
3348 ((type *)(fbSubTemplateMultiListEntryNextDataPtr( \
3349 (subTemplateMultiListEntry), (current))))
3579 struct sockaddr *peer,
3685 gboolean automatic);
3694 gboolean automatic);
4244 const gchar *filename,
4282 const gchar *xml_data,
4283 gssize xml_data_len,
4484#define FB_TMPL_IS_OPTIONS (1u << 0)
4495#define FB_TMPL_IS_META_ELEMENT (1u << 1)
4504#define FB_TMPL_IS_META_TEMPLATE_V1 (1u << 2)
4513#define FB_TMPL_IS_META_TEMPLATE_V3 (1u << 3)
4522#define FB_TMPL_IS_META_BASICLIST (1u << 4)
4530#define FB_TMPL_IS_META_TMPL_ANY \
4531 (FB_TMPL_IS_OPTIONS | \
4532 FB_TMPL_IS_META_TEMPLATE_V1 | \
4533 FB_TMPL_IS_META_BASICLIST)
4541#define FB_TMPL_IS_META_ANY \
4542 (FB_TMPL_IS_OPTIONS | \
4543 FB_TMPL_IS_META_TMPL_ANY | \
4544 FB_TMPL_IS_META_ELEMENT)
4637 uint32_t wantedFlags,
4656 uint32_t wantedFlags,
4693 uint32_t wantedFlags,
4713 uint32_t wantedFlags,
4724#define FB_TMPL_COPY_REMOVE_PADDING 0x01u
4733#define FB_TMPL_COPY_IGNORE_SCOPE 0x04u
4797 uint16_t scope_count);
5002 uint32_t wantedFlags);
5081 uint32_t wantedFlags);
5113__attribute__((__deprecated__));
5235 unsigned int flags);
5295 uint16_t *matching_fields,
5296 unsigned int flags);
5304#define FB_TMPL_CMP_IGNORE_PADDING 0x01u
5312#define FB_TMPL_CMP_IGNORE_LENGTHS 0x02u
5320#define FB_TMPL_CMP_IGNORE_SCOPE 0x04u
5816 uint16_t tmplInfoTid,
5911 void *exportSession,
6478 struct sockaddr *address,
6479 size_t address_length);
6674 const struct sockaddr *peer,
6695 const struct sockaddr *peer,
6705const struct sockaddr *
6747 gboolean multi_session);
An IPFIX template or options template structure.
Definition: private.h:108
fbCollector_t * fbSessionGetCollector(const fbSession_t *session)
Retrieves the Collector that was associated with session by an explicit call to fBufAllocForCollectio...
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t additional)
Increases the size of the list's internal data buffer to hold additional more elements.
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.h:2142
uint8_t ie_semantic
ie semantic (fbInfoElementSemantics_t)
Definition: public.h:1545
struct fbListenerGroupResult_st * next
Pointer to the next listener group result.
Definition: public.h:2124
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:2077
const char * description
Element description.
Definition: public.h:839
void fBufFree(fBuf_t *fbuf)
Frees a buffer.
const fbTemplateField_t * fbTemplateFindFieldByIdent(const fbTemplate_t *tmpl, uint32_t ent, uint16_t num, uint16_t *position, uint16_t skip)
Searches a Template for a TemplateField by an fbInfoElement_t's private enterprise number and element...
void * fbBasicListGetNextPtr(const fbBasicList_t *basicList, const void *currentPtr)
Retrieves a pointer to the data element in the basicList that follows the one at currentPtr.
void fbBasicListCollectorInit(fbBasicList_t *basicList)
Initializes a BasicList for collection, setting all properties of the list to 0 or NULL.
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Frees a template if it is not currently in use by any Session.
uint16_t fbBasicListInfoGetContentIdent(const fbBasicListInfo_t *blInfo, uint32_t *pen)
Gets from blInfo the element numbers for the fbInfoElement_t that the BasicList contains.
struct fbBasicListInfo_st fbBasicListInfo_t
fbBasicListInfo_t describes a basicList and is used by fbTemplateInfo_t.
Definition: public.h:1792
fbTemplate_t * fBufGetCollectionTemplate(const fBuf_t *fbuf, uint16_t *ext_tid)
Retrieves the external template used to read the last record from the buffer.
uint8_t type
Data Type, an fbInfoElementDataType_t.
Definition: public.h:828
struct timespec dt
Used when ie is FB_DT_SEC, FB_DT_MILSEC, FB_DT_MICROSEC, or FB_DT_NANOSEC.
Definition: public.h:1473
gboolean fbTemplateAppendSpecId(fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec, uint32_t wantedFlags, GError **err)
Potentially appends an information element described by the specifier to a template.
uint16_t fbBasicListCountElements(const fbBasicList_t *basicList)
Returns the number of elements the basic list is capable of holding.
void fbTemplateIterInit(fbTemplateIter_t *iter, const fbTemplate_t *tmpl)
Initializes a TemplateIter to visit the fbTemplateField_t objects in a Template.
uint8_t fbBasicListGetSemantic(const fbBasicList_t *basicList)
Returns the list semantics value (fbListSemantics_t) for a BasicList.
gboolean fbTemplateContainsElementByName(const fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of a given information element (fbInfoElement...
struct fbRecord_st fbRecord_t
fbRecord_t maintains a buffer holding an IPFIX record's data, the fbTemplate_t that describes that da...
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
gboolean fbTemplateInfoInit(fbTemplateInfo_t *tmplInfo, const char *name, const char *description, uint16_t appLabel, uint16_t parentTid)
Initializes a template metadata structure.
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieves a record from a Buffer associated with a collecting process.
void(* fbNewTemplateCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void *app_ctx, void **tmpl_ctx, fbTemplateCtxFree_fn *tmpl_ctx_free_fn)
A callback function that will be called when the session receives a new external template.
Definition: public.h:2170
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP() but for TLS (not tested)
struct fbTemplateField_st fbTemplateField_t
fbTemplateField_t represents an fbInfoElement_t that has been added to an fbTemplate_t.
void * fbBasicListGetDataPtr(const fbBasicList_t *basicList)
Gets a pointer to the data buffer for the basic list.
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Returns a pointer to the next information element in the information model.
gboolean fbRecordFindValueForInfoElement(const fbRecord_t *record, const fbInfoElement_t *ie, fbRecordValue_t *value, uint16_t *position, uint16_t skip)
Searches a Record for an Element and gets its Value.
const fbInfoElement_t * canon
Pointer to canonical IE.
Definition: public.h:1058
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateList, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) of a SubTemplateList.
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocates an empty transport session state container.
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Enables or disables multi-session mode for a fbCollector_t associated with a UDP fbListener_t.
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1630
fbBasicList_t * fbBasicListAlloc(void)
Allocates and returns an empty BasicList.
enum fbListSemantics_en fbListSemantics_t
fbListSemantics_t defines the possible values for the semantics of the structured Data Types: basicLi...
uint16_t tmplID
The ID of the template used to structure the data.
Definition: public.h:2630
uint8_t padding[6]
padding to align within the template
Definition: public.h:1549
gboolean fbTemplateContainsAllArraySpecId(const fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec)
Determines if a template contains at least one instance of each fbInfoElement_t in a specifier array.
fbInfoModel_t * fbInfoModelAlloc(void)
Allocates a new information model.
size_t fbExporterGetMsgLen(const fbExporter_t *exporter)
Gets the (transcoded) message length that was copied to the exporting buffer upon fBufEmit() when usi...
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Removes a template from a session.
void * fbBasicListResize(fbBasicList_t *basicList, uint16_t newCount)
Resizes and zeroes the list's internal buffer for elements.
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Sets the internal template on a buffer to the given template ID.
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Sets an octet array on an fBuf for collection.
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Returns the number of information elements in the information model.
uint16_t fbTemplateGetOptionsScope(const fbTemplate_t *tmpl)
Determines number of scope information elements in a template.
gboolean fbInfoModelReadXMLData(fbInfoModel_t *model, const gchar *xml_data, gssize xml_data_len, GError **err)
Adds information specified in the given XML data to the information model.
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateList)
Frees the data array of subTemplateList and sets all parameters of subTemplateList to 0 or NULL.
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates and returns an empty subTemplateMultiList structure.
struct fbTemplateIter_st fbTemplateIter_t
fbTemplateIter_t iterates over the fbTemplateField_t objects in an fbTemplate_t.
uint16_t fbSessionSetMetadataExportElements(fbSession_t *session, gboolean enabled, uint16_t tid, GError **err)
Configures a session to export type information for enterprise-specific information elements as optio...
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition: public.h:3594
uint8_t * dataPtr
The pointer to the buffer used to hold the data in this list.
Definition: public.h:2611
uint16_t offset
Octet-offset of this field in a record.
Definition: public.h:1071
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Calls fbSubTemplateMultiListEntryClear() for each Entry in STML then frees the STML's data array and ...
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
uint16_t tid
The template ID for tmpl.
Definition: public.h:1411
fbInfoElementSemantics_en
fbInfoElementSemantics_t defines the possible semantics of an fbInfoElement_t.
Definition: public.h:387
@ FB_IE_SEM_FLAGS
Describes an information element as a flags element.
Definition: public.h:411
@ FB_IE_SEM_QUANTITY
Describes an information element as a quantity.
Definition: public.h:395
@ FB_IE_SEM_DELTACOUNTER
Describes an information element as a deltaCounter.
Definition: public.h:403
@ FB_IE_SEM_IDENTIFIER
Describes an information element as an identifier.
Definition: public.h:407
@ FB_IE_SEM_LIST
Describes an information element as a list element.
Definition: public.h:415
@ FB_IE_SEM_SNMPCOUNTER
Describes an information element as an SNMP counter.
Definition: public.h:419
@ FB_IE_SEM_DEFAULT
Describes an information element as having no specific semantics.
Definition: public.h:391
@ FB_IE_SEM_TOTALCOUNTER
Describes an information element as a totalCounter.
Definition: public.h:399
@ FB_IE_SEM_SNMPGAUGE
Describes an information element as a SNMP gauge.
Definition: public.h:423
const char * name
Information element name.
Definition: public.h:1610
uint16_t numElements
The number of elements (sub-records) in the list.
Definition: public.h:2626
fbTemplateInfo_t * fbTemplateInfoCopy(const fbTemplateInfo_t *tmplInfo)
Makes a copy of TemplateInfo.
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.h:2126
const fbTemplateField_t * fbTemplateGetIndexedIE(const fbTemplate_t *tmpl, uint16_t position) __attribute__((__deprecated__))
Deprecated alias for fbTemplateGetFieldByPosition.
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
gboolean fbTemplateContainsAllFlaggedElementsByName(const fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec, uint32_t wantedFlags)
Determines if a template contains at least one instance of each information element in a given inform...
uint16_t ie_id
information element id
Definition: public.h:1541
enum fbInfoElementUnits_en fbInfoElementUnits_t
fbInfoElementUnits_t defines the possible units on an fbInfoElement_t.
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emits the message currently in a buffer using the associated exporting process endpoint.
uint8_t * dataPtr
Pointer to the memory that stores the elements in the list.
Definition: public.h:2248
enum fbInfoElementSemantics_en fbInfoElementSemantics_t
fbInfoElementSemantics_t defines the possible semantics of an fbInfoElement_t.
const fbInfoElement_t * fbInfoModelGetElementByID(const fbInfoModel_t *model, uint16_t id, uint32_t ent)
Returns a pointer to the canonical information element within an information model given the informat...
void * vai
Pointer to address info cache.
Definition: public.h:1766
uint16_t element_id
The numeric identifier of the element within its PEN.
Definition: public.h:1673
const fbTemplate_t * fbSubTemplateListGetTemplate(const fbSubTemplateList_t *subTemplateList)
Gets the template pointer from the list structure.
void fbInfoModelAddElement(fbInfoModel_t *model, const fbInfoElement_t *ie)
Adds a single information element to an information model.
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:2094
gboolean fbTemplateContainsAllFlaggedArraySpecId(const fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec, uint32_t wantedFlags)
Determines if a template contains at least one instance of each fbInfoElement_t in a specifier array ...
fbTransport_en
Transport protocol for connection specifier.
Definition: public.h:1714
@ FB_DTLS_SCTP
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1729
@ FB_DTLS_UDP
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.h:1740
@ FB_TLS_TCP
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1734
@ FB_TCP
Reliable stream transport via TCP.
Definition: public.h:1721
@ FB_SCTP
Partially reliable datagram transport via SCTP.
Definition: public.h:1719
@ FB_UDP
Unreliable datagram transport via UDP.
Definition: public.h:1723
gboolean(* fbListenerAppInit_fn)(fbListener_t *listener, void **ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
Application context initialization function type for fbListener_t.
Definition: public.h:3575
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Accepts connections for multiple listeners.
void fBufSetAutomaticNextMessage(fBuf_t *fbuf, gboolean automatic)
Sets the automatic next-message mode flag on a Buffer.
uint16_t fbBasicListGetElementLength(const fbBasicList_t *basicList)
Returns the octet length of an individual element in the BasicList.
const fbTemplate_t * tmpl
The pointer to the template used to structure the data in this list.
Definition: public.h:2607
gboolean fbTemplateContainsAllElementsByName(const fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of each fbInfoElement_t in a given informatio...
gboolean fBufNextRecord(fBuf_t *fbuf, fbRecord_t *record, GError **err)
Sets the internal template on a Buffer and gets its next record.
gboolean fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Sets the number of information elements in a template that are scope.
uint16_t numElements
The number of elements in the list.
Definition: public.h:2257
struct fbInfoElementOptRec_st fbInfoElementOptRec_t
The corresponding C struct for a record whose template is the RFC 5610 Information Element Type Optio...
size_t recsize
The number of bytes used by the record current in rec.
Definition: public.h:1409
const char * name
Information element name.
Definition: public.h:837
size_t reccapacity
The number of bytes allocated for the rec buffer.
Definition: public.h:1407
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t additional)
Increases the size of the list's internal buffer to hold additional more entries.
void * fbSubTemplateListInit(fbSubTemplateList_t *stl, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes stl with the given parameters and allocates the internal data array to a size capable of ...
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) for the multi list.
const fbBasicList_t * fbRecordFindBasicListOfIE(const fbRecord_t *record, const fbInfoElement_t *contentsElement, uint16_t *position, uint16_t skip)
Searches record for a basicList of contentsElement values.
void fbSessionFree(fbSession_t *session)
Frees a transport session state container.
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocates a new buffer for collection.
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Exports all external templates in the current domain of a given session.
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *subTemplateList)
Initializes a SubTemplateList for collection, setting all properties of the list to 0 or NULL.
gboolean fbListSemanticsIsValid(uint8_t semantic)
Validates the value of a structured data types semantic field, as defined in RFC 6313 and listed at I...
uint16_t fbSessionAddTemplatesForExport(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, fbTemplateInfo_t *tmplInfo, GError **err)
Adds a Template to a Session being used for export as both an internal template and an external templ...
uint16_t ie_units
ie units (fbInfoElementUnits_t)
Definition: public.h:1547
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
Removes an input translator from a given collector such that it will operate on IPFIX protocol again.
fbRecordValue_t * fbRecordValueCopy(fbRecordValue_t *dstValue, const fbRecordValue_t *srcValue)
Copies srcValue to dstValue and returns dstValue.
struct fbInfoElementSpecId_st fbInfoElementSpecId_t
A single IPFIX Information Element specification using the element's numeric identifier and private e...
GHashTableIter fbInfoModelIter_t
An iterator over the information elements in an information model.
Definition: public.h:169
gboolean fbInfoElementAddOptRecElement(fbInfoModel_t *model, const fbInfoElementOptRec_t *rec)
Adds an element that we received via an RFC 5610 Options Record to the given info model.
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.h:715
@ FB_DT_MICROSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:770
@ FB_STRING
The "string" data type: A finite-length string of valid characters from the Unicode character encodin...
Definition: public.h:757
@ FB_DT_SEC
The "dateTimeSeconds" data type: An unsigned 32-bit integer containing the number of seconds since th...
Definition: public.h:761
@ FB_INT_8
The "signed8" data type: An integer value in the range of -128 to 127.
Definition: public.h:734
@ FB_UINT_16
The "unsigned16" data type: A non-negative integer value in the range of 0 to 65535 (0xFFFF).
Definition: public.h:724
@ FB_UINT_64
The "unsigned64" data type: A non-negative integer value in the range of 0 to 18_446_744_073_709_551_...
Definition: public.h:731
@ FB_FLOAT_64
The "float64" data type: An IEEE double-precision 64-bit floating point type.
Definition: public.h:749
@ FB_SUB_TMPL_MULTI_LIST
The "subTemplateMultiList" data type: A structured data element as described in RFC6313,...
Definition: public.h:788
@ FB_SUB_TMPL_LIST
The "subTemplateList" data type: A structured data element as described in RFC6313,...
Definition: public.h:785
@ FB_BOOL
The "boolean" data type: A binary value: "true" or "false".
Definition: public.h:751
@ FB_UINT_32
The "unsigned32" data type: A non-negative integer value in the range of 0 to 4_294_967_295 (0xFFFFFF...
Definition: public.h:727
@ FB_IP6_ADDR
The "ipv6Address" data type: A value of an IPv6 address.
Definition: public.h:779
@ FB_INT_32
The "signed32" data type: An integer value in the range of -2_147_483_648 to 2_147_483_647.
Definition: public.h:740
@ FB_UINT_8
The "unsigned8" data type: A non-negative integer value in the range of 0 to 255 (0xFF).
Definition: public.h:721
@ FB_INT_64
The "signed64" data type: An integer value in the range of -9_223_372_036_854_775_808 to 9_223_372_03...
Definition: public.h:743
@ FB_OCTET_ARRAY
The "octetArray" data type: A finite-length string of octets.
Definition: public.h:718
@ FB_DT_NANOSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:775
@ FB_FLOAT_32
The "float32" data type: An IEEE single-precision 32-bit floating point type.
Definition: public.h:746
@ FB_BASIC_LIST
The "basicList" data type: A structured data element as described in RFC6313, Section 4....
Definition: public.h:782
@ FB_MAC_ADDR
The "macAddress" data type: A MAC-48 address as a string of 6 octets.
Definition: public.h:754
@ FB_INT_16
The "signed16" data type: An integer value in the range of -32768 to 32767.
Definition: public.h:737
@ FB_DT_MILSEC
The "dateTimeMilliseconds" data type: An unsigned 64-bit integer containing the number of millisecond...
Definition: public.h:765
@ FB_IP4_ADDR
The "ipv4Address" data type: A value of an IPv4 address.
Definition: public.h:777
uint16_t fbSubTemplateMultiListEntryGetTemplateID(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the template ID for the template used to structure the data.
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates and returns an empty subTemplateList structure.
size_t fbExporterGetOctetCountAndReset(fbExporter_t *exporter)
Gets the number of octets that have been written to the exporter's file, socket, or buffer since the ...
const fbTemplate_t * tmpl
The pointer to the template used to structure the data in this entry.
Definition: public.h:2969
void fbBasicListSetSemantic(fbBasicList_t *basicList, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) for describing a basic list.
const fbInfoElement_t * fbInfoModelGetElementByName(const fbInfoModel_t *model, const char *name)
Returns a pointer to the canonical information element within an information model given the informat...
uint32_t flags
Application flags word.
Definition: public.h:1638
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, fbTemplateInfo_t *tmplInfo, GError **err)
Adds a Template to a Session.
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.h:2128
fbTemplatesSetCompareStatus_t fbTemplatesSetCompare(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2, uint16_t *matching_fields, unsigned int flags)
Compares two Templates to determine if one is a subset of the other.
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Frees the listener group result returned from fbListenerGroupWait().
gboolean fBufSetAutomaticElementInsert(fBuf_t *fbuf, GError **err)
Enables automatic insertion of RFC 5610 elements read from a Buffer.
fbTemplate_t * fBufNextCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid, GError **err)
Retrieves the external template that will be used to read the next record from the buffer.
void * fbBasicListInit(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes a BasicList for export.
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Deprecated.
fbExporter_t * fbExporterAllocFile(const char *path)
Allocates an exporting process endpoint for a named file.
void * fbSubTemplateListGetIndexedDataPtr(const fbSubTemplateList_t *subTemplateList, uint16_t index)
Returns the data for the record at position index in the sub template list, or returns NULL if index ...
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Waits on a listener.
void fbSessionAddTemplatePair(fbSession_t *session, uint16_t ext_tid, uint16_t int_tid)
Adds an external-internal fbTemplate_t mapping pair for list elements in a Session.
const fbInfoElement_t * fbBasicListGetInfoElement(const fbBasicList_t *basicList)
Returns a pointer to the information element used in the basic list.
uint16_t fbSessionGetTemplatePath(const fbSession_t *session, const fbTemplateInfo_t *tmplInfo, uint16_t path[], uint16_t path_size, GError **err)
Finds the template path of the fbTemplate_t described by tmplInfo.
gchar * fbRecordValueTakeVarfieldBuf(fbRecordValue_t *value)
Returns a pointer to the string buffer used by value to store fbVarfield_t values and transfers owner...
uint8_t semantic
The semantic value to describe the contents of the list, a value defined in fbListSemantics_t.
Definition: public.h:2266
void * fbBasicListInitWithLength(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t elementLength, uint16_t numElements)
Initializes a BasicList for export using a user-specified element length.
uint16_t fbSubTemplateListGetTemplateID(const fbSubTemplateList_t *subTemplateList)
Gets the template ID for the template used by the list.
void * fbBasicListGetIndexedDataPtr(const fbBasicList_t *basicList, uint16_t index)
Retrieves the element at position index in the basic list or returns NULL if index is out of range.
enum fbTemplateSetCompareStatus_en fbTemplatesSetCompareStatus_t
Defines the values returned by fbTemplatesSetCompare() when checking whether one fbTemplate_t is a su...
gboolean fbTemplateAppend(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie, GError **err)
Appends an information element to a template.
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait(), except that this function does not moni...
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t additional)
Increases the size of the entry's internal buffer to hold additional more elements (sub-records).
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:164
gboolean fbInfoElementWriteOptionsRecord(fBuf_t *fbuf, const fbInfoElement_t *model_ie, uint16_t itid, uint16_t etid, GError **err)
Exports an options record to the given fbuf with information element type information about the given...
fbExporter_t * fbExporterAllocNet(const fbConnSpec_t *spec)
Allocates an exporting process endpoint for a network connection.
uint16_t dataLength
The length of the buffer used to store the elements in the list.
Definition: public.h:2261
const char * fbTemplateInfoGetDescription(const fbTemplateInfo_t *tmplInfo)
Returns the description value specified in fbTemplateInfoInit().
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocates an exporting process to use the existing buffer buf having the specified size.
fbInfoElementUnits_en
fbInfoElementUnits_t defines the possible units on an fbInfoElement_t.
Definition: public.h:572
@ FB_IE_UNITS_MICROSECONDS
Describes an information element as counting microseconds.
Definition: public.h:604
@ FB_IE_UNITS_FLOWS
Describes an information element as counting flows.
Definition: public.h:592
@ FB_IE_UNITS_WORDS
Describes an information element as counting 4-octet words, as for IPv4-header length.
Definition: public.h:613
@ FB_IE_UNITS_SECONDS
Describes an information element as counting seconds.
Definition: public.h:596
@ FB_IE_UNITS_PORTS
Describes an information element as counting ports.
Definition: public.h:635
@ FB_IE_UNITS_MILLISECONDS
Describes an information element as counting milliseconds.
Definition: public.h:600
@ FB_IE_UNITS_MESSAGES
Describes an information element as counting messages.
Definition: public.h:617
@ FB_IE_UNITS_NONE
Describes an information element as having no units.
Definition: public.h:576
@ FB_IE_UNITS_FRAMES
Describes an information element as counting frames, as for Layer 2 frames.
Definition: public.h:631
@ FB_IE_UNITS_OCTETS
Describes an information element as counting octets.
Definition: public.h:584
@ FB_IE_UNITS_NANOSECONDS
Describes an information element as counting nanoseconds.
Definition: public.h:608
@ FB_IE_UNITS_INFERRED
Describes an information element as having units inferred from some other element.
Definition: public.h:641
@ FB_IE_UNITS_PACKETS
Describes an information element as counting packets.
Definition: public.h:588
@ FB_IE_UNITS_HOPS
Describes an information element as counting hops, as for TTL.
Definition: public.h:621
@ FB_IE_UNITS_ENTRIES
Describes an information element as counting entries, as for MPLS label stack.
Definition: public.h:626
@ FB_IE_UNITS_BITS
Describes an information element as counting bits.
Definition: public.h:580
void * fbSubTemplateListResize(fbSubTemplateList_t *subTemplateList, uint16_t newCount)
Resizes and zeroes the list's internal buffer for elements (sub-records).
void fbListenerGroupFree(fbListenerGroup_t *group)
Frees a listener group.
struct fbListenerEntry_st fbListenerEntry_t
ListenerEntry's make up an fbListenerGroup_t as a linked list.
void fbTemplateInfoAddBasicList(fbTemplateInfo_t *tmplInfo, uint32_t blEnt, uint16_t blNum, uint32_t contentEnt, uint16_t contentNum)
Adds a description for an fbBasicList_t that is used by the fbTemplate_t described by tmplInfo.
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Reads a new message into a buffer using the associated collecting process endpoint.
uint16_t fbSubTemplateListCountElements(const fbSubTemplateList_t *subTemplateList)
Returns the number of elements (sub-records) the sub template list is capable of holding.
struct fbTemplateInfo_st fbTemplateInfo_t
fbTemplateInfo_t describes an fbTemplate_t.
Definition: public.h:1782
void fbBasicListFree(fbBasicList_t *basicList)
Frees the data array of basicList (fbBasicListClear()), then frees basicList itself.
void fbListenerInterrupt(fbListener_t *listener)
Causes the current or next call to fbListenerWait() to unblock and return.
fbVarfield_t varfield
Used when ie is FB_STRING or FB_OCTET_ARRAY.
Definition: public.h:1466
uint16_t fbSessionLookupTemplatePair(const fbSession_t *session, uint16_t ext_tid)
Finds the internal template ID to use for sub-records in a list that use the external template ext_ti...
void fbExporterAutoStream(fbExporter_t *exporter)
Enables automatic SCTP stream selection for the next message exported.
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Sets the current observation domain on a session.
const fbTemplateField_t * fbTemplateFindFieldByElement(const fbTemplate_t *tmpl, const fbInfoElement_t *ie, uint16_t *position, uint16_t skip)
Searches a Template for an Information Element and returns a TemplateField if found.
char * ssl_ca_file
Path to certificate authority file.
Definition: public.h:1755
uint16_t fbTemplateInfoGetTemplateId(const fbTemplateInfo_t *tmplInfo)
Returns the Template ID value associated with this TemplateInfo.
gboolean fbRecordCopyToTemplate(const fbRecord_t *srcRec, fbRecord_t *dstRec, const fbTemplate_t *tmpl, uint16_t tid, GError **err)
Copies a Record to a destination Record that uses a different Template.
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.h:1711
fbTransport_t transport
Transport protocol to use.
Definition: public.h:1749
gboolean fBufSetTemplatesForExport(fBuf_t *fbuf, uint16_t tid, GError **err)
Sets the internal and external templates on a Buffer to the given template ID.
struct fbListenerEntry_st * next
pointer to the next listener entry in the linked list
Definition: public.h:2110
void * fbSubTemplateMultiListEntryInit(fbSubTemplateMultiListEntry_t *entry, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes entry with the given parameters and allocates the internal data array to a size capable o...
void fbInfoModelFree(fbInfoModel_t *model)
Frees an information model.
const fbTemplateField_t * fbTemplateFindFieldByDataType(const fbTemplate_t *tmpl, fbInfoElementDataType_t datatype, uint16_t *position, uint16_t skip)
Searches a Template for a TemplateField by an fbInfoElement_t's datatype.
fbTemplate_t * fbInfoElementAllocTypeTemplate(fbInfoModel_t *model, GError **err)
Allocates and returns the Options Template that will be used to define Information Element Type Recor...
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListInit(fbSubTemplateMultiList_t *STML, uint8_t semantic, uint16_t numElements)
Initializes the multi list with the list semantic and allocates a data array to store numElements ent...
uint16_t tmplID
The ID of the template used to structure the data in this entry.
Definition: public.h:2990
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.h:1771
const fbBasicList_t * bl
Used when ie is FB_BASIC_LIST.
Definition: public.h:1451
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListResize(fbSubTemplateMultiList_t *STML, uint16_t newCount)
Resizes and zeroes the list's internal buffer for entries (fbSubTemplateMultiListEntry_t).
const fbTemplate_t * fbTemplateIterGetTemplate(const fbTemplateIter_t *iter)
Returns the Template to which the TemplateIter is bound.
uint64_t u64
Used when ie is FB_UINT_8, FB_UINT_16, FB_UINT_32, FB_UINT_64, or FB_BOOL (0 == false,...
Definition: public.h:1482
const fbSubTemplateMultiList_t * stml
Used when ie is FB_SUB_TMPL_MULTI_LIST.
Definition: public.h:1459
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateList)
Frees the data array of subTemplateList (fbSubTemplateListClear()), then frees subTemplateList itself...
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Sets all parameters of basicList to 0 or NULL except for the internal data array and its allocated le...
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Sets the SCTP stream for the next message exported.
GString * stringbuf
An internal buffer used to store the varfield value.
Definition: public.h:1441
uint16_t fbTemplateCountElements(const fbTemplate_t *tmpl)
Determines number of information elements in a template.
fbTemplateField_t field
The description of one element in the list.
Definition: public.h:2253
fbInfoModel_t * fbSessionGetInfoModel(const fbSession_t *session)
Gets the info model for the session.
const fbSubTemplateList_t * fbRecordFindStlOfTemplate(const fbRecord_t *record, const fbTemplate_t *tmpl, uint16_t *position, uint16_t skip)
Searches record for a subTemplateList that uses tmpl.
fbExporter_t * fBufGetExporter(const fBuf_t *fbuf)
Retrieves the exporting process endpoint associated with a buffer.
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert SFlow into IPFIX for the given collector.
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Exports a single external fbTemplate_t in the current domain of a given Session.
uint8_t * buf
Content buffer.
Definition: public.h:156
gboolean fbTemplateAppendArraySpecId(fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec, uint32_t wantedFlags, GError **err)
Appends information elements described by a specifier array to a template.
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocates a new buffer for export.
void * fbSubTemplateListGetNextPtr(const fbSubTemplateList_t *subTemplateList, const void *currentPtr)
Retrieves a pointer to the data record in the sub template list that follows the one at currentPtr.
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initializes an information model iterator for iteration over the information elements (fbInfoElement_...
void fbTemplateSetContext(fbTemplate_t *tmpl, void *tmpl_ctx, void *app_ctx, fbTemplateCtxFree_fn ctx_free)
Sets the context pointers on a Template.
int(* fbRecordValueCallback_fn)(const fbRecord_t *parent_record, const fbBasicList_t *parent_bl, const fbInfoElement_t *field, const fbRecordValue_t *value, void *ctx)
Signature of the callback function required by fbRecordFindAllElementValues().
Definition: public.h:5596
uint8_t semantic
The semantic value to describe the contents of the list, a value defined in fbListSemantics_t.
Definition: public.h:2635
const fbBasicListInfo_t * fbTemplateInfoGetNextBasicList(const fbTemplateInfo_t *tmplInfo, const fbBasicListInfo_t *blInfo)
Returns a description of the next fbBasicList_t that is used by the fbTemplate_t described by tmplInf...
const fbTemplateField_t * fbTemplateIterGetField(const fbTemplateIter_t *iter)
Returns the same TemplateField returned by the most recent call to fbTemplateIterNext().
fbListSemantics_en
fbListSemantics_t defines the possible values for the semantics of the structured Data Types: basicLi...
Definition: public.h:2191
@ FB_LIST_SEM_EXACTLY_ONE_OF
Semantic field for exactly-one-of value defined in RFC 6313.
Definition: public.h:2203
@ FB_LIST_SEM_ORDERED
Semantic field for the ordered value defined in RFC 6313.
Definition: public.h:2215
@ FB_LIST_SEM_ONE_OR_MORE_OF
Semantic field for the one-or-more-of value defined in RFC 6313.
Definition: public.h:2207
@ FB_LIST_SEM_ALL_OF
Semantic field for the all-of value defined in RFC 6313.
Definition: public.h:2211
@ FB_LIST_SEM_NONE_OF
Semantic field for none-of value defined in RFC 6313.
Definition: public.h:2199
@ FB_LIST_SEM_UNDEFINED
Semantic field for indicating the value has not been set.
Definition: public.h:2195
uint8_t fbSubTemplateMultiListGetSemantic(const fbSubTemplateMultiList_t *STML)
Gets the list semantics value (fbListSemantics_t) from the multi list.
uint32_t ip4
Used when ie is FB_IP4_ADDR.
Definition: public.h:1477
fbTemplate_t * tmpl
Octet-length of this IE in memory.
Definition: public.h:1083
const fbTemplateField_t * fbTemplateIterNext(fbTemplateIter_t *iter)
Returns the next TemplateField in the fbTemplate_t.
uint32_t dataLength
The octet length of the allocated buffer used to hold the data.
Definition: public.h:2617
uint32_t enterprise_id
The private enterprise number (PEN) of the element or 0 for an IANA-defined element.
Definition: public.h:1669
uint64_t max
range max
Definition: public.h:832
char * svc
Service name or port number to connect/listen to.
Definition: public.h:1753
void * fbSubTemplateMultiListEntryGetIndexedPtr(const fbSubTemplateMultiListEntry_t *entry, uint16_t index)
Retrieves a pointer to the data element in the entry at position index, or returns NULL when index is...
uint16_t numElements
The number of sub template lists in the multi list.
Definition: public.h:2951
void fbExporterResetOctetCount(fbExporter_t *exporter)
Resets the counter that holds the number of octets written to the exporter's file,...
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetIndexedEntry(const fbSubTemplateMultiList_t *STML, uint16_t index)
Retrieves a pointer to the entry at a specific index, or returns NULL if index is out of range.
void * fbTemplateGetContext(const fbTemplate_t *tmpl)
Gets the context pointer associated with a Template.
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1694
char * ssl_cert_file
Path to certificate file.
Definition: public.h:1757
struct fbListenerGroup_st fbListenerGroup_t
Structure that represents a group of listeners.
Definition: public.h:2103
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateList)
Returns the pointer to the sub-record data array for the subTemplateList.
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Calls fbSubTemplateMultiListEntryClear() for each Entry in STML.
char * ssl_key_file
Path to private key file.
Definition: public.h:1759
uint16_t numElements
The number of elements (sub-records) in this entry.
Definition: public.h:2986
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec, uint32_t wantedFlags, GError **err)
Potentially appends an information element described by the specifier to a template.
uint32_t fbCollectorGetObservationDomain(const fbCollector_t *collector)
Retrieves the observation domain of the node connected to the UDP collector.
fbCollector_t * fBufGetCollector(const fBuf_t *fbuf)
Retrieves the collecting process endpoint associated with a buffer.
uint16_t fbTemplateInfoGetApplabel(const fbTemplateInfo_t *tmplInfo)
Returns the applabel value specified in fbTemplateInfoInit().
struct fbListenerEntry_st * prev
pointer to the previous listener entry in the linked list
Definition: public.h:2112
size_t fbExporterGetOctetCount(const fbExporter_t *exporter)
Gets the number of octets that have been written to the exporter's file, socket, or buffer since the ...
uint32_t recordLength
The octet length of a record (in memory) described by the template.
Definition: public.h:2622
void * fbSubTemplateMultiListEntryNextDataPtr(const fbSubTemplateMultiListEntry_t *entry, const void *currentPtr)
Retrieves a pointer to the data record in this entry that follows the one at currentPtr.
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert NetFlowV9 into IPFIX for the given collector.
uint8_t fbSubTemplateListGetSemantic(const fbSubTemplateList_t *subTemplateList)
Gets the list semantics value (fbListSemantics_t) from a SubTemplateList.
void fBufListFree(const fbTemplate_t *tmpl, uint8_t *record)
Frees all of the memory that fixbuf allocated during transcode of this record.
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the data array that holds the sub-records of entry and sets all parameters of entry to 0 or NUL...
const fbInfoElement_t * ie
The element that describes this data.
Definition: public.h:1439
uint16_t fbSessionGetLargestInternalTemplateSize(fbSession_t *session)
Gets the largest decoded size of an internal template in the session.
gboolean fbListenerGetCollector(const fbListener_t *listener, fbCollector_t **collector, GError **err)
If a collector is associated with the listener class, this will return a handle to the collector stat...
struct fbListenerGroupResult_st fbListenerGroupResult_t
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
const char * fbTemplateInfoGetName(const fbTemplateInfo_t *tmplInfo)
Returns the name value specified in fbTemplateInfoInit().
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:139
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the template pointer used to structure the data elements.
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocates an exporting process endpoint for an opened ANSI C file pointer.
uint32_t fbCollectorGetNetflowMissed(const fbCollector_t *collector, const struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
Returns the number of potential missed export packets of the Netflow v9 session that is currently set...
uint32_t flags
Flags.
Definition: public.h:826
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t additional)
Increases the size of the list's internal buffer to hold additional more elements (sub-records).
uint32_t fbSessionGetDomain(const fbSession_t *session)
Retrieves the current domain on a session.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetNextEntry(const fbSubTemplateMultiList_t *STML, const fbSubTemplateMultiListEntry_t *currentEntry)
Retrieves a pointer to the entry in the multi list that follows the one at currentEntry.
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Frees the data arrays of each Entry and of STML (fbSubTemplateMultiListClear()), then frees STML itse...
gboolean fbBasicListGetIndexedRecordValue(const fbBasicList_t *basicList, uint16_t index, fbRecordValue_t *value)
Fills a RecordValue from the data for the indexth element in basicList.
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateList)
Sets all parameters of subTemplateList to 0 or NULL except for the internal data array and its alloca...
uint16_t fbSessionSetMetadataExportTemplates(fbSession_t *session, gboolean enabled, uint16_t tmplInfoTid, uint16_t blInfoTid, GError **err)
Configures a Session to export template metadata (fbTemplateInfo_t) as options records.
uint32_t recordLength
The octet length of a record (in memory) described by the template.
Definition: public.h:2982
fbInfoModel_t * fbTemplateGetInfoModel(const fbTemplate_t *tmpl)
Returns the information model, as understood by the template.
fbSession_t * fBufGetSession(const fBuf_t *fbuf)
Retrieves the session associated with a buffer.
uint32_t ie_pen
private enterprise number
Definition: public.h:1539
int fbRecordFindAllSubRecords(const fbRecord_t *record, uint16_t tid, unsigned int flags, fbRecordSubRecordCallback_fn callback, void *ctx)
Recursively searches a Record for uses of a fbTemplate_t having a particular ID.
uint8_t ie_type
ie data type (fbInfoElementDataType_t)
Definition: public.h:1543
size_t len
Length of content in buffer.
Definition: public.h:149
uint64_t ie_range_begin
ie range min
Definition: public.h:1551
char * host
Hostname to connect/listen to.
Definition: public.h:1751
uint16_t len
Standard information element length in octets; FB_IE_VARLEN for strings, octetArrays,...
Definition: public.h:823
void fbInfoModelAddElementArray(fbInfoModel_t *model, const fbInfoElement_t *ie)
Adds multiple information elements in an array to an information model.
struct fbRecordValue_st fbRecordValue_t
fbRecordValue_t is used to access the value of a single Element (or Field) in an fbRecord_t.
void fbCollectorSetAcceptOnly(fbCollector_t *collector, struct sockaddr *address, size_t address_length)
Sets the collector to only receive from the given IP address over UDP.
fbVarfield_t ie_desc
information element description
Definition: public.h:1557
char * ssl_key_pass
Private key decryption password.
Definition: public.h:1761
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocates a collecting process endpoint for a named file.
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocates a collecting process endpoint for an open file.
gboolean fBufSetAutomaticMetadataAttach(fBuf_t *fbuf, GError **err)
Instructes a collection Buffer to process Template Metadata records.
void fbSessionResetExternal(fbSession_t *session)
Resets the external state (sequence numbers and templates) in a session state container.
uint16_t midx
Multiple IE index.
Definition: public.h:1063
void fbExporterClose(fbExporter_t *exporter)
Forces the file or socket underlying an exporting process endpoint to close.
uint16_t fbRecordGetFieldCount(const fbRecord_t *record)
Returns the number of fields in a record.
fBuf_t * fbListenerOwnSocketCollectorTCP(fbListener_t *listener, int sock, GError **err)
Returns an fBuf wrapped around an independently managed socket and a properly created listener for TC...
const fbTemplateInfo_t * fbSessionGetTemplateInfo(const fbSession_t *session, uint16_t tid)
Returns the metadata for template whose ID is tid in the current domain or NULL if no metadata is ava...
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
uint16_t len
Octet-length of this field as specified by the template specification.
Definition: public.h:1067
void fbBasicListClear(fbBasicList_t *basicList)
Frees the data array of basicList and sets all parameters of basicList to 0 or NULL.
uint8_t * rec
The buffer holding the data for a record.
Definition: public.h:1405
double dbl
Used when ie is FB_FLOAT_64 or FB_FLOAT_32.
Definition: public.h:1491
fbTemplateInfo_t * fbTemplateInfoAlloc(void)
Allocates and returns an empty template metadata information structure.
gboolean fbRecordGetValueForField(const fbRecord_t *record, const fbTemplateField_t *field, fbRecordValue_t *value)
Gets the value from a Record given a Field used by the Record's fbTemplate_t.
void fbListenerFree(fbListener_t *listener)
Frees a listener.
uint64_t min
range min
Definition: public.h:830
void fbTemplateInfoFree(fbTemplateInfo_t *tmplInfo)
Frees a template metadata structure.
void fbRecordFreeLists(fbRecord_t *record)
Releases all of the memory allocated during transcode of this record, freeing the list structures,...
int fbRecordFindAllElementValues(const fbRecord_t *record, const fbInfoElement_t *ie, unsigned int flags, fbRecordValueCallback_fn callback, void *ctx)
Recursively searches a Record and all its sub-records for an Info Element.
fbTemplate_t * fbSessionGetTemplate(const fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieves a template from a session by ID.
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocates a new empty template.
gboolean fbInfoModelContainsElement(const fbInfoModel_t *model, const fbInfoElement_t *element)
Returns TRUE if element is present in the information model either by name or by element and enterpri...
const fbTemplateField_t * fbTemplateGetFieldByPosition(const fbTemplate_t *tmpl, uint16_t position)
Returns a field in a template at a specific position.
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Appends a record to a buffer.
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
A deprecated alias for fBufSetAutomaticElementInsert().
int fbTemplatesCompare(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2, unsigned int flags)
Compares templates tmpl1 and tmpl2 according to flags and returns 0 if the are the same and non-zero ...
fbVarfield_t ie_name
information element name
Definition: public.h:1555
uint8_t semantic
The semantic value to describe the contents of the list, a value defined in fbListSemantics_t.
Definition: public.h:2956
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(const fbSubTemplateMultiList_t *STML)
Retrieves the first entry in the multi list.
fbSubTemplateMultiListEntry_t * firstEntry
The pointer to the first entry in the multi list.
Definition: public.h:2947
uint16_t fbTemplateIterGetPosition(const fbTemplateIter_t *iter)
Returns the position of the fbTemplateField_t returned by the most recent call to fbTemplateIterNext(...
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:2114
fbListener_t * fbListenerAlloc(const fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocates a listener.
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:2086
void * fbCollectorGetContext(const fbCollector_t *collector)
Retrieves the application context associated with a collector.
uint16_t fbTemplateGetIELenOfMemBuffer(const fbTemplate_t *tmpl)
Returns the number of octets required for a data buffer (an octet array) to store a data record descr...
int64_t s64
Used when ie is FB_INT_8, FB_INT_16, FB_INT_32, or FB_INT_64.
Definition: public.h:1487
uint16_t num
Information Element number.
Definition: public.h:818
uint32_t fBufGetExportTime(const fBuf_t *fbuf)
Retrieves the export time on the message currently in a buffer.
fbTemplateSetCompareStatus_en
Defines the values returned by fbTemplatesSetCompare() when checking whether one fbTemplate_t is a su...
Definition: public.h:5244
@ FB_TMPL_SETCMP_DISJOINT
Indicates the templates contain no common elements.
Definition: public.h:5255
@ FB_TMPL_SETCMP_EQUAL
Indicates the two templates contain the same elements.
Definition: public.h:5248
@ FB_TMPL_SETCMP_SUPERSET
Indicates the first template is a strict superset of the second.
Definition: public.h:5250
@ FB_TMPL_SETCMP_SUBSET
Indicates the first template is a strict subset of the second.
Definition: public.h:5246
@ FB_TMPL_SETCMP_COMMON
Indicates the templates contain common elements but each has elements that the other does not.
Definition: public.h:5253
void fbSessionRemoveTemplatePair(fbSession_t *session, uint16_t ext_tid)
Removes a template mapping pair for list sub-records from the Session.
void * fbSubTemplateMultiListEntryResize(fbSubTemplateMultiListEntry_t *entry, uint16_t newCount)
Resizes and zeroes the entry's internal buffer for elements (sub-records).
gboolean fbTemplateIsMetadata(const fbTemplate_t *tmpl, uint32_t tests)
Checks to see if a template describes a meta-data record according to the bit-field value in tests.
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associates an collecting process endpoint with a buffer.
gboolean fbRecordCopyFieldValue(const fbRecord_t *record, const fbTemplateField_t *field, void *dest, size_t destlen)
Copies the value from a Record given a Field used by the Record's fbTemplate_t.
void fbSessionAddNewTemplateCallback(fbSession_t *session, fbNewTemplateCallback_fn callback, void *app_ctx)
This function sets the callback that allows the application to set its own context variable with a ne...
fbTemplate_t * fbTemplateCopy(const fbTemplate_t *tmpl, uint32_t flags)
Creates a new template that is a copy of tmpl perhaps modified by the values specified in flags.
uint64_t ie_range_end
ie range max
Definition: public.h:1553
uint8_t ip6[16]
Used when ie is FB_IP6_ADDR.
Definition: public.h:1447
void fbRecordValueClear(fbRecordValue_t *value)
Releases any memory used by the string buffer on value (that is used to store the fbVarfield_t) and r...
uint32_t dataLength
The octet length of the buffer used to hold the data in this entry.
Definition: public.h:2977
size_t fBufRemaining(fBuf_t *fbuf)
When using fBufSetBuffer(), returns the number of unprocessed octets in the octet array.
gboolean fbTemplatesAreEqual(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2)
Returns TRUE when templates tmpl1 and tmpl2 are equal.
void fbCollectorClose(fbCollector_t *collector)
Closes the file or socket underlying a collecting process endpoint.
uint32_t flags
Application flags word.
Definition: public.h:1701
uint16_t fbTemplateInfoGetParentTid(const fbTemplateInfo_t *tmplInfo)
Returns the parentTid value specified in fbTemplateInfoInit().
void fbSessionSetCallbackCopyTemplates(fbSession_t *incomingSession, fbSession_t *exportSession)
Arranges for templates read by incomingSession to be copied to exportSession by setting the new templ...
uint16_t fbBasicListGetElementIdent(const fbBasicList_t *basicList, uint32_t *pen)
Gets the element ID and enterprise number for the fbInfoElement_t used by a BasicList.
uint8_t * dataPtr
The pointer to the buffer used to hold the data in this entry.
Definition: public.h:2973
const fbSubTemplateList_t * stl
Used when ie is FB_SUB_TMPL_LIST.
Definition: public.h:1455
uint8_t mac[6]
Used when ie is FB_MAC_ADDR.
Definition: public.h:1495
void * fbSubTemplateMultiListEntryGetDataPtr(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
struct fbVarfield_st fbVarfield_t
A variable-length field value.
gboolean fBufSetExportTemplate(fBuf_t *fbuf, uint16_t ext_tid, GError **err)
Sets the external template for export on a buffer to the given template ID.
gboolean fbInfoModelReadXMLFile(fbInfoModel_t *model, const gchar *filename, GError **err)
Adds information specified in the given XML file to the information model.
const struct sockaddr * fbCollectorGetPeer(const fbCollector_t *collector)
Retrieves information about the node connected to this collector.
const fbTemplateField_t * fbBasicListGetTemplateField(const fbBasicList_t *basicList)
Returns a simulated TemplateField that describes the data within a basicList.
uint32_t ent
Private Enterprise Number.
Definition: public.h:813
const fbTemplate_t * tmpl
The template that describes the bytes in rec.
Definition: public.h:1403
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns an empty ListenerGroup.
gboolean fbTemplateContainsElement(const fbTemplate_t *tmpl, const fbInfoElement_t *element)
Determines if a template contains a given information element.
uint32_t fbCollectorGetSFlowMissed(const fbCollector_t *collector, const struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
Returns the number of potential missed export packets of the SFlow session that is identified with th...
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associates an exporting process endpoint with a buffer.
void fbSessionCopyIncomingTemplatesCallback(fbSession_t *incomingSession, uint16_t tid, fbTemplate_t *tmpl, void *exportSession, void **tmpl_ctx, fbTemplateCtxFree_fn *tmpl_ctx_free_fn)
Arranges for templates read by incomingSession to be copied to exportSession.
int(* fbRecordSubRecordCallback_fn)(const fbRecord_t *record, void *ctx)
Signature of the callback function required by fbRecordFindAllSubRecords().
Definition: public.h:5647
uint16_t fbSubTemplateMultiListEntryCountElements(const fbSubTemplateMultiListEntry_t *entry)
Returns the number of entries the sub template multi list entry is capable of holding.
gboolean fbTemplateAppendSpecArray(fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec, uint32_t wantedFlags, GError **err)
Appends information elements described by a specifier array to a template.
uint16_t fbBasicListInfoGetListIdent(const fbBasicListInfo_t *blInfo, uint32_t *pen)
Gets from blInfo the element numbers for the fbInfoElement_t used by the BasicList element itself.
uint16_t fbSubTemplateMultiListCountElements(const fbSubTemplateMultiList_t *STML)
Returns the number of entries the sub template multi list is capable of holding.
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Sets the export time on the message currently in a buffer.
gboolean fbTemplateContainsSpecId(const fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec)
Determines if a template contains at least one instance of a given information element (fbInfoElement...
fbBasicList_t provides the internal representation of an fbInfoElement_t of type basicList (FB_BASIC_...
Definition: public.h:2244
Connection specifier.
Definition: public.h:1747
A single IPFIX Information Element definition.
Definition: public.h:809
The corresponding C struct for a record whose template is the RFC 5610 Information Element Type Optio...
Definition: public.h:1537
A single IPFIX Information Element specification.
Definition: public.h:1606
A single IPFIX Information Element specification using the element's numeric identifier and private e...
Definition: public.h:1660
The numeric pair to identify the element.
Definition: public.h:1664
ListenerEntry's make up an fbListenerGroup_t as a linked list.
Definition: public.h:2108
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
Definition: public.h:2122
fbRecord_t maintains a buffer holding an IPFIX record's data, the fbTemplate_t that describes that da...
Definition: public.h:1401
fbRecordValue_t is used to access the value of a single Element (or Field) in an fbRecord_t.
Definition: public.h:1437
fbSubTemplateList_t provides the internal representation of an fbInfoElement_t of type subTemplateLis...
Definition: public.h:2603
fbSubTemplateMultiList_t provides the internal representation of an fbInfoElement_t of type subTempla...
Definition: public.h:2943
fbSubTemplateMultiListEntry_t represents structured data instances within a fbSubTemplateMultiList_t ...
Definition: public.h:2965
fbTemplateField_t represents an fbInfoElement_t that has been added to an fbTemplate_t.
Definition: public.h:1056
fbTemplateIter_t iterates over the fbTemplateField_t objects in an fbTemplate_t.
Definition: public.h:1213
A variable-length field value.
Definition: public.h:147
The value depending on the type of ie.
Definition: public.h:1443
Fixbuf's version information.