Go to the documentation of this file.
18 #include <fixbuf/autoinc.h>
30 #define FIXBUF_CHECK_VERSION(major, minor, release) \
31 (FIXBUF_VERSION_MAJOR > (major) || \
32 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
33 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
34 FIXBUF_VERSION_RELEASE >= (release)))
43 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
49 #define FB_ERROR_TMPL 1
54 #define FB_ERROR_EOM 2
60 #define FB_ERROR_EOF 3
65 #define FB_ERROR_IPFIX 4
71 #define FB_ERROR_BUFSZ 5
75 #define FB_ERROR_IMPL 6
84 #define FB_ERROR_NLREAD 8
90 #define FB_ERROR_NLWRITE 9
94 #define FB_ERROR_NOELEMENT 10
98 #define FB_ERROR_CONN 11
103 #define FB_ERROR_NETFLOWV9 12
107 #define FB_ERROR_TRANSMISC 13
111 #define FB_ERROR_SFLOW 14
115 #define FB_ERROR_SETUP 15
119 #define FB_ERROR_LAXSIZE 16
129 typedef struct fBuf_st
fBuf_t;
166 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, \
167 _min_, _max_, _type_, _desc_) \
168 { _ent_, _num_, _len_, _flags_, _type_, _min_, _max_, _name_, _desc_ }
181 #define FB_IE_INIT_FULL_SPLIT(_name_, _ent_, _num_, _len_, \
182 _rev_, _endian_, _semantics_, _units_, \
183 _min_, _max_, _type_, _desc_) \
184 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, \
185 (((_rev_) ? FB_IE_F_REVERSIBLE : 0) | \
186 ((_endian_) ? FB_IE_F_ENDIAN : 0) | \
187 (((_semantic) & 0xFF) << 8) | \
188 (((_units_) & 0xFFFF) << 16)), \
189 _min_, _max_, _type_, _desc_)
196 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
197 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char *)NULL)
205 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
216 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
226 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
233 #define FB_IE_F_NONE 0x00000000
242 #define FB_IE_F_ENDIAN 0x00000001
259 #define FB_IE_F_REVERSIBLE 0x00000040
271 #define FB_IE_F_ALIEN 0x00000080
288 #define FB_IE_QUANTITY 0x00000100
297 #define FB_IE_TOTALCOUNTER 0x00000200
306 #define FB_IE_DELTACOUNTER 0x00000300
315 #define FB_IE_IDENTIFIER 0x00000400
324 #define FB_IE_FLAGS 0x00000500
333 #define FB_IE_LIST 0x00000600
342 #define FB_IE_SNMPCOUNTER 0x00000700
351 #define FB_IE_SNMPGAUGE 0x00000800
361 #define FB_IE_DEFAULT 0x00000000
428 #define FB_UNITS_BITS 0x00010000
436 #define FB_UNITS_OCTETS 0x00020000
444 #define FB_UNITS_PACKETS 0x00030000
452 #define FB_UNITS_FLOWS 0x00040000
460 #define FB_UNITS_SECONDS 0x00050000
469 #define FB_UNITS_MILLISECONDS 0x00060000
478 #define FB_UNITS_MICROSECONDS 0x00070000
487 #define FB_UNITS_NANOSECONDS 0x00080000
496 #define FB_UNITS_WORDS 0x00090000
504 #define FB_UNITS_MESSAGES 0x000A0000
512 #define FB_UNITS_HOPS 0x000B0000
520 #define FB_UNITS_ENTRIES 0x000C0000
528 #define FB_UNITS_FRAMES 0x000D0000
536 #define FB_UNITS_PORTS 0x000E0000
545 #define FB_UNITS_INFERRED 0x000F0000
633 #define FB_IE_VARLEN 65535
644 #define FB_IE_PEN_REVERSE 29305
656 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
663 #define FB_IE_REVERSE_STR "reverse"
666 #define FB_IE_REVERSE_STRLEN 7
671 #define FB_CISCO_GENERIC 9999
678 #define FB_CISCO_ASA_EVENT_ID 9998
688 #define FB_CISCO_ASA_EVENT_XTRA 9997
833 #define fbInfoElementCheckIdent(_ie, _enterpriseNumber, _elementId) \
834 ((_elementId) == (_ie)->num && (_enterpriseNumber) == (_ie)->ent)
841 #define fbInfoElementGetDescription(_ie) ((_ie)->description)
850 #define fbInfoElementGetId(_ie) ((_ie)->num)
857 #define fbInfoElementGetLen(_ie) ((_ie)->len)
865 #define fbInfoElementGetMax(_ie) ((_ie)->max)
872 #define fbInfoElementGetMin(_ie) ((_ie)->min)
879 #define fbInfoElementGetName(_ie) ((_ie)->name)
887 #define fbInfoElementGetPEN(_ie) ((_ie)->ent)
895 #define fbInfoElementGetSemantics(_ie) FB_IE_SEMANTIC((_ie)->flags)
903 #define fbInfoElementGetType(_ie) ((_ie)->type)
911 #define fbInfoElementGetUnits(_ie) FB_IE_UNITS((_ie)->units)
919 #define fbInfoElementIsAlien(_ie) (!!((_ie)->flags & FB_IE_F_ALIEN))
927 #define fbInfoElementIsEndian(_ie) (!!((_ie)->flags & FB_IE_F_ENDIAN))
935 #define fbInfoElementIsReversible(_ie) (!!((_ie)->flags & FB_IE_F_REVERSIBLE))
945 #define fbInfoElementIsUnsigned(_ie) \
946 ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_UINT_64)
956 #define fbInfoElementIsSigned(_ie) \
957 ((_ie)->type >= FB_INT_8 && (_ie)->type <= FB_INT_64)
966 #define fbInfoElementIsInteger(_ie) \
967 ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_INT_64)
976 #define fbInfoElementIsFloat(_ie) \
977 ((_ie)->type >= FB_FLOAT_32 && (_ie)->type <= FB_FLOAT_64)
989 #define fbInfoElementIsNumber(_ie) \
990 ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_FLOAT_64)
998 #define fbInfoElementIsIPAddress(_ie) \
999 ((_ie)->type >= FB_IP4_ADDR && (_ie)->type <= FB_IP6_ADDR)
1009 #define fbInfoElementIsDatetime(_ie) \
1010 ((_ie)->type >= FB_DT_SEC && (_ie)->type <= FB_DT_NANOSEC)
1019 #define fbInfoElementIsList(_ie) \
1020 ((_ie)->type >= FB_BASIC_LIST && (_ie)->type <= FB_SUB_TMPL_MULTI_LIST)
1028 #define fbInfoElementIsPadding(_ie) (210 == (_ie)->num && 0 == (_ie)->ent)
1073 #define FB_TEMPLATEFIELD_INIT {NULL, 0, 0, 0, NULL}
1082 #define fbTemplateFieldCheckIdent(_field, _enterpriseNumber, _elementId) \
1083 ((_elementId) == (_field)->canon->num && \
1084 (_enterpriseNumber) == (_field)->canon->ent)
1091 #define fbTemplateFieldGetIE(_field) ((_field)->canon)
1099 #define fbTemplateFieldGetId(_field) ((_field)->canon->num)
1110 #define fbTemplateFieldGetLen(_field) ((_field)->len)
1120 #define fbTemplateFieldGetMemsize(_field) \
1121 ((FB_IE_VARLEN != (_field)->len) \
1123 : ((FB_BASIC_LIST == (_field)->canon->type) \
1124 ? sizeof(fbBasicList_t) \
1125 : ((FB_SUB_TMPL_LIST == (_field)->canon->type) \
1126 ? sizeof(fbSubTemplateList_t) \
1127 : ((FB_SUB_TMPL_MULTI_LIST == (_field)->canon->type) \
1128 ? sizeof(fbSubTemplateMultiList_t) \
1129 : sizeof(fbVarfield_t)))))
1137 #define fbTemplateFieldGetName(_field) ((_field)->canon->name)
1146 #define fbTemplateFieldGetOffset(_field) ((_field)->offset)
1154 #define fbTemplateFieldGetPEN(_field) ((_field)->canon->ent)
1162 #define fbTemplateFieldGetType(_field) ((_field)->canon->type)
1179 #define fbTemplateFieldGetRepeat(_field) ((_field)->midx)
1202 #define FB_TEMPLATE_ITER_NULL {NULL, UINT16_MAX}
1396 #define FB_RECORD_INIT {NULL, NULL, 0, 0, 0}
1481 #define FB_RECORD_VALUE_INIT \
1482 { NULL, NULL, { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } }
1549 #define FB_TID_AUTO 0
1559 #define FB_TID_OTS 3
1564 #define FB_TID_MIN_DATA 256
1571 #define FB_IESPEC_NULL { NULL, 0, 0 }
1613 #define FB_IESPECID_NULL { {0, 0}, 0, 0 }
1794 const char *description,
1796 uint16_t parentTid);
1805 #define FB_TMPL_MD_LEVEL_0 0
1812 #define FB_TMPL_MD_LEVEL_1 1
1819 #define FB_TMPL_MD_LEVEL_NA 0xFF
1842 uint32_t contentEnt,
1843 uint16_t contentNum);
2019 #define FB_CONNSPEC_INIT \
2020 { FB_SCTP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
2231 uint16_t numElements);
2261 uint16_t elementLength,
2262 uint16_t numElements);
2425 const void *currentPtr);
2435 #define fbBLNext(type, basicList, current) \
2436 ((type *)(fbBasicListGetNextPtr((basicList), (current))))
2473 uint16_t additional);
2575 uint16_t numElements);
2635 const void *currentPtr);
2646 #define fbSTLNext(type, subTemplateList, current) \
2647 ((type *)(fbSubTemplateListGetNextPtr((subTemplateList), (current))))
2740 uint16_t additional);
2882 uint16_t numElements);
2994 uint16_t additional);
3046 #define fbSTMLNext(subTemplateMultiList, current) \
3047 fbSubTemplateMultiListGetNextEntry((subTemplateMultiList), (current))
3068 uint16_t numElements);
3107 uint16_t additional);
3150 const void *currentPtr);
3161 #define fbSTMLEntryNext(type, subTemplateMultiListEntry, current) \
3162 ((type *)(fbSubTemplateMultiListEntryNextDataPtr( \
3163 (subTemplateMultiListEntry), (current))))
3388 struct sockaddr *peer,
3494 gboolean automatic);
3503 gboolean automatic);
4036 const gchar *filename,
4074 const gchar *xml_data,
4075 gssize xml_data_len,
4274 #define FB_TMPL_IS_OPTIONS (1u << 0)
4285 #define FB_TMPL_IS_META_ELEMENT (1u << 1)
4294 #define FB_TMPL_IS_META_TEMPLATE_V1 (1u << 2)
4303 #define FB_TMPL_IS_META_TEMPLATE_V3 (1u << 3)
4312 #define FB_TMPL_IS_META_BASICLIST (1u << 4)
4320 #define FB_TMPL_IS_META_TMPL_ANY \
4321 (FB_TMPL_IS_OPTIONS | \
4322 FB_TMPL_IS_META_TEMPLATE_V1 | \
4323 FB_TMPL_IS_META_BASICLIST)
4331 #define FB_TMPL_IS_META_ANY \
4332 (FB_TMPL_IS_OPTIONS | \
4333 FB_TMPL_IS_META_TMPL_ANY | \
4334 FB_TMPL_IS_META_ELEMENT)
4427 uint32_t wantedFlags,
4446 uint32_t wantedFlags,
4483 uint32_t wantedFlags,
4503 uint32_t wantedFlags,
4514 #define FB_TMPL_COPY_REMOVE_PADDING 0x01u
4523 #define FB_TMPL_COPY_IGNORE_SCOPE 0x04u
4587 uint16_t scope_count);
4790 uint32_t wantedFlags);
4869 uint32_t wantedFlags);
4901 __attribute__((__deprecated__));
5023 unsigned int flags);
5083 uint16_t *matching_fields,
5084 unsigned int flags);
5092 #define FB_TMPL_CMP_IGNORE_PADDING 0x01u
5100 #define FB_TMPL_CMP_IGNORE_LENGTHS 0x02u
5108 #define FB_TMPL_CMP_IGNORE_SCOPE 0x04u
5597 uint16_t tmplInfoTid,
5691 void *exportSession,
6256 struct sockaddr *address,
6257 size_t address_length);
6452 const struct sockaddr *peer,
6473 const struct sockaddr *peer,
6483 const struct sockaddr *
6525 gboolean multi_session);
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocates a collecting process endpoint for a named file.
void * fbSubTemplateListResize(fbSubTemplateList_t *subTemplateList, uint16_t newCount)
Resizes and zeroes the list's internal buffer for elements (sub-records).
uint16_t fbSubTemplateListGetTemplateID(const fbSubTemplateList_t *subTemplateList)
Gets the template ID for the template used by the list.
@ FB_INT_8
The "signed8" data type: An integer value in the range of -128 to 127.
Definition: public.h:720
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:2036
const fbInfoElement_t * canon
Pointer to canonical IE.
Definition: public.h:1039
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:2118
@ FB_IE_UNITS_FLOWS
Describes an information element as counting flows.
Definition: public.h:578
uint8_t * dataPtr
pointer to the buffer used to hold the data in this list
Definition: public.h:2525
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Exports a single external fbTemplate_t in the current domain of a given Session.
size_t fbExporterGetMsgLen(const fbExporter_t *exporter)
Gets the (transcoded) message length that was copied to the exporting buffer upon fBufEmit() when usi...
A single IPFIX Information Element definition.
Definition: public.h:793
void fbSessionRemoveTemplatePair(fbSession_t *session, uint16_t ext_tid)
Removes a template mapping pair for list sub-records from the Session.
const fbTemplateField_t * fbBasicListGetTemplateField(const fbBasicList_t *basicList)
Returns a simulated TemplateField that describes the data within a basicList.
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1595
const fbBasicList_t * bl
Used when ie is FB_BASIC_LIST.
Definition: public.h:1427
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocates an empty transport session state container.
GHashTableIter fbInfoModelIter_t
An iterator over the information elements in an information model.
Definition: public.h:159
uint16_t numElements
number of elements in the list
Definition: public.h:2195
enum fbInfoElementSemantics_en fbInfoElementSemantics_t
fbInfoElementSemantics_t defines the possible semantics of an fbInfoElement_t.
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Sets an octet array on an fBuf for collection.
@ FB_SCTP
Partially reliable datagram transport via SCTP.
Definition: public.h:1669
void fbTemplateIterInit(fbTemplateIter_t *iter, const fbTemplate_t *tmpl)
Initializes a TemplateIter to visit the fbTemplateField_t objects in a Template.
@ FB_BOOL
The "boolean" data type: A binary value: "true" or "false".
Definition: public.h:737
@ FB_IE_UNITS_BITS
Describes an information element as counting bits.
Definition: public.h:566
uint16_t len
Octet-length of this field as specified by the template specification.
Definition: public.h:1048
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.
@ FB_DT_MILSEC
The "dateTimeMilliseconds" data type: An unsigned 64-bit integer containing the number of millisecond...
Definition: public.h:751
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition: public.h:2191
fbTemplate_t * fbInfoElementAllocTypeTemplate(fbInfoModel_t *model, GError **err)
Allocates and returns the Options Template that will be used to define Information Element Type Recor...
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.
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initializes an information model iterator for iteration over the information elements (fbInfoElement_...
uint8_t ie_semantic
ie semantic (fbInfoElementSemantics_t)
Definition: public.h:1521
fbVarfield_t varfield
Used when ie is FB_STRING or FB_OCTET_ARRAY.
Definition: public.h:1442
void * fbTemplateGetContext(const fbTemplate_t *tmpl)
Gets the context pointer associated with a Template.
const fbTemplateField_t * fbTemplateGetIndexedIE(const fbTemplate_t *tmpl, uint16_t position) __attribute__((__deprecated__))
Deprecated alias for fbTemplateGetFieldByPosition.
uint16_t fbSubTemplateListCountElements(const fbSubTemplateList_t *subTemplateList)
Returns the number of elements (sub-records) the sub template list is capable of holding.
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition: public.h:3403
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.
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Exports all external templates in the current domain of a given session.
void fBufFree(fBuf_t *fbuf)
Frees a buffer.
gboolean fbTemplatesAreEqual(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2)
Returns TRUE when templates tmpl1 and tmpl2 are equal.
double dbl
Used when ie is FB_FLOAT_64 or FB_FLOAT_32.
Definition: public.h:1467
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emits the message currently in a buffer using the associated exporting process endpoint.
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:5382
uint16_t fbTemplateCountElements(const fbTemplate_t *tmpl)
Determines number of information elements in a template.
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...
uint16_t offset
Octet-offset of this field in a record.
Definition: public.h:1052
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns an empty ListenerGroup.
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateList)
Returns a pointer to the buffer that contains the data for the list.
@ FB_TMPL_SETCMP_EQUAL
Indicates the two templates contain the same elements.
Definition: public.h:5036
fbInfoModel_t * fbInfoModelAlloc(void)
Allocates a new information model.
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.
const char * fbTemplateInfoGetDescription(const fbTemplateInfo_t *tmplInfo)
Returns the description value specified in fbTemplateInfoInit().
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 fBufSetAutomaticNextMessage(fBuf_t *fbuf, gboolean automatic)
Sets the automatic next-message mode flag on a Buffer.
@ FB_IE_SEM_QUANTITY
Describes an information element as a quantity.
Definition: public.h:383
gboolean fbTemplateContainsElement(const fbTemplate_t *tmpl, const fbInfoElement_t *element)
Determines if a template contains a given information element.
void fbBasicListCollectorInit(fbBasicList_t *basicList)
Initializes a BasicList for collection, setting all properties of the list to 0 or NULL.
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Returns a pointer to the next information element in the information model.
A single IPFIX Information Element specification.
Definition: public.h:1581
uint32_t fbCollectorGetObservationDomain(const fbCollector_t *collector)
Retrieves the observation domain of the node connected to the UDP collector.
fbCollector_t * fbSessionGetCollector(const fbSession_t *session)
Retrieves the Collector that was associated with session by an explicit call to fBufAllocForCollectio...
fbTemplateSetCompareStatus_en
Defines the values returned by fbTemplatesSetCompare() when checking whether one fbTemplate_t is a su...
Definition: public.h:5032
fbTransport_t transport
Transport protocol to use.
Definition: public.h:1699
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.h:2197
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...
@ FB_IE_SEM_LIST
Describes an information element as a list element.
Definition: public.h:403
fbTransport_en
Transport protocol for connection specifier.
Definition: public.h:1664
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...
char * ssl_key_file
Path to private key file.
Definition: public.h:1709
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.
@ FB_IE_SEM_SNMPCOUNTER
Describes an information element as an SNMP counter.
Definition: public.h:407
char * svc
Service name or port number to connect/listen to.
Definition: public.h:1703
struct fbListenerGroupResult_st fbListenerGroupResult_t
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
@ FB_UINT_8
The "unsigned8" data type: A non-negative integer value in the range of 0 to 255 (0xFF).
Definition: public.h:707
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateList)
Clears a subTemplateList structure, notably freeing the internal buffer and setting it to NULL.
uint16_t fbRecordGetFieldCount(const fbRecord_t *record)
Returns the number of fields in a record.
struct fbRecordValue_st fbRecordValue_t
fbRecordValue_t is used to access the value of a single Element (or Field) in an fbRecord_t.
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:1458
uint16_t num
Information Element number.
Definition: public.h:802
uint32_t ip4
Used when ie is FB_IP4_ADDR.
Definition: public.h:1453
GString * stringbuf
An internal buffer used to store the varfield value.
Definition: public.h:1417
uint16_t fbTemplateInfoGetParentTid(const fbTemplateInfo_t *tmplInfo)
Returns the parentTid value specified in fbTemplateInfoInit().
fbTemplateField_t represents an fbInfoElement_t that has been added to an fbTemplate_t.
Definition: public.h:1037
@ FB_MAC_ADDR
The "macAddress" data type: A MAC-48 address as a string of 6 octets.
Definition: public.h:740
uint32_t flags
Flags.
Definition: public.h:810
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1644
void fbInfoModelAddElementArray(fbInfoModel_t *model, const fbInfoElement_t *ie)
Adds multiple information elements in an array to an information model.
@ FB_LIST_SEM_UNDEFINED
Semantic field for indicating the value has not been set.
Definition: public.h:2143
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.
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list (fbSubTemplateMultiListClear()), then frees the STML itself.
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.
char * ssl_key_pass
Private key decryption password.
Definition: public.h:1711
@ FB_UDP
Unreliable datagram transport via UDP.
Definition: public.h:1673
@ FB_OCTET_ARRAY
The "octetArray" data type: A finite-length string of octets.
Definition: public.h:704
gboolean fbListSemanticsIsValid(uint8_t semantic)
Validates the value of a structured data types semantic field, as defined in RFC 6313 and listed at I...
struct fbInfoElementSpecId_st fbInfoElementSpecId_t
A single IPFIX Information Element specification using the element's numeric identifier and private e...
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory holding the sub-records' data used by this entry.
An IPFIX template or options template structure.
Definition: private.h:108
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:3384
void fbCollectorClose(fbCollector_t *collector)
Closes the file or socket underlying a collecting process endpoint.
@ FB_IE_UNITS_MICROSECONDS
Describes an information element as counting microseconds.
Definition: public.h:590
uint8_t semantic
value used to describe the list of sub templates
Definition: public.h:2829
fbSubTemplateMultiListEntry_t represents structured data instances within a fbSubTemplateMultiList_t ...
Definition: public.h:2838
@ FB_FLOAT_32
The "float32" data type: An IEEE single-precision 32-bit floating point type.
Definition: public.h:732
@ FB_IE_SEM_FLAGS
Describes an information element as a flags element.
Definition: public.h:399
uint8_t * rec
The buffer holding the data for a record.
Definition: public.h:1381
void fBufListFree(const fbTemplate_t *tmpl, uint8_t *record)
Clears all of the memory that fixbuf allocated during transcode of this record.
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.
fbSubTemplateMultiList_t provides the internal representation of an fbInfoElement_t of type subTempla...
Definition: public.h:2823
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:129
const struct sockaddr * fbCollectorGetPeer(const fbCollector_t *collector)
Retrieves information about the node connected to this collector.
gboolean fBufNextRecord(fBuf_t *fbuf, fbRecord_t *record, GError **err)
Sets the internal template on a Buffer and gets its next record.
uint32_t dataLength
octet length of the buffer used to hold the data in this entry
Definition: public.h:2844
gboolean fBufSetAutomaticElementInsert(fBuf_t *fbuf, GError **err)
Enables automatic insertion of RFC 5610 elements read from a Buffer.
void fbExporterResetOctetCount(fbExporter_t *exporter)
Resets the counter that holds the number of octets written to the exporter's file,...
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.
Fixbuf's version information.
struct fbInfoElementOptRec_st fbInfoElementOptRec_t
The corresponding C struct for a record whose template is the RFC 5610 Information Element Type Optio...
@ FB_IE_UNITS_WORDS
Describes an information element as counting 4-octet words, as for IPv4-header length.
Definition: public.h:599
struct fbListenerEntry_st fbListenerEntry_t
ListenerEntry's make up an fbListenerGroup_t as a linked list.
@ FB_IE_SEM_SNMPGAUGE
Describes an information element as a SNMP gauge.
Definition: public.h:411
fbRecordValue_t * fbRecordValueCopy(fbRecordValue_t *dstValue, const fbRecordValue_t *srcValue)
Copies srcValue to dstValue and returns dstValue.
@ 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:729
void * fbBasicListInit(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes a BasicList for export.
@ FB_SUB_TMPL_LIST
The "subTemplateList" data type: A structured data element as described in RFC6313,...
Definition: public.h:771
size_t fBufRemaining(fBuf_t *fbuf)
When using fBufSetBuffer(), returns the number of unprocessed octets in the octet array.
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
Definition: public.h:2072
const char * name
Information element name.
Definition: public.h:821
@ FB_TMPL_SETCMP_COMMON
Indicates the templates contain common elements but each has elements that the other does not.
Definition: public.h:5041
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.
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t additional)
Increases the size of the list's internal buffer to hold additional more elements (sub-records).
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.
uint32_t recordLength
octet length of a record (in memory) described by the template
Definition: public.h:2846
struct fbListenerEntry_st * next
pointer to the next listener entry in the linked list
Definition: public.h:2060
@ FB_IE_UNITS_PACKETS
Describes an information element as counting packets.
Definition: public.h:574
ListenerEntry's make up an fbListenerGroup_t as a linked list.
Definition: public.h:2058
void fbSessionResetExternal(fbSession_t *session)
Resets the external state (sequence numbers and templates) in a session state container.
struct fbBasicListInfo_st fbBasicListInfo_t
fbBasicListInfo_t describes a basicList and is used by fbTemplateInfo_t.
Definition: public.h:1742
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 ...
struct timespec dt
Used when ie is FB_DT_SEC, FB_DT_MILSEC, FB_DT_MICROSEC, or FB_DT_NANOSEC.
Definition: public.h:1449
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Sets the SCTP stream for the next message exported.
@ FB_LIST_SEM_ALL_OF
Semantic field for the all-of value defined in RFC 6313.
Definition: public.h:2159
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:154
fbBasicList_t * fbBasicListAlloc(void)
Allocates and returns an empty BasicList.
void fbBasicListSetSemantic(fbBasicList_t *basicList, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) for describing a basic list.
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the template pointer used to structure the data elements.
gboolean fBufSetTemplatesForExport(fBuf_t *fbuf, uint16_t tid, GError **err)
Sets the internal and external templates on a Buffer to the given template ID.
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.
@ FB_FLOAT_64
The "float64" data type: An IEEE double-precision 64-bit floating point type.
Definition: public.h:735
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...
@ 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:717
@ FB_IE_UNITS_SECONDS
Describes an information element as counting seconds.
Definition: public.h:582
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t additional)
Increases the size of the list's internal data buffer to hold additional more elements.
struct fbTemplateField_st fbTemplateField_t
fbTemplateField_t represents an fbInfoElement_t that has been added to an fbTemplate_t.
gboolean fBufSetAutomaticMetadataAttach(fBuf_t *fbuf, GError **err)
Instructes a collection Buffer to process Template Metadata records.
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...
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...
void * fbCollectorGetContext(const fbCollector_t *collector)
Retrieves the application context associated with a collector.
uint32_t enterprise_id
The private enterprise number (PEN) of the element or 0 for an IANA-defined element.
Definition: public.h:1629
@ FB_IE_UNITS_INFERRED
Describes an information element as having units inferred from some other element.
Definition: public.h:627
Connection specifier.
Definition: public.h:1697
uint16_t fbBasicListInfoGetContentIdent(const fbBasicListInfo_t *blInfo, uint32_t *pen)
Gets from blInfo the element numbers for the fbInfoElement_t that the BasicList contains.
const fbTemplate_t * fbTemplateIterGetTemplate(const fbTemplateIter_t *iter)
Returns the Template to which the TemplateIter is bound.
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...
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.h:2535
@ 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:713
struct fbTemplateIter_st fbTemplateIter_t
fbTemplateIter_t iterates over the fbTemplateField_t objects in an fbTemplate_t.
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates and returns an empty subTemplateMultiList structure.
struct fbVarfield_st fbVarfield_t
A variable-length field value.
uint16_t fbTemplateIterGetPosition(const fbTemplateIter_t *iter)
Returns the position of the fbTemplateField_t returned by the most recent call to fbTemplateIterNext(...
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.
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.
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...
A single IPFIX Information Element specification using the element's numeric identifier and private e...
Definition: public.h:1624
void fbTemplateInfoFree(fbTemplateInfo_t *tmplInfo)
Frees a template metadata structure.
uint16_t fbSubTemplateMultiListEntryGetTemplateID(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the template ID for the template used to structure the data.
@ FB_IE_UNITS_NONE
Describes an information element as having no units.
Definition: public.h:562
int(* fbRecordSubRecordCallback_fn)(const fbRecord_t *record, void *ctx)
Signature of the callback function required by fbRecordFindAllSubRecords().
Definition: public.h:5433
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...
const fbSubTemplateList_t * stl
Used when ie is FB_SUB_TMPL_LIST.
Definition: public.h:1431
struct fbRecord_st fbRecord_t
fbRecord_t maintains a buffer holding an IPFIX record's data, the fbTemplate_t that describes that da...
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.
@ FB_IP6_ADDR
The "ipv6Address" data type: A value of an IPv6 address.
Definition: public.h:765
void fbRecordFreeLists(fbRecord_t *record)
Releases all of the memory allocated during transcode of this record, freeing the list structures,...
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.
The corresponding C struct for a record whose template is the RFC 5610 Information Element Type Optio...
Definition: public.h:1513
@ FB_IE_UNITS_NANOSECONDS
Describes an information element as counting nanoseconds.
Definition: public.h:594
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.
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Sets the internal template on a buffer to the given template ID.
uint8_t type
Data Type, an fbInfoElementDataType_t.
Definition: public.h:812
@ FB_IE_UNITS_FRAMES
Describes an information element as counting frames, as for Layer 2 frames.
Definition: public.h:617
void * fbBasicListResize(fbBasicList_t *basicList, uint16_t newCount)
Resizes and zeroes the list's internal buffer for elements.
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *subTemplateList)
Initializes a SubTemplateList variable on a fbCollector_t.
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition: public.h:2825
fbSubTemplateList_t provides the internal representation of an fbInfoElement_t of type subTemplateLis...
Definition: public.h:2521
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Frees the listener group result returned from fbListenerGroupWait().
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Accepts connections for multiple listeners.
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t additional)
Increases the size of the entry's internal buffer to hold additional more elements (sub-records).
@ FB_BASIC_LIST
The "basicList" data type: A structured data element as described in RFC6313, Section 4....
Definition: public.h:768
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Frees a template if it is not currently in use by any Session.
fbInfoModel_t * fbTemplateGetInfoModel(const fbTemplate_t *tmpl)
Returns the information model, as understood by the template.
const fbTemplate_t * tmpl
pointer to the template used to structure the data in this list
Definition: public.h:2523
uint8_t ip6[16]
Used when ie is FB_IP6_ADDR.
Definition: public.h:1423
void * fbSubTemplateMultiListEntryInit(fbSubTemplateMultiListEntry_t *entry, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes the multi list entry with the template values, and allocates the memory used by the entry...
@ FB_IE_UNITS_ENTRIES
Describes an information element as counting entries, as for MPLS label stack.
Definition: public.h:612
A variable-length field value.
Definition: public.h:137
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
A deprecated alias for fBufSetAutomaticElementInsert().
fbBasicList_t provides the internal representation of an fbInfoElement_t of type basicList (FB_BASIC_...
Definition: public.h:2189
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Deprecated.
fbExporter_t * fbExporterAllocFile(const char *path)
Allocates an exporting process endpoint for a named file.
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Returns the number of information elements in the information model.
struct fbTemplateInfo_st fbTemplateInfo_t
fbTemplateInfo_t describes an fbTemplate_t.
Definition: public.h:1732
@ FB_DTLS_SCTP
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1679
int64_t s64
Used when ie is FB_INT_8, FB_INT_16, FB_INT_32, or FB_INT_64.
Definition: public.h:1463
char * ssl_ca_file
Path to certificate authority file.
Definition: public.h:1705
uint8_t fbSubTemplateListGetSemantic(const fbSubTemplateList_t *subTemplateList)
Gets the list semantics value (fbListSemantics_t) from a SubTemplateList.
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.h:1721
@ FB_LIST_SEM_NONE_OF
Semantic field for none-of value defined in RFC 6313.
Definition: public.h:2147
uint64_t ie_range_end
ie range max
Definition: public.h:1529
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocates a new buffer for export.
uint64_t max
range max
Definition: public.h:816
uint8_t fbBasicListGetSemantic(const fbBasicList_t *basicList)
Returns the list semantics value (fbListSemantics_t) for a BasicList.
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocates a collecting process endpoint for an open file.
uint16_t fbTemplateInfoGetTemplateId(const fbTemplateInfo_t *tmplInfo)
Returns the Template ID value associated with this TemplateInfo.
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...
uint16_t ie_id
information element id
Definition: public.h:1517
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.
@ FB_IE_UNITS_MILLISECONDS
Describes an information element as counting milliseconds.
Definition: public.h:586
fbListSemantics_en
fbListSemantics_t defines the possible values for the semantics of the structured Data Types: basicLi...
Definition: public.h:2139
@ FB_IE_UNITS_HOPS
Describes an information element as counting hops, as for TTL.
Definition: public.h:607
uint8_t padding[6]
padding to align within the template
Definition: public.h:1525
@ FB_TMPL_SETCMP_SUBSET
Indicates the first template is a strict subset of the second.
Definition: public.h:5034
size_t len
Length of content in buffer.
Definition: public.h:139
@ FB_STRING
The "string" data type: A finite-length string of valid characters from the Unicode character encodin...
Definition: public.h:743
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associates an exporting process endpoint with a buffer.
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Reads a new message into a buffer using the associated collecting process endpoint.
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
@ FB_LIST_SEM_EXACTLY_ONE_OF
Semantic field for exactly-one-of value defined in RFC 6313.
Definition: public.h:2151
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...
uint16_t numElements
number of elements in this entry
Definition: public.h:2848
const fbInfoElement_t * fbBasicListGetInfoElement(const fbBasicList_t *basicList)
Returns a pointer to the information element used in the basic list.
uint16_t fbSubTemplateMultiListEntryCountElements(const fbSubTemplateMultiListEntry_t *entry)
Returns the number of entries the sub template multi list entry is capable of holding.
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list parameters but does not free the data ptr.
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
uint16_t ie_units
ie units (fbInfoElementUnits_t)
Definition: public.h:1523
fbInfoElementUnits_en
fbInfoElementUnits_t defines the possible units on an fbInfoElement_t.
Definition: public.h:558
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocates a new empty template.
void fbListenerInterrupt(fbListener_t *listener)
Causes the current or next call to fbListenerWait() to unblock and return.
uint32_t ie_pen
private enterprise number
Definition: public.h:1515
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.
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateList, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) of a SubTemplateList.
uint16_t midx
Multiple IE index.
Definition: public.h:1044
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Appends a record to a buffer.
fbExporter_t * fBufGetExporter(const fBuf_t *fbuf)
Retrieves the exporting process endpoint associated with a buffer.
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.
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.
The numeric pair to identify the element.
Definition: public.h:1626
fbExporter_t * fbExporterAllocNet(const fbConnSpec_t *spec)
Allocates an exporting process endpoint for a network connection.
fbTemplate_t * fBufGetCollectionTemplate(const fBuf_t *fbuf, uint16_t *ext_tid)
Retrieves the external template used to read the last record from the buffer.
@ FB_TLS_TCP
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1684
uint8_t mac[6]
Used when ie is FB_MAC_ADDR.
Definition: public.h:1471
uint8_t semantic
semantic field to describe the list
Definition: public.h:2199
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...
struct fbListenerGroupResult_st * next
Pointer to the next listener group result.
Definition: public.h:2074
const fbTemplateField_t * fbTemplateIterNext(fbTemplateIter_t *iter)
Returns the next TemplateField in the fbTemplate_t.
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Removes a template from a session.
fbTemplateIter_t iterates over the fbTemplateField_t objects in an fbTemplate_t.
Definition: public.h:1192
void * fbSubTemplateMultiListEntryResize(fbSubTemplateMultiListEntry_t *entry, uint16_t newCount)
Resizes and zeroes the entry's internal buffer for elements (sub-records).
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list (fbSubTemplateListClear()) then frees the subTemplateList itself.
@ 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:726
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates and returns an empty subTemplateList structure.
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...
fbTemplateField_t field
the description of one element in the list
Definition: public.h:2193
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.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListInit(fbSubTemplateMultiList_t *STML, uint8_t semantic, uint16_t numElements)
Initializes the multi list with the list semantic and allocates memory to store numElements entries.
gchar * fbRecordValueTakeVarfieldBuf(fbRecordValue_t *value)
Returns a pointer to the string buffer used by value to store fbVarfield_t values and transfers owner...
@ FB_IP4_ADDR
The "ipv4Address" data type: A value of an IPv4 address.
Definition: public.h:763
void * vai
Pointer to address info cache.
Definition: public.h:1716
@ FB_DT_SEC
The "dateTimeSeconds" data type: An unsigned 32-bit integer containing the number of seconds since th...
Definition: public.h:747
uint16_t fbTemplateInfoGetApplabel(const fbTemplateInfo_t *tmplInfo)
Returns the applabel value specified in fbTemplateInfoInit().
@ FB_DT_NANOSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:761
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Waits on a listener.
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.
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.
fbSession_t * fBufGetSession(const fBuf_t *fbuf)
Retrieves the session associated with a buffer.
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 ...
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert SFlow into IPFIX for the given collector.
fbVarfield_t ie_name
information element name
Definition: public.h:1531
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Clears the memory used by all the entries of a sub template multi list.
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.h:2076
void fbTemplateSetContext(fbTemplate_t *tmpl, void *tmpl_ctx, void *app_ctx, fbTemplateCtxFree_fn ctx_free)
Sets the context pointers on a Template.
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocates an exporting process endpoint for an opened ANSI C file pointer.
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Clears all of the fbSubTemplateMultiListEntry_t objects on this STML (see fbSubTemplateMultiListClear...
void fbListenerGroupFree(fbListenerGroup_t *group)
Frees a listener group.
@ FB_UINT_16
The "unsigned16" data type: A non-negative integer value in the range of 0 to 65535 (0xFFFF).
Definition: public.h:710
void fbExporterClose(fbExporter_t *exporter)
Forces the file or socket underlying an exporting process endpoint to close.
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Clears the parameters of the basic list but does not free the buffer.
uint16_t numElements
number of elements in the list
Definition: public.h:2531
uint16_t element_id
The numeric identifier of the element within its PEN.
Definition: public.h:1631
enum fbListSemantics_en fbListSemantics_t
fbListSemantics_t defines the possible values for the semantics of the structured Data Types: basicLi...
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.
const fbTemplateField_t * fbTemplateIterGetField(const fbTemplateIter_t *iter)
Returns the same TemplateField returned by the most recent call to fbTemplateIterNext().
uint16_t tid
The template ID for tmpl.
Definition: public.h:1387
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...
uint32_t ent
Private Enterprise Number.
Definition: public.h:797
uint32_t flags
Application flags word.
Definition: public.h:1602
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 fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.h:2840
size_t reccapacity
The number of bytes allocated for the rec buffer.
Definition: public.h:1383
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:2044
@ FB_IE_SEM_DELTACOUNTER
Describes an information element as a deltaCounter.
Definition: public.h:391
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.
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 ...
fbVarfield_t ie_desc
information element description
Definition: public.h:1533
fbListener_t * fbListenerAlloc(const fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocates a listener.
void fbBasicListFree(fbBasicList_t *basicList)
Clears the basic list (fbBasicListClear()), then frees the basic list itself.
@ FB_TCP
Reliable stream transport via TCP.
Definition: public.h:1671
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...
fbRecord_t maintains a buffer holding an IPFIX record's data, the fbTemplate_t that describes that da...
Definition: public.h:1377
@ FB_TMPL_SETCMP_SUPERSET
Indicates the first template is a strict superset of the second.
Definition: public.h:5038
uint32_t fBufGetExportTime(const fBuf_t *fbuf)
Retrieves the export time on the message currently in a buffer.
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.
uint16_t tmplID
ID of the template used to structure the data.
Definition: public.h:2533
const fbInfoElement_t * ie
The element that describes this data.
Definition: public.h:1415
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait(), except that this function does not moni...
const fbTemplate_t * fbSubTemplateListGetTemplate(const fbSubTemplateList_t *subTemplateList)
Gets the template pointer from the list structure.
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Sets the export time on the message currently in a buffer.
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocates a new buffer for collection.
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 ...
fbCollector_t * fBufGetCollector(const fBuf_t *fbuf)
Retrieves the collecting process endpoint associated with a buffer.
uint8_t * buf
Content buffer.
Definition: public.h:146
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.
@ FB_DT_MICROSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:756
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...
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
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.
uint8_t ie_type
ie data type (fbInfoElementDataType_t)
Definition: public.h:1519
void * fbSubTemplateListInit(fbSubTemplateList_t *sTL, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes a subTemplateList structure and allocates the internal buffer to a size capable of holdin...
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 ...
uint32_t flags
Application flags word.
Definition: public.h:1651
fbTemplateInfo_t * fbTemplateInfoCopy(const fbTemplateInfo_t *tmplInfo)
Makes a copy of TemplateInfo.
uint64_t ie_range_begin
ie range min
Definition: public.h:1527
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP() but for TLS (not tested)
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t additional)
Increases the size of the list's internal buffer to hold additional more entries.
void fbInfoModelFree(fbInfoModel_t *model)
Frees an information model.
void fbInfoModelAddElement(fbInfoModel_t *model, const fbInfoElement_t *ie)
Adds a single information element to an information model.
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:2027
gboolean fbTemplateInfoInit(fbTemplateInfo_t *tmplInfo, const char *name, const char *description, uint16_t appLabel, uint16_t parentTid)
Initializes a template metadata structure.
fbTemplateInfo_t * fbTemplateInfoAlloc(void)
Allocates and returns an empty template metadata information structure.
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.
@ FB_LIST_SEM_ORDERED
Semantic field for the ordered value defined in RFC 6313.
Definition: public.h:2163
uint16_t numElements
number of sub template lists in the multi list
Definition: public.h:2827
void fbExporterAutoStream(fbExporter_t *exporter)
Enables automatic SCTP stream selection for the next message exported.
@ FB_IE_SEM_IDENTIFIER
Describes an information element as an identifier.
Definition: public.h:395
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.
const char * name
Information element name.
Definition: public.h:1583
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocates an exporting process to use the existing buffer buf having the specified size.
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:2064
fbRecordValue_t is used to access the value of a single Element (or Field) in an fbRecord_t.
Definition: public.h:1413
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert NetFlowV9 into IPFIX for the given collector.
uint32_t fbSessionGetDomain(const fbSession_t *session)
Retrieves the current domain on a session.
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.
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.h:2850
@ FB_TMPL_SETCMP_DISJOINT
Indicates the templates contain no common elements.
Definition: public.h:5043
uint16_t fbBasicListCountElements(const fbBasicList_t *basicList)
Returns the number of elements the basic list is capable of holding.
fbTemplate_t * tmpl
Octet-length of this IE in memory.
Definition: public.h:1064
void * fbBasicListGetDataPtr(const fbBasicList_t *basicList)
Gets a pointer to the data buffer for the basic list.
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
uint16_t fbSubTemplateMultiListCountElements(const fbSubTemplateMultiList_t *STML)
Returns the number of entries the sub template multi list is capable of holding.
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
Removes an input translator from a given collector such that it will operate on IPFIX protocol again.
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.h:2078
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.h:2091
void fbSessionFree(fbSession_t *session)
Frees a transport session state container.
struct fbListenerGroup_st fbListenerGroup_t
Structure that represents a group of listeners.
Definition: public.h:2053
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListResize(fbSubTemplateMultiList_t *STML, uint16_t newCount)
Resizes and zeroes the list's internal buffer for entries (fbSubTemplateMultiListEntry_t).
@ FB_IE_UNITS_MESSAGES
Describes an information element as counting messages.
Definition: public.h:603
const char * fbTemplateInfoGetName(const fbTemplateInfo_t *tmplInfo)
Returns the name value specified in fbTemplateInfoInit().
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.h:701
enum fbInfoElementUnits_en fbInfoElementUnits_t
fbInfoElementUnits_t defines the possible units on an fbInfoElement_t.
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.h:1661
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Enables or disables multi-session mode for a fbCollector_t associated with a UDP fbListener_t.
void fbListenerFree(fbListener_t *listener)
Frees a listener.
const char * description
Element description.
Definition: public.h:823
fbInfoModel_t * fbSessionGetInfoModel(const fbSession_t *session)
Gets the info model for the session.
uint16_t fbSessionGetLargestInternalTemplateSize(fbSession_t *session)
Gets the largest decoded size of an internal template in the session.
gboolean fbInfoModelReadXMLFile(fbInfoModel_t *model, const gchar *filename, GError **err)
Adds information specified in the given XML file to the information model.
gboolean fbBasicListGetIndexedRecordValue(const fbBasicList_t *basicList, uint16_t index, fbRecordValue_t *value)
Fills a RecordValue from the data for the indexth element in basicList.
@ FB_DTLS_UDP
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.h:1690
uint16_t fbBasicListGetElementLength(const fbBasicList_t *basicList)
Returns the octet length of an individual element in the BasicList.
void fbBasicListClear(fbBasicList_t *basicList)
Clears the parameters of the BasicList and frees the data buffer.
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
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.
gboolean fbTemplateAppend(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie, GError **err)
Appends an information element to a template.
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) for the multi list.
uint16_t fbTemplateGetOptionsScope(const fbTemplate_t *tmpl)
Determines number of scope information elements in a template.
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.h:2842
@ FB_IE_UNITS_OCTETS
Describes an information element as counting octets.
Definition: public.h:570
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(const fbSubTemplateMultiList_t *STML)
Retrieves the first entry in the multi list.
uint32_t recordLength
octet length of a record (in memory) described by the template
Definition: public.h:2529
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...
enum fbTemplateSetCompareStatus_en fbTemplatesSetCompareStatus_t
Defines the values returned by fbTemplatesSetCompare() when checking whether one fbTemplate_t is a su...
uint16_t len
Standard information element length in octets; FB_IE_VARLEN for strings, octetArrays,...
Definition: public.h:807
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associates an collecting process endpoint with a buffer.
char * host
Hostname to connect/listen to.
Definition: public.h:1701
void fbSessionSetCallbackCopyTemplates(fbSession_t *incomingSession, fbSession_t *exportSession)
Arranges for templates read by incomingSession to be copied to exportSession by setting the new templ...
char * ssl_cert_file
Path to certificate file.
Definition: public.h:1707
const fbTemplate_t * tmpl
The template that describes the bytes in rec.
Definition: public.h:1379
@ FB_IE_UNITS_PORTS
Describes an information element as counting ports.
Definition: public.h:621
const fbTemplateField_t * fbTemplateGetFieldByPosition(const fbTemplate_t *tmpl, uint16_t position)
Returns a field in a template at a specific position.
gboolean fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Sets the number of information elements in a template that are scope.
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.
uint64_t min
range min
Definition: public.h:814
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.
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieves a record from a Buffer associated with a collecting process.
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
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.
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...
The value depending on the type of ie.
Definition: public.h:1419
@ FB_IE_SEM_TOTALCOUNTER
Describes an information element as a totalCounter.
Definition: public.h:387
@ FB_SUB_TMPL_MULTI_LIST
The "subTemplateMultiList" data type: A structured data element as described in RFC6313,...
Definition: public.h:774
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Sets the current observation domain on a session.
const fbSubTemplateMultiList_t * stml
Used when ie is FB_SUB_TMPL_MULTI_LIST.
Definition: public.h:1435
struct fbListenerEntry_st * prev
pointer to the previous listener entry in the linked list
Definition: public.h:2062
@ FB_INT_16
The "signed16" data type: An integer value in the range of -32768 to 32767.
Definition: public.h:723
uint8_t fbSubTemplateMultiListGetSemantic(const fbSubTemplateMultiList_t *STML)
Gets the list semantics value (fbListSemantics_t) from the multi list.
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...
size_t recsize
The number of bytes used by the record current in rec.
Definition: public.h:1385
@ FB_IE_SEM_DEFAULT
Describes an information element as having no specific semantics.
Definition: public.h:379
fbInfoElementSemantics_en
fbInfoElementSemantics_t defines the possible semantics of an fbInfoElement_t.
Definition: public.h:375
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 * fbSessionGetTemplate(const fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieves a template from a session by ID.
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.
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...
@ FB_LIST_SEM_ONE_OR_MORE_OF
Semantic field for the one-or-more-of value defined in RFC 6313.
Definition: public.h:2155
void * fbSubTemplateMultiListEntryGetDataPtr(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
uint32_t dataLength
octet length of the allocated buffer used to hold the data
Definition: public.h:2527