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-2019 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-2019 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
1068 #ifndef _FB_PUBLIC_H_
1069 #define _FB_PUBLIC_H_
1070 #include <fixbuf/autoinc.h>
1071 #include <fixbuf/version.h>
1072
1073 #ifdef __cplusplus
1074 extern "C" {
1075 #endif
1076
1077
1082 #define FIXBUF_CHECK_VERSION(major, minor, release) \
1083 (FIXBUF_VERSION_MAJOR > (major) || \
1084 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
1085 (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
1086 FIXBUF_VERSION_RELEASE >= (release)))
1087
1088 /*
1089 * Error Handling Definitions
1090 */
1091
1093 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
1094
1095 #define FB_ERROR_TMPL 1
1096
1100 #define FB_ERROR_EOM 2
1101
1106 #define FB_ERROR_EOF 3
1107
1111 #define FB_ERROR_IPFIX 4
1112
1117 #define FB_ERROR_BUFSZ 5
1118
1119 #define FB_ERROR_IMPL 6
1120
1121 #define FB_ERROR_IO 7
1122
1126 #define FB_ERROR_NLREAD 8
1127
1132 #define FB_ERROR_NLWRITE 9
1133
1136 #define FB_ERROR_NOELEMENT 10
1137
1140 #define FB_ERROR_CONN 11
1141
1145 #define FB_ERROR_NETFLOWV9 12
1146
1149 #define FB_ERROR_TRANSMISC 13
1150
1153 #define FB_ERROR_SFLOW 14
1154
1157 #define FB_ERROR_SETUP 15
1158
1161 #define FB_ERROR_LAXSIZE 16
1162
1163 /*
1164 * Public Datatypes and Constants
1165 */
1166
1172 typedef struct fBuf_st fBuf_t;
1173
1180 typedef struct fbVarfield_st {
1182 size_t len;
1189 uint8_t *buf;
1190 } fbVarfield_t;
1191
1192
1197 typedef struct fbInfoModel_st fbInfoModel_t;
1198
1202 typedef GHashTableIter fbInfoModelIter_t;
1203
1209 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_)\
1210 { {(const struct fbInfoElement_st*)_name_}, 0, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_ }
1211
1218 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
1219 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char*)NULL)
1220
1221
1227 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
1228
1235 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
1236
1242 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
1243
1248 #define FB_IE_F_NONE 0x00000000
1249
1255 #define FB_IE_F_ENDIAN 0x00000001
1256
1268 #define FB_IE_F_REVERSIBLE 0x00000040
1269
1278 #define FB_IE_F_ALIEN 0x00000080
1279
1284 #define FB_IE_QUANTITY 0x00000100
1285
1291 #define FB_IE_TOTALCOUNTER 0x00000200
1292
1297 #define FB_IE_DELTACOUNTER 0x00000300
1298
1303 #define FB_IE_IDENTIFIER 0x00000400
1304
1309 #define FB_IE_FLAGS 0x00000500
1310
1316 #define FB_IE_LIST 0x00000600
1317
1323 #define FB_IE_SNMPCOUNTER 0x00000700
1324
1330 #define FB_IE_SNMPGAUGE 0x00000800
1331
1337 #define FB_IE_DEFAULT 0x00000000
1338
1349 #define FB_UNITS_BITS 0x00010000
1350
1355 #define FB_UNITS_OCTETS 0x00020000
1356
1361 #define FB_UNITS_PACKETS 0x00030000
1362
1367 #define FB_UNITS_FLOWS 0x00040000
1368
1373 #define FB_UNITS_SECONDS 0x00050000
1374
1379 #define FB_UNITS_MILLISECONDS 0x00060000
1380
1385 #define FB_UNITS_MICROSECONDS 0x00070000
1386
1391 #define FB_UNITS_NANOSECONDS 0x00080000
1392
1397 #define FB_UNITS_WORDS 0x00090000
1398
1403 #define FB_UNITS_MESSAGES 0x000A0000
1404
1409 #define FB_UNITS_HOPS 0x000B0000
1410
1415 #define FB_UNITS_ENTRIES 0x000C0000
1416
1421 #define FB_UNITS_FRAMES 0x000D0000
1422
1427 #define FB_UNITS_PORTS 0x000E0000
1428
1433 #define FB_UNITS_INFERRED 0x000F0000
1434
1438 #define FB_IE_VARLEN 65535
1439
1448 #define FB_IE_BASIC_LIST 291
1449
1457 #define FB_IE_SUBTEMPLATE_LIST 292
1458
1466 #define FB_IE_SUBTEMPLATE_MULTILIST 293
1467
1476 #define FB_IE_PEN_REVERSE 29305
1477
1486 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
1487
1493 #define FB_CISCO_GENERIC 9999
1494
1501 #define FB_CISCO_ASA_EVENT_ID 9998
1502
1511 #define FB_CISCO_ASA_EVENT_XTRA 9997
1512
1517 #define FB_IE_REVERSE_STR "reverse"
1518
1520 #define FB_IE_REVERSE_STRLEN 7
1521
1528 typedef enum fbInfoElementDataType_en {
1531 FB_OCTET_ARRAY,
1534 FB_UINT_8,
1537 FB_UINT_16,
1540 FB_UINT_32,
1544 FB_UINT_64,
1547 FB_INT_8,
1550 FB_INT_16,
1553 FB_INT_32,
1556 FB_INT_64,
1559 FB_FLOAT_32,
1562 FB_FLOAT_64,
1564 FB_BOOL,
1567 FB_MAC_ADDR,
1570 FB_STRING,
1574 FB_DT_SEC,
1578 FB_DT_MILSEC,
1583 FB_DT_MICROSEC,
1588 FB_DT_NANOSEC,
1590 FB_IP4_ADDR,
1592 FB_IP6_ADDR,
1595 FB_BASIC_LIST,
1598 FB_SUB_TMPL_LIST,
1601 FB_SUB_TMPL_MULTI_LIST
1602 } fbInfoElementDataType_t;
1603
1612 typedef struct fbInfoElement_st {
1614 union {
1620 const struct fbInfoElement_st *canon;
1625 const char *name;
1626 } ref;
1627
1633 uint32_t midx;
1635 uint32_t ent;
1640 uint16_t num;
1642 uint16_t len;
1645 uint32_t flags;
1647 uint64_t min;
1649 uint64_t max;
1651 uint8_t type;
1653 const char *description;
1654 } fbInfoElement_t;
1655
1681 typedef struct fbInfoElementOptRec_st {
1683 uint32_t ie_pen;
1685 uint16_t ie_id;
1687 uint8_t ie_type;
1689 uint8_t ie_semantic;
1691 uint16_t ie_units;
1693 uint8_t padding[6];
1695 uint64_t ie_range_begin;
1697 uint64_t ie_range_end;
1699 fbVarfield_t ie_name;
1701 fbVarfield_t ie_desc;
1702 } fbInfoElementOptRec_t;
1703
1704
1717 #define FB_TID_AUTO 0
1718
1722 #define FB_TID_TS 2
1723
1727 #define FB_TID_OTS 3
1728
1732 #define FB_TID_MIN_DATA 256
1733
1739 typedef struct fbTemplate_st fbTemplate_t;
1740
1746 #define FB_IESPEC_NULL { NULL, 0, 0 }
1747
1754 typedef struct fbInfoElementSpec_st {
1756 char *name;
1768 uint16_t len_override;
1775 uint32_t flags;
1776 } fbInfoElementSpec_t;
1777
1784 typedef struct fbSession_st fbSession_t;
1785
1787 typedef enum fbTransport_en {
1792 FB_SCTP,
1794 FB_TCP,
1796 FB_UDP,
1802 FB_DTLS_SCTP,
1807 FB_TLS_TCP,
1813 FB_DTLS_UDP
1814 } fbTransport_t;
1815
1820 typedef struct fbConnSpec_st {
1822 fbTransport_t transport;
1824 char *host;
1826 char *svc;
1828 char *ssl_ca_file;
1830 char *ssl_cert_file;
1832 char *ssl_key_file;
1834 char *ssl_key_pass;
1839 void *vai;
1844 void *vssl_ctx;
1845 } fbConnSpec_t;
1846
1850 #define FB_CONNSPEC_INIT { FB_SCTP, NULL, NULL, \
1851 NULL, NULL, NULL, NULL, \
1852 NULL, NULL }
1853
1854 #if HAVE_SPREAD
1855
1859 #define FB_SPREADPARAMS_INIT { 0, 0, 0 }
1860
1866 typedef struct fbSpreadParams_st {
1869 fbSession_t * session;
1872 char * daemon;
1875 char ** groups;
1876 } fbSpreadParams_t;
1877
1878 #endif /* HAVE_SPREAD */
1879
1885 typedef struct fbExporter_st fbExporter_t;
1886
1894 typedef struct fbCollector_st fbCollector_t;
1895
1902 typedef struct fbListener_st fbListener_t;
1903
1904 /*
1905 * ListenerGroup and associated data type definitions
1906 */
1907
1911 typedef struct fbListenerGroup_st fbListenerGroup_t;
1912
1916 typedef struct fbListenerEntry_st {
1918 struct fbListenerEntry_st *next;
1920 struct fbListenerEntry_st *prev;
1922 fbListener_t *listener;
1923 } fbListenerEntry_t;
1924
1930 typedef struct fbListenerGroupResult_st {
1932 struct fbListenerGroupResult_st *next;
1934 fbListener_t *listener;
1936 fBuf_t *fbuf;
1937 } fbListenerGroupResult_t;
1938
1950 typedef void (*fbTemplateCtxFree_fn)(
1951 void *tmpl_ctx,
1952 void *app_ctx);
1953
1977 typedef void (*fbNewTemplateCallback_fn) (
1978 fbSession_t *session,
1979 uint16_t tid,
1980 fbTemplate_t *tmpl,
1981 void *app_ctx,
1982 void **tmpl_ctx,
1983 fbTemplateCtxFree_fn *tmpl_ctx_free_fn);
1984
1985
1993 #define FB_LIST_SEM_UNDEFINED 0xFF
1994
1997 #define FB_LIST_SEM_NONE_OF 0x00
1998
2001 #define FB_LIST_SEM_EXACTLY_ONE_OF 0x01
2002
2005 #define FB_LIST_SEM_ONE_OR_MORE_OF 0x02
2006
2009 #define FB_LIST_SEM_ALL_OF 0x03
2010
2013 #define FB_LIST_SEM_ORDERED 0x04
2014
2022 gboolean fbListValidSemantic(
2023 uint8_t semantic);
2024
2025 /****** BASICLIST FUNCTIONS AND STRUCTS *******/
2031 typedef struct fbBasicList_st {
2033 const fbInfoElement_t *infoElement;
2035 uint8_t *dataPtr;
2037 uint16_t numElements;
2039 uint16_t dataLength;
2041 uint8_t semantic;
2042 } fbBasicList_t;
2043
2044
2050 fbBasicList_t* fbBasicListAlloc(
2051 void);
2052
2065 void* fbBasicListInit(
2066 fbBasicList_t *basicList,
2067 uint8_t semantic,
2068 const fbInfoElement_t *infoElement,
2069 uint16_t numElements);
2070
2085 void* fbBasicListInitWithOwnBuffer(
2086 fbBasicList_t *basicList,
2087 uint8_t semantic,
2088 const fbInfoElement_t *infoElement,
2089 uint16_t numElements,
2090 uint16_t dataLength,
2091 uint8_t *dataPtr);
2092
2105 void fbBasicListCollectorInit(
2106 fbBasicList_t *basicList);
2107
2114 uint16_t fbBasicListCountElements(
2115 const fbBasicList_t *basicList);
2116
2124 uint8_t fbBasicListGetSemantic(
2125 fbBasicList_t *basicList);
2126
2135 void fbBasicListSetSemantic(
2136 fbBasicList_t *basicList,
2137 uint8_t semantic);
2138
2146 const fbInfoElement_t* fbBasicListGetInfoElement(
2147 fbBasicList_t *basicList);
2148
2154 void* fbBasicListGetDataPtr(
2155 fbBasicList_t *basicList);
2156
2166 void* fbBasicListGetIndexedDataPtr(
2167 fbBasicList_t *basicList,
2168 uint16_t index);
2169
2181 void* fbBasicListGetNextPtr(
2182 fbBasicList_t *basicList,
2183 void *currentPtr);
2184
2198 void* fbBasicListRealloc(
2199 fbBasicList_t *basicList,
2200 uint16_t newNumElements);
2201
2209 void* fbBasicListAddNewElements(
2210 fbBasicList_t *basicList,
2211 uint16_t numNewElements);
2212
2221 void fbBasicListClear(
2222 fbBasicList_t *basicList);
2223
2231 void fbBasicListClearWithoutFree(
2232 fbBasicList_t *basicList);
2233
2241 void fbBasicListFree(
2242 fbBasicList_t *basicList);
2243
2244
2245 /******* END OF BASICLIST ********/
2246
2247
2248
2249 /******* SUBTEMPLATELIST FUNCTIONS ****/
2250
2258 typedef struct fbSubTemplateList_st {
2261 union {
2262 size_t length;
2263 uint64_t extra;
2264 } dataLength;
2266 const fbTemplate_t *tmpl;
2268 uint8_t *dataPtr;
2270 uint16_t tmplID;
2272 uint16_t numElements;
2274 uint8_t semantic;
2275 } fbSubTemplateList_t;
2276
2283 fbSubTemplateList_t* fbSubTemplateListAlloc(
2284 void);
2285
2303 void* fbSubTemplateListInit(
2304 fbSubTemplateList_t *sTL,
2305 uint8_t semantic,
2306 uint16_t tmplID,
2307 const fbTemplate_t *tmpl,
2308 uint16_t numElements);
2309
2325 void* fbSubTemplateListInitWithOwnBuffer(
2326 fbSubTemplateList_t *subTemplateList,
2327 uint8_t semantic,
2328 uint16_t tmplID,
2329 const fbTemplate_t *tmpl,
2330 uint16_t numElements,
2331 uint16_t dataLength,
2332 uint8_t *dataPtr);
2333
2348 void fbSubTemplateListCollectorInit(
2349 fbSubTemplateList_t *STL);
2350
2356 void* fbSubTemplateListGetDataPtr(
2357 const fbSubTemplateList_t *subTemplateList);
2358
2368 void* fbSubTemplateListGetIndexedDataPtr(
2369 const fbSubTemplateList_t *subTemplateList,
2370 uint16_t index);
2371
2383 void* fbSubTemplateListGetNextPtr(
2384 const fbSubTemplateList_t *subTemplateList,
2385 void *currentPtr);
2386
2393 uint16_t fbSubTemplateListCountElements(
2394 const fbSubTemplateList_t *subTemplateList);
2395
2402 void fbSubTemplateListSetSemantic(
2403 fbSubTemplateList_t *subTemplateList,
2404 uint8_t semantic);
2405
2411 uint8_t fbSubTemplateListGetSemantic(
2412 fbSubTemplateList_t *subTemplateList);
2413
2419 const fbTemplate_t* fbSubTemplateListGetTemplate(
2420 fbSubTemplateList_t *subTemplateList);
2421
2427 uint16_t fbSubTemplateListGetTemplateID(
2428 fbSubTemplateList_t *subTemplateList);
2429
2445 void* fbSubTemplateListRealloc(
2446 fbSubTemplateList_t *subTemplateList,
2447 uint16_t newNumElements);
2448
2458 void* fbSubTemplateListAddNewElements(
2459 fbSubTemplateList_t *subTemplateList,
2460 uint16_t numNewElements);
2461
2477 void fbSubTemplateListClear(
2478 fbSubTemplateList_t *subTemplateList);
2479
2488 void fbSubTemplateListClearWithoutFree(
2489 fbSubTemplateList_t *subTemplateList);
2490
2499 void fbSubTemplateListFree(
2500 fbSubTemplateList_t *subTemplateList);
2501
2502 /********* END OF SUBTEMPLATELIST **********/
2520 typedef struct fbSubTemplateMultiListEntry_st {
2522 fbTemplate_t *tmpl;
2524 uint8_t *dataPtr;
2526 size_t dataLength;
2528 uint16_t tmplID;
2530 uint16_t numElements;
2531 } fbSubTemplateMultiListEntry_t;
2532
2537 typedef struct fbSubTemplateMultiList_st {
2539 fbSubTemplateMultiListEntry_t *firstEntry;
2541 uint16_t numElements;
2543 uint8_t semantic;
2544 } fbSubTemplateMultiList_t;
2545
2546
2554 fbSubTemplateMultiList_t* fbSubTemplateMultiListAlloc(
2555 void);
2556
2557
2567 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListInit(
2568 fbSubTemplateMultiList_t *STML,
2569 uint8_t semantic,
2570 uint16_t numElements);
2571
2579 uint16_t fbSubTemplateMultiListCountElements(
2580 const fbSubTemplateMultiList_t *STML);
2581
2588 void fbSubTemplateMultiListSetSemantic(
2589 fbSubTemplateMultiList_t *STML,
2590 uint8_t semantic);
2591
2597 uint8_t fbSubTemplateMultiListGetSemantic(
2598 fbSubTemplateMultiList_t *STML);
2599
2608 void fbSubTemplateMultiListClear(
2609 fbSubTemplateMultiList_t *STML);
2610
2625 void fbSubTemplateMultiListClearEntries(
2626 fbSubTemplateMultiList_t *STML);
2627
2635 void fbSubTemplateMultiListFree(
2636 fbSubTemplateMultiList_t *STML);
2637
2652 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListRealloc(
2653 fbSubTemplateMultiList_t *STML,
2654 uint16_t newNumEntries);
2655
2664 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListAddNewEntries(
2665 fbSubTemplateMultiList_t *STML,
2666 uint16_t numNewEntries);
2667
2673 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetFirstEntry(
2674 fbSubTemplateMultiList_t *STML);
2675
2684 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetIndexedEntry(
2685 fbSubTemplateMultiList_t *STML,
2686 uint16_t index);
2687
2699 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetNextEntry(
2700 fbSubTemplateMultiList_t *STML,
2701 fbSubTemplateMultiListEntry_t *currentEntry);
2702
2717 void* fbSubTemplateMultiListEntryInit(
2718 fbSubTemplateMultiListEntry_t *entry,
2719 uint16_t tmplID,
2720 fbTemplate_t *tmpl,
2721 uint16_t numElements);
2722
2740 void* fbSubTemplateMultiListEntryRealloc(
2741 fbSubTemplateMultiListEntry_t *entry,
2742 uint16_t newNumElements);
2743
2753 void* fbSubTemplateMultiListEntryAddNewElements(
2754 fbSubTemplateMultiListEntry_t *entry,
2755 uint16_t numNewElements);
2756
2766 void fbSubTemplateMultiListEntryClear(
2767 fbSubTemplateMultiListEntry_t *entry);
2768
2775 void* fbSubTemplateMultiListEntryGetDataPtr(
2776 fbSubTemplateMultiListEntry_t *entry);
2777
2789 void* fbSubTemplateMultiListEntryNextDataPtr(
2790 fbSubTemplateMultiListEntry_t *entry,
2791 void *currentPtr);
2792
2803 void* fbSubTemplateMultiListEntryGetIndexedPtr(
2804 fbSubTemplateMultiListEntry_t *entry,
2805 uint16_t index);
2806
2814 uint16_t fbSubTemplateMultiListEntryCountElements(
2815 const fbSubTemplateMultiListEntry_t *entry);
2816
2823 const fbTemplate_t* fbSubTemplateMultiListEntryGetTemplate(
2824 fbSubTemplateMultiListEntry_t *entry);
2825
2832 uint16_t fbSubTemplateMultiListEntryGetTemplateID(
2833 fbSubTemplateMultiListEntry_t *entry);
2834
2835 /************** END OF STML FUNCTIONS *********** */
2836
2853 void fBufListFree(
2854 fbTemplate_t *tmpl,
2855 uint8_t *record);
2856
2857
2866 fbListenerGroup_t* fbListenerGroupAlloc(
2867 void);
2868
2875 void fbListenerGroupFree(
2876 fbListenerGroup_t *group);
2877
2887 int fbListenerGroupAddListener(
2888 fbListenerGroup_t *group,
2889 const fbListener_t *listener);
2890
2900 int fbListenerGroupDeleteListener(
2901 fbListenerGroup_t *group,
2902 const fbListener_t *listener);
2903
2916 fbListenerGroupResult_t* fbListenerGroupWait(
2917 fbListenerGroup_t *group,
2918 GError **err);
2919
2925 void fbListenerFreeGroupResult(
2926 fbListenerGroupResult_t *result);
2927
2940 fBuf_t *fbListenerOwnSocketCollectorTCP(
2941 fbListener_t *listener,
2942 int sock,
2943 GError **err);
2944
2954 fBuf_t *fbListenerOwnSocketCollectorTLS(
2955 fbListener_t *listener,
2956 int sock,
2957 GError **err);
2958
2964 void fBufInterruptSocket(
2965 fBuf_t *fbuf);
2966
2967
2989 typedef gboolean (*fbListenerAppInit_fn) (
2990 fbListener_t *listener,
2991 void **ctx,
2992 int fd,
2993 struct sockaddr *peer,
2994 size_t peerlen,
2995 GError **err);
2996
3006 typedef void (*fbListenerAppFree_fn) (
3007 void *ctx);
3008
3009 /*
3010 * Public Function Calls. These calls will remain available and retain
3011 * their functionality in all subsequent versions of libfixbuf.
3012 */
3013
3014
3031 gboolean fBufSetInternalTemplate(
3032 fBuf_t *fbuf,
3033 uint16_t int_tid,
3034 GError **err);
3035
3053 gboolean fBufSetExportTemplate(
3054 fBuf_t *fbuf,
3055 uint16_t ext_tid,
3056 GError **err);
3057
3058 #if HAVE_SPREAD
3059
3074 void fBufSetSpreadExportGroup(
3075 fBuf_t *fbuf,
3076 char **groups,
3077 int num_groups,
3078 GError **err);
3079 #endif /* HAVE_SPREAD */
3080
3102 void fBufSetAutomaticMode(
3103 fBuf_t *fbuf,
3104 gboolean automatic);
3105
3126 gboolean fBufSetAutomaticInsert(
3127 fBuf_t *fbuf,
3128 GError **err);
3129
3130
3138 fbSession_t *fBufGetSession(
3139 fBuf_t *fbuf);
3140
3149 void fBufFree(
3150 fBuf_t *fbuf);
3151
3164 fBuf_t *fBufAllocForExport(
3165 fbSession_t *session,
3166 fbExporter_t *exporter);
3167
3177 fbExporter_t *fBufGetExporter(
3178 fBuf_t *fbuf);
3179
3190 void fBufSetExporter(
3191 fBuf_t *fbuf,
3192 fbExporter_t *exporter);
3193
3194
3206 size_t fBufRemaining(
3207 fBuf_t *fbuf);
3208
3209
3222 void fBufSetBuffer(
3223 fBuf_t *fbuf,
3224 uint8_t *buf,
3225 size_t buflen);
3226
3227
3251 gboolean fBufAppend(
3252 fBuf_t *fbuf,
3253 uint8_t *recbase,
3254 size_t recsize,
3255 GError **err);
3256
3266 gboolean fBufEmit(
3267 fBuf_t *fbuf,
3268 GError **err);
3269
3281 void fBufSetExportTime(
3282 fBuf_t *fbuf,
3283 uint32_t extime);
3284
3301 fBuf_t *fBufAllocForCollection(
3302 fbSession_t *session,
3303 fbCollector_t *collector);
3304
3314 fbCollector_t *fBufGetCollector(
3315 fBuf_t *fbuf);
3316
3327 void fBufSetCollector(
3328 fBuf_t *fbuf,
3329 fbCollector_t *collector);
3330
3360 gboolean fBufNext(
3361 fBuf_t *fbuf,
3362 uint8_t *recbase,
3363 size_t *recsize,
3364 GError **err);
3365
3378 gboolean fBufNextMessage(
3379 fBuf_t *fbuf,
3380 GError **err);
3381
3389 uint32_t fBufGetExportTime(
3390 fBuf_t *fbuf);
3391
3411 fbTemplate_t *fBufGetCollectionTemplate(
3412 fBuf_t *fbuf,
3413 uint16_t *ext_tid);
3414
3433 fbTemplate_t *fBufNextCollectionTemplate(
3434 fBuf_t *fbuf,
3435 uint16_t *ext_tid,
3436 GError **err);
3437
3452 fbInfoModel_t *fbInfoModelAlloc(
3453 void);
3454
3463 void fbInfoModelFree(
3464 fbInfoModel_t *model);
3465
3480 void fbInfoModelAddElement(
3481 fbInfoModel_t *model,
3482 fbInfoElement_t *ie);
3483
3502 void fbInfoModelAddElementArray(
3503 fbInfoModel_t *model,
3504 fbInfoElement_t *ie);
3505
3537 gboolean fbInfoModelReadXMLFile(
3538 fbInfoModel_t *model,
3539 const gchar *filename,
3540 GError **err);
3541
3574 gboolean fbInfoModelReadXMLData(
3575 fbInfoModel_t *model,
3576 const gchar *xml_data,
3577 gssize xml_data_len,
3578 GError **err);
3579
3591 const fbInfoElement_t *fbInfoModelGetElementByName(
3592 fbInfoModel_t *model,
3593 const char *name);
3594
3608 const fbInfoElement_t *fbInfoModelGetElementByID(
3609 fbInfoModel_t *model,
3610 uint16_t id,
3611 uint32_t ent);
3612
3620 guint fbInfoModelCountElements(
3621 const fbInfoModel_t *model);
3622
3632 void fbInfoModelIterInit(
3633 fbInfoModelIter_t *iter,
3634 const fbInfoModel_t *model);
3635
3646 const fbInfoElement_t *fbInfoModelIterNext(
3647 fbInfoModelIter_t *iter);
3648
3662 fbTemplate_t *fbInfoElementAllocTypeTemplate(
3663 fbInfoModel_t *model,
3664 GError **err);
3665
3680 gboolean fbInfoElementWriteOptionsRecord(
3681 fBuf_t *fbuf,
3682 const fbInfoElement_t *model_ie,
3683 uint16_t itid,
3684 uint16_t etid,
3685 GError **err);
3686
3698 gboolean fbInfoElementAddOptRecElement(
3699 fbInfoModel_t *model,
3700 fbInfoElementOptRec_t *rec);
3701
3710 gboolean fbInfoModelTypeInfoRecord(
3711 fbTemplate_t *tmpl);
3712
3731 fbTemplate_t *fbTemplateAlloc(
3732 fbInfoModel_t *model);
3733
3751 gboolean fbTemplateAppend(
3752 fbTemplate_t *tmpl,
3753 fbInfoElement_t *ex_ie,
3754 GError **err);
3755
3773 gboolean fbTemplateAppendSpec(
3774 fbTemplate_t *tmpl,
3775 fbInfoElementSpec_t *spec,
3776 uint32_t flags,
3777 GError **err);
3778
3794 gboolean fbTemplateAppendSpecArray(
3795 fbTemplate_t *tmpl,
3796 fbInfoElementSpec_t *spec,
3797 uint32_t flags,
3798 GError **err);
3799
3807 uint32_t fbTemplateCountElements(
3808 fbTemplate_t *tmpl);
3809
3824 void fbTemplateSetOptionsScope(
3825 fbTemplate_t *tmpl,
3826 uint16_t scope_count);
3827
3835 uint32_t fbTemplateGetOptionsScope(
3836 fbTemplate_t *tmpl);
3837
3851 gboolean fbTemplateContainsElement(
3852 fbTemplate_t *tmpl,
3853 const fbInfoElement_t *ex_ie);
3854
3866 gboolean fbTemplateContainsElementByName(
3867 fbTemplate_t *tmpl,
3868 fbInfoElementSpec_t *spec);
3869
3881 gboolean fbTemplateContainsAllElementsByName(
3882 fbTemplate_t *tmpl,
3883 fbInfoElementSpec_t *spec);
3884
3899 gboolean fbTemplateContainsAllFlaggedElementsByName(
3900 fbTemplate_t *tmpl,
3901 fbInfoElementSpec_t *spec,
3902 uint32_t flags);
3903
3912 fbInfoElement_t* fbTemplateGetIndexedIE(
3913 fbTemplate_t *tmpl,
3914 uint32_t IEindex);
3915
3916
3924 fbInfoModel_t * fbTemplateGetInfoModel(
3925 fbTemplate_t *tmpl);
3926
3934 void fbTemplateFreeUnused(
3935 fbTemplate_t *tmpl);
3936
3944 void *fbTemplateGetContext(
3945 fbTemplate_t *tmpl);
3946
3953 uint16_t fbTemplateGetIELenOfMemBuffer(
3954 fbTemplate_t *tmpl);
3955
3973 fbSession_t *fbSessionAlloc(
3974 fbInfoModel_t *model);
3975
3989 gboolean fbSessionEnableTypeMetadata(
3990 fbSession_t *session,
3991 gboolean enabled,
3992 GError **err);
3993
4017 uint16_t fbSessionSetMetadataExportElements(
4018 fbSession_t *session,
4019 gboolean enabled,
4020 uint16_t tid,
4021 GError **err);
4022
4037 gboolean fbSessionEnableTemplateMetadata(
4038 fbSession_t *session,
4039 gboolean enabled,
4040 GError **err);
4041
4065 uint16_t fbSessionSetMetadataExportTemplates(
4066 fbSession_t *session,
4067 gboolean enabled,
4068 uint16_t tid,
4069 GError **err);
4070
4088 uint16_t fbSessionAddTemplateWithMetadata(
4089 fbSession_t *session,
4090 gboolean internal,
4091 uint16_t tid,
4092 fbTemplate_t *tmpl,
4093 const char *name,
4094 const char *description,
4095 GError **err);
4096
4103 fbInfoModel_t *fbSessionGetInfoModel(
4104 fbSession_t *session);
4105
4135 void fbSessionAddNewTemplateCallback(
4136 fbSession_t *session,
4137 fbNewTemplateCallback_fn callback,
4138 void *app_ctx);
4139
4163 void fbSessionAddTemplatePair(
4164 fbSession_t *session,
4165 uint16_t ent_tid,
4166 uint16_t int_tid);
4167
4177 void fbSessionRemoveTemplatePair(
4178 fbSession_t *session,
4179 uint16_t ext_tid);
4180
4189 uint16_t fbSessionLookupTemplatePair(
4190 fbSession_t *session,
4191 uint16_t ext_tid);
4192
4202 void fbSessionFree(
4203 fbSession_t *session);
4204
4217 void fbSessionResetExternal(
4218 fbSession_t *session);
4219
4235 void fbSessionSetDomain(
4236 fbSession_t *session,
4237 uint32_t domain);
4238
4246 uint32_t fbSessionGetDomain(
4247 fbSession_t *session);
4248
4259 uint16_t fbSessionGetLargestInternalTemplateSize(
4260 fbSession_t *session);
4261
4269 fbCollector_t *fbSessionGetCollector(
4270 fbSession_t *session);
4271
4272 #if HAVE_SPREAD
4273
4295 uint16_t fbSessionAddTemplatesMulticast(
4296 fbSession_t *session,
4297 char **groups,
4298 gboolean internal,
4299 uint16_t tid,
4300 fbTemplate_t *tmpl,
4301 GError **err);
4302
4326 uint16_t fbSessionAddTemplatesMulticastWithMetadata(
4327 fbSession_t *session,
4328 char **groups,
4329 gboolean internal,
4330 uint16_t tid,
4331 fbTemplate_t *tmpl,
4332 char *name,
4333 char *description,
4334 GError **err);
4335
4336
4352 gboolean fbSessionSpreadEnableTemplateMetadata(
4353 fbSession_t *session,
4354 char **groups,
4355 gboolean enabled,
4356 GError **err);
4357
4377 uint16_t fbSessionSpreadSetMetadataExportTemplates(
4378 fbSession_t *session,
4379 char **groups,
4380 gboolean enabled,
4381 uint16_t tid,
4382 GError **err);
4383
4400 gboolean fbSessionSpreadEnableTypeMetadata(
4401 fbSession_t *session,
4402 char **groups,
4403 gboolean enabled,
4404 GError **err);
4405
4424 uint16_t fbSessionSpreadSetMetadataExportElements(
4425 fbSession_t *session,
4426 char **groups,
4427 gboolean enabled,
4428 uint16_t tid,
4429 GError **err);
4430 #endif /* HAVE_SPREAD */
4431
4448 gboolean fbSessionExportTemplate(
4449 fbSession_t *session,
4450 uint16_t tid,
4451 GError **err);
4452
4471 gboolean fbSessionExportTemplates(
4472 fbSession_t *session,
4473 GError **err);
4474
4495 uint16_t fbSessionAddTemplate(
4496 fbSession_t *session,
4497 gboolean internal,
4498 uint16_t tid,
4499 fbTemplate_t *tmpl,
4500 GError **err);
4501
4514 gboolean fbSessionRemoveTemplate(
4515 fbSession_t *session,
4516 gboolean internal,
4517 uint16_t tid,
4518 GError **err);
4519
4531 fbTemplate_t *fbSessionGetTemplate(
4532 fbSession_t *session,
4533 gboolean internal,
4534 uint16_t tid,
4535 GError **err);
4536
4549 fbExporter_t *fbExporterAllocNet(
4550 fbConnSpec_t *spec);
4551
4552 #if HAVE_SPREAD
4553
4562 int fbCollectorGetSpreadReturnGroups(
4563 fbCollector_t *collector,
4564 char *groups[]);
4565
4579 fbExporter_t *fbExporterAllocSpread(
4580 fbSpreadParams_t *params);
4581
4582 #endif /* HAVE_SPREAD */
4583
4595 fbExporter_t *fbExporterAllocFile(
4596 const char *path);
4597
4609 fbExporter_t *fbExporterAllocBuffer(
4610 uint8_t *buf,
4611 uint16_t bufsize);
4612
4613
4622 fbExporter_t *fbExporterAllocFP(
4623 FILE *fp);
4624
4637 void fbExporterSetStream(
4638 fbExporter_t *exporter,
4639 int sctp_stream);
4640
4653 void fbExporterAutoStream(
4654 fbExporter_t *exporter);
4655
4663 void fbExporterClose(
4664 fbExporter_t *exporter);
4665
4672 size_t fbExporterGetMsgLen(
4673 fbExporter_t *exporter);
4674
4687 fbCollector_t *fbCollectorAllocFile(
4688 void *ctx,
4689 const char *path,
4690 GError **err);
4691
4702 fbCollector_t *fbCollectorAllocFP(
4703 void *ctx,
4704 FILE *fp);
4705
4706
4707 #if HAVE_SPREAD
4708
4718 fbCollector_t *fbCollectorAllocSpread(
4719 void *ctx,
4720 fbSpreadParams_t *params,
4721 GError **err);
4722
4723 #endif /* HAVE_SPREAD */
4724
4735 void *fbCollectorGetContext(
4736 fbCollector_t *collector);
4737
4748 void fbCollectorClose(
4749 fbCollector_t *collector);
4750
4751
4763 void fbCollectorSetAcceptOnly(
4764 fbCollector_t *collector,
4765 struct sockaddr *address,
4766 size_t address_length);
4767
4796 fbListener_t *fbListenerAlloc(
4797 fbConnSpec_t *spec,
4798 fbSession_t *session,
4799 fbListenerAppInit_fn appinit,
4800 fbListenerAppFree_fn appfree,
4801 GError **err);
4802
4810 void fbListenerFree(
4811 fbListener_t *listener);
4812
4835 fBuf_t *fbListenerWait(
4836 fbListener_t *listener,
4837 GError **err);
4838
4849 fBuf_t *fbListenerWaitNoCollectors(
4850 fbListener_t *listener,
4851 GError **err);
4852
4860 void fbListenerInterrupt(
4861 fbListener_t *listener);
4862
4863
4874 gboolean fbListenerGetCollector(
4875 fbListener_t *listener,
4876 fbCollector_t **collector,
4877 GError **err);
4878
4879
4880
4881
4893 gboolean fbCollectorClearTranslator(
4894 fbCollector_t *collector,
4895 GError **err);
4896
4897
4909 gboolean fbCollectorSetNetflowV9Translator(
4910 fbCollector_t *collector,
4911 GError **err);
4912
4913
4925 gboolean fbCollectorSetSFlowTranslator(
4926 fbCollector_t *collector,
4927 GError **err);
4928
4947 uint32_t fbCollectorGetNetflowMissed(
4948 fbCollector_t *collector,
4949 struct sockaddr *peer,
4950 size_t peerlen,
4951 uint32_t obdomain);
4952
4968 uint32_t fbCollectorGetSFlowMissed(
4969 fbCollector_t *collector,
4970 struct sockaddr *peer,
4971 size_t peerlen,
4972 uint32_t obdomain);
4973
4980 struct sockaddr* fbCollectorGetPeer(
4981 fbCollector_t *collector);
4982
4992 uint32_t fbCollectorGetObservationDomain(
4993 fbCollector_t *collector);
4994
5017 void fbCollectorSetUDPMultiSession(
5018 fbCollector_t *collector,
5019 gboolean multi_session);
5020
5021
5022 #ifdef __cplusplus
5023 } /* extern "C" */
5024 #endif
5025
5026 #endif /* _FB_PUBLIC_H_ */
fbInfoElement_st::flags
uint32_t flags
Flags.
Definition: public.h:1645
FB_DT_MILSEC
The "dateTimeMilliseconds" data type: An unsigned 64-bit integer containing the number of millisecond...
Definition: public.h:1578
fbTemplateGetIndexedIE
fbInfoElement_t * fbTemplateGetIndexedIE(fbTemplate_t *tmpl, uint32_t IEindex)
Returns the information element in the template referenced by the index.
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...
fbSubTemplateMultiListEntry_t
struct fbSubTemplateMultiListEntry_st fbSubTemplateMultiListEntry_t
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
fbConnSpec_st::vssl_ctx
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.h:1844
fbSubTemplateMultiList_st::firstEntry
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition: public.h:2539
fbExporterAllocFile
fbExporter_t * fbExporterAllocFile(const char *path)
Allocates an exporting process endpoint for a named file.
fbInfoElementOptRec_st::ie_type
uint8_t ie_type
ie data type
Definition: public.h:1687
fbBasicListCountElements
uint16_t fbBasicListCountElements(const fbBasicList_t *basicList)
Returns the number of elements the basic list is capable of holding.
fbSubTemplateList_st::tmplID
uint16_t tmplID
ID of the template used to structure the data.
Definition: public.h:2270
FB_DT_MICROSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:1583
fbTemplateFreeUnused
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Frees a template if it is not currently in use by any Session.
fbInfoElementOptRec_st::ie_pen
uint32_t ie_pen
private enterprise number
Definition: public.h:1683
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...
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::dataLength
size_t dataLength
length of the buffer used to hold the data in this entry
Definition: public.h:2526
fbBasicListGetDataPtr
void * fbBasicListGetDataPtr(fbBasicList_t *basicList)
Gets a pointer to the data buffer for the basic list.
fbSubTemplateMultiListEntryCountElements
uint16_t fbSubTemplateMultiListEntryCountElements(const fbSubTemplateMultiListEntry_t *entry)
Returns the number of entries the sub template multi list entry is capable of holding.
fbSubTemplateMultiListClearEntries
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Clears the memory used by all the entries of a sub template multi list.
fbBasicListClearWithoutFree
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Clears the parameters of the basic list, but does not free the buffer.
fbTemplateGetOptionsScope
uint32_t fbTemplateGetOptionsScope(fbTemplate_t *tmpl)
Determines number of scope information elements in a template.
fbSubTemplateMultiListEntryAddNewElements
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t numNewElements)
Allocates space for numNewEntries additional elements in the sub template multi list entry...
fbExporterAllocFP
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocates an exporting process endpoint for an opened ANSI C file pointer.
fBufAppend
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Appends a record to a buffer.
FB_SCTP
Partially reliable datagram transport via SCTP.
Definition: public.h:1792
fBufListFree
void fBufListFree(fbTemplate_t *tmpl, uint8_t *record)
Clears all of the memory that fixbuf allocated during transcode of this record.
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:1540
FB_SUB_TMPL_LIST
The "subTemplateList" data type: A structured data element as described in RFC6313, Section 4.5.2.
Definition: public.h:1598
FB_INT_16
The "signed16" data type: An integer value in the range of -32768 to 32767.
Definition: public.h:1550
fbListenerGroupResult_st::next
struct fbListenerGroupResult_st * next
Pointer to the next listener group result.
Definition: public.h:1932
fbSubTemplateMultiList_st::semantic
uint8_t semantic
value used to describe the list of sub templates
Definition: public.h:2543
fbSubTemplateListGetTemplateID
uint16_t fbSubTemplateListGetTemplateID(fbSubTemplateList_t *subTemplateList)
Gets the template ID for the template used by the list.
fbBasicListFree
void fbBasicListFree(fbBasicList_t *basicList)
Clears the basic list (fbBasicListClear()), then frees the basic list itself.
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.
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...
fbExporterClose
void fbExporterClose(fbExporter_t *exporter)
Forces the file or socket underlying an exporting process endpoint to close.
fbSessionEnableTypeMetadata
gboolean fbSessionEnableTypeMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configures a session to export type information for enterprise-specific information elements as optio...
fbConnSpec_st::host
char * host
Hostname to connect/listen to.
Definition: public.h:1824
fbSessionSetDomain
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Sets the current observation domain on a session.
fbSessionGetCollector
fbCollector_t * fbSessionGetCollector(fbSession_t *session)
Retrieves the collector that was created with the session.
fbCollectorAllocSpread
fbCollector_t * fbCollectorAllocSpread(void *ctx, fbSpreadParams_t *params, GError **err)
Allocates a collecting process endpoint for the Spread transport.
fbSubTemplateList_st::numElements
uint16_t numElements
number of elements in the list
Definition: public.h:2272
fbSpreadParams_t
struct fbSpreadParams_st fbSpreadParams_t
Spread connection parameters.
fbListenerWait
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Waits on a listener.
fbBasicList_st::infoElement
const fbInfoElement_t * infoElement
pointer to the information element that is repeated in the list
Definition: public.h:2033
FB_FLOAT_64
The "float64" data type: An IEEE double-precision 64-bit floating point type.
Definition: public.h:1562
fbInfoElementOptRec_st::ie_range_end
uint64_t ie_range_end
ie range max
Definition: public.h:1697
fbInfoElement_st::description
const char * description
description
Definition: public.h:1653
fbConnSpec_t
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
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...
fBufSetAutomaticMode
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Sets the automatic (read/write) mode flag on a buffer.
fbSubTemplateMultiListEntryRealloc
void * fbSubTemplateMultiListEntryRealloc(fbSubTemplateMultiListEntry_t *entry, uint16_t newNumElements)
Potentially reallocates the entry&#39;s internal buffer and returns a handle to it.
fbInfoElement_st::min
uint64_t min
range min
Definition: public.h:1647
fbTemplate_st
An IPFIX template or options template structure.
Definition: private.h:199
fbCollector_t
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:1894
fbExporter_t
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:1885
fbSubTemplateMultiListAlloc
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates and returns an empty subTemplateMultiList structure.
FB_TLS_TCP
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1807
fbBasicListSetSemantic
void fbBasicListSetSemantic(fbBasicList_t *basicList, uint8_t semantic)
Sets the semantic for describing a basic list.
fbSubTemplateMultiListSetSemantic
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the semantic field for the multi list.
fbSession_t
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.h:1784
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...
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.
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...
fbCollectorGetSpreadReturnGroups
int fbCollectorGetSpreadReturnGroups(fbCollector_t *collector, char *groups[])
This function is useful if need to know what groups were set on the message.
fbListenerGroup_t
struct fbListenerGroup_st fbListenerGroup_t
Structure that represents a group of listeners.
Definition: public.h:1911
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...
fbListener_t
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:1902
FB_UDP
Unreliable datagram transport via UDP.
Definition: public.h:1796
fbInfoElementOptRec_st::ie_desc
fbVarfield_t ie_desc
information element description
Definition: public.h:1701
fbSessionSetMetadataExportTemplates
uint16_t fbSessionSetMetadataExportTemplates(fbSession_t *session, gboolean enabled, uint16_t tid, GError **err)
Configures a session to export template metadata as options records.
FB_UINT_8
The "unsigned8" data type: A non-negative integer value in the range of 0 to 255 (0xFF).
Definition: public.h:1534
fbSubTemplateListClearWithoutFree
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list parameters but does not free the data ptr.
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...
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.
fbSubTemplateMultiListEntry_st::tmpl
fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.h:2522
fbSubTemplateListAlloc
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates and returns an empty subTemplateList structure.
FB_OCTET_ARRAY
The "octetArray" data type: A finite-length string of octets.
Definition: public.h:1531
fbCollectorSetNetflowV9Translator
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert NetFlowV9 into IPFIX for the given collector...
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 ...
fbCollectorGetPeer
struct sockaddr * fbCollectorGetPeer(fbCollector_t *collector)
Retrieves information about the node connected to this collector.
fbSessionSpreadEnableTemplateMetadata
gboolean fbSessionSpreadEnableTemplateMetadata(fbSession_t *session, char **groups, gboolean enabled, GError **err)
Enables template metadata export for Spread Sessions.
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...
fbTemplateAppend
gboolean fbTemplateAppend(fbTemplate_t *tmpl, fbInfoElement_t *ex_ie, GError **err)
Appends an information element to a template.
fBufEmit
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emits the message currently in a buffer using the associated exporting process endpoint.
fbInfoElementOptRec_st::ie_id
uint16_t ie_id
information element id
Definition: public.h:1685
fbSubTemplateMultiListEntry_st::numElements
uint16_t numElements
number of elements in this entry
Definition: public.h:2530
fbInfoElement_t
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
fbBasicList_t
struct fbBasicList_st fbBasicList_t
A basic list element in a template which structure represents a basic list on the internal side...
fbCollectorAllocFP
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocates a collecting process endpoint for an open file.
fBufInterruptSocket
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
fbExporterAllocNet
fbExporter_t * fbExporterAllocNet(fbConnSpec_t *spec)
Allocates an exporting process endpoint for a network connection.
fBufSetCollector
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associates an collecting process endpoint with a buffer.
fbSubTemplateListFree
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list (fbSubTemplateListClear()) then frees the subTemplateList itself...
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...
fbSubTemplateMultiListRealloc
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListRealloc(fbSubTemplateMultiList_t *STML, uint16_t newNumEntries)
Potentially reallocates the list&#39;s internal buffer for entries and returns a handle to it...
fbSessionAddTemplatePair
void fbSessionAddTemplatePair(fbSession_t *session, uint16_t ent_tid, uint16_t int_tid)
Adds an external-internal template pair to the session.
fBufNext
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieves a record from a buffer.
fBufAllocForCollection
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocates a new buffer for collection.
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...
fbConnSpec_st::ssl_ca_file
char * ssl_ca_file
Path to certificate authority file.
Definition: public.h:1828
fbInfoElement_st::ref
union fbInfoElement_st::@1 ref
Information element name.
fBufFree
void fBufFree(fBuf_t *fbuf)
Frees a buffer.
fbSessionEnableTemplateMetadata
gboolean fbSessionEnableTemplateMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configures a session to export template metadata as options records.
fbSubTemplateList_st
Structure used to hold information of a sub template list.
Definition: public.h:2258
fbInfoElementSpec_st::flags
uint32_t flags
Application flags word.
Definition: public.h:1775
fbSubTemplateMultiListEntry_st
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
Definition: public.h:2520
fbSubTemplateListCollectorInit
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *STL)
Initializes a sub template list variable on a fbCollector_t.
fbSubTemplateMultiListEntry_st::tmplID
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.h:2528
fbInfoElementOptRec_st::ie_name
fbVarfield_t ie_name
information element name
Definition: public.h:1699
fbBasicList_st::semantic
uint8_t semantic
semantic field to describe the list
Definition: public.h:2041
fBufSetBuffer
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Sets a buffer on an fBuf for collection.
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:1553
fbSessionAlloc
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocates a transport session state container.
fbListenerWaitNoCollectors
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait(), except that this function doesn&#39;t monit...
fbListenerEntry_st::listener
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:1922
fbBasicListGetNextPtr
void * fbBasicListGetNextPtr(fbBasicList_t *basicList, void *currentPtr)
Retrieves a pointer to the data element in the basicList that follows the one at currentPtr.
fbConnSpec_st
Connection specifier.
Definition: public.h:1820
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...
fbInfoElementOptRec_t
struct fbInfoElementOptRec_st fbInfoElementOptRec_t
The corresponding C struct for a record whose template is the RFC5610 Information Element Type Option...
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:1950
fBufGetExporter
fbExporter_t * fBufGetExporter(fBuf_t *fbuf)
Retrieves the exporting process endpoint associated with a buffer.
fbTemplateGetIELenOfMemBuffer
uint16_t fbTemplateGetIELenOfMemBuffer(fbTemplate_t *tmpl)
Gets the length required for a buffer to store a data record described by this template.
fbSubTemplateList_t
struct fbSubTemplateList_st fbSubTemplateList_t
Structure used to hold information of a sub template list.
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...
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...
fbSubTemplateMultiListFree
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list (fbSubTemplateMultiListClear()), then frees the STML itself.
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.
fbInfoElement_st::len
uint16_t len
Information element length in octets.
Definition: public.h:1642
fbListenerGroupResult_st
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf...
Definition: public.h:1930
fBufAllocForExport
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocates a new buffer for export.
fbBasicListGetInfoElement
const fbInfoElement_t * fbBasicListGetInfoElement(fbBasicList_t *basicList)
Returns a pointer to the information element used in the basic list.
fbTemplateContainsElement
gboolean fbTemplateContainsElement(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie)
Determines if a template contains a given information element.
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.
fbSubTemplateMultiListEntryGetDataPtr
void * fbSubTemplateMultiListEntryGetDataPtr(fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
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:1869
fbConnSpec_st::vai
void * vai
Pointer to address info cache.
Definition: public.h:1839
fbListenerGroupResult_st::fbuf
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.h:1936
fbListenerEntry_st::prev
struct fbListenerEntry_st * prev
pointer to the previous listener entry in the linked list
Definition: public.h:1920
fbListenerGroupAlloc
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns an empty listenerGroup.
fbBasicList_st::dataPtr
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition: public.h:2035
fbSpreadParams_st
Spread connection parameters.
Definition: public.h:1866
fbListenerGroupResult_t
struct fbListenerGroupResult_st fbListenerGroupResult_t
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf...
fbTransport_t
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
fbConnSpec_st::ssl_key_pass
char * ssl_key_pass
Private key decryption password.
Definition: public.h:1834
fbBasicListGetSemantic
uint8_t fbBasicListGetSemantic(fbBasicList_t *basicList)
Gets the Semantic field for Basic List.
fbInfoModelAlloc
fbInfoModel_t * fbInfoModelAlloc(void)
Allocates a new information model.
fbConnSpec_st::ssl_cert_file
char * ssl_cert_file
Path to certificate file.
Definition: public.h:1830
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.
FB_SUB_TMPL_MULTI_LIST
The "subTemplateMultiList" data type: A structured data element as described in RFC6313, Section 4.5.3.
Definition: public.h:1601
fbSubTemplateMultiListGetSemantic
uint8_t fbSubTemplateMultiListGetSemantic(fbSubTemplateMultiList_t *STML)
Gets the semantic paramter from the multi list.
fbSubTemplateList_st::dataPtr
uint8_t * dataPtr
pointer to the buffer used to hold the data
Definition: public.h:2268
fbInfoElement_st::num
uint16_t num
Information Element number.
Definition: public.h:1640
fbSpreadParams_st::daemon
char * daemon
pointer to the daemon host address, in Spread format.
Definition: public.h:1872
fbBasicList_st::numElements
uint16_t numElements
number of elements in the list
Definition: public.h:2037
fBufSetExportTime
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Sets the export time on the message currently in a buffer.
FB_UINT_16
The "unsigned16" data type: A non-negative integer value in the range of 0 to 65535 (0xFFFF)...
Definition: public.h:1537
fbExporterGetMsgLen
size_t fbExporterGetMsgLen(fbExporter_t *exporter)
Gets the (transcoded) message length that was copied to the exporting buffer upon fBufEmit() when usi...
fbInfoElementOptRec_st::ie_semantic
uint8_t ie_semantic
ie semantic
Definition: public.h:1689
fbSessionExportTemplates
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Exports all external templates in the current domain of a given session.
fbListenerEntry_st::next
struct fbListenerEntry_st * next
pointer to the next listener entry in the linked list
Definition: public.h:1918
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...
fbSessionGetLargestInternalTemplateSize
uint16_t fbSessionGetLargestInternalTemplateSize(fbSession_t *session)
Gets the largest decoded size of an internal template in the session.
fbSubTemplateMultiList_st::numElements
uint16_t numElements
number of sub template lists in the multi list
Definition: public.h:2541
fbBasicList_st::dataLength
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.h:2039
fbListenerEntry_st
ListenerEntry&#39;s make up an fbListenerGroup_t as a linked list.
Definition: public.h:1916
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...
fbInfoModelFree
void fbInfoModelFree(fbInfoModel_t *model)
Frees an information model.
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.
fBufGetCollectionTemplate
fbTemplate_t * fBufGetCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid)
Retrieves the external template used to read the last record from the buffer.
fbSubTemplateListCountElements
uint16_t fbSubTemplateListCountElements(const fbSubTemplateList_t *subTemplateList)
Returns the number of elements the sub template list is capable of holding.
FB_MAC_ADDR
The "macAddress" data type: A MAC-48 address as a string of 6 octets.
Definition: public.h:1567
fbInfoModelReadXMLFile
gboolean fbInfoModelReadXMLFile(fbInfoModel_t *model, const gchar *filename, GError **err)
Adds information specified in the given XML file to the information model.
fBufGetCollector
fbCollector_t * fBufGetCollector(fBuf_t *fbuf)
Retrieves the collecting process endpoint associated with a buffer.
fbVarfield_st
A variable-length field value.
Definition: public.h:1180
fbInfoElement_st
A single IPFIX Information Element definition.
Definition: public.h:1612
fbSessionSpreadEnableTypeMetadata
gboolean fbSessionSpreadEnableTypeMetadata(fbSession_t *session, char **groups, gboolean enabled, GError **err)
Enables RFC 5610 information element metadata export for Spread Sessions.
fbInfoElementSpec_st::name
char * name
Information element name.
Definition: public.h:1756
fbCollectorGetContext
void * fbCollectorGetContext(fbCollector_t *collector)
Retrieves the application context associated with a collector.
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.
fbBasicListRealloc
void * fbBasicListRealloc(fbBasicList_t *basicList, uint16_t newNumElements)
Potentially reallocates the list&#39;s internal buffer and returns a handle to it.
FB_DTLS_UDP
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.h:1813
fbExporterSetStream
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Sets the SCTP stream for the next message exported.
fbSubTemplateMultiListEntryNextDataPtr
void * fbSubTemplateMultiListEntryNextDataPtr(fbSubTemplateMultiListEntry_t *entry, void *currentPtr)
Retrieves a pointer to the data record in this entry that follows the one at currentPtr.
fbSessionSpreadSetMetadataExportTemplates
uint16_t fbSessionSpreadSetMetadataExportTemplates(fbSession_t *session, char **groups, gboolean enabled, uint16_t tid, GError **err)
Enables template metadata export for Spread Sessions.
fbInfoModel_t
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:1197
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...
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...
fbInfoElementOptRec_st
The corresponding C struct for a record whose template is the RFC5610 Information Element Type Option...
Definition: public.h:1681
fbTemplateContainsElementByName
gboolean fbTemplateContainsElementByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of a given information element, specified by name in the template&#39;s information model.
FB_TCP
Reliable stream transport via TCP.
Definition: public.h:1794
fbInfoModelAddElement
void fbInfoModelAddElement(fbInfoModel_t *model, fbInfoElement_t *ie)
Adds a single information element to an information model.
fbInfoElementOptRec_st::ie_range_begin
uint64_t ie_range_begin
ie range min
Definition: public.h:1695
fbSessionGetDomain
uint32_t fbSessionGetDomain(fbSession_t *session)
Retrieves the current domain on a session.
fbVarfield_st::buf
uint8_t * buf
Content buffer.
Definition: public.h:1189
fbBasicListAddNewElements
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t numNewElements)
Allocates numNewElements additional element(s) into the basic list.
fbConnSpec_st::ssl_key_file
char * ssl_key_file
Path to private key file.
Definition: public.h:1832
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:2989
fbInfoElement_st::midx
uint32_t midx
Multiple IE index.
Definition: public.h:1633
fbListenerGroupAddListener
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
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...
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...
fBufSetAutomaticInsert
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
Enables automatic insertion of RFC 5610 elements on a buffer.
fbSubTemplateMultiList_st
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
Definition: public.h:2537
fbSubTemplateList_st::semantic
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.h:2274
fbExporterAutoStream
void fbExporterAutoStream(fbExporter_t *exporter)
Enables automatic SCTP stream selection for the next message exported.
fbVarfield_t
struct fbVarfield_st fbVarfield_t
A variable-length field value.
fbSessionGetInfoModel
fbInfoModel_t * fbSessionGetInfoModel(fbSession_t *session)
Gets the info model for the session.
fbInfoModelCountElements
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Returns the number of information elements in the information model.
version.h
Fixbuf&#39;s version information.
fbInfoElementDataType_t
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
fbConnSpec_st::transport
fbTransport_t transport
Transport protocol to use.
Definition: public.h:1822
fbSubTemplateMultiListEntryClear
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory holding the records&#39; data used by this entry.
fbSubTemplateMultiListEntryGetTemplate
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(fbSubTemplateMultiListEntry_t *entry)
Retrieves the template pointer used to structure the data elements.
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.
fbSubTemplateListGetDataPtr
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateList)
Returns a pointer to the buffer that contains the data for the list.
fbListenerAlloc
fbListener_t * fbListenerAlloc(fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocates a listener.
fbBasicListCollectorInit
void fbBasicListCollectorInit(fbBasicList_t *basicList)
Initializes a basic list structure for collection.
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...
fbVarfield_st::len
size_t len
Length of content in buffer.
Definition: public.h:1182
fbSubTemplateMultiListCountElements
uint16_t fbSubTemplateMultiListCountElements(const fbSubTemplateMultiList_t *STML)
Returns the number of entries the sub template multi list is capable of holding.
fbInfoElementSpec_st::len_override
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1768
fBufNextMessage
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Reads a new message into a buffer using the associated collecting process endpoint.
fbExporterAllocSpread
fbExporter_t * fbExporterAllocSpread(fbSpreadParams_t *params)
Allocates an exporting process endpoint for a Spread connection.
FB_DT_NANOSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:1588
fbInfoElementDataType_en
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.h:1528
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:1556
fbInfoElement_st::max
uint64_t max
range max
Definition: public.h:1649
fbSubTemplateMultiListEntry_st::dataPtr
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.h:2524
fbInfoModelIter_t
GHashTableIter fbInfoModelIter_t
An iterator over the information elements in an information model.
Definition: public.h:1202
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.
fbSubTemplateListGetTemplate
const fbTemplate_t * fbSubTemplateListGetTemplate(fbSubTemplateList_t *subTemplateList)
Gets the template pointer from the list structure.
fBufGetExportTime
uint32_t fBufGetExportTime(fBuf_t *fbuf)
Retrieves the export time on the message currently in a buffer.
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.
fbListenerGroupWait
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Accepts connections for multiple listeners.
fbBasicListAlloc
fbBasicList_t * fbBasicListAlloc(void)
Allocates and returns an empty Basic List Structure.
fbBasicList_st
A basic list element in a template which structure represents a basic list on the internal side...
Definition: public.h:2031
FB_IP6_ADDR
The "ipv6Address" data type: A value of an IPv6 address.
Definition: public.h:1592
fbTransport_en
fbTransport_en
Transport protocol for connection specifier.
Definition: public.h:1787
fbInfoModelIterNext
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Returns a pointer to the next information element in the information model.
FB_BASIC_LIST
The "basicList" data type: A structured data element as described in RFC6313, Section 4...
Definition: public.h:1595
fbSubTemplateListRealloc
void * fbSubTemplateListRealloc(fbSubTemplateList_t *subTemplateList, uint16_t newNumElements)
Potentially reallocates the list&#39;s internal buffer and returns a handle to it.
fBufSetExporter
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associates an exporting process endpoint with a buffer.
FB_BOOL
The "boolean" data type: A binary value: "true" or "false".
Definition: public.h:1564
FB_DT_SEC
The "dateTimeSeconds" data type: An unsigned 32-bit integer containing the number of seconds since th...
Definition: public.h:1574
fbSubTemplateMultiListGetFirstEntry
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(fbSubTemplateMultiList_t *STML)
Retrieves the first entry in the multi list.
fbListenerAppFree_fn
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition: public.h:3006
fbTemplateGetContext
void * fbTemplateGetContext(fbTemplate_t *tmpl)
Gets the ctx pointer associated with a Template.
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:1875
fbInfoElementOptRec_st::ie_units
uint16_t ie_units
ie units
Definition: public.h:1691
fbTemplateAlloc
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocates a new empty template.
fbCollectorAllocFile
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocates a collecting process endpoint for a named file.
fbSubTemplateMultiList_t
struct fbSubTemplateMultiList_st fbSubTemplateMultiList_t
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
fBufGetSession
fbSession_t * fBufGetSession(fBuf_t *fbuf)
Retrieves the session associated with a buffer.
fbInfoElement_st::ent
uint32_t ent
Private Enterprise Number.
Definition: public.h:1635
fbListenerFreeGroupResult
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Frees the listener group result returned from fbListenerGroupWait().
FB_DTLS_SCTP
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1802
fbInfoElement_st::type
uint8_t type
Data Type.
Definition: public.h:1651
FB_IP4_ADDR
The "ipv4Address" data type: A value of an IPv4 address.
Definition: public.h:1590
fbTemplateCountElements
uint32_t fbTemplateCountElements(fbTemplate_t *tmpl)
Determines number of information elements in a template.
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.
fbCollectorGetObservationDomain
uint32_t fbCollectorGetObservationDomain(fbCollector_t *collector)
Retrieves the observation domain of the node connected to the UDP collector.
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.
fbListenerGroupFree
void fbListenerGroupFree(fbListenerGroup_t *group)
Frees a listener group.
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...
fbTemplateGetInfoModel
fbInfoModel_t * fbTemplateGetInfoModel(fbTemplate_t *tmpl)
Returns the information model, as understood by the template.
fbListenerEntry_t
struct fbListenerEntry_st fbListenerEntry_t
ListenerEntry&#39;s make up an fbListenerGroup_t as a linked list.
FB_FLOAT_32
The "float32" data type: An IEEE single-precision 32-bit floating point type.
Definition: public.h:1559
FB_STRING
The "string" data type: A finite-length string of valid characters from the Unicode character encodin...
Definition: public.h:1570
fBuf_t
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:1172
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:1977
fbSubTemplateListSetSemantic
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateList, uint8_t semantic)
Sets the semantic parameter of a subTemplateList.
fbSessionGetTemplate
fbTemplate_t * fbSessionGetTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieves a template from a session by ID.
fbInfoElementSpec_st
A single IPFIX Information Element specification.
Definition: public.h:1754
fbSessionExportTemplate
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Exports a single external template in the current domain of a given session.
fbSubTemplateListClear
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateList)
Clears a subTemplateList structure, notably freeing the internal buffer and setting it to NULL...
fbSessionAddTemplate
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, GError **err)
Adds a template to a session.
fbSubTemplateMultiListAddNewEntries
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t numNewEntries)
Adds numNewElements entries to the multi list of entries.
fbSubTemplateListAddNewElements
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t numNewElements)
Allocates space for numNewElements additional element in the subTemplateList.
fbTemplateAppendSpec
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Appends an information element described by specifier to a template.
fbListenerGroupDeleteListener
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
fbConnSpec_st::svc
char * svc
Service name or port number to connect/listen to.
Definition: public.h:1826
fbSessionRemoveTemplate
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Removes a template from a session.
FB_INT_8
The "signed8" data type: An integer value in the range of -128 to 127.
Definition: public.h:1547
fbInfoModelIterInit
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initializes an information model iterator for iteration over the information elements (fbInfoElement_...
fbSessionResetExternal
void fbSessionResetExternal(fbSession_t *session)
Resets the external state (sequence numbers and templates) in a session state container.
fbSubTemplateMultiListEntryGetTemplateID
uint16_t fbSubTemplateMultiListEntryGetTemplateID(fbSubTemplateMultiListEntry_t *entry)
Retrieves the template ID for the template used to structure the data.
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...
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:1544
fbCollectorSetSFlowTranslator
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert SFlow into IPFIX for the given collector.
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.
fbListenerInterrupt
void fbListenerInterrupt(fbListener_t *listener)
Causes the current or next call to fbListenerWait() to unblock and return.
fbListenerOwnSocketCollectorTLS
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP() but for TLS (not tested)
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...
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...
fbSubTemplateListGetSemantic
uint8_t fbSubTemplateListGetSemantic(fbSubTemplateList_t *subTemplateList)
Gets the semantic value from a sub template list.
fbListenerGroupResult_st::listener
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.h:1934
fbInfoModelAddElementArray
void fbInfoModelAddElementArray(fbInfoModel_t *model, fbInfoElement_t *ie)
Adds multiple information elements in an array to an information model.
fBufSetInternalTemplate
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Sets the internal template on a buffer to the given template ID.
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...
fbListenerFree
void fbListenerFree(fbListener_t *listener)
Frees a listener.
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.
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...
fbSessionFree
void fbSessionFree(fbSession_t *session)
Frees a transport session state container.
fbTemplateSetOptionsScope
void fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Sets the number of information elements in a template that are scope.
fbSubTemplateList_st::tmpl
const fbTemplate_t * tmpl
pointer to the template used to structure the data
Definition: public.h:2266