CERT NetSA Security Suite
Monitoring for Large-Scale Networks

# fixbuf

Documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

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-2015 Carnegie Mellon University. All Rights Reserved.
7 ** ------------------------------------------------------------------------
8 ** Authors: Brian Trammell, Dan Ruef
9 ** ------------------------------------------------------------------------
10 ** Use of the libfixbuf system and related source code is subject to the terms
11 ** of the following licenses:
12 **
13 ** GNU Lesser GPL (LGPL) Rights pursuant to Version 2.1, February 1999
14 ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.227.7013
15 **
16 ** NO WARRANTY
17 **
18 ** ANY INFORMATION, MATERIALS, SERVICES, INTELLECTUAL PROPERTY OR OTHER
19 ** PROPERTY OR RIGHTS GRANTED OR PROVIDED BY CARNEGIE MELLON UNIVERSITY
20 ** PURSUANT TO THIS LICENSE (HEREINAFTER THE "DELIVERABLES") ARE ON AN
21 ** "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY
22 ** KIND, EITHER EXPRESS OR IMPLIED AS TO ANY MATTER INCLUDING, BUT NOT
23 ** LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE,
24 ** MERCHANTABILITY, INFORMATIONAL CONTENT, NONINFRINGEMENT, OR ERROR-FREE
25 ** OPERATION. CARNEGIE MELLON UNIVERSITY SHALL NOT BE LIABLE FOR INDIRECT,
26 ** SPECIAL OR CONSEQUENTIAL DAMAGES, SUCH AS LOSS OF PROFITS OR INABILITY
27 ** TO USE SAID INTELLECTUAL PROPERTY, UNDER THIS LICENSE, REGARDLESS OF
28 ** WHETHER SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH DAMAGES.
29 ** LICENSEE AGREES THAT IT WILL NOT MAKE ANY WARRANTY ON BEHALF OF
30 ** CARNEGIE MELLON UNIVERSITY, EXPRESS OR IMPLIED, TO ANY PERSON
31 ** CONCERNING THE APPLICATION OF OR THE RESULTS TO BE OBTAINED WITH THE
32 ** DELIVERABLES UNDER THIS LICENSE.
33 **
34 ** Licensee hereby agrees to defend, indemnify, and hold harmless Carnegie
35 ** Mellon University, its trustees, officers, employees, and agents from
36 ** all claims or demands made against them (and any related losses,
37 ** expenses, or attorney's fees) arising out of, or relating to Licensee's
38 ** and/or its sub licensees' negligent use or willful misuse of or
39 ** negligent conduct or willful misconduct regarding the Software,
40 ** facilities, or other rights or assistance granted by Carnegie Mellon
41 ** University under this License, including, but not limited to, any
42 ** claims of product liability, personal injury, death, damage to
43 ** property, or violation of any laws or regulations.
44 **
45 ** Carnegie Mellon University Software Engineering Institute authored
46 ** documents are sponsored by the U.S. Department of Defense under
47 ** Contract FA8721-05-C-0003. Carnegie Mellon University retains
48 ** copyrights in all material produced under this contract. The U.S.
49 ** Government retains a non-exclusive, royalty-free license to publish or
50 ** reproduce these documents, or allow others to do so, for U.S.
51 ** Government purposes only pursuant to the copyright license under the
52 ** contract clause at 252.227.7013.
53 **
54 ** ------------------------------------------------------------------------
55 */
56
946 #ifndef _FB_PUBLIC_H_
947 #define _FB_PUBLIC_H_
948 #include <fixbuf/autoinc.h>
949
950 #ifdef __cplusplus
951 extern "C" {
952 #endif
953
954 #ident "$Id$"
955
956 /*
957 * Error Handling Definitions
958 */
959
961 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
962
963 #define FB_ERROR_TMPL 1
964
968 #define FB_ERROR_EOM 2
969
974 #define FB_ERROR_EOF 3
975
979 #define FB_ERROR_IPFIX 4
980
985 #define FB_ERROR_BUFSZ 5
986
987 #define FB_ERROR_IMPL 6
988
989 #define FB_ERROR_IO 7
990
994 #define FB_ERROR_NLREAD 8
995
1000 #define FB_ERROR_NLWRITE 9
1001
1004 #define FB_ERROR_NOELEMENT 10
1005
1008 #define FB_ERROR_CONN 11
1009
1013 #define FB_ERROR_NETFLOWV9 12
1014
1017 #define FB_ERROR_TRANSMISC 13
1018
1021 #define FB_ERROR_SFLOW 14
1022
1023
1024 /*
1025 * Public Datatypes and Constants
1026 */
1027
1028 struct fBuf_st;
1034 typedef struct fBuf_st fBuf_t;
1035
1042 typedef struct fbVarfield_st {
1044 size_t len;
1051 uint8_t *buf;
1052 } fbVarfield_t;
1053
1054
1055 struct fbInfoModel_st;
1060 typedef struct fbInfoModel_st fbInfoModel_t;
1061
1065 typedef struct fbInfoModelIter_st {
1069 const fbInfoModel_t *model;
1073 guint index;
1074 } fbInfoModelIter_t;
1075
1081 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_)\
1082 { {(const struct fbInfoElement_st*)_name_}, 0, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_ }
1083
1089 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
1090 FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char*)NULL)
1091
1092
1098 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
1099
1105 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
1106
1112 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
1113
1118 #define FB_IE_F_NONE 0x00000000
1119
1124 #define FB_IE_F_ENDIAN 0x00000001
1125
1135 #define FB_IE_F_REVERSIBLE 0x00000040
1136
1144 #define FB_IE_F_ALIEN 0x00000080
1145
1150 #define FB_IE_QUANTITY 0x00000100
1151
1157 #define FB_IE_TOTALCOUNTER 0x00000200
1158
1163 #define FB_IE_DELTACOUNTER 0x00000300
1164
1169 #define FB_IE_IDENTIFIER 0x00000400
1170
1175 #define FB_IE_FLAGS 0x00000500
1176
1182 #define FB_IE_LIST 0x00000600
1183
1189 #define FB_IE_DEFAULT 0x00000000
1190
1201 #define FB_UNITS_BITS 0x00010000
1202
1207 #define FB_UNITS_OCTETS 0x00020000
1208
1213 #define FB_UNITS_PACKETS 0x00030000
1214
1219 #define FB_UNITS_FLOWS 0x00040000
1220
1225 #define FB_UNITS_SECONDS 0x00050000
1226
1231 #define FB_UNITS_MILLISECONDS 0x00060000
1232
1237 #define FB_UNITS_MICROSECONDS 0x00070000
1238
1243 #define FB_UNITS_NANOSECONDS 0x00080000
1244
1249 #define FB_UNITS_WORDS 0x00090000
1250
1255 #define FB_UNITS_MESSAGES 0x000A0000
1256
1261 #define FB_UNITS_HOPS 0x000B0000
1262
1267 #define FB_UNITS_ENTRIES 0x000C0000
1268
1273 #define FB_UNITS_FRAMES 0x000D0000
1274
1278 #define FB_IE_VARLEN 65535
1279
1284 #define FB_IE_BASIC_LIST 291
1285
1289 #define FB_IE_SUBTEMPLATE_LIST 292
1290
1294 #define FB_IE_SUBTEMPLATE_MULTILIST 293
1295
1303 #define FB_IE_PEN_REVERSE 29305
1304
1313 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
1314
1320 #define FB_CISCO_GENERIC 9999
1321
1328 #define FB_CISCO_ASA_EVENT_ID 9998
1329
1338 #define FB_CISCO_ASA_EVENT_XTRA 9997
1339
1344 #define FB_IE_REVERSE_STR "reverse"
1345
1347 #define FB_IE_REVERSE_STRLEN 7
1348
1354 typedef enum fbInfoElementDataType_en {
1355 FB_OCTET_ARRAY,
1356 FB_UINT_8,
1357 FB_UINT_16,
1358 FB_UINT_32,
1359 FB_UINT_64,
1360 FB_INT_8,
1361 FB_INT_16,
1362 FB_INT_32,
1363 FB_INT_64,
1364 FB_FLOAT_32,
1365 FB_FLOAT_64,
1366 FB_BOOL,
1367 FB_MAC_ADDR,
1368 FB_STRING,
1369 FB_DT_SEC,
1370 FB_DT_MILSEC,
1371 FB_DT_MICROSEC,
1372 FB_DT_NANOSEC,
1373 FB_IP4_ADDR,
1374 FB_IP6_ADDR,
1375 FB_BASIC_LIST,
1376 FB_SUB_TMPL_LIST,
1377 FB_SUB_TMPL_MULTI_LIST
1378 } fbInfoElementDataType_t;
1379
1388 typedef struct fbInfoElement_st {
1390 union {
1396 const struct fbInfoElement_st *canon;
1401 const char *name;
1402 } ref;
1403
1409 uint32_t midx;
1411 uint32_t ent;
1416 uint16_t num;
1418 uint16_t len;
1421 uint32_t flags;
1423 uint64_t min;
1425 uint64_t max;
1427 uint8_t type;
1429 const char *description;
1430 } fbInfoElement_t;
1431
1438 typedef struct fbInfoElementOptRec_st {
1440 uint64_t ie_range_begin;
1442 uint64_t ie_range_end;
1444 uint32_t ie_pen;
1446 uint16_t ie_units;
1448 uint16_t ie_id;
1450 uint8_t ie_type;
1452 uint8_t ie_semantic;
1454 uint8_t padding[6];
1456 fbVarfield_t ie_name;
1458 fbVarfield_t ie_desc;
1459 } fbInfoElementOptRec_t;
1460
1465 #define FB_TID_AUTO 0
1466
1470 #define FB_TID_TS 2
1471
1475 #define FB_TID_OTS 3
1476
1480 #define FB_TID_MIN_DATA 256
1481
1482 struct fbTemplate_st;
1488 typedef struct fbTemplate_st fbTemplate_t;
1489
1495 #define FB_IESPEC_NULL { NULL, 0, 0 }
1496
1502 typedef struct fbInfoElementSpec_st {
1504 char *name;
1509 uint16_t len_override;
1516 uint32_t flags;
1517 } fbInfoElementSpec_t;
1518
1519 struct fbSession_st;
1526 typedef struct fbSession_st fbSession_t;
1527
1529 typedef enum fbTransport_en {
1534 FB_SCTP,
1536 FB_TCP,
1538 FB_UDP,
1544 FB_DTLS_SCTP,
1549 FB_TLS_TCP,
1555 FB_DTLS_UDP,
1556 } fbTransport_t;
1557
1562 typedef struct fbConnSpec_st {
1564 fbTransport_t transport;
1566 char *host;
1568 char *svc;
1570 char *ssl_ca_file;
1572 char *ssl_cert_file;
1574 char *ssl_key_file;
1576 char *ssl_key_pass;
1581 void *vai;
1586 void *vssl_ctx;
1587 } fbConnSpec_t;
1588
1592 #define FB_CONNSPEC_INIT { FB_SCTP, NULL, NULL, \
1593 NULL, NULL, NULL, NULL, \
1594 NULL, NULL }
1595
1596 #if HAVE_SPREAD
1597
1602 #define FB_SPREADPARAMS_INIT { 0, 0, 0 }
1603
1604 typedef struct fbSpreadParams_st {
1607 fbSession_t * session;
1610 char * daemon;
1613 char ** groups;
1614 } fbSpreadParams_t;
1615
1616 #endif /* HAVE_SPREAD */
1617
1618 struct fbExporter_st;
1624 typedef struct fbExporter_st fbExporter_t;
1625
1626 struct fbCollector_st;
1634 typedef struct fbCollector_st fbCollector_t;
1635
1636 struct fbListener_st;
1643 typedef struct fbListener_st fbListener_t;
1644
1648 typedef struct fbListenerEntry_st fbListenerEntry_t;
1649
1653 struct fbListenerEntry_st
1654 {
1656 fbListenerEntry_t *next;
1658 fbListenerEntry_t *prev;
1660 fbListener_t *listener;
1661 };
1662
1666 typedef struct fbListenerGroupResult_st fbListenerGroupResult_t;
1667
1673 struct fbListenerGroupResult_st
1674 {
1676 fbListenerGroupResult_t *next;
1678 fbListener_t *listener;
1680 fBuf_t *fbuf;
1681 };
1682
1683 struct fbListenerGroup_st;
1687 typedef struct fbListenerGroup_st fbListenerGroup_t;
1688
1705 typedef void (*fbNewTemplateCallback_fn) (
1706 fbSession_t *session,
1707 uint16_t tid,
1708 fbTemplate_t *tmpl);
1709
1717 typedef void (*fbTemplateCtxFree_fn)(
1718 void *ctx);
1719
1729 typedef void (*fbTemplateCtxFree2_fn)(
1730 void *tmpl_ctx,
1731 void *app_ctx);
1732
1733
1760 typedef void (*fbTemplateCtxCallback_fn) (
1761 fbSession_t *session,
1762 uint16_t tid,
1763 fbTemplate_t *tmpl,
1764 void **ctx,
1765 fbTemplateCtxFree_fn *fn);
1766
1791 typedef void (*fbTemplateCtxCallback2_fn) (
1792 fbSession_t *session,
1793 uint16_t tid,
1794 fbTemplate_t *tmpl,
1795 void *app_ctx,
1796 void **tmpl_ctx,
1797 fbTemplateCtxFree2_fn *fn);
1798
1799
1807 #define FB_LIST_SEM_UNDEFINED 0xFF
1808
1811 #define FB_LIST_SEM_NONE_OF 0x00
1812
1815 #define FB_LIST_SEM_EXACTLY_ONE_OF 0x01
1816
1819 #define FB_LIST_SEM_ONE_OR_MORE_OF 0x02
1820
1823 #define FB_LIST_SEM_ALL_OF 0x03
1824
1827 #define FB_LIST_SEM_ORDERED 0x04
1828
1835 gboolean fbListValidSemantic(
1836 uint8_t semantic);
1837
1838 /****** BASICLIST FUNCTIONS AND STRUCTS *******/
1844 typedef struct fbBasicList_st {
1846 const fbInfoElement_t *infoElement;
1848 uint8_t *dataPtr;
1850 uint16_t numElements;
1852 uint16_t dataLength;
1854 uint8_t semantic;
1855 } fbBasicList_t;
1856
1857
1863 fbBasicList_t* fbBasicListAlloc(
1864 void);
1865
1878 void* fbBasicListInit(
1879 fbBasicList_t *basicListPtr,
1880 uint8_t semantic,
1881 const fbInfoElement_t *infoElement,
1882 uint16_t numElements);
1883
1898 void* fbBasicListInitWithOwnBuffer(
1899 fbBasicList_t *basicListPtr,
1900 uint8_t semantic,
1901 const fbInfoElement_t *infoElement,
1902 uint16_t numElements,
1903 uint16_t dataLength,
1904 uint8_t *dataPtr);
1905
1918 void fbBasicListCollectorInit(
1919 fbBasicList_t *basicListPtr);
1920
1921
1929 uint8_t fbBasicListGetSemantic(
1930 fbBasicList_t *basicListPtr);
1931
1940 void fbBasicListSetSemantic(
1941 fbBasicList_t *basicListPtr,
1942 uint8_t semantic);
1943
1944
1952 const fbInfoElement_t* fbBasicListGetInfoElement(
1953 fbBasicList_t *basicListPtr);
1954
1960 void* fbBasicListGetDataPtr(
1961 fbBasicList_t *basicListPtr);
1962
1971 void* fbBasicListGetIndexedDataPtr(
1972 fbBasicList_t *basicListPtr,
1973 uint16_t bl_index);
1974
1983 void* fbBasicListGetNextPtr(
1984 fbBasicList_t *basicListPtr,
1985 void *currentPtr);
1986
1996 void* fbBasicListRealloc(
1997 fbBasicList_t *basicList,
1998 uint16_t newNumElements);
1999
2007 void* fbBasicListAddNewElements(
2008 fbBasicList_t *basicList,
2009 uint16_t numNewElements);
2010
2016 void fbBasicListClear(
2017 fbBasicList_t *basicListPtr);
2018
2025 void fbBasicListClearWithoutFree(
2026 fbBasicList_t *basicList);
2027
2033 void fbBasicListFree(
2034 fbBasicList_t *basicListPtr);
2035
2036
2037 /******* END OF BASICLIST ********/
2038
2039
2040
2041 /******* SUBTEMPLATELIST FUNCTIONS ****/
2042
2050 typedef struct fbSubTemplateList_st {
2053 union {
2054 size_t length;
2055 uint64_t extra;
2056 } dataLength;
2058 const fbTemplate_t *tmpl;
2060 uint8_t *dataPtr;
2062 uint16_t tmplID;
2064 uint16_t numElements;
2066 uint8_t semantic;
2067 } fbSubTemplateList_t;
2068
2075 fbSubTemplateList_t* fbSubTemplateListAlloc(
2076 void);
2077
2090 void* fbSubTemplateListInit(
2091 fbSubTemplateList_t *sTL,
2092 uint8_t semantic,
2093 uint16_t tmplID,
2094 const fbTemplate_t *tmpl,
2095 uint16_t numElements);
2096
2111 void* fbSubTemplateListInitWithOwnBuffer(
2112 fbSubTemplateList_t *subTemplateList,
2113 uint8_t semantic,
2114 uint16_t tmplID,
2115 const fbTemplate_t *tmpl,
2116 uint16_t numElements,
2117 uint16_t dataLength,
2118 uint8_t *dataPtr);
2119
2130 void fbSubTemplateListCollectorInit(
2131 fbSubTemplateList_t *STL);
2132
2138 void* fbSubTemplateListGetDataPtr(
2139 const fbSubTemplateList_t *subTemplateListPtr);
2140
2148 void* fbSubTemplateListGetIndexedDataPtr(
2149 const fbSubTemplateList_t *subTemplateListPtr,
2150 uint16_t index);
2151
2163 void* fbSubTemplateListGetNextPtr(
2164 const fbSubTemplateList_t *subTemplateListPtr,
2165 void *currentPtr);
2166
2173 void fbSubTemplateListSetSemantic(
2174 fbSubTemplateList_t *subTemplateListPtr,
2175 uint8_t semantic);
2176
2182 uint8_t fbSubTemplateListGetSemantic(
2183 fbSubTemplateList_t *subTemplateListPtr);
2184
2190 const fbTemplate_t* fbSubTemplateListGetTemplate(
2191 fbSubTemplateList_t *subTemplateListPtr);
2192
2198 uint16_t fbSubTemplateListGetTemplateID(
2199 fbSubTemplateList_t *subTemplateListPtr);
2200
2211 void* fbSubTemplateListRealloc(
2212 fbSubTemplateList_t *subTemplateList,
2213 uint16_t newNumElements);
2214
2223 void* fbSubTemplateListAddNewElements(
2224 fbSubTemplateList_t *subTemplateList,
2225 uint16_t numNewElements);
2226
2240 void fbSubTemplateListClear(
2241 fbSubTemplateList_t *subTemplateListPtr);
2242
2251 void fbSubTemplateListClearWithoutFree(
2252 fbSubTemplateList_t *subTemplateListPtr);
2253
2261 void fbSubTemplateListFree(
2262 fbSubTemplateList_t *subTemplateListPtr);
2263
2264 /********* END OF SUBTEMPLATELIST **********/
2282 typedef struct fbSubTemplateMultiListEntry_st {
2284 fbTemplate_t *tmpl;
2286 uint8_t *dataPtr;
2288 size_t dataLength;
2290 uint16_t tmplID;
2292 uint16_t numElements;
2293 } fbSubTemplateMultiListEntry_t;
2294
2299 typedef struct fbSubTemplateMultiList_st {
2301 fbSubTemplateMultiListEntry_t *firstEntry;
2303 uint16_t numElements;
2305 uint8_t semantic;
2306 } fbSubTemplateMultiList_t;
2307
2308
2316 fbSubTemplateMultiList_t* fbSubTemplateMultiListAlloc(
2317 void);
2318
2319
2329 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListInit(
2330 fbSubTemplateMultiList_t *STML,
2331 uint8_t semantic,
2332 uint16_t numElements);
2333
2340 void fbSubTemplateMultiListSetSemantic(
2341 fbSubTemplateMultiList_t *STML,
2342 uint8_t semantic);
2343
2349 uint8_t fbSubTemplateMultiListGetSemantic(
2350 fbSubTemplateMultiList_t *STML);
2351
2358 void fbSubTemplateMultiListClear(
2359 fbSubTemplateMultiList_t *STML);
2360
2370 void fbSubTemplateMultiListClearEntries(
2371 fbSubTemplateMultiList_t *STML);
2372
2378 void fbSubTemplateMultiListFree(
2379 fbSubTemplateMultiList_t *STML);
2380
2390 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListRealloc(
2391 fbSubTemplateMultiList_t *STML,
2392 uint16_t newNumEntries);
2393
2402 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListAddNewEntries(
2403 fbSubTemplateMultiList_t *STML,
2404 uint16_t numNewEntries);
2405
2411 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetFirstEntry(
2412 fbSubTemplateMultiList_t *STML);
2413
2421 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetIndexedEntry(
2422 fbSubTemplateMultiList_t *STML,
2423 uint16_t index);
2424
2436 fbSubTemplateMultiListEntry_t* fbSubTemplateMultiListGetNextEntry(
2437 fbSubTemplateMultiList_t *STML,
2438 fbSubTemplateMultiListEntry_t *currentEntry);
2439
2451 void* fbSubTemplateMultiListEntryInit(
2452 fbSubTemplateMultiListEntry_t *entry,
2453 uint16_t tmplID,
2454 fbTemplate_t *tmpl,
2455 uint16_t numElements);
2456
2467 void *fbSubTemplateMultiListEntryRealloc(
2468 fbSubTemplateMultiListEntry_t *entry,
2469 uint16_t newNumElements);
2470
2480 void* fbSubTemplateMultiListEntryAddNewElements(
2481 fbSubTemplateMultiListEntry_t *entry,
2482 uint16_t numNewElements);
2483
2490 void fbSubTemplateMultiListEntryClear(
2491 fbSubTemplateMultiListEntry_t *entry);
2492
2499 void* fbSubTemplateMultiListEntryGetDataPtr(
2500 fbSubTemplateMultiListEntry_t *entry);
2501
2513 void* fbSubTemplateMultiListEntryNextDataPtr(
2514 fbSubTemplateMultiListEntry_t *entry,
2515 void *currentPtr);
2516
2527 void* fbSubTemplateMultiListEntryGetIndexedPtr(
2528 fbSubTemplateMultiListEntry_t *entry,
2529 uint16_t index);
2530
2537 const fbTemplate_t* fbSubTemplateMultiListEntryGetTemplate(
2538 fbSubTemplateMultiListEntry_t *entry);
2539
2546 uint16_t fbSubTemplateMultiListEntryGetTemplateID(
2547 fbSubTemplateMultiListEntry_t *entry);
2548
2549 /************** END OF STML FUNCTIONS *********** */
2550
2566 void fBufListFree(
2567 fbTemplate_t *tmpl,
2568 uint8_t *record);
2569
2570
2576 fbListenerGroup_t* fbListenerGroupAlloc(
2577 void);
2578
2585 void fbListenerGroupFree(
2586 fbListenerGroup_t *group);
2587
2597 int fbListenerGroupAddListener(
2598 fbListenerGroup_t *group,
2599 const fbListener_t *listener);
2600
2610 int fbListenerGroupDeleteListener(
2611 fbListenerGroup_t *group,
2612 const fbListener_t *listener);
2613
2624 fbListenerGroupResult_t* fbListenerGroupWait(
2625 fbListenerGroup_t *group,
2626 GError **err);
2627
2628
2635 void fbListenerFreeGroupResult(
2636 fbListenerGroupResult_t *result);
2637
2650 fBuf_t *fbListenerOwnSocketCollectorTCP(
2651 fbListener_t *listener,
2652 int sock,
2653 GError **err);
2654
2664 fBuf_t *fbListenerOwnSocketCollectorTLS(
2665 fbListener_t *listener,
2666 int sock,
2667 GError **err);
2668
2674 void fBufInterruptSocket(
2675 fBuf_t *fbuf);
2676
2677
2698 typedef gboolean (*fbListenerAppInit_fn) (
2699 fbListener_t *listener,
2700 void **ctx,
2701 int fd,
2702 struct sockaddr *peer,
2703 size_t peerlen,
2704 GError **err);
2705
2713 typedef void (*fbListenerAppFree_fn) (
2714 void *ctx);
2715
2716 /*
2717 * Public Function Calls. These calls will remain available and retain
2718 * their functionality in all subsequent versions of libfixbuf.
2719 */
2720
2721
2738 gboolean fBufSetInternalTemplate(
2739 fBuf_t *fbuf,
2740 uint16_t int_tid,
2741 GError **err);
2742
2760 gboolean fBufSetExportTemplate(
2761 fBuf_t *fbuf,
2762 uint16_t ext_tid,
2763 GError **err);
2764
2765 #if HAVE_SPREAD
2766
2783 void fBufSetSpreadExportGroup(
2784 fBuf_t *fbuf,
2785 char **groups,
2786 int num_groups,
2787 GError **err);
2788 #endif
2789
2804 void fBufSetAutomaticMode(
2805 fBuf_t *fbuf,
2806 gboolean automatic);
2807
2822 gboolean fBufSetAutomaticInsert(
2823 fBuf_t *fbuf,
2824 GError **err);
2825
2826
2834 fbSession_t *fBufGetSession(
2835 fBuf_t *fbuf);
2836
2845 void fBufFree(
2846 fBuf_t *fbuf);
2847
2860 fBuf_t *fBufAllocForExport(
2861 fbSession_t *session,
2862 fbExporter_t *exporter);
2863
2873 fbExporter_t *fBufGetExporter(
2874 fBuf_t *fbuf);
2875
2886 void fBufSetExporter(
2887 fBuf_t *fbuf,
2888 fbExporter_t *exporter);
2889
2890
2902 size_t fBufRemaining(
2903 fBuf_t *fbuf);
2904
2905
2918 void fBufSetBuffer(
2919 fBuf_t *fbuf,
2920 uint8_t *buf,
2921 size_t buflen);
2922
2923
2947 gboolean fBufAppend(
2948 fBuf_t *fbuf,
2949 uint8_t *recbase,
2950 size_t recsize,
2951 GError **err);
2952
2962 gboolean fBufEmit(
2963 fBuf_t *fbuf,
2964 GError **err);
2965
2977 void fBufSetExportTime(
2978 fBuf_t *fbuf,
2979 uint32_t extime);
2980
2993 fBuf_t *fBufAllocForCollection(
2994 fbSession_t *session,
2995 fbCollector_t *collector);
2996
3006 fbCollector_t *fBufGetCollector(
3007 fBuf_t *fbuf);
3008
3019 void fBufSetCollector(
3020 fBuf_t *fbuf,
3021 fbCollector_t *collector);
3022
3052 gboolean fBufNext(
3053 fBuf_t *fbuf,
3054 uint8_t *recbase,
3055 size_t *recsize,
3056 GError **err);
3057
3071 gboolean fBufNextMessage(
3072 fBuf_t *fbuf,
3073 GError **err);
3074
3082 uint32_t fBufGetExportTime(
3083 fBuf_t *fbuf);
3084
3104 fbTemplate_t *fBufGetCollectionTemplate(
3105 fBuf_t *fbuf,
3106 uint16_t *ext_tid);
3107
3126 fbTemplate_t *fBufNextCollectionTemplate(
3127 fBuf_t *fbuf,
3128 uint16_t *ext_tid,
3129 GError **err);
3130
3142 fbInfoModel_t *fbInfoModelAlloc(void);
3143
3152 void fbInfoModelFree(
3153 fbInfoModel_t *model);
3154
3169 void fbInfoModelAddElement(
3170 fbInfoModel_t *model,
3171 fbInfoElement_t *ie);
3172
3187 void fbInfoModelAddElementArray(
3188 fbInfoModel_t *model,
3189 fbInfoElement_t *ie);
3190
3202 const fbInfoElement_t *fbInfoModelGetElementByName(
3203 fbInfoModel_t *model,
3204 const char *name);
3205
3219 const fbInfoElement_t *fbInfoModelGetElementByID(
3220 fbInfoModel_t *model,
3221 uint16_t id,
3222 uint32_t ent);
3223
3231 guint fbInfoModelCountElements(
3232 const fbInfoModel_t *model);
3233
3241 void fbInfoModelIterInit(
3242 fbInfoModelIter_t *iter,
3243 const fbInfoModel_t *model);
3244
3255 const fbInfoElement_t *fbInfoModelIterNext(
3256 fbInfoModelIter_t *iter);
3257
3271 fbTemplate_t *fbInfoElementAllocTypeTemplate(
3272 fbInfoModel_t *model,
3273 GError **err);
3274
3288 gboolean fbInfoElementWriteOptionsRecord(
3289 fBuf_t *fbuf,
3290 const fbInfoElement_t *model_ie,
3291 uint16_t tid,
3292 GError **err);
3293
3305 gboolean fbInfoElementAddOptRecElement(
3306 fbInfoModel_t *model,
3307 fbInfoElementOptRec_t *rec);
3308
3318 gboolean fbInfoModelTypeInfoRecord(
3319 fbTemplate_t *tmpl);
3320
3338 fbTemplate_t *fbTemplateAlloc(
3339 fbInfoModel_t *model);
3340
3357 gboolean fbTemplateAppend(
3358 fbTemplate_t *tmpl,
3359 fbInfoElement_t *ex_ie,
3360 GError **err);
3361
3377 gboolean fbTemplateAppendSpec(
3378 fbTemplate_t *tmpl,
3379 fbInfoElementSpec_t *spec,
3380 uint32_t flags,
3381 GError **err);
3382
3400 gboolean fbTemplateAppendSpecArray(
3401 fbTemplate_t *tmpl,
3402 fbInfoElementSpec_t *spec,
3403 uint32_t flags,
3404 GError **err);
3405
3413 uint32_t fbTemplateCountElements(
3414 fbTemplate_t *tmpl);
3415
3425 void fbTemplateSetOptionsScope(
3426 fbTemplate_t *tmpl,
3427 uint16_t scope_count);
3428
3436 uint32_t fbTemplateGetOptionsScope(
3437 fbTemplate_t *tmpl);
3438
3450 gboolean fbTemplateContainsElement(
3451 fbTemplate_t *tmpl,
3452 const fbInfoElement_t *ex_ie);
3453
3463 gboolean fbTemplateContainsElementByName(
3464 fbTemplate_t *tmpl,
3465 fbInfoElementSpec_t *spec);
3466
3476 gboolean fbTemplateContainsAllElementsByName(
3477 fbTemplate_t *tmpl,
3478 fbInfoElementSpec_t *spec);
3479
3490 gboolean fbTemplateContainsAllFlaggedElementsByName(
3491 fbTemplate_t *tmpl,
3492 fbInfoElementSpec_t *spec,
3493 uint32_t flags);
3494
3503 fbInfoElement_t* fbTemplateGetIndexedIE(
3504 fbTemplate_t *tmpl,
3505 uint32_t IEindex);
3506
3514 void fbTemplateFreeUnused(
3515 fbTemplate_t *tmpl);
3516
3524 void *fbTemplateGetContext(
3525 fbTemplate_t *tmpl);
3526
3544 fbSession_t *fbSessionAlloc(
3545 fbInfoModel_t *model);
3546
3555 fbInfoModel_t *fbSessionGetInfoModel(
3556 fbSession_t *session);
3557
3558
3582 void fbSessionAddTemplateCallback(
3583 fbSession_t *session,
3584 fbNewTemplateCallback_fn callback);
3585
3623 void fbSessionAddTemplateCtxCallback(
3624 fbSession_t *session,
3625 fbTemplateCtxCallback_fn callback);
3626
3659 void fbSessionAddTemplateCtxCallback2(
3660 fbSession_t *session,
3661 fbTemplateCtxCallback2_fn callback,
3662 void *app_ctx);
3663
3687 void fbSessionAddTemplatePair(
3688 fbSession_t *session,
3689 uint16_t ent_tid,
3690 uint16_t int_tid);
3691
3701 void fbSessionRemoveTemplatePair(
3702 fbSession_t *session,
3703 uint16_t ext_tid);
3704
3713 uint16_t fbSessionLookupTemplatePair(
3714 fbSession_t *session,
3715 uint16_t ext_tid);
3716
3726 void fbSessionFree(
3727 fbSession_t *session);
3728
3741 void fbSessionResetExternal(
3742 fbSession_t *session);
3743
3759 void fbSessionSetDomain(
3760 fbSession_t *session,
3761 uint32_t domain);
3762
3770 uint32_t fbSessionGetDomain(
3771 fbSession_t *session);
3772
3780 fbCollector_t *fbSessionGetCollector(
3781 fbSession_t *session);
3782
3783 #if HAVE_SPREAD
3784
3805 gboolean fbSessionAddTemplatesMulticast(
3806 fbSession_t *session,
3807 char **groups,
3808 gboolean internal,
3809 uint16_t tid,
3810 fbTemplate_t *tmpl,
3811 GError **err);
3812
3813 #endif
3814
3827 gboolean fbSessionExportTemplate(
3828 fbSession_t *session,
3829 uint16_t tid,
3830 GError **err);
3831
3843 gboolean fbSessionExportTemplates(
3844 fbSession_t *session,
3845 GError **err);
3846
3865 uint16_t fbSessionAddTemplate(
3866 fbSession_t *session,
3867 gboolean internal,
3868 uint16_t tid,
3869 fbTemplate_t *tmpl,
3870 GError **err);
3871
3884 gboolean fbSessionRemoveTemplate(
3885 fbSession_t *session,
3886 gboolean internal,
3887 uint16_t tid,
3888 GError **err);
3889
3901 fbTemplate_t *fbSessionGetTemplate(
3902 fbSession_t *session,
3903 gboolean internal,
3904 uint16_t tid,
3905 GError **err);
3906
3919 fbExporter_t *fbExporterAllocNet(
3920 fbConnSpec_t *spec);
3921
3922 #if HAVE_SPREAD
3923
3934 int fbCollectorGetSpreadReturnGroups(
3935 fbCollector_t *collector,
3936 char *groups[]);
3937
3951 fbExporter_t *fbExporterAllocSpread(
3952 fbSpreadParams_t *params );
3953
3954 #endif /* HAVE_SPREAD */
3955
3967 fbExporter_t *fbExporterAllocFile(
3968 const char *path);
3969
3979 fbExporter_t *fbExporterAllocBuffer(
3980 uint8_t *buf,
3981 uint16_t bufsize);
3982
3983
3992 fbExporter_t *fbExporterAllocFP(
3993 FILE *fp);
3994
4007 void fbExporterSetStream(
4008 fbExporter_t *exporter,
4009 int sctp_stream);
4010
4023 void fbExporterAutoStream(
4024 fbExporter_t *exporter);
4025
4033 void fbExporterClose(
4034 fbExporter_t *exporter);
4035
4042 size_t fbExporterGetMsgLen(
4043 fbExporter_t *exporter);
4044
4057 fbCollector_t *fbCollectorAllocFile(
4058 void *ctx,
4059 const char *path,
4060 GError **err);
4061
4072 fbCollector_t *fbCollectorAllocFP(
4073 void *ctx,
4074 FILE *fp);
4075
4076
4077 #if HAVE_SPREAD
4078
4088 fbCollector_t *fbCollectorAllocSpread(
4089 void *ctx,
4090 fbSpreadParams_t *params,
4091 GError **err );
4092
4093 #endif /* HAVE_SPREAD */
4094
4105 void *fbCollectorGetContext(
4106 fbCollector_t *collector);
4107
4118 void fbCollectorClose(
4119 fbCollector_t *collector);
4120
4121
4133 void fbCollectorSetAcceptOnly(
4134 fbCollector_t *collector,
4135 struct sockaddr *address,
4136 size_t address_length);
4137
4166 fbListener_t *fbListenerAlloc(
4167 fbConnSpec_t *spec,
4168 fbSession_t *session,
4169 fbListenerAppInit_fn appinit,
4170 fbListenerAppFree_fn appfree,
4171 GError **err);
4172
4180 void fbListenerFree(
4181 fbListener_t *listener);
4182
4205 fBuf_t *fbListenerWait(
4206 fbListener_t *listener,
4207 GError **err);
4208
4219 fBuf_t *fbListenerWaitNoCollectors(
4220 fbListener_t *listener,
4221 GError **err);
4222
4230 void fbListenerInterrupt(
4231 fbListener_t *listener);
4232
4233
4249 gboolean fbListenerGetCollector(
4250 fbListener_t *listener,
4251 fbCollector_t **collector,
4252 GError **err);
4253
4254
4255
4256
4272 gboolean fbCollectorClearTranslator(
4273 fbCollector_t *collector,
4274 GError **err);
4275
4276
4292 gboolean fbCollectorSetNetflowV9Translator(
4293 fbCollector_t *collector,
4294 GError **err);
4295
4296
4312 gboolean fbCollectorSetSFlowTranslator(
4313 fbCollector_t *collector,
4314 GError **err);
4315
4336 uint32_t fbCollectorGetNetflowMissed(
4337 fbCollector_t *collector,
4338 struct sockaddr *peer,
4339 size_t peerlen,
4340 uint32_t obdomain);
4341
4359 uint32_t fbCollectorGetSFlowMissed(
4360 fbCollector_t *collector,
4361 struct sockaddr *peer,
4362 size_t peerlen,
4363 uint32_t obdomain);
4364
4371 struct sockaddr* fbCollectorGetPeer(
4372 fbCollector_t *collector);
4373
4383 uint32_t fbCollectorGetObservationDomain(
4384 fbCollector_t *collector);
4385
4398 void fbCollectorSetUDPMultiSession(
4399 fbCollector_t *collector,
4400 gboolean multi_session);
4401
4416 void fbCollectorManageUDPStreamByPort(
4417 fbCollector_t *collector,
4418 gboolean manage_port);
4419
4420 #ifdef __cplusplus
4421 } /* extern "C" */
4422 #endif
4423
4424 #endif
fbTemplateGetIndexedIE
fbInfoElement_t * fbTemplateGetIndexedIE(fbTemplate_t *tmpl, uint32_t IEindex)
Return the information element in the template referenced by the index.
fbInfoElement_st::ent
uint32_t ent
Private Enterprise Number.
Definition: public.h:1411
fbSubTemplateMultiListEntry_t
struct fbSubTemplateMultiListEntry_st fbSubTemplateMultiListEntry_t
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
fbExporterAllocFile
fbExporter_t * fbExporterAllocFile(const char *path)
Allocate an exporting process endpoint for a named file.
fbListenerGroupResult_st::listener
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.h:1678
fbTemplateFreeUnused
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Free a template if it is not currently in use by any Session.
fbConnSpec_st::ssl_ca_file
char * ssl_ca_file
Path to certificate authority file.
Definition: public.h:1570
fbExporterAllocBuffer
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocate an exporting process for a buffer.
fbConnSpec_st::vai
void * vai
Pointer to address info cache.
Definition: public.h:1581
fbInfoElementOptRec_st::ie_pen
uint32_t ie_pen
private enterprise number
Definition: public.h:1444
fbVarfield_st
A variable-length field value.
Definition: public.h:1042
fbSubTemplateMultiListClearEntries
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Clears the memory used by the entries of a sub template multi list NOTE: if any of those entries cont...
fbBasicListClearWithoutFree
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Clear the parameters of the basic list, but do not free the buffer.
fbTemplateGetOptionsScope
uint32_t fbTemplateGetOptionsScope(fbTemplate_t *tmpl)
Determine number of scope information elements in a template.
fbSubTemplateMultiListEntryAddNewElements
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t numNewElements)
Allocates space for a number of additional elements in the sub template multi list entry...
fbExporterAllocFP
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocate 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)
Append a record to a buffer.
fbConnSpec_st::ssl_cert_file
char * ssl_cert_file
Path to certificate file.
Definition: public.h:1572
FB_SCTP
Partially reliable datagram transport via SCTP.
Definition: public.h:1534
fBufListFree
void fBufListFree(fbTemplate_t *tmpl, uint8_t *record)
Clear all of the memory that fixbuf allocated during transcode of this record.
fbInfoElementOptRec_st::ie_range_begin
uint64_t ie_range_begin
ie range min
Definition: public.h:1440
fbSubTemplateList_st::numElements
uint16_t numElements
number of elements in the list
Definition: public.h:2064
fbInfoElement_st::min
uint64_t min
range min
Definition: public.h:1423
fbInfoElementOptRec_st::ie_range_end
uint64_t ie_range_end
ie range max
Definition: public.h:1442
fbBasicListFree
void fbBasicListFree(fbBasicList_t *basicListPtr)
Clear the basic list, then free the basic list pointer.
fbInfoModelGetElementByName
const fbInfoElement_t * fbInfoModelGetElementByName(fbInfoModel_t *model, const char *name)
Return a pointer to the canonical information element within an information model given the informati...
fbExporterClose
void fbExporterClose(fbExporter_t *exporter)
Force the file or socket underlying an exporting process endpoint to close.
fbListenerGroupResult_st::fbuf
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.h:1680
fbSubTemplateMultiListEntry_st::tmplID
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.h:2290
fbBasicListInitWithOwnBuffer
void * fbBasicListInitWithOwnBuffer(fbBasicList_t *basicListPtr, 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...
fbSessionSetDomain
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Set the current observation domain on a session.
fbSessionGetCollector
fbCollector_t * fbSessionGetCollector(fbSession_t *session)
Retrieve collector that was created with the session.
fbBasicListGetInfoElement
const fbInfoElement_t * fbBasicListGetInfoElement(fbBasicList_t *basicListPtr)
This function returns a pointer to the information element used in the list it is mainly used in coll...
fbListenerWait
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Wait on a listener.
fbSubTemplateMultiList_st
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
Definition: public.h:2299
fbConnSpec_t
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
fBufSetAutomaticMode
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Set the automatic mode flag on a buffer.
fbSubTemplateMultiListEntryRealloc
void * fbSubTemplateMultiListEntryRealloc(fbSubTemplateMultiListEntry_t *entry, uint16_t newNumElements)
Frees the memory for the data used by the entry, then allocates a new buffer based on the size of the...
fbCollector_t
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:1634
fbExporter_t
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:1624
fbSubTemplateList_st::semantic
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.h:2066
fbSubTemplateMultiListAlloc
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates a subTemplateMultiList_t Based on how subTemplateMultiLists will be used and set up amidst ...
FB_TLS_TCP
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1549
fbSubTemplateList_st::tmpl
const fbTemplate_t * tmpl
pointer to the template used to structure the data
Definition: public.h:2058
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:1526
fbSubTemplateMultiListInit
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListInit(fbSubTemplateMultiList_t *STML, uint8_t semantic, uint16_t numElements)
Initializes the multi list with semantic, numbers of elements, and allocates memory to store numEleme...
fbSubTemplateMultiListEntry_st::dataLength
size_t dataLength
length of the buffer used to hold the data in this entry
Definition: public.h:2288
fbSessionRemoveTemplatePair
void fbSessionRemoveTemplatePair(fbSession_t *session, uint16_t ext_tid)
remove a template pair from the list this is called by fixbuf when a template is revoked from the ses...
fbListenerGroup_t
struct fbListenerGroup_st fbListenerGroup_t
Structure that holds the listeners that are added to the group.
Definition: public.h:1687
fbSubTemplateListInit
void * fbSubTemplateListInit(fbSubTemplateList_t *sTL, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes a subTemplateList structure and alloc's the dataPtr to get a buffer able to hold numEleme...
fbListener_t
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:1643
fbVarfield_st::len
size_t len
Length of content in buffer.
Definition: public.h:1044
FB_UDP
Unreliable datagram transport via UDP.
Definition: public.h:1538
fbBasicList_st::dataLength
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.h:1852
fbSubTemplateListFree
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateListPtr)
Frees and clears a subTemplateList struct.
fbSubTemplateListClear
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateListPtr)
Clears a subtemplate list struct, notably freeing the dataPtr and setting it to NULL.
fbCollectorGetNetflowMissed
uint32_t fbCollectorGetNetflowMissed(fbCollector_t *collector, struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
fbCollectorGetNetflowMissed
fbTemplateAppendSpecArray
gboolean fbTemplateAppendSpecArray(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Append information elements described by a specifier array to a template.
fbBasicList_st::dataPtr
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition: public.h:1848
fbInfoElement_st::num
uint16_t num
Information Element number.
Definition: public.h:1416
fbSubTemplateListAlloc
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates a subTemplateList_t Based on how subTemplateLists will be used and set up amidst data struc...
fbCollectorSetNetflowV9Translator
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
fbCollectorSetNetflowV9Translator
fbCollectorGetPeer
struct sockaddr * fbCollectorGetPeer(fbCollector_t *collector)
Retrieves information about the node connected to this collector.
fbBasicList_st::numElements
uint16_t numElements
number of elements in the list
Definition: public.h:1850
fbTemplateAppend
gboolean fbTemplateAppend(fbTemplate_t *tmpl, fbInfoElement_t *ex_ie, GError **err)
Append an information element to a template.
fBufEmit
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emit the message currently in a buffer using the associated exporting process endpoint.
fbTemplateCtxCallback_fn
void(* fbTemplateCtxCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void **ctx, fbTemplateCtxFree_fn *fn)
A callback function that will be called when the session receives a new external template.
Definition: public.h:1760
fbSubTemplateMultiList_st::firstEntry
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition: public.h:2301
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)
Allocate a collecting process endpoint for an open file.
fbSessionAddTemplateCallback
void fbSessionAddTemplateCallback(fbSession_t *session, fbNewTemplateCallback_fn callback)
This function sets the callback to let the user know when a new template has arrived from the connect...
fBufInterruptSocket
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
fbInfoElement_st::len
uint16_t len
Information element length in octets.
Definition: public.h:1418
fbExporterAllocNet
fbExporter_t * fbExporterAllocNet(fbConnSpec_t *spec)
Allocate an exporting process endpoint for a network connection.
fBufSetCollector
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associate an collecting process endpoint with a buffer.
fbTemplateContainsAllElementsByName
gboolean fbTemplateContainsAllElementsByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determine if a template contains at least one instance of each information element in a given informa...
fbSubTemplateMultiListRealloc
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListRealloc(fbSubTemplateMultiList_t *STML, uint16_t newNumEntries)
Clears the entries used by the multi list, then if newNumElements is different than numElements...
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)
Retrieve a record from a buffer.
fBufAllocForCollection
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocate a new buffer for collection.
fbTemplateContainsAllFlaggedElementsByName
gboolean fbTemplateContainsAllFlaggedElementsByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags)
Determine if a template contains at least one instance of each information element in a given informa...
fbSubTemplateListGetDataPtr
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateListPtr)
Returns a pointer to the buffer that contains the data for the list.
fBufFree
void fBufFree(fBuf_t *fbuf)
Free a buffer.
fbBasicListClear
void fbBasicListClear(fbBasicList_t *basicListPtr)
Clear the parameters of the basic list and free the data buffer.
fbBasicList_st::infoElement
const fbInfoElement_t * infoElement
pointer to the information element that is repeated in the list
Definition: public.h:1846
fbBasicListGetDataPtr
void * fbBasicListGetDataPtr(fbBasicList_t *basicListPtr)
fbSubTemplateListCollectorInit
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *STL)
Initializes a sub template list variable on a collector.
fbSubTemplateListClearWithoutFree
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateListPtr)
Clears the sub template list parameters but does not free the data ptr.
fBufSetBuffer
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Set a buffer on an fBuf for collection.
fbSessionAlloc
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocate 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't monitor...
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 struct to the Information Element Type Options Template.
fbInfoElementSpec_st::flags
uint32_t flags
Application flags word.
Definition: public.h:1516
fbNewTemplateCallback_fn
void(* fbNewTemplateCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl)
The callback function to be called when the session receives a new external template from the connect...
Definition: public.h:1705
fBufGetExporter
fbExporter_t * fBufGetExporter(fBuf_t *fbuf)
Retrieve the exporting process endpoint associated with a buffer.
fbSubTemplateList_t
struct fbSubTemplateList_st fbSubTemplateList_t
Structure used to hold information of a sub template list.
fbInfoElementOptRec_st::ie_type
uint8_t ie_type
ie data type
Definition: public.h:1450
fbInfoElementAllocTypeTemplate
fbTemplate_t * fbInfoElementAllocTypeTemplate(fbInfoModel_t *model, GError **err)
Allocate the Options Template that will be used to define Information Element Type Records...
fbSubTemplateMultiList_st::numElements
uint16_t numElements
number of sub template lists in the multi list
Definition: public.h:2303
fbInfoModelIter_st::index
guint index
iterator index
Definition: public.h:1073
fbSubTemplateMultiListFree
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list, then frees the memory pointed to by STML.
fbSubTemplateMultiListClear
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Clears all of the entries (frees their data pointers), then frees the memory containing the entries...
fbInfoElementSpec_t
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
fbListenerEntry_st
ListenerEntry's make up a listener group as a linked list.
Definition: public.h:1653
fBufAllocForExport
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocate a new buffer for export.
fbTemplateContainsElement
gboolean fbTemplateContainsElement(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie)
Determine if a template contains a given information element.
fbSubTemplateMultiListEntryGetDataPtr
void * fbSubTemplateMultiListEntryGetDataPtr(fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
fbListenerGroupResult_st
ListenerGroupResult's contain the listener who's listening socket got a new connection.
Definition: public.h:1673
fbListenerGroupAlloc
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns a fbListenerGroup with no entries.
fbTransport_t
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
fbSubTemplateList_st::dataPtr
uint8_t * dataPtr
pointer to the buffer used to hold the data
Definition: public.h:2060
fbInfoModelAlloc
fbInfoModel_t * fbInfoModelAlloc(void)
Allocate a new information model.
fbInfoElementOptRec_st::ie_name
fbVarfield_t ie_name
information element name
Definition: public.h:1456
fbSubTemplateMultiList_st::semantic
uint8_t semantic
value used to describe the list of sub templates
Definition: public.h:2305
fbCollectorSetAcceptOnly
void fbCollectorSetAcceptOnly(fbCollector_t *collector, struct sockaddr *address, size_t address_length)
Set the collector to only receive from the given IP address over UDP.
fbTemplateCtxCallback2_fn
void(* fbTemplateCtxCallback2_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void *app_ctx, void **tmpl_ctx, fbTemplateCtxFree2_fn *fn)
A callback function that will be called when the session receives a new external template.
Definition: public.h:1791
fbSubTemplateMultiListGetSemantic
uint8_t fbSubTemplateMultiListGetSemantic(fbSubTemplateMultiList_t *STML)
Get the semantic paramter from the multi list.
fbSubTemplateList_st
Structure used to hold information of a sub template list.
Definition: public.h:2050
fbInfoElementSpec_st::name
char * name
Information element name.
Definition: public.h:1504
fbSubTemplateListGetNextPtr
void * fbSubTemplateListGetNextPtr(const fbSubTemplateList_t *subTemplateListPtr, void *currentPtr)
This function also traverses the elements in the list by accepting a pointer to the last element the ...
fBufSetExportTime
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Set the export time on the message currently in a buffer.
fbConnSpec_st::vssl_ctx
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.h:1586
fbInfoElement_st::midx
uint32_t midx
Multiple IE index.
Definition: public.h:1409
fbExporterGetMsgLen
size_t fbExporterGetMsgLen(fbExporter_t *exporter)
Get the (transcoded) message length that was copied to the exporting buffer upon fBufEmit().
fbBasicListGetNextPtr
void * fbBasicListGetNextPtr(fbBasicList_t *basicListPtr, void *currentPtr)
Function returns the next element in the list based on the currentPtr.
fbListenerEntry_st::prev
fbListenerEntry_t * prev
pointer to the previous listener entry in the linked list
Definition: public.h:1658
fbConnSpec_st::host
char * host
Hostname to connect/listen to.
Definition: public.h:1566
fbInfoModelIter_st
An iterator over the information elements in an information model.
Definition: public.h:1065
fbSessionExportTemplates
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Export all external templates in the current domain of a given session.
fBufNextCollectionTemplate
fbTemplate_t * fBufNextCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid, GError **err)
Retrieve the external template that will be used to read the next record from the buffer...
fbInfoElementOptRec_st::padding
uint8_t padding[6]
padding to align with template
Definition: public.h:1454
fbCollectorGetSFlowMissed
uint32_t fbCollectorGetSFlowMissed(fbCollector_t *collector, struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
fbCollectorGetSFlowMissed
fbSubTemplateList_st::dataLength
union fbSubTemplateList_st::@2 dataLength
length of the allocated buffer used to hold the data
fbInfoModelFree
void fbInfoModelFree(fbInfoModel_t *model)
Free an information model.
fbSubTemplateList_st::tmplID
uint16_t tmplID
ID of the template used to structure the data.
Definition: public.h:2062
fbSubTemplateListSetSemantic
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateListPtr, uint8_t semantic)
Sets the semantic parameter of a subTemplateList.
fbInfoElement_st::canon
const struct fbInfoElement_st * canon
Pointer to canonical copy of IE.
Definition: public.h:1396
fBufGetCollectionTemplate
fbTemplate_t * fBufGetCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid)
Retrieve the external template used to read the last record from the buffer.
fBufGetCollector
fbCollector_t * fBufGetCollector(fBuf_t *fbuf)
Retrieve the collecting process endpoint associated with a buffer.
fbInfoElementWriteOptionsRecord
gboolean fbInfoElementWriteOptionsRecord(fBuf_t *fbuf, const fbInfoElement_t *model_ie, uint16_t tid, GError **err)
Export an options record to the given fbuf with information element type information about the given ...
fbCollectorGetContext
void * fbCollectorGetContext(fbCollector_t *collector)
Retrieve the application context associated with a collector.
fbInfoElementOptRec_st
The corresponding struct to the Information Element Type Options Template.
Definition: public.h:1438
fBufSetExportTemplate
gboolean fBufSetExportTemplate(fBuf_t *fbuf, uint16_t ext_tid, GError **err)
Set the external template for export on a buffer to the given template ID.
fbBasicListRealloc
void * fbBasicListRealloc(fbBasicList_t *basicList, uint16_t newNumElements)
Free the current data pointer, allocating a new buffer to accomodate the new number of elements...
FB_DTLS_UDP
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.h:1555
fbExporterSetStream
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Set the SCTP stream for the next message exported.
fbSubTemplateMultiListEntryNextDataPtr
void * fbSubTemplateMultiListEntryNextDataPtr(fbSubTemplateMultiListEntry_t *entry, void *currentPtr)
This function traverses the elements in the entry by accepting a pointer to the last element the user...
fbInfoModel_t
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:1060
fbSubTemplateMultiListEntryGetIndexedPtr
void * fbSubTemplateMultiListEntryGetIndexedPtr(fbSubTemplateMultiListEntry_t *entry, uint16_t index)
Returns a pointer to a data element in the entry based on the index.
fbInfoElement_st::flags
uint32_t flags
Flags.
Definition: public.h:1421
fbInfoElementAddOptRecElement
gboolean fbInfoElementAddOptRecElement(fbInfoModel_t *model, fbInfoElementOptRec_t *rec)
Add an element that we received via an Options Record to the given info model.
fbInfoElement_st::description
const char * description
description
Definition: public.h:1429
fbSubTemplateMultiListEntry_st::numElements
uint16_t numElements
number of elements in this entry
Definition: public.h:2292
fbTemplateContainsElementByName
gboolean fbTemplateContainsElementByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determine if a template contains at least one instance of a given information element, specified by name in the template's information model.
FB_TCP
Reliable stream transport via TCP.
Definition: public.h:1536
fbInfoModelAddElement
void fbInfoModelAddElement(fbInfoModel_t *model, fbInfoElement_t *ie)
Add a single information element to an information model.
fbSessionGetDomain
uint32_t fbSessionGetDomain(fbSession_t *session)
Retrieve the current domain on a session.
fbBasicListAddNewElements
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t numNewElements)
Allocates an additional elememnt into the basic list must be called after calling BasicListInit...
fbSubTemplateMultiListEntry_st
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
Definition: public.h:2282
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:2698
fbInfoElementOptRec_st::ie_desc
fbVarfield_t ie_desc
information element description
Definition: public.h:1458
fbBasicListInit
void * fbBasicListInit(fbBasicList_t *basicListPtr, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes the basic list structure based on the parameters.
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 the template contains all of the elements the RFC 5610 info element type record shou...
fBufSetAutomaticInsert
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
Set the automatic insert flag on a buffer.
fbExporterAutoStream
void fbExporterAutoStream(fbExporter_t *exporter)
Enable 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)
fbSessionGetInfoModel
fbInfoModelCountElements
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Return the number of information elements in the information model.
fbInfoElementDataType_t
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
fbInfoElement_st::ref
union fbInfoElement_st::@1 ref
Information element name.
fbConnSpec_st::transport
fbTransport_t transport
Transport protocol to use.
Definition: public.h:1564
fbSubTemplateMultiListEntryClear
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory pointed to by the data buffer holding the data elements.
fbSubTemplateMultiListEntryGetTemplate
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(fbSubTemplateMultiListEntry_t *entry)
Retrieve the template pointer used to structure the data elements.
fbInfoModelIter_t
struct fbInfoModelIter_st fbInfoModelIter_t
An iterator over the information elements in an information model.
fbConnSpec_st::svc
char * svc
Service name or port number to connect/listen to.
Definition: public.h:1568
fbCollectorSetUDPMultiSession
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Attempt to maintain backwards compatibility with UDP.
fbSessionAddTemplateCtxCallback
void fbSessionAddTemplateCtxCallback(fbSession_t *session, fbTemplateCtxCallback_fn callback)
This function sets the callback that allows the application to set its own context variable with a ne...
fbSubTemplateMultiListEntry_st::dataPtr
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.h:2286
fbCollectorManageUDPStreamByPort
void fbCollectorManageUDPStreamByPort(fbCollector_t *collector, gboolean manage_port)
An attempt to fix what some netflow v9 exporters do wrong.
fbListenerAlloc
fbListener_t * fbListenerAlloc(fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocate a listener.
fbInfoModelGetElementByID
const fbInfoElement_t * fbInfoModelGetElementByID(fbInfoModel_t *model, uint16_t id, uint32_t ent)
Return a pointer to the canonical information element within an information model given the informati...
fbConnSpec_st::ssl_key_pass
char * ssl_key_pass
Private key decryption password.
Definition: public.h:1576
fbSessionAddTemplateCtxCallback2
void fbSessionAddTemplateCtxCallback2(fbSession_t *session, fbTemplateCtxCallback2_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_id
uint16_t ie_id
information element id
Definition: public.h:1448
fBufNextMessage
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Read a new message into a buffer using the associated collecting process endpoint.
fbSubTemplateListGetIndexedDataPtr
void * fbSubTemplateListGetIndexedDataPtr(const fbSubTemplateList_t *subTemplateListPtr, uint16_t index)
This function is used to iterate over the elements in the list by passing in a counter to indicate wh...
fbBasicListGetIndexedDataPtr
void * fbBasicListGetIndexedDataPtr(fbBasicList_t *basicListPtr, uint16_t bl_index)
Function retrieves the index'th element in the list index is 0-based.
fbInfoElementDataType_en
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.h:1354
fbInfoModelIter_st::model
const fbInfoModel_t * model
information Model
Definition: public.h:1069
fbSubTemplateMultiListGetNextEntry
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetNextEntry(fbSubTemplateMultiList_t *STML, fbSubTemplateMultiListEntry_t *currentEntry)
This function also traverses the elements in the list by accepting a pointer to the last element the ...
fBufGetExportTime
uint32_t fBufGetExportTime(fBuf_t *fbuf)
Retrieve 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.
fbVarfield_st::buf
uint8_t * buf
Content buffer.
Definition: public.h:1051
fbListenerGroupWait
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Similar to fbListenerWait, except that is looks for connections for multiple listeners.
fbSubTemplateListGetTemplateID
uint16_t fbSubTemplateListGetTemplateID(fbSubTemplateList_t *subTemplateListPtr)
Gets the template ID for the template used by the list.
fbBasicListAlloc
fbBasicList_t * fbBasicListAlloc(void)
allocates a Basic List Structure
fbTransport_en
fbTransport_en
Transport protocol for connection specifier.
Definition: public.h:1529
fbInfoModelIterNext
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Return a pointer to the next information element in the information model.
fbSubTemplateListRealloc
void * fbSubTemplateListRealloc(fbSubTemplateList_t *subTemplateList, uint16_t newNumElements)
Free the current data pointer, allocating a new buffer to accomodate the new number of elements...
fBufSetExporter
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associate an exporting process endpoint with a buffer.
fbTemplate_st
An IPFIX template or options template structure.
Definition: private.h:184
fbSubTemplateMultiListGetFirstEntry
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(fbSubTemplateMultiList_t *STML)
Retrieve 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:2713
fbTemplateGetContext
void * fbTemplateGetContext(fbTemplate_t *tmpl)
Get the ctx pointer associated with a Template.
fbListenerEntry_st::next
fbListenerEntry_t * next
pointer to the next listener entry in the linked list
Definition: public.h:1656
fbTemplateAlloc
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocate a new empty template.
fbCollectorAllocFile
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocate 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)
Retrieve the session associated with a buffer.
fbInfoElementOptRec_st::ie_units
uint16_t ie_units
ie units
Definition: public.h:1446
fbBasicListCollectorInit
void fbBasicListCollectorInit(fbBasicList_t *basicListPtr)
This initializes a basic list structure for collection.
fbListenerGroupResult_st::next
fbListenerGroupResult_t * next
Pointer to the next listener group result.
Definition: public.h:1676
fbListenerFreeGroupResult
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Free the fbListenerGroupResult_t returned from fbListenerGroupWait.
FB_DTLS_SCTP
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1544
fbTemplateCtxFree_fn
void(* fbTemplateCtxFree_fn)(void *ctx)
A callback function that is called when a template is freed.
Definition: public.h:1717
fbTemplateCountElements
uint32_t fbTemplateCountElements(fbTemplate_t *tmpl)
Determine number of information elements in a template.
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)
Retrieve the length of the buffer that is remaining after processing.
fbCollectorClose
void fbCollectorClose(fbCollector_t *collector)
Close the file or socket underlying a collecting process endpoint.
fbBasicList_st
A basic list element in a template which structure represents a basic list on the internal side...
Definition: public.h:1844
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...
fbBasicListGetSemantic
uint8_t fbBasicListGetSemantic(fbBasicList_t *basicListPtr)
Get Semantic field for Basic List presumably used in collectors after decoding.
fbConnSpec_st
Connection specifier.
Definition: public.h:1562
fbListenerEntry_st::listener
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:1660
fbSubTemplateMultiListEntry_st::tmpl
fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.h:2284
fBuf_t
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:1034
fbInfoElement_st::max
uint64_t max
range max
Definition: public.h:1425
fbSessionGetTemplate
fbTemplate_t * fbSessionGetTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieve a template from a session by ID.
fbInfoElementSpec_st::len_override
uint16_t len_override
Length override; if nonzero, replace the length of the IE from the model with this length...
Definition: public.h:1509
fbSessionExportTemplate
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Export a single external template in the current domain of a given session.
fbSessionAddTemplate
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, GError **err)
Add a template to a session.
fbSubTemplateMultiListAddNewEntries
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t numNewEntries)
Adds entries to the multi list of entries can only be run after the list has been initialized...
fbSubTemplateListAddNewElements
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t numNewElements)
Allocates space for a number of additional element in the sub template list must be called after the ...
fbSubTemplateListGetSemantic
uint8_t fbSubTemplateListGetSemantic(fbSubTemplateList_t *subTemplateListPtr)
Gets the semantic value from a sub template list.
fbTemplateAppendSpec
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Append an information element described by specifier to a template.
fbInfoElement_st
A single IPFIX Information Element definition.
Definition: public.h:1388
fbListenerGroupDeleteListener
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
fbTemplateCtxFree2_fn
void(* fbTemplateCtxFree2_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.h:1729
fbSessionRemoveTemplate
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Remove a template from a session.
fbBasicList_st::semantic
uint8_t semantic
semantic field to describe the list
Definition: public.h:1854
fbInfoElement_st::name
const char * name
Information element name.
Definition: public.h:1401
fbSubTemplateListGetTemplate
const fbTemplate_t * fbSubTemplateListGetTemplate(fbSubTemplateList_t *subTemplateListPtr)
Gets the template pointer from the list structure.
fbInfoModelIterInit
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initialize an information model iterator for iteration.
fbSessionResetExternal
void fbSessionResetExternal(fbSession_t *session)
Reset the external state (sequence numbers and templates) in a session state container.
fbInfoElement_st::type
uint8_t type
Data Type.
Definition: public.h:1427
fbSubTemplateMultiListEntryGetTemplateID
uint16_t fbSubTemplateMultiListEntryGetTemplateID(fbSubTemplateMultiListEntry_t *entry)
Retrieve the template ID for the template used to structure the data.
fbListenerGetCollector
gboolean fbListenerGetCollector(fbListener_t *listener, fbCollector_t **collector, GError **err)
fbListenerGetCollector
fbCollectorSetSFlowTranslator
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
fbCollectorSetSFlowTranslator
fbInfoElementSpec_st
A single IPFIX Information Element specification.
Definition: public.h:1502
fbListenerInterrupt
void fbListenerInterrupt(fbListener_t *listener)
Cause 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)
Retrieve a pointer to the entry of a specific index.
fbCollectorClearTranslator
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
fbCollectorClearTranslator
fbConnSpec_st::ssl_key_file
char * ssl_key_file
Path to private key file.
Definition: public.h:1574
fbInfoModelAddElementArray
void fbInfoModelAddElementArray(fbInfoModel_t *model, fbInfoElement_t *ie)
Add multiple information elements in an array to an information model.
fbBasicListSetSemantic
void fbBasicListSetSemantic(fbBasicList_t *basicListPtr, uint8_t semantic)
Sets the semantic for describing a basic list generally used in exporters before decoding.
fBufSetInternalTemplate
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Set the internal template on a buffer to the given template ID.
fbInfoElementOptRec_st::ie_semantic
uint8_t ie_semantic
ie semantic
Definition: public.h:1452
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)
Free a listener.
fbListValidSemantic
gboolean fbListValidSemantic(uint8_t semantic)
validates the value of the semantic field,
fbSessionFree
void fbSessionFree(fbSession_t *session)
Free a transport session state container.
fbTemplateSetOptionsScope
void fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Set the number of information elements in a template that are scope.