CERT NetSA Security Suite
Monitoring for Large-Scale Networks

# fixbuf

Documentation
public.h
Go to the documentation of this file.
1/*
2 ** public.h
3 ** fixbuf IPFIX Implementation Public Interface
4 **
5 ** ------------------------------------------------------------------------
6 ** Copyright (C) 2006-2020 Carnegie Mellon University. All Rights Reserved.
7 ** ------------------------------------------------------------------------
8 ** Authors: Brian Trammell, Dan Ruef
9 ** ------------------------------------------------------------------------
10 ** @OPENSOURCE_LICENSE_START@
11 ** libfixbuf 2.0
12 **
13 ** Copyright 2018-2020 Carnegie Mellon University. All Rights Reserved.
14 **
15 ** NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE
16 ** ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS"
17 ** BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND,
18 ** EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT
19 ** LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY,
20 ** EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE
21 ** MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF
22 ** ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR
23 ** COPYRIGHT INFRINGEMENT.
24 **
25 ** Released under a GNU-Lesser GPL 3.0-style license, please see
26 ** LICENSE.txt or contact permission@sei.cmu.edu for full terms.
27 **
28 ** [DISTRIBUTION STATEMENT A] This material has been approved for
29 ** public release and unlimited distribution. Please see Copyright
30 ** notice for non-US Government use and distribution.
31 **
32 ** Carnegie Mellon(R) and CERT(R) are registered in the U.S. Patent
33 ** and Trademark Office by Carnegie Mellon University.
34 **
35 ** DM18-0325
36 ** @OPENSOURCE_LICENSE_END@
37 **
38 ** ------------------------------------------------------------------------
39 */
40
1124#ifndef _FB_PUBLIC_H_
1125#define _FB_PUBLIC_H_
1126#include <fixbuf/autoinc.h>
1127#include <fixbuf/version.h>
1128
1129#ifdef __cplusplus
1130 extern "C" {
1131#endif
1132
1133
1138#define FIXBUF_CHECK_VERSION(major, minor, release) \
1139 (FIXBUF_VERSION_MAJOR > (major) || \
1140 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
1141 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
1142 FIXBUF_VERSION_RELEASE >= (release)))
1143
1144/*
1145 * Error Handling Definitions
1146 */
1147
1149#define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
1151#define FB_ERROR_TMPL 1
1156#define FB_ERROR_EOM 2
1162#define FB_ERROR_EOF 3
1167#define FB_ERROR_IPFIX 4
1173#define FB_ERROR_BUFSZ 5
1175#define FB_ERROR_IMPL 6
1177#define FB_ERROR_IO 7
1182#define FB_ERROR_NLREAD 8
1188#define FB_ERROR_NLWRITE 9
1192#define FB_ERROR_NOELEMENT 10
1196#define FB_ERROR_CONN 11
1201#define FB_ERROR_NETFLOWV9 12
1205#define FB_ERROR_TRANSMISC 13
1209#define FB_ERROR_SFLOW 14
1213#define FB_ERROR_SETUP 15
1217#define FB_ERROR_LAXSIZE 16
1218
1219/*
1220 * Public Datatypes and Constants
1221 */
1222
1228 typedef struct fBuf_st fBuf_t;
1229
1236 typedef struct fbVarfield_st {
1238 size_t len;
1245 uint8_t *buf;
1246} fbVarfield_t;
1247
1248
1253 typedef struct fbInfoModel_st fbInfoModel_t;
1254
1258 typedef GHashTableIter fbInfoModelIter_t;
1259
1265#define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_)\
1266 { {(const struct fbInfoElement_st*)_name_}, 0, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_ }
1267
1274#define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
1275 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char*)NULL)
1276
1277
1283#define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
1284
1291#define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
1292
1298#define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
1299
1304#define FB_IE_F_NONE 0x00000000
1305
1311#define FB_IE_F_ENDIAN 0x00000001
1312
1324#define FB_IE_F_REVERSIBLE 0x00000040
1325
1334#define FB_IE_F_ALIEN 0x00000080
1335
1340#define FB_IE_QUANTITY 0x00000100
1341
1347#define FB_IE_TOTALCOUNTER 0x00000200
1348
1353#define FB_IE_DELTACOUNTER 0x00000300
1354
1359#define FB_IE_IDENTIFIER 0x00000400
1360
1365#define FB_IE_FLAGS 0x00000500
1366
1372#define FB_IE_LIST 0x00000600
1373
1379#define FB_IE_SNMPCOUNTER 0x00000700
1380
1386#define FB_IE_SNMPGAUGE 0x00000800
1387
1393#define FB_IE_DEFAULT 0x00000000
1394
1405#define FB_UNITS_BITS 0x00010000
1411#define FB_UNITS_OCTETS 0x00020000
1417#define FB_UNITS_PACKETS 0x00030000
1423#define FB_UNITS_FLOWS 0x00040000
1429#define FB_UNITS_SECONDS 0x00050000
1435#define FB_UNITS_MILLISECONDS 0x00060000
1441#define FB_UNITS_MICROSECONDS 0x00070000
1447#define FB_UNITS_NANOSECONDS 0x00080000
1453#define FB_UNITS_WORDS 0x00090000
1459#define FB_UNITS_MESSAGES 0x000A0000
1465#define FB_UNITS_HOPS 0x000B0000
1471#define FB_UNITS_ENTRIES 0x000C0000
1477#define FB_UNITS_FRAMES 0x000D0000
1483#define FB_UNITS_PORTS 0x000E0000
1489#define FB_UNITS_INFERRED 0x000F0000
1490
1494#define FB_IE_VARLEN 65535
1495
1504#define FB_IE_BASIC_LIST 291
1513#define FB_IE_SUBTEMPLATE_LIST 292
1522#define FB_IE_SUBTEMPLATE_MULTILIST 293
1523
1532#define FB_IE_PEN_REVERSE 29305
1533
1542#define FB_IE_VENDOR_BIT_REVERSE 0x4000
1543
1549#define FB_CISCO_GENERIC 9999
1557#define FB_CISCO_ASA_EVENT_ID 9998
1567#define FB_CISCO_ASA_EVENT_XTRA 9997
1573#define FB_IE_REVERSE_STR "reverse"
1574
1576#define FB_IE_REVERSE_STRLEN 7
1577
1584 typedef enum fbInfoElementDataType_en {
1587 FB_OCTET_ARRAY,
1590 FB_UINT_8,
1593 FB_UINT_16,
1596 FB_UINT_32,
1600 FB_UINT_64,
1603 FB_INT_8,
1606 FB_INT_16,
1609 FB_INT_32,
1612 FB_INT_64,
1615 FB_FLOAT_32,
1618 FB_FLOAT_64,
1620 FB_BOOL,
1623 FB_MAC_ADDR,
1626 FB_STRING,
1630 FB_DT_SEC,
1634 FB_DT_MILSEC,
1639 FB_DT_MICROSEC,
1644 FB_DT_NANOSEC,
1646 FB_IP4_ADDR,
1648 FB_IP6_ADDR,
1651 FB_BASIC_LIST,
1654 FB_SUB_TMPL_LIST,
1657 FB_SUB_TMPL_MULTI_LIST
1658} fbInfoElementDataType_t;
1659
1668 typedef struct fbInfoElement_st {
1670 union {
1676 const struct fbInfoElement_st *canon;
1681 const char *name;
1682 } ref;
1683
1689 uint32_t midx;
1691 uint32_t ent;
1696 uint16_t num;
1698 uint16_t len;
1701 uint32_t flags;
1703 uint64_t min;
1705 uint64_t max;
1707 uint8_t type;
1709 const char *description;
1710} fbInfoElement_t;
1711
1737 typedef struct fbInfoElementOptRec_st {
1739 uint32_t ie_pen;
1741 uint16_t ie_id;
1743 uint8_t ie_type;
1745 uint8_t ie_semantic;
1747 uint16_t ie_units;
1749 uint8_t padding[6];
1751 uint64_t ie_range_begin;
1753 uint64_t ie_range_end;
1755 fbVarfield_t ie_name;
1757 fbVarfield_t ie_desc;
1758} fbInfoElementOptRec_t;
1759
1760
1773#define FB_TID_AUTO 0
1774
1778#define FB_TID_TS 2
1779
1783#define FB_TID_OTS 3
1784
1788#define FB_TID_MIN_DATA 256
1789
1795 typedef struct fbTemplate_st fbTemplate_t;
1796
1802#define FB_IESPEC_NULL { NULL, 0, 0 }
1803
1810 typedef struct fbInfoElementSpec_st {
1812 char *name;
1824 uint16_t len_override;
1831 uint32_t flags;
1832} fbInfoElementSpec_t;
1833
1840 typedef struct fbSession_st fbSession_t;
1841
1843 typedef enum fbTransport_en {
1848 FB_SCTP,
1850 FB_TCP,
1852 FB_UDP,
1858 FB_DTLS_SCTP,
1863 FB_TLS_TCP,
1869 FB_DTLS_UDP
1870} fbTransport_t;
1871
1876 typedef struct fbConnSpec_st {
1878 fbTransport_t transport;
1880 char *host;
1882 char *svc;
1884 char *ssl_ca_file;
1886 char *ssl_cert_file;
1888 char *ssl_key_file;
1890 char *ssl_key_pass;
1895 void *vai;
1900 void *vssl_ctx;
1901} fbConnSpec_t;
1902
1906#define FB_CONNSPEC_INIT { FB_SCTP, NULL, NULL, \
1907 NULL, NULL, NULL, NULL, \
1908 NULL, NULL }
1909
1910#if HAVE_SPREAD
1911
1915#define FB_SPREADPARAMS_INIT { 0, 0, 0 }
1916
1922 typedef struct fbSpreadParams_st {
1925 fbSession_t * session;
1928 char * daemon;
1931 char ** groups;
1932} fbSpreadParams_t;
1933
1934#endif /* HAVE_SPREAD */
1935
1941 typedef struct fbExporter_st fbExporter_t;
1942
1950 typedef struct fbCollector_st fbCollector_t;
1951
1958 typedef struct fbListener_st fbListener_t;
1959
1960/*
1961 * ListenerGroup and associated data type definitions
1962 */
1963
1967 typedef struct fbListenerGroup_st fbListenerGroup_t;
1968
1972 typedef struct fbListenerEntry_st {
1974 struct fbListenerEntry_st *next;
1976 struct fbListenerEntry_st *prev;
1978 fbListener_t *listener;
1979} fbListenerEntry_t;
1980
1986 typedef struct fbListenerGroupResult_st {
1988 struct fbListenerGroupResult_st *next;
1990 fbListener_t *listener;
1992 fBuf_t *fbuf;
1993} fbListenerGroupResult_t;
1994
2005 typedef void (*fbTemplateCtxFree_fn)(
2006 void *tmpl_ctx,
2007 void *app_ctx);
2008
2031 typedef void (*fbNewTemplateCallback_fn) (
2032 fbSession_t *session,
2033 uint16_t tid,
2034 fbTemplate_t *tmpl,
2035 void *app_ctx,
2036 void **tmpl_ctx,
2037 fbTemplateCtxFree_fn *tmpl_ctx_free_fn);
2038
2039
2047#define FB_LIST_SEM_UNDEFINED 0xFF
2051#define FB_LIST_SEM_NONE_OF 0x00
2055#define FB_LIST_SEM_EXACTLY_ONE_OF 0x01
2059#define FB_LIST_SEM_ONE_OR_MORE_OF 0x02
2063#define FB_LIST_SEM_ALL_OF 0x03
2067#define FB_LIST_SEM_ORDERED 0x04
2068
2076gboolean fbListValidSemantic(
2077 uint8_t semantic);
2078
2079/****** BASICLIST FUNCTIONS AND STRUCTS *******/
2085 typedef struct fbBasicList_st {
2087 const fbInfoElement_t *infoElement;
2089 uint8_t *dataPtr;
2091 uint16_t numElements;
2093 uint16_t dataLength;
2095 uint8_t semantic;
2096} fbBasicList_t;
2097
2098
2104 fbBasicList_t* fbBasicListAlloc(
2105 void);
2106
2119 void* fbBasicListInit(
2120 fbBasicList_t *basicList,
2121 uint8_t semantic,
2122 const fbInfoElement_t *infoElement,
2123 uint16_t numElements);
2124
2139 void* fbBasicListInitWithOwnBuffer(
2140 fbBasicList_t *basicList,
2141 uint8_t semantic,
2142 const fbInfoElement_t *infoElement,
2143 uint16_t numElements,
2144 uint16_t dataLength,
2145 uint8_t *dataPtr);
2146
2158 void fbBasicListCollectorInit(
2159 fbBasicList_t *basicList);
2160
2167uint16_t fbBasicListCountElements(
2168 const fbBasicList_t *basicList);
2169
2177uint8_t fbBasicListGetSemantic(
2178 fbBasicList_t *basicList);
2179
2187 void fbBasicListSetSemantic(
2188 fbBasicList_t *basicList,
2189 uint8_t semantic);
2190
2198 const fbInfoElement_t* fbBasicListGetInfoElement(
2199 fbBasicList_t *basicList);
2200
2206 void* fbBasicListGetDataPtr(
2207 fbBasicList_t *basicList);
2208
2218 void* fbBasicListGetIndexedDataPtr(
2219 fbBasicList_t *basicList,
2220 uint16_t index);
2221
2233 void* fbBasicListGetNextPtr(
2234 fbBasicList_t *basicList,
2235 void *currentPtr);
2236
2250 void* fbBasicListRealloc(
2251 fbBasicList_t *basicList,
2252 uint16_t newNumElements);
2253
2261 void* fbBasicListAddNewElements(
2262 fbBasicList_t *basicList,
2263 uint16_t numNewElements);
2264
2272 void fbBasicListClear(
2273 fbBasicList_t *basicList);
2274
2281 void fbBasicListClearWithoutFree(
2282 fbBasicList_t *basicList);
2283
2290 void fbBasicListFree(
2291 fbBasicList_t *basicList);
2292
2293
2294/******* END OF BASICLIST ********/
2295
2296
2297
2298/******* SUBTEMPLATELIST FUNCTIONS ****/
2299
2307 typedef struct fbSubTemplateList_st {
2310 union {
2311 size_t length;
2312 uint64_t extra;
2313 } dataLength;
2315 const fbTemplate_t *tmpl;
2317 uint8_t *dataPtr;
2319 uint16_t tmplID;
2321 uint16_t numElements;
2323 uint8_t semantic;
2324} fbSubTemplateList_t;
2325
2332 fbSubTemplateList_t* fbSubTemplateListAlloc(
2333 void);
2334
2352 void* fbSubTemplateListInit(
2353 fbSubTemplateList_t *sTL,
2354 uint8_t semantic,
2355 uint16_t tmplID,
2356 const fbTemplate_t *tmpl,
2357 uint16_t numElements);
2358
2374 void* fbSubTemplateListInitWithOwnBuffer(
2375 fbSubTemplateList_t *subTemplateList,
2376 uint8_t semantic,
2377 uint16_t tmplID,
2378 const fbTemplate_t *tmpl,
2379 uint16_t numElements,
2380 uint16_t dataLength,
2381 uint8_t *dataPtr);
2382
2396 void fbSubTemplateListCollectorInit(
2397 fbSubTemplateList_t *STL);
2398
2404 void* fbSubTemplateListGetDataPtr(
2405 const fbSubTemplateList_t *subTemplateList);
2406
2416 void* fbSubTemplateListGetIndexedDataPtr(
2417 const fbSubTemplateList_t *subTemplateList,
2418 uint16_t index);
2419
2431 void* fbSubTemplateListGetNextPtr(
2432 const fbSubTemplateList_t *subTemplateList,
2433 void *currentPtr);
2434
2441uint16_t fbSubTemplateListCountElements(
2442 const fbSubTemplateList_t *subTemplateList);
2443
2449 void fbSubTemplateListSetSemantic(
2450 fbSubTemplateList_t *subTemplateList,
2451 uint8_t semantic);
2452
2458uint8_t fbSubTemplateListGetSemantic(
2459 fbSubTemplateList_t *subTemplateList);
2460
2466 const fbTemplate_t* fbSubTemplateListGetTemplate(
2467 fbSubTemplateList_t *subTemplateList);
2468
2474uint16_t fbSubTemplateListGetTemplateID(
2475 fbSubTemplateList_t *subTemplateList);
2476
2492 void* fbSubTemplateListRealloc(
2493 fbSubTemplateList_t *subTemplateList,
2494 uint16_t newNumElements);
2495
2505 void* fbSubTemplateListAddNewElements(
2506 fbSubTemplateList_t *subTemplateList,
2507 uint16_t numNewElements);
2508
2523 void fbSubTemplateListClear(
2524 fbSubTemplateList_t *subTemplateList);
2525
2533 void fbSubTemplateListClearWithoutFree(
2534 fbSubTemplateList_t *subTemplateList);
2535
2543 void fbSubTemplateListFree(
2544 fbSubTemplateList_t *subTemplateList);
2545
2546/********* END OF SUBTEMPLATELIST **********/
2564 typedef struct fbSubTemplateMultiListEntry_st {
2566 fbTemplate_t *tmpl;
2568 uint8_t *dataPtr;
2570 size_t dataLength;
2572 uint16_t tmplID;
2574 uint16_t numElements;
2575} fbSubTemplateMultiListEntry_t;
2576
2581 typedef struct fbSubTemplateMultiList_st {
2583 fbSubTemplateMultiListEntry_t *firstEntry;
2585 uint16_t numElements;
2587 uint8_t semantic;
2588} fbSubTemplateMultiList_t;
2589
2590
2598 fbSubTemplateMultiList_t* fbSubTemplateMultiListAlloc(
2599 void);
2600
2601
2611 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListInit(
2612 fbSubTemplateMultiList_t *STML,
2613 uint8_t semantic,
2614 uint16_t numElements);
2615
2623uint16_t fbSubTemplateMultiListCountElements(
2624 const fbSubTemplateMultiList_t *STML);
2625
2631 void fbSubTemplateMultiListSetSemantic(
2632 fbSubTemplateMultiList_t *STML,
2633 uint8_t semantic);
2634
2640uint8_t fbSubTemplateMultiListGetSemantic(
2641 fbSubTemplateMultiList_t *STML);
2642
2650 void fbSubTemplateMultiListClear(
2651 fbSubTemplateMultiList_t *STML);
2652
2666 void fbSubTemplateMultiListClearEntries(
2667 fbSubTemplateMultiList_t *STML);
2668
2675 void fbSubTemplateMultiListFree(
2676 fbSubTemplateMultiList_t *STML);
2677
2692 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListRealloc(
2693 fbSubTemplateMultiList_t *STML,
2694 uint16_t newNumEntries);
2695
2704 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListAddNewEntries(
2705 fbSubTemplateMultiList_t *STML,
2706 uint16_t numNewEntries);
2707
2713 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetFirstEntry(
2714 fbSubTemplateMultiList_t *STML);
2715
2724 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetIndexedEntry(
2725 fbSubTemplateMultiList_t *STML,
2726 uint16_t index);
2727
2739 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetNextEntry(
2740 fbSubTemplateMultiList_t *STML,
2741 fbSubTemplateMultiListEntry_t *currentEntry);
2742
2757 void* fbSubTemplateMultiListEntryInit(
2758 fbSubTemplateMultiListEntry_t *entry,
2759 uint16_t tmplID,
2760 fbTemplate_t *tmpl,
2761 uint16_t numElements);
2762
2780 void* fbSubTemplateMultiListEntryRealloc(
2781 fbSubTemplateMultiListEntry_t *entry,
2782 uint16_t newNumElements);
2783
2793 void* fbSubTemplateMultiListEntryAddNewElements(
2794 fbSubTemplateMultiListEntry_t *entry,
2795 uint16_t numNewElements);
2796
2805 void fbSubTemplateMultiListEntryClear(
2806 fbSubTemplateMultiListEntry_t *entry);
2807
2814 void* fbSubTemplateMultiListEntryGetDataPtr(
2815 fbSubTemplateMultiListEntry_t *entry);
2816
2828 void* fbSubTemplateMultiListEntryNextDataPtr(
2829 fbSubTemplateMultiListEntry_t *entry,
2830 void *currentPtr);
2831
2842 void* fbSubTemplateMultiListEntryGetIndexedPtr(
2843 fbSubTemplateMultiListEntry_t *entry,
2844 uint16_t index);
2845
2853uint16_t fbSubTemplateMultiListEntryCountElements(
2854 const fbSubTemplateMultiListEntry_t *entry);
2855
2862 const fbTemplate_t* fbSubTemplateMultiListEntryGetTemplate(
2863 fbSubTemplateMultiListEntry_t *entry);
2864
2871uint16_t fbSubTemplateMultiListEntryGetTemplateID(
2872 fbSubTemplateMultiListEntry_t *entry);
2873
2874/************** END OF STML FUNCTIONS *********** */
2875
2891 void fBufListFree(
2892 fbTemplate_t *tmpl,
2893 uint8_t *record);
2894
2895
2904 fbListenerGroup_t* fbListenerGroupAlloc(
2905 void);
2906
2912 void fbListenerGroupFree(
2913 fbListenerGroup_t *group);
2914
2924 int fbListenerGroupAddListener(
2925 fbListenerGroup_t *group,
2926 const fbListener_t *listener);
2927
2937 int fbListenerGroupDeleteListener(
2938 fbListenerGroup_t *group,
2939 const fbListener_t *listener);
2940
2953 fbListenerGroupResult_t* fbListenerGroupWait(
2954 fbListenerGroup_t *group,
2955 GError **err);
2956
2962 void fbListenerFreeGroupResult(
2963 fbListenerGroupResult_t *result);
2964
2977 fBuf_t *fbListenerOwnSocketCollectorTCP(
2978 fbListener_t *listener,
2979 int sock,
2980 GError **err);
2981
2991 fBuf_t *fbListenerOwnSocketCollectorTLS(
2992 fbListener_t *listener,
2993 int sock,
2994 GError **err);
2995
3001 void fBufInterruptSocket(
3002 fBuf_t *fbuf);
3003
3004
3026 typedef gboolean (*fbListenerAppInit_fn) (
3027 fbListener_t *listener,
3028 void **ctx,
3029 int fd,
3030 struct sockaddr *peer,
3031 size_t peerlen,
3032 GError **err);
3033
3043 typedef void (*fbListenerAppFree_fn) (
3044 void *ctx);
3045
3046/*
3047 * Public Function Calls. These calls will remain available and retain
3048 * their functionality in all subsequent versions of libfixbuf.
3049 */
3050
3051
3068gboolean fBufSetInternalTemplate(
3069 fBuf_t *fbuf,
3070 uint16_t int_tid,
3071 GError **err);
3072
3090gboolean fBufSetExportTemplate(
3091 fBuf_t *fbuf,
3092 uint16_t ext_tid,
3093 GError **err);
3094
3095#if HAVE_SPREAD
3111 void fBufSetSpreadExportGroup(
3112 fBuf_t *fbuf,
3113 char **groups,
3114 int num_groups,
3115 GError **err);
3116#endif /* HAVE_SPREAD */
3117
3139 void fBufSetAutomaticMode(
3140 fBuf_t *fbuf,
3141 gboolean automatic);
3142
3164gboolean fBufSetAutomaticInsert(
3165 fBuf_t *fbuf,
3166 GError **err);
3167
3168
3176 fbSession_t *fBufGetSession(
3177 fBuf_t *fbuf);
3178
3187 void fBufFree(
3188 fBuf_t *fbuf);
3189
3202 fBuf_t *fBufAllocForExport(
3203 fbSession_t *session,
3204 fbExporter_t *exporter);
3205
3215 fbExporter_t *fBufGetExporter(
3216 fBuf_t *fbuf);
3217
3228 void fBufSetExporter(
3229 fBuf_t *fbuf,
3230 fbExporter_t *exporter);
3231
3232
3244 size_t fBufRemaining(
3245 fBuf_t *fbuf);
3246
3247
3260 void fBufSetBuffer(
3261 fBuf_t *fbuf,
3262 uint8_t *buf,
3263 size_t buflen);
3264
3265
3289gboolean fBufAppend(
3290 fBuf_t *fbuf,
3291 uint8_t *recbase,
3292 size_t recsize,
3293 GError **err);
3294
3304gboolean fBufEmit(
3305 fBuf_t *fbuf,
3306 GError **err);
3307
3319 void fBufSetExportTime(
3320 fBuf_t *fbuf,
3321 uint32_t extime);
3322
3339 fBuf_t *fBufAllocForCollection(
3340 fbSession_t *session,
3341 fbCollector_t *collector);
3342
3352 fbCollector_t *fBufGetCollector(
3353 fBuf_t *fbuf);
3354
3365 void fBufSetCollector(
3366 fBuf_t *fbuf,
3367 fbCollector_t *collector);
3368
3399gboolean fBufNext(
3400 fBuf_t *fbuf,
3401 uint8_t *recbase,
3402 size_t *recsize,
3403 GError **err);
3404
3417gboolean fBufNextMessage(
3418 fBuf_t *fbuf,
3419 GError **err);
3420
3428uint32_t fBufGetExportTime(
3429 fBuf_t *fbuf);
3430
3450 fbTemplate_t *fBufGetCollectionTemplate(
3451 fBuf_t *fbuf,
3452 uint16_t *ext_tid);
3453
3472 fbTemplate_t *fBufNextCollectionTemplate(
3473 fBuf_t *fbuf,
3474 uint16_t *ext_tid,
3475 GError **err);
3476
3491 fbInfoModel_t *fbInfoModelAlloc(
3492 void);
3493
3502 void fbInfoModelFree(
3503 fbInfoModel_t *model);
3504
3519 void fbInfoModelAddElement(
3520 fbInfoModel_t *model,
3521 fbInfoElement_t *ie);
3522
3541 void fbInfoModelAddElementArray(
3542 fbInfoModel_t *model,
3543 fbInfoElement_t *ie);
3544
3576gboolean fbInfoModelReadXMLFile(
3577 fbInfoModel_t *model,
3578 const gchar *filename,
3579 GError **err);
3580
3613gboolean fbInfoModelReadXMLData(
3614 fbInfoModel_t *model,
3615 const gchar *xml_data,
3616 gssize xml_data_len,
3617 GError **err);
3618
3630 const fbInfoElement_t *fbInfoModelGetElementByName(
3631 fbInfoModel_t *model,
3632 const char *name);
3633
3647 const fbInfoElement_t *fbInfoModelGetElementByID(
3648 fbInfoModel_t *model,
3649 uint16_t id,
3650 uint32_t ent);
3651
3659guint fbInfoModelCountElements(
3660 const fbInfoModel_t *model);
3661
3671 void fbInfoModelIterInit(
3672 fbInfoModelIter_t *iter,
3673 const fbInfoModel_t *model);
3674
3685 const fbInfoElement_t *fbInfoModelIterNext(
3686 fbInfoModelIter_t *iter);
3687
3701 fbTemplate_t *fbInfoElementAllocTypeTemplate(
3702 fbInfoModel_t *model,
3703 GError **err);
3704
3719gboolean fbInfoElementWriteOptionsRecord(
3720 fBuf_t *fbuf,
3721 const fbInfoElement_t *model_ie,
3722 uint16_t itid,
3723 uint16_t etid,
3724 GError **err);
3725
3737gboolean fbInfoElementAddOptRecElement(
3738 fbInfoModel_t *model,
3739 fbInfoElementOptRec_t *rec);
3740
3749gboolean fbInfoModelTypeInfoRecord(
3750 fbTemplate_t *tmpl);
3751
3770 fbTemplate_t *fbTemplateAlloc(
3771 fbInfoModel_t *model);
3772
3790gboolean fbTemplateAppend(
3791 fbTemplate_t *tmpl,
3792 fbInfoElement_t *ex_ie,
3793 GError **err);
3794
3812gboolean fbTemplateAppendSpec(
3813 fbTemplate_t *tmpl,
3814 fbInfoElementSpec_t *spec,
3815 uint32_t flags,
3816 GError **err);
3817
3833gboolean fbTemplateAppendSpecArray(
3834 fbTemplate_t *tmpl,
3835 fbInfoElementSpec_t *spec,
3836 uint32_t flags,
3837 GError **err);
3838
3846uint32_t fbTemplateCountElements(
3847 fbTemplate_t *tmpl);
3848
3863 void fbTemplateSetOptionsScope(
3864 fbTemplate_t *tmpl,
3865 uint16_t scope_count);
3866
3874uint32_t fbTemplateGetOptionsScope(
3875 fbTemplate_t *tmpl);
3876
3890gboolean fbTemplateContainsElement(
3891 fbTemplate_t *tmpl,
3892 const fbInfoElement_t *ex_ie);
3893
3905gboolean fbTemplateContainsElementByName(
3906 fbTemplate_t *tmpl,
3907 fbInfoElementSpec_t *spec);
3908
3920gboolean fbTemplateContainsAllElementsByName(
3921 fbTemplate_t *tmpl,
3922 fbInfoElementSpec_t *spec);
3923
3938gboolean fbTemplateContainsAllFlaggedElementsByName(
3939 fbTemplate_t *tmpl,
3940 fbInfoElementSpec_t *spec,
3941 uint32_t flags);
3942
3951 fbInfoElement_t* fbTemplateGetIndexedIE(
3952 fbTemplate_t *tmpl,
3953 uint32_t IEindex);
3954
3955
3963 fbInfoModel_t * fbTemplateGetInfoModel(
3964 fbTemplate_t *tmpl);
3965
3973 void fbTemplateFreeUnused(
3974 fbTemplate_t *tmpl);
3975
3983 void *fbTemplateGetContext(
3984 fbTemplate_t *tmpl);
3985
3993uint16_t fbTemplateGetIELenOfMemBuffer(
3994 fbTemplate_t *tmpl);
3995
4013 fbSession_t *fbSessionAlloc(
4014 fbInfoModel_t *model);
4015
4029gboolean fbSessionEnableTypeMetadata(
4030 fbSession_t *session,
4031 gboolean enabled,
4032 GError **err);
4033
4057uint16_t fbSessionSetMetadataExportElements(
4058 fbSession_t *session,
4059 gboolean enabled,
4060 uint16_t tid,
4061 GError **err);
4062
4077gboolean fbSessionEnableTemplateMetadata(
4078 fbSession_t *session,
4079 gboolean enabled,
4080 GError **err);
4081
4105uint16_t fbSessionSetMetadataExportTemplates(
4106 fbSession_t *session,
4107 gboolean enabled,
4108 uint16_t tid,
4109 GError **err);
4110
4128uint16_t fbSessionAddTemplateWithMetadata(
4129 fbSession_t *session,
4130 gboolean internal,
4131 uint16_t tid,
4132 fbTemplate_t *tmpl,
4133 const char *name,
4134 const char *description,
4135 GError **err);
4136
4143 fbInfoModel_t *fbSessionGetInfoModel(
4144 fbSession_t *session);
4145
4174 void fbSessionAddNewTemplateCallback(
4175 fbSession_t *session,
4176 fbNewTemplateCallback_fn callback,
4177 void *app_ctx);
4178
4201 void fbSessionAddTemplatePair(
4202 fbSession_t *session,
4203 uint16_t ent_tid,
4204 uint16_t int_tid);
4205
4214 void fbSessionRemoveTemplatePair(
4215 fbSession_t *session,
4216 uint16_t ext_tid);
4217
4226uint16_t fbSessionLookupTemplatePair(
4227 fbSession_t *session,
4228 uint16_t ext_tid);
4229
4239 void fbSessionFree(
4240 fbSession_t *session);
4241
4254 void fbSessionResetExternal(
4255 fbSession_t *session);
4256
4272 void fbSessionSetDomain(
4273 fbSession_t *session,
4274 uint32_t domain);
4275
4283uint32_t fbSessionGetDomain(
4284 fbSession_t *session);
4285
4296uint16_t fbSessionGetLargestInternalTemplateSize(
4297 fbSession_t *session);
4298
4306 fbCollector_t *fbSessionGetCollector(
4307 fbSession_t *session);
4308
4309#if HAVE_SPREAD
4332uint16_t fbSessionAddTemplatesMulticast(
4333 fbSession_t *session,
4334 char **groups,
4335 gboolean internal,
4336 uint16_t tid,
4337 fbTemplate_t *tmpl,
4338 GError **err);
4339
4363uint16_t fbSessionAddTemplatesMulticastWithMetadata(
4364 fbSession_t *session,
4365 char **groups,
4366 gboolean internal,
4367 uint16_t tid,
4368 fbTemplate_t *tmpl,
4369 char *name,
4370 char *description,
4371 GError **err);
4372
4373
4389gboolean fbSessionSpreadEnableTemplateMetadata(
4390 fbSession_t *session,
4391 char **groups,
4392 gboolean enabled,
4393 GError **err);
4394
4414uint16_t fbSessionSpreadSetMetadataExportTemplates(
4415 fbSession_t *session,
4416 char **groups,
4417 gboolean enabled,
4418 uint16_t tid,
4419 GError **err);
4420
4437gboolean fbSessionSpreadEnableTypeMetadata(
4438 fbSession_t *session,
4439 char **groups,
4440 gboolean enabled,
4441 GError **err);
4442
4461uint16_t fbSessionSpreadSetMetadataExportElements(
4462 fbSession_t *session,
4463 char **groups,
4464 gboolean enabled,
4465 uint16_t tid,
4466 GError **err);
4467#endif /* HAVE_SPREAD */
4468
4485gboolean fbSessionExportTemplate(
4486 fbSession_t *session,
4487 uint16_t tid,
4488 GError **err);
4489
4508gboolean fbSessionExportTemplates(
4509 fbSession_t *session,
4510 GError **err);
4511
4532uint16_t fbSessionAddTemplate(
4533 fbSession_t *session,
4534 gboolean internal,
4535 uint16_t tid,
4536 fbTemplate_t *tmpl,
4537 GError **err);
4538
4551gboolean fbSessionRemoveTemplate(
4552 fbSession_t *session,
4553 gboolean internal,
4554 uint16_t tid,
4555 GError **err);
4556
4568 fbTemplate_t *fbSessionGetTemplate(
4569 fbSession_t *session,
4570 gboolean internal,
4571 uint16_t tid,
4572 GError **err);
4573
4586 fbExporter_t *fbExporterAllocNet(
4587 fbConnSpec_t *spec);
4588
4589#if HAVE_SPREAD
4599 int fbCollectorGetSpreadReturnGroups(
4600 fbCollector_t *collector,
4601 char *groups[]);
4602
4616 fbExporter_t *fbExporterAllocSpread(
4617 fbSpreadParams_t *params);
4618
4619#endif /* HAVE_SPREAD */
4620
4632 fbExporter_t *fbExporterAllocFile(
4633 const char *path);
4634
4646 fbExporter_t *fbExporterAllocBuffer(
4647 uint8_t *buf,
4648 uint16_t bufsize);
4649
4650
4659 fbExporter_t *fbExporterAllocFP(
4660 FILE *fp);
4661
4674 void fbExporterSetStream(
4675 fbExporter_t *exporter,
4676 int sctp_stream);
4677
4690 void fbExporterAutoStream(
4691 fbExporter_t *exporter);
4692
4700 void fbExporterClose(
4701 fbExporter_t *exporter);
4702
4709 size_t fbExporterGetMsgLen(
4710 fbExporter_t *exporter);
4711
4724 fbCollector_t *fbCollectorAllocFile(
4725 void *ctx,
4726 const char *path,
4727 GError **err);
4728
4739 fbCollector_t *fbCollectorAllocFP(
4740 void *ctx,
4741 FILE *fp);
4742
4743
4744#if HAVE_SPREAD
4755 fbCollector_t *fbCollectorAllocSpread(
4756 void *ctx,
4757 fbSpreadParams_t *params,
4758 GError **err);
4759
4760#endif /* HAVE_SPREAD */
4761
4772 void *fbCollectorGetContext(
4773 fbCollector_t *collector);
4774
4785 void fbCollectorClose(
4786 fbCollector_t *collector);
4787
4788
4800 void fbCollectorSetAcceptOnly(
4801 fbCollector_t *collector,
4802 struct sockaddr *address,
4803 size_t address_length);
4804
4833 fbListener_t *fbListenerAlloc(
4834 fbConnSpec_t *spec,
4835 fbSession_t *session,
4836 fbListenerAppInit_fn appinit,
4837 fbListenerAppFree_fn appfree,
4838 GError **err);
4839
4847 void fbListenerFree(
4848 fbListener_t *listener);
4849
4872 fBuf_t *fbListenerWait(
4873 fbListener_t *listener,
4874 GError **err);
4875
4886 fBuf_t *fbListenerWaitNoCollectors(
4887 fbListener_t *listener,
4888 GError **err);
4889
4897 void fbListenerInterrupt(
4898 fbListener_t *listener);
4899
4900
4911gboolean fbListenerGetCollector(
4912 fbListener_t *listener,
4913 fbCollector_t **collector,
4914 GError **err);
4915
4916
4917
4918
4930gboolean fbCollectorClearTranslator(
4931 fbCollector_t *collector,
4932 GError **err);
4933
4934
4946gboolean fbCollectorSetNetflowV9Translator(
4947 fbCollector_t *collector,
4948 GError **err);
4949
4950
4962gboolean fbCollectorSetSFlowTranslator(
4963 fbCollector_t *collector,
4964 GError **err);
4965
4984uint32_t fbCollectorGetNetflowMissed(
4985 fbCollector_t *collector,
4986 struct sockaddr *peer,
4987 size_t peerlen,
4988 uint32_t obdomain);
4989
5005uint32_t fbCollectorGetSFlowMissed(
5006 fbCollector_t *collector,
5007 struct sockaddr *peer,
5008 size_t peerlen,
5009 uint32_t obdomain);
5010
5017 struct sockaddr* fbCollectorGetPeer(
5018 fbCollector_t *collector);
5019
5029uint32_t fbCollectorGetObservationDomain(
5030 fbCollector_t *collector);
5031
5054 void fbCollectorSetUDPMultiSession(
5055 fbCollector_t *collector,
5056 gboolean multi_session);
5057
5058
5059#ifdef __cplusplus
5060} /* extern "C" */
5061#endif
5062
5063#endif /* _FB_PUBLIC_H_ */
fbTemplate_st
An IPFIX template or options template structure.
Definition private.h:202
fbSessionSpreadEnableTemplateMetadata
gboolean fbSessionSpreadEnableTemplateMetadata(fbSession_t *session, char **groups, gboolean enabled, GError **err)
Enables template metadata export for Spread Sessions.
fbTemplateCtxFree_fn
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition public.h:2005
fbInfoElementOptRec_st::ie_semantic
uint8_t ie_semantic
ie semantic
Definition public.h:1745
fbSubTemplateMultiListEntryAddNewElements
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t numNewElements)
Allocates space for numNewEntries additional elements in the sub template multi list entry.
fbListenerGroupResult_st::next
struct fbListenerGroupResult_st * next
Pointer to the next listener group result.
Definition public.h:1988
fbExporter_t
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition public.h:1941
fbInfoElement_st::description
const char * description
description
Definition public.h:1709
fBufFree
void fBufFree(fBuf_t *fbuf)
Frees a buffer.
fbTemplateAppend
gboolean fbTemplateAppend(fbTemplate_t *tmpl, fbInfoElement_t *ex_ie, GError **err)
Appends an information element to a template.
fbInfoModelGetElementByName
const fbInfoElement_t * fbInfoModelGetElementByName(fbInfoModel_t *model, const char *name)
Returns a pointer to the canonical information element within an information model given the informat...
fbBasicListCollectorInit
void fbBasicListCollectorInit(fbBasicList_t *basicList)
Initializes a basic list structure for collection.
fbTemplateFreeUnused
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Frees a template if it is not currently in use by any Session.
fBufGetCollectionTemplate
fbTemplate_t * fBufGetCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid)
Retrieves the external template used to read the last record from the buffer.
fbCollectorGetNetflowMissed
uint32_t fbCollectorGetNetflowMissed(fbCollector_t *collector, 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...
fbInfoElement_st::type
uint8_t type
Data Type.
Definition public.h:1707
fbSpreadParams_st::daemon
char * daemon
pointer to the daemon host address, in Spread format.
Definition public.h:1928
fbTemplateGetIELenOfMemBuffer
uint16_t fbTemplateGetIELenOfMemBuffer(fbTemplate_t *tmpl)
Returns the number of octets required for a data buffer (an octet array) to store a data record descr...
fbBasicListCountElements
uint16_t fbBasicListCountElements(const fbBasicList_t *basicList)
Returns the number of elements the basic list is capable of holding.
fbInfoElementDataType_t
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
fBufNext
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieves a record from a Buffer associated with a collecting process.
fbTemplateContainsElement
gboolean fbTemplateContainsElement(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie)
Determines if a template contains a given information element.
fbNewTemplateCallback_fn
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:2031
fbInfoModelTypeInfoRecord
gboolean fbInfoModelTypeInfoRecord(fbTemplate_t *tmpl)
Checks to see if a template contains all of the elements required by RFC 5610 for describing an infor...
fbListenerOwnSocketCollectorTLS
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP() but for TLS (not tested)
fbInfoModelIterNext
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Returns a pointer to the next information element in the information model.
fbSpreadParams_t
struct fbSpreadParams_st fbSpreadParams_t
Spread connection parameters.
fbSessionAddTemplatesMulticast
uint16_t fbSessionAddTemplatesMulticast(fbSession_t *session, char **groups, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, GError **err)
Sets and sends templates for 1 or more groups.
fbSubTemplateListSetSemantic
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateList, uint8_t semantic)
Sets the semantic parameter of a subTemplateList.
fbSessionAlloc
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocates a transport session state container.
fbSessionAddTemplatePair
void fbSessionAddTemplatePair(fbSession_t *session, uint16_t ent_tid, uint16_t int_tid)
Adds an external-internal template pair to the session.
fbCollectorSetUDPMultiSession
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Enables or disables multi-session mode for a fbCollector_t associated with a UDP fbListener_t.
fbSubTemplateList_t
struct fbSubTemplateList_st fbSubTemplateList_t
Structure used to hold information of a sub template list.
fbCollectorGetSFlowMissed
uint32_t fbCollectorGetSFlowMissed(fbCollector_t *collector, 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...
fbCollectorAllocSpread
fbCollector_t * fbCollectorAllocSpread(void *ctx, fbSpreadParams_t *params, GError **err)
Allocates a collecting process endpoint for the Spread transport.
fbInfoElementSpec_st::len_override
uint16_t len_override
The size of the information element in bytes.
Definition public.h:1824
fbInfoModelAddElementArray
void fbInfoModelAddElementArray(fbInfoModel_t *model, fbInfoElement_t *ie)
Adds multiple information elements in an array to an information model.
fbBasicListAlloc
fbBasicList_t * fbBasicListAlloc(void)
Allocates and returns an empty Basic List Structure.
fbSubTemplateList_st::tmplID
uint16_t tmplID
ID of the template used to structure the data.
Definition public.h:2319
fbInfoElementOptRec_st::padding
uint8_t padding[6]
padding to align with template
Definition public.h:1749
fbSubTemplateListGetTemplateID
uint16_t fbSubTemplateListGetTemplateID(fbSubTemplateList_t *subTemplateList)
Gets the template ID for the template used by the list.
fbInfoModelAlloc
fbInfoModel_t * fbInfoModelAlloc(void)
Allocates a new information model.
fbSubTemplateListRealloc
void * fbSubTemplateListRealloc(fbSubTemplateList_t *subTemplateList, uint16_t newNumElements)
Potentially reallocates the list's internal buffer and returns a handle to it.
fbSessionRemoveTemplate
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Removes a template from a session.
fBufSetInternalTemplate
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Sets the internal template on a buffer to the given template ID.
fBufSetBuffer
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Sets a buffer on an fBuf for collection.
fbInfoModelCountElements
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Returns the number of information elements in the information model.
fbInfoModelReadXMLData
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.
fbSubTemplateListClear
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateList)
Clears a subTemplateList structure, notably freeing the internal buffer and setting it to NULL.
fbSubTemplateMultiListAlloc
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates and returns an empty subTemplateMultiList structure.
fbSessionAddTemplate
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, GError **err)
Adds a template to a session.
fbSessionSetMetadataExportElements
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...
fbListenerAppFree_fn
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition public.h:3043
fbCollectorGetPeer
struct sockaddr * fbCollectorGetPeer(fbCollector_t *collector)
Retrieves information about the node connected to this collector.
fbSubTemplateMultiListAddNewEntries
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t numNewEntries)
Adds numNewElements entries to the multi list of entries.
fbSubTemplateList_st::dataPtr
uint8_t * dataPtr
pointer to the buffer used to hold the data
Definition public.h:2317
fbSubTemplateMultiListClear
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Clears all of the fbSubTemplateMultiListEntry_t objects on this STML (see fbSubTemplateMultiListClear...
fbInfoElementSpec_t
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
fbSubTemplateMultiList_t
struct fbSubTemplateMultiList_st fbSubTemplateMultiList_t
Multilists just contain the semantic to describe the sub lists, the number of sub lists,...
fbTemplateAppendSpec
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Appends an information element described by specifier to a template.
fbListValidSemantic
gboolean fbListValidSemantic(uint8_t semantic)
Validates the value of a structured data types semantic field, as defined in RFC 6313 and listed at I...
fbTemplateGetOptionsScope
uint32_t fbTemplateGetOptionsScope(fbTemplate_t *tmpl)
Determines number of scope information elements in a template.
fbTemplateContainsAllFlaggedElementsByName
gboolean fbTemplateContainsAllFlaggedElementsByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags)
Determines if a template contains at least one instance of each information element in a given inform...
fbSubTemplateList_st::numElements
uint16_t numElements
number of elements in the list
Definition public.h:2321
fbListenerGroupResult_st::listener
fbListener_t * listener
pointer to the listener that received a new connection
Definition public.h:1990
fbConnSpec_t
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
fbBasicListGetNextPtr
void * fbBasicListGetNextPtr(fbBasicList_t *basicList, void *currentPtr)
Retrieves a pointer to the data element in the basicList that follows the one at currentPtr.
fBufSetSpreadExportGroup
void fBufSetSpreadExportGroup(fBuf_t *fbuf, char **groups, int num_groups, GError **err)
This function checks to see if the groups you are setting on the buffer are different than the groups...
fbInfoElementOptRec_st::ie_id
uint16_t ie_id
information element id
Definition public.h:1741
fBufEmit
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emits the message currently in a buffer using the associated exporting process endpoint.
fbBasicList_st::dataPtr
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition public.h:2089
fbConnSpec_st::vai
void * vai
Pointer to address info cache.
Definition public.h:1895
fbSubTemplateList_st::dataLength
union fbSubTemplateList_st::@2 dataLength
length of the allocated buffer used to hold the data
fbListener_t
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition public.h:1958
fbTransport_en
fbTransport_en
Transport protocol for connection specifier.
Definition public.h:1843
FB_DTLS_SCTP
@ FB_DTLS_SCTP
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition public.h:1858
FB_DTLS_UDP
@ FB_DTLS_UDP
Secure, unreliable datagram transport via DTLS over UDP.
Definition public.h:1869
FB_TLS_TCP
@ FB_TLS_TCP
Secure, reliable stream transport via TLS over TCP.
Definition public.h:1863
FB_TCP
@ FB_TCP
Reliable stream transport via TCP.
Definition public.h:1850
FB_SCTP
@ FB_SCTP
Partially reliable datagram transport via SCTP.
Definition public.h:1848
FB_UDP
@ FB_UDP
Unreliable datagram transport via UDP.
Definition public.h:1852
fbListenerAppInit_fn
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:3026
fbListenerGroupWait
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Accepts connections for multiple listeners.
fbSubTemplateList_st::tmpl
const fbTemplate_t * tmpl
pointer to the template used to structure the data
Definition public.h:2315
fbBasicList_st::numElements
uint16_t numElements
number of elements in the list
Definition public.h:2091
fbInfoElementOptRec_t
struct fbInfoElementOptRec_st fbInfoElementOptRec_t
The corresponding C struct for a record whose template is the RFC5610 Information Element Type Option...
fbBasicList_st::infoElement
const fbInfoElement_t * infoElement
pointer to the information element that is repeated in the list
Definition public.h:2087
fbSubTemplateMultiListSetSemantic
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the semantic field for the multi list.
fbSessionGetDomain
uint32_t fbSessionGetDomain(fbSession_t *session)
Retrieves the current domain on a session.
fbSpreadParams_st::groups
char ** groups
pointer to array of group names, must have at least one, and must be null term array
Definition public.h:1931
fbSessionFree
void fbSessionFree(fbSession_t *session)
Frees a transport session state container.
fBufAllocForCollection
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocates a new buffer for collection.
fbSessionExportTemplates
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Exports all external templates in the current domain of a given session.
fbInfoElement_st::ref
union fbInfoElement_st::@1 ref
Information element name.
fbInfoElementOptRec_st::ie_units
uint16_t ie_units
ie units
Definition public.h:1747
fbCollectorClearTranslator
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
Removes an input translator from a given collector such that it will operate on IPFIX protocol again.
fbInfoModelIter_t
GHashTableIter fbInfoModelIter_t
An iterator over the information elements in an information model.
Definition public.h:1258
fbBasicListGetSemantic
uint8_t fbBasicListGetSemantic(fbBasicList_t *basicList)
Gets the Semantic field for Basic List.
fbSubTemplateListInit
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...
fbInfoElementDataType_en
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition public.h:1584
FB_DT_MICROSEC
@ FB_DT_MICROSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition public.h:1639
FB_STRING
@ FB_STRING
The "string" data type: A finite-length string of valid characters from the Unicode character encodin...
Definition public.h:1626
FB_DT_SEC
@ FB_DT_SEC
The "dateTimeSeconds" data type: An unsigned 32-bit integer containing the number of seconds since th...
Definition public.h:1630
FB_INT_8
@ FB_INT_8
The "signed8" data type: An integer value in the range of -128 to 127.
Definition public.h:1603
FB_UINT_16
@ FB_UINT_16
The "unsigned16" data type: A non-negative integer value in the range of 0 to 65535 (0xFFFF).
Definition public.h:1593
FB_UINT_64
@ 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:1600
FB_FLOAT_64
@ FB_FLOAT_64
The "float64" data type: An IEEE double-precision 64-bit floating point type.
Definition public.h:1618
FB_SUB_TMPL_MULTI_LIST
@ FB_SUB_TMPL_MULTI_LIST
The "subTemplateMultiList" data type: A structured data element as described in RFC6313,...
Definition public.h:1657
FB_SUB_TMPL_LIST
@ FB_SUB_TMPL_LIST
The "subTemplateList" data type: A structured data element as described in RFC6313,...
Definition public.h:1654
FB_BOOL
@ FB_BOOL
The "boolean" data type: A binary value: "true" or "false".
Definition public.h:1620
FB_UINT_32
@ 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:1596
FB_IP6_ADDR
@ FB_IP6_ADDR
The "ipv6Address" data type: A value of an IPv6 address.
Definition public.h:1648
FB_INT_32
@ 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:1609
FB_UINT_8
@ FB_UINT_8
The "unsigned8" data type: A non-negative integer value in the range of 0 to 255 (0xFF).
Definition public.h:1590
FB_INT_64
@ 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:1612
FB_OCTET_ARRAY
@ FB_OCTET_ARRAY
The "octetArray" data type: A finite-length string of octets.
Definition public.h:1587
FB_DT_NANOSEC
@ FB_DT_NANOSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition public.h:1644
FB_FLOAT_32
@ FB_FLOAT_32
The "float32" data type: An IEEE single-precision 32-bit floating point type.
Definition public.h:1615
FB_BASIC_LIST
@ FB_BASIC_LIST
The "basicList" data type: A structured data element as described in RFC6313, Section 4....
Definition public.h:1651
FB_MAC_ADDR
@ FB_MAC_ADDR
The "macAddress" data type: A MAC-48 address as a string of 6 octets.
Definition public.h:1623
FB_INT_16
@ FB_INT_16
The "signed16" data type: An integer value in the range of -32768 to 32767.
Definition public.h:1606
FB_DT_MILSEC
@ FB_DT_MILSEC
The "dateTimeMilliseconds" data type: An unsigned 64-bit integer containing the number of millisecond...
Definition public.h:1634
FB_IP4_ADDR
@ FB_IP4_ADDR
The "ipv4Address" data type: A value of an IPv4 address.
Definition public.h:1646
fbInfoModelGetElementByID
const fbInfoElement_t * fbInfoModelGetElementByID(fbInfoModel_t *model, uint16_t id, uint32_t ent)
Returns a pointer to the canonical information element within an information model given the informat...
fbSubTemplateListAlloc
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates and returns an empty subTemplateList structure.
fbTemplateGetIndexedIE
fbInfoElement_t * fbTemplateGetIndexedIE(fbTemplate_t *tmpl, uint32_t IEindex)
Returns the information element in the template referenced by the index.
fbSubTemplateMultiListGetIndexedEntry
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetIndexedEntry(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.
fbBasicListSetSemantic
void fbBasicListSetSemantic(fbBasicList_t *basicList, uint8_t semantic)
Sets the semantic for describing a basic list.
fbInfoElementSpec_st::name
char * name
Information element name.
Definition public.h:1812
fbInfoElementSpec_st::flags
uint32_t flags
Application flags word.
Definition public.h:1831
fbListenerGroupAddListener
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
fbListenerGroupResult_st::fbuf
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition public.h:1992
fBufGetExportTime
uint32_t fBufGetExportTime(fBuf_t *fbuf)
Retrieves the export time on the message currently in a buffer.
fbBasicListInitWithOwnBuffer
void * fbBasicListInitWithOwnBuffer(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements, uint16_t dataLength, uint8_t *dataPtr)
use this function to initialize the basic list, but it gets the pointer to a buffer and its length al...
fbListenerFreeGroupResult
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Frees the listener group result returned from fbListenerGroupWait().
fBufNextCollectionTemplate
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.
fbTemplateGetContext
void * fbTemplateGetContext(fbTemplate_t *tmpl)
Gets the ctx pointer associated with a Template.
fbBasicListInit
void * fbBasicListInit(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes the basic list structure based on the parameters.
fBufListFree
void fBufListFree(fbTemplate_t *tmpl, uint8_t *record)
Clears all of the memory that fixbuf allocated during transcode of this record.
fBufSetAutomaticMode
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Sets the automatic (read/write) mode flag on a buffer.
fbExporterAllocFile
fbExporter_t * fbExporterAllocFile(const char *path)
Allocates an exporting process endpoint for a named file.
fbSubTemplateListGetIndexedDataPtr
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 ...
fbSubTemplateMultiListEntryRealloc
void * fbSubTemplateMultiListEntryRealloc(fbSubTemplateMultiListEntry_t *entry, uint16_t newNumElements)
Potentially reallocates the entry's internal buffer and returns a handle to it.
fbCollectorGetObservationDomain
uint32_t fbCollectorGetObservationDomain(fbCollector_t *collector)
Retrieves the observation domain of the node connected to the UDP collector.
fbListenerWait
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Waits on a listener.
fBufGetCollector
fbCollector_t * fBufGetCollector(fBuf_t *fbuf)
Retrieves the collecting process endpoint associated with a buffer.
fbSubTemplateMultiListGetNextEntry
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetNextEntry(fbSubTemplateMultiList_t *STML, fbSubTemplateMultiListEntry_t *currentEntry)
Retrieves a pointer to the entry in the mutli list that follows the one at currentEntry.
fbSubTemplateMultiListGetFirstEntry
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(fbSubTemplateMultiList_t *STML)
Retrieves the first entry in the multi list.
fbBasicList_st::semantic
uint8_t semantic
semantic field to describe the list
Definition public.h:2095
fbSessionSpreadSetMetadataExportTemplates
uint16_t fbSessionSpreadSetMetadataExportTemplates(fbSession_t *session, char **groups, gboolean enabled, uint16_t tid, GError **err)
Enables template metadata export for Spread Sessions.
fbListenerWaitNoCollectors
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait(), except that this function doesn't monit...
fbInfoModel_t
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition public.h:1253
fbTemplateGetInfoModel
fbInfoModel_t * fbTemplateGetInfoModel(fbTemplate_t *tmpl)
Returns the information model, as understood by the template.
fbInfoElementWriteOptionsRecord
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...
fbTemplateContainsAllElementsByName
gboolean fbTemplateContainsAllElementsByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of each fbInfoElement_t in a given informatio...
fbBasicList_st::dataLength
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition public.h:2093
fbExporterAllocBuffer
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocates an exporting process to use the existing buffer buf having the specified size.
fbSubTemplateMultiListEntry_st::tmpl
fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition public.h:2566
fbSessionGetInfoModel
fbInfoModel_t * fbSessionGetInfoModel(fbSession_t *session)
Gets the info model for the session.
fbListenerGroupFree
void fbListenerGroupFree(fbListenerGroup_t *group)
Frees a listener group.
fbListenerEntry_t
struct fbListenerEntry_st fbListenerEntry_t
ListenerEntry's make up an fbListenerGroup_t as a linked list.
fBufGetSession
fbSession_t * fBufGetSession(fBuf_t *fbuf)
Retrieves the session associated with a buffer.
fBufNextMessage
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Reads a new message into a buffer using the associated collecting process endpoint.
fBufGetExporter
fbExporter_t * fBufGetExporter(fBuf_t *fbuf)
Retrieves the exporting process endpoint associated with a buffer.
fbSubTemplateListCountElements
uint16_t fbSubTemplateListCountElements(const fbSubTemplateList_t *subTemplateList)
Returns the number of elements the sub template list is capable of holding.
fbSessionLookupTemplatePair
uint16_t fbSessionLookupTemplatePair(fbSession_t *session, uint16_t ext_tid)
Function to find a pair, uniquely identified by the external ID, and return the associated internal t...
fbListenerGetCollector
gboolean fbListenerGetCollector(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...
fbBasicListFree
void fbBasicListFree(fbBasicList_t *basicList)
Clears the basic list (fbBasicListClear()), then frees the basic list itself.
fbListenerInterrupt
void fbListenerInterrupt(fbListener_t *listener)
Causes the current or next call to fbListenerWait() to unblock and return.
fbExporterAutoStream
void fbExporterAutoStream(fbExporter_t *exporter)
Enables automatic SCTP stream selection for the next message exported.
fbSessionSetDomain
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Sets the current observation domain on a session.
fbSessionAddTemplateWithMetadata
uint16_t fbSessionAddTemplateWithMetadata(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, const char *name, const char *description, GError **err)
Adds a template to the session, as fbSessionAddTemplate(), with the provided metadata.
fbConnSpec_st::ssl_ca_file
char * ssl_ca_file
Path to certificate authority file.
Definition public.h:1884
fbSession_t
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition public.h:1840
fbConnSpec_st::transport
fbTransport_t transport
Transport protocol to use.
Definition public.h:1878
fbListenerEntry_st::next
struct fbListenerEntry_st * next
pointer to the next listener entry in the linked list
Definition public.h:1974
fbInfoModelFree
void fbInfoModelFree(fbInfoModel_t *model)
Frees an information model.
fbInfoElementAllocTypeTemplate
fbTemplate_t * fbInfoElementAllocTypeTemplate(fbInfoModel_t *model, GError **err)
Allocates and returns the Options Template that will be used to define Information Element Type Recor...
fbSubTemplateMultiListEntryGetTemplateID
uint16_t fbSubTemplateMultiListEntryGetTemplateID(fbSubTemplateMultiListEntry_t *entry)
Retrieves the template ID for the template used to structure the data.
fbSubTemplateMultiListInit
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.
fbSubTemplateMultiListEntry_st::tmplID
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition public.h:2572
fbConnSpec_st::vssl_ctx
void * vssl_ctx
Pointer to SSL context cache.
Definition public.h:1900
fbInfoElement_t
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
fbSessionSetMetadataExportTemplates
uint16_t fbSessionSetMetadataExportTemplates(fbSession_t *session, gboolean enabled, uint16_t tid, GError **err)
Configures a session to export template metadata as options records.
fbSubTemplateListFree
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list (fbSubTemplateListClear()) then frees the subTemplateList itself.
fbBasicListClearWithoutFree
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Clears the parameters of the basic list, but does not free the buffer.
fbExporterSetStream
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Sets the SCTP stream for the next message exported.
fbCollectorGetSpreadReturnGroups
int fbCollectorGetSpreadReturnGroups(fbCollector_t *collector, char *groups[])
This function is useful if need to know what groups were set on the message.
fbCollectorSetSFlowTranslator
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert SFlow into IPFIX for the given collector.
fbSessionExportTemplate
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Exports a single external template in the current domain of a given session.
fbInfoElement_st::midx
uint32_t midx
Multiple IE index.
Definition public.h:1689
fbVarfield_st::buf
uint8_t * buf
Content buffer.
Definition public.h:1245
fBufAllocForExport
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocates a new buffer for export.
fbInfoModelIterInit
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initializes an information model iterator for iteration over the information elements (fbInfoElement_...
fbSubTemplateList_st::semantic
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition public.h:2323
fbListenerAlloc
fbListener_t * fbListenerAlloc(fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocates a listener.
fbInfoElement_st::max
uint64_t max
range max
Definition public.h:1705
fbConnSpec_st::svc
char * svc
Service name or port number to connect/listen to.
Definition public.h:1882
fbCollectorGetContext
void * fbCollectorGetContext(fbCollector_t *collector)
Retrieves the application context associated with a collector.
fbTemplateSetOptionsScope
void fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Sets the number of information elements in a template that are scope.
fbSubTemplateMultiList_st::numElements
uint16_t numElements
number of sub template lists in the multi list
Definition public.h:2585
fbSubTemplateListAddNewElements
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t numNewElements)
Allocates space for numNewElements additional element in the subTemplateList.
fbBasicListRealloc
void * fbBasicListRealloc(fbBasicList_t *basicList, uint16_t newNumElements)
Potentially reallocates the list's internal buffer and returns a handle to it.
fbExporterGetMsgLen
size_t fbExporterGetMsgLen(fbExporter_t *exporter)
Gets the (transcoded) message length that was copied to the exporting buffer upon fBufEmit() when usi...
fbConnSpec_st::ssl_cert_file
char * ssl_cert_file
Path to certificate file.
Definition public.h:1886
fbListenerGroup_t
struct fbListenerGroup_st fbListenerGroup_t
Structure that represents a group of listeners.
Definition public.h:1967
fbSubTemplateListGetDataPtr
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateList)
Returns a pointer to the buffer that contains the data for the list.
fbSubTemplateMultiListClearEntries
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Clears the memory used by all the entries of a sub template multi list.
fbConnSpec_st::ssl_key_file
char * ssl_key_file
Path to private key file.
Definition public.h:1888
fbSubTemplateMultiListEntry_st::numElements
uint16_t numElements
number of elements in this entry
Definition public.h:2574
fbListenerEntry_st::prev
struct fbListenerEntry_st * prev
pointer to the previous listener entry in the linked list
Definition public.h:1976
fbSubTemplateMultiListEntryInit
void * fbSubTemplateMultiListEntryInit(fbSubTemplateMultiListEntry_t *entry, uint16_t tmplID, fbTemplate_t *tmpl, uint16_t numElements)
Initializes the multi list entry with the template values, and allocates the memory used by the entry...
fbCollectorSetNetflowV9Translator
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert NetFlowV9 into IPFIX for the given collector.
fbSubTemplateListInitWithOwnBuffer
void * fbSubTemplateListInitWithOwnBuffer(fbSubTemplateList_t *subTemplateList, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements, uint16_t dataLength, uint8_t *dataPtr)
Initializes the subTemplateList but does not allocate a buffer.
fBufInterruptSocket
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
fbSubTemplateMultiListEntryClear
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory holding the records' data used by this entry.
fbSubTemplateMultiListEntry_t
struct fbSubTemplateMultiListEntry_st fbSubTemplateMultiListEntry_t
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
fbSessionGetLargestInternalTemplateSize
uint16_t fbSessionGetLargestInternalTemplateSize(fbSession_t *session)
Gets the largest decoded size of an internal template in the session.
fbListenerGroupResult_t
struct fbListenerGroupResult_st fbListenerGroupResult_t
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
fbSessionSpreadSetMetadataExportElements
uint16_t fbSessionSpreadSetMetadataExportElements(fbSession_t *session, char **groups, gboolean enabled, uint16_t tid, GError **err)
Enables RFC 5610 information element metadata export for Spread Sessions.
fBuf_t
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition public.h:1228
fbSubTemplateMultiListEntryNextDataPtr
void * fbSubTemplateMultiListEntryNextDataPtr(fbSubTemplateMultiListEntry_t *entry, void *currentPtr)
Retrieves a pointer to the data record in this entry that follows the one at currentPtr.
fbExporterAllocFP
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocates an exporting process endpoint for an opened ANSI C file pointer.
fbInfoElement_st::flags
uint32_t flags
Flags.
Definition public.h:1701
fbSubTemplateListGetSemantic
uint8_t fbSubTemplateListGetSemantic(fbSubTemplateList_t *subTemplateList)
Gets the semantic value from a sub template list.
fbSessionGetTemplate
fbTemplate_t * fbSessionGetTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieves a template from a session by ID.
fbSubTemplateMultiListFree
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list (fbSubTemplateMultiListClear()), then frees the STML itself.
fbSubTemplateListClearWithoutFree
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list parameters but does not free the data ptr.
fbBasicList_t
struct fbBasicList_st fbBasicList_t
A basic list element in a template which structure represents a basic list on the internal side,...
fbInfoElementOptRec_st::ie_pen
uint32_t ie_pen
private enterprise number
Definition public.h:1739
fbInfoElementOptRec_st::ie_type
uint8_t ie_type
ie data type
Definition public.h:1743
fbSpreadParams_st::session
fbSession_t * session
pointer to the session, this MUST be set to a valid session before the spec is passed to fbExporterAl...
Definition public.h:1925
fbVarfield_st::len
size_t len
Length of content in buffer.
Definition public.h:1238
fbInfoElementOptRec_st::ie_range_begin
uint64_t ie_range_begin
ie range min
Definition public.h:1751
fbConnSpec_st::host
char * host
Hostname to connect/listen to.
Definition public.h:1880
fbInfoElement_st::len
uint16_t len
Information element length in octets.
Definition public.h:1698
fbCollectorSetAcceptOnly
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.
fbExporterAllocSpread
fbExporter_t * fbExporterAllocSpread(fbSpreadParams_t *params)
Allocates an exporting process endpoint for a Spread connection.
fbInfoElementOptRec_st::ie_desc
fbVarfield_t ie_desc
information element description
Definition public.h:1757
fbBasicListGetInfoElement
const fbInfoElement_t * fbBasicListGetInfoElement(fbBasicList_t *basicList)
Returns a pointer to the information element used in the basic list.
fbExporterAllocNet
fbExporter_t * fbExporterAllocNet(fbConnSpec_t *spec)
Allocates an exporting process endpoint for a network connection.
fbConnSpec_st::ssl_key_pass
char * ssl_key_pass
Private key decryption password.
Definition public.h:1890
fbCollectorAllocFile
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocates a collecting process endpoint for a named file.
fbTransport_t
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
fbCollectorAllocFP
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocates a collecting process endpoint for an open file.
fbSessionResetExternal
void fbSessionResetExternal(fbSession_t *session)
Resets the external state (sequence numbers and templates) in a session state container.
fbSessionEnableTemplateMetadata
gboolean fbSessionEnableTemplateMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configures a session to export template metadata as options records.
fbExporterClose
void fbExporterClose(fbExporter_t *exporter)
Forces the file or socket underlying an exporting process endpoint to close.
fbListenerOwnSocketCollectorTCP
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...
fbTemplateAppendSpecArray
gboolean fbTemplateAppendSpecArray(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Appends information elements described by a specifier array to a template.
fbListenerGroupDeleteListener
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
fbBasicListGetDataPtr
void * fbBasicListGetDataPtr(fbBasicList_t *basicList)
Gets a pointer to the data buffer for the basic list.
fbSubTemplateListGetNextPtr
void * fbSubTemplateListGetNextPtr(const fbSubTemplateList_t *subTemplateList, void *currentPtr)
Retrieves a pointer to the data record in the sub template list that follows the one at currentPtr.
fbBasicListClear
void fbBasicListClear(fbBasicList_t *basicList)
Clears the parameters of the basic list and frees the data buffer.
fbListenerFree
void fbListenerFree(fbListener_t *listener)
Frees a listener.
fbInfoElement_st::min
uint64_t min
range min
Definition public.h:1703
fbTemplateAlloc
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocates a new empty template.
fbBasicListGetIndexedDataPtr
void * fbBasicListGetIndexedDataPtr(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.
fbSubTemplateMultiListEntryGetIndexedPtr
void * fbSubTemplateMultiListEntryGetIndexedPtr(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...
fBufAppend
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Appends a record to a buffer.
fBufSetAutomaticInsert
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
Enables automatic insertion of RFC 5610 elements read from a Buffer.
fbInfoElementOptRec_st::ie_name
fbVarfield_t ie_name
information element name
Definition public.h:1755
fbSubTemplateMultiList_st::semantic
uint8_t semantic
value used to describe the list of sub templates
Definition public.h:2587
fbInfoElementAddOptRecElement
gboolean fbInfoElementAddOptRecElement(fbInfoModel_t *model, fbInfoElementOptRec_t *rec)
Adds an element that we received via an RFC 5610 Options Record to the given info model.
fbSubTemplateMultiListEntryGetTemplate
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(fbSubTemplateMultiListEntry_t *entry)
Retrieves the template pointer used to structure the data elements.
fbSubTemplateMultiList_st::firstEntry
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition public.h:2583
fbSubTemplateMultiListRealloc
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListRealloc(fbSubTemplateMultiList_t *STML, uint16_t newNumEntries)
Potentially reallocates the list's internal buffer for entries and returns a handle to it.
fbSessionSpreadEnableTypeMetadata
gboolean fbSessionSpreadEnableTypeMetadata(fbSession_t *session, char **groups, gboolean enabled, GError **err)
Enables RFC 5610 information element metadata export for Spread Sessions.
fbListenerEntry_st::listener
fbListener_t * listener
pointer to the listener to add to the list
Definition public.h:1978
fbCollector_t
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition public.h:1950
fbInfoElement_st::num
uint16_t num
Information Element number.
Definition public.h:1696
fbInfoModelAddElement
void fbInfoModelAddElement(fbInfoModel_t *model, fbInfoElement_t *ie)
Adds a single information element to an information model.
fbSessionRemoveTemplatePair
void fbSessionRemoveTemplatePair(fbSession_t *session, uint16_t ext_tid)
Removes a template pair from the list this is called by fixbuf when a template is revoked from the se...
fbBasicListAddNewElements
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t numNewElements)
Allocates numNewElements additional element(s) into the basic list.
fbSubTemplateListGetTemplate
const fbTemplate_t * fbSubTemplateListGetTemplate(fbSubTemplateList_t *subTemplateList)
Gets the template pointer from the list structure.
fbTemplateCountElements
uint32_t fbTemplateCountElements(fbTemplate_t *tmpl)
Determines number of information elements in a template.
fBufSetCollector
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associates an collecting process endpoint with a buffer.
fbSessionAddNewTemplateCallback
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...
fbInfoElementOptRec_st::ie_range_end
uint64_t ie_range_end
ie range max
Definition public.h:1753
fBufRemaining
size_t fBufRemaining(fBuf_t *fbuf)
Retrieves the length of the buffer that is remaining after processing.
fbCollectorClose
void fbCollectorClose(fbCollector_t *collector)
Closes the file or socket underlying a collecting process endpoint.
fbSubTemplateListCollectorInit
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *STL)
Initializes a sub template list variable on a fbCollector_t.
fbSubTemplateMultiListEntry_st::dataLength
size_t dataLength
length of the buffer used to hold the data in this entry
Definition public.h:2570
fbSubTemplateMultiListEntry_st::dataPtr
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition public.h:2568
fbSessionAddTemplatesMulticastWithMetadata
uint16_t fbSessionAddTemplatesMulticastWithMetadata(fbSession_t *session, char **groups, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, char *name, char *description, GError **err)
Sets and sends templates for 1 or more groups.
fbVarfield_t
struct fbVarfield_st fbVarfield_t
A variable-length field value.
fBufSetExportTemplate
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.
fbSubTemplateMultiListEntryGetDataPtr
void * fbSubTemplateMultiListEntryGetDataPtr(fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
fbInfoModelReadXMLFile
gboolean fbInfoModelReadXMLFile(fbInfoModel_t *model, const gchar *filename, GError **err)
Adds information specified in the given XML file to the information model.
fbSessionGetCollector
fbCollector_t * fbSessionGetCollector(fbSession_t *session)
Retrieves the collector that was created with the session.
fbSubTemplateMultiListGetSemantic
uint8_t fbSubTemplateMultiListGetSemantic(fbSubTemplateMultiList_t *STML)
Gets the semantic paramter from the multi list.
fbInfoElement_st::ent
uint32_t ent
Private Enterprise Number.
Definition public.h:1691
fbListenerGroupAlloc
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns an empty listenerGroup.
fBufSetExporter
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associates an exporting process endpoint with a buffer.
fbSessionEnableTypeMetadata
gboolean fbSessionEnableTypeMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configures a session to export type information for enterprise-specific information elements as optio...
fbSubTemplateMultiListEntryCountElements
uint16_t fbSubTemplateMultiListEntryCountElements(const fbSubTemplateMultiListEntry_t *entry)
Returns the number of entries the sub template multi list entry is capable of holding.
fbSubTemplateMultiListCountElements
uint16_t fbSubTemplateMultiListCountElements(const fbSubTemplateMultiList_t *STML)
Returns the number of entries the sub template multi list is capable of holding.
fbTemplateContainsElementByName
gboolean fbTemplateContainsElementByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of a given information element,...
fBufSetExportTime
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Sets the export time on the message currently in a buffer.
fbBasicList_st
A basic list element in a template which structure represents a basic list on the internal side,...
Definition public.h:2085
fbConnSpec_st
Connection specifier.
Definition public.h:1876
fbInfoElement_st
A single IPFIX Information Element definition.
Definition public.h:1668
fbInfoElementOptRec_st
The corresponding C struct for a record whose template is the RFC5610 Information Element Type Option...
Definition public.h:1737
fbInfoElementSpec_st
A single IPFIX Information Element specification.
Definition public.h:1810
fbListenerEntry_st
ListenerEntry's make up an fbListenerGroup_t as a linked list.
Definition public.h:1972
fbListenerGroupResult_st
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
Definition public.h:1986
fbSpreadParams_st
Spread connection parameters.
Definition public.h:1922
fbSubTemplateList_st
Structure used to hold information of a sub template list.
Definition public.h:2307
fbSubTemplateMultiList_st
Multilists just contain the semantic to describe the sub lists, the number of sub lists,...
Definition public.h:2581
fbSubTemplateMultiListEntry_st
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
Definition public.h:2564
fbVarfield_st
A variable-length field value.
Definition public.h:1236
version.h
Fixbuf's version information.