public.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2022 Carnegie Mellon University
3  * See license information in LICENSE.txt.
4  */
9 /*
10  * ------------------------------------------------------------------------
11  * Authors: Brian Trammell, Dan Ruef
12  * ------------------------------------------------------------------------
13  */
14 
15 #ifndef _FB_PUBLIC_H_
16 #define _FB_PUBLIC_H_
17 
18 #include <fixbuf/autoinc.h>
19 #include <fixbuf/version.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 
30 #define FIXBUF_CHECK_VERSION(major, minor, release) \
31  (FIXBUF_VERSION_MAJOR > (major) || \
32  (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
33  (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
34  FIXBUF_VERSION_RELEASE >= (release)))
35 
36 /*
37  * Error Handling Definitions
38  */
39 
43 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
44 
49 #define FB_ERROR_TMPL 1
50 
54 #define FB_ERROR_EOM 2
55 
60 #define FB_ERROR_EOF 3
61 
65 #define FB_ERROR_IPFIX 4
66 
71 #define FB_ERROR_BUFSZ 5
72 
75 #define FB_ERROR_IMPL 6
76 
79 #define FB_ERROR_IO 7
80 
84 #define FB_ERROR_NLREAD 8
85 
90 #define FB_ERROR_NLWRITE 9
91 
94 #define FB_ERROR_NOELEMENT 10
95 
98 #define FB_ERROR_CONN 11
99 
103 #define FB_ERROR_NETFLOWV9 12
104 
107 #define FB_ERROR_TRANSMISC 13
108 
111 #define FB_ERROR_SFLOW 14
112 
115 #define FB_ERROR_SETUP 15
116 
119 #define FB_ERROR_LAXSIZE 16
120 
121 /*
122  * Public Datatypes and Constants
123  */
124 
129 typedef struct fBuf_st fBuf_t;
130 
137 typedef struct fbVarfield_st {
139  size_t len;
146  uint8_t *buf;
148 
149 
154 typedef struct fbInfoModel_st fbInfoModel_t;
155 
159 typedef GHashTableIter fbInfoModelIter_t;
160 
166 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, \
167  _min_, _max_, _type_, _desc_) \
168  { _ent_, _num_, _len_, _flags_, _type_, _min_, _max_, _name_, _desc_ }
169 
181 #define FB_IE_INIT_FULL_SPLIT(_name_, _ent_, _num_, _len_, \
182  _rev_, _endian_, _semantics_, _units_, \
183  _min_, _max_, _type_, _desc_) \
184  FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, \
185  (((_rev_) ? FB_IE_F_REVERSIBLE : 0) | \
186  ((_endian_) ? FB_IE_F_ENDIAN : 0) | \
187  (((_semantic) & 0xFF) << 8) | \
188  (((_units_) & 0xFFFF) << 16)), \
189  _min_, _max_, _type_, _desc_)
190 
196 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
197  FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char *)NULL)
198 
199 
205 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
206 
216 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
217 
226 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
227 
233 #define FB_IE_F_NONE 0x00000000
234 
242 #define FB_IE_F_ENDIAN 0x00000001
243 
259 #define FB_IE_F_REVERSIBLE 0x00000040
260 
271 #define FB_IE_F_ALIEN 0x00000080
272 
288 #define FB_IE_QUANTITY 0x00000100
289 
297 #define FB_IE_TOTALCOUNTER 0x00000200
298 
306 #define FB_IE_DELTACOUNTER 0x00000300
307 
315 #define FB_IE_IDENTIFIER 0x00000400
316 
324 #define FB_IE_FLAGS 0x00000500
325 
333 #define FB_IE_LIST 0x00000600
334 
342 #define FB_IE_SNMPCOUNTER 0x00000700
343 
351 #define FB_IE_SNMPGAUGE 0x00000800
352 
361 #define FB_IE_DEFAULT 0x00000000
362 
363 
413 
414 
428 #define FB_UNITS_BITS 0x00010000
429 
436 #define FB_UNITS_OCTETS 0x00020000
437 
444 #define FB_UNITS_PACKETS 0x00030000
445 
452 #define FB_UNITS_FLOWS 0x00040000
453 
460 #define FB_UNITS_SECONDS 0x00050000
461 
469 #define FB_UNITS_MILLISECONDS 0x00060000
470 
478 #define FB_UNITS_MICROSECONDS 0x00070000
479 
487 #define FB_UNITS_NANOSECONDS 0x00080000
488 
496 #define FB_UNITS_WORDS 0x00090000
497 
504 #define FB_UNITS_MESSAGES 0x000A0000
505 
512 #define FB_UNITS_HOPS 0x000B0000
513 
520 #define FB_UNITS_ENTRIES 0x000C0000
521 
528 #define FB_UNITS_FRAMES 0x000D0000
529 
536 #define FB_UNITS_PORTS 0x000E0000
537 
545 #define FB_UNITS_INFERRED 0x000F0000
546 
558 typedef enum fbInfoElementUnits_en {
629 
633 #define FB_IE_VARLEN 65535
634 
644 #define FB_IE_PEN_REVERSE 29305
645 
656 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
657 
663 #define FB_IE_REVERSE_STR "reverse"
664 
666 #define FB_IE_REVERSE_STRLEN 7
667 
671 #define FB_CISCO_GENERIC 9999
672 
678 #define FB_CISCO_ASA_EVENT_ID 9998
679 
688 #define FB_CISCO_ASA_EVENT_XTRA 9997
689 
690 
776 
783 typedef struct fbTemplate_st fbTemplate_t;
784 
793 typedef struct fbInfoElement_st {
797  uint32_t ent;
802  uint16_t num;
807  uint16_t len;
810  uint32_t flags;
812  uint8_t type;
814  uint64_t min;
816  uint64_t max;
821  const char *name;
823  const char *description;
825 
826 
833 #define fbInfoElementCheckIdent(_ie, _enterpriseNumber, _elementId) \
834  ((_elementId) == (_ie)->num && (_enterpriseNumber) == (_ie)->ent)
835 
841 #define fbInfoElementGetDescription(_ie) ((_ie)->description)
842 
850 #define fbInfoElementGetId(_ie) ((_ie)->num)
851 
857 #define fbInfoElementGetLen(_ie) ((_ie)->len)
858 
865 #define fbInfoElementGetMax(_ie) ((_ie)->max)
866 
872 #define fbInfoElementGetMin(_ie) ((_ie)->min)
873 
879 #define fbInfoElementGetName(_ie) ((_ie)->name)
880 
887 #define fbInfoElementGetPEN(_ie) ((_ie)->ent)
888 
895 #define fbInfoElementGetSemantics(_ie) FB_IE_SEMANTIC((_ie)->flags)
896 
903 #define fbInfoElementGetType(_ie) ((_ie)->type)
904 
911 #define fbInfoElementGetUnits(_ie) FB_IE_UNITS((_ie)->units)
912 
919 #define fbInfoElementIsAlien(_ie) (!!((_ie)->flags & FB_IE_F_ALIEN))
920 
927 #define fbInfoElementIsEndian(_ie) (!!((_ie)->flags & FB_IE_F_ENDIAN))
928 
935 #define fbInfoElementIsReversible(_ie) (!!((_ie)->flags & FB_IE_F_REVERSIBLE))
936 
945 #define fbInfoElementIsUnsigned(_ie) \
946  ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_UINT_64)
947 
956 #define fbInfoElementIsSigned(_ie) \
957  ((_ie)->type >= FB_INT_8 && (_ie)->type <= FB_INT_64)
958 
966 #define fbInfoElementIsInteger(_ie) \
967  ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_INT_64)
968 
976 #define fbInfoElementIsFloat(_ie) \
977  ((_ie)->type >= FB_FLOAT_32 && (_ie)->type <= FB_FLOAT_64)
978 
989 #define fbInfoElementIsNumber(_ie) \
990  ((_ie)->type >= FB_UINT_8 && (_ie)->type <= FB_FLOAT_64)
991 
998 #define fbInfoElementIsIPAddress(_ie) \
999  ((_ie)->type >= FB_IP4_ADDR && (_ie)->type <= FB_IP6_ADDR)
1000 
1009 #define fbInfoElementIsDatetime(_ie) \
1010  ((_ie)->type >= FB_DT_SEC && (_ie)->type <= FB_DT_NANOSEC)
1011 
1019 #define fbInfoElementIsList(_ie) \
1020  ((_ie)->type >= FB_BASIC_LIST && (_ie)->type <= FB_SUB_TMPL_MULTI_LIST)
1021 
1028 #define fbInfoElementIsPadding(_ie) (210 == (_ie)->num && 0 == (_ie)->ent)
1029 
1030 
1037 typedef struct fbTemplateField_st {
1044  uint16_t midx;
1048  uint16_t len;
1052  uint16_t offset;
1056  /*uint16_t memsize; */
1060  /*uint16_t position; */
1066 
1067 
1073 #define FB_TEMPLATEFIELD_INIT {NULL, 0, 0, 0, NULL}
1074 
1075 
1082 #define fbTemplateFieldCheckIdent(_field, _enterpriseNumber, _elementId) \
1083  ((_elementId) == (_field)->canon->num && \
1084  (_enterpriseNumber) == (_field)->canon->ent)
1085 
1091 #define fbTemplateFieldGetIE(_field) ((_field)->canon)
1092 
1099 #define fbTemplateFieldGetId(_field) ((_field)->canon->num)
1100 
1110 #define fbTemplateFieldGetLen(_field) ((_field)->len)
1111 
1120 #define fbTemplateFieldGetMemsize(_field) \
1121  ((FB_IE_VARLEN != (_field)->len) \
1122  ? (_field)->len \
1123  : ((FB_BASIC_LIST == (_field)->canon->type) \
1124  ? sizeof(fbBasicList_t) \
1125  : ((FB_SUB_TMPL_LIST == (_field)->canon->type) \
1126  ? sizeof(fbSubTemplateList_t) \
1127  : ((FB_SUB_TMPL_MULTI_LIST == (_field)->canon->type) \
1128  ? sizeof(fbSubTemplateMultiList_t) \
1129  : sizeof(fbVarfield_t)))))
1130 
1137 #define fbTemplateFieldGetName(_field) ((_field)->canon->name)
1138 
1146 #define fbTemplateFieldGetOffset(_field) ((_field)->offset)
1147 
1154 #define fbTemplateFieldGetPEN(_field) ((_field)->canon->ent)
1155 
1162 #define fbTemplateFieldGetType(_field) ((_field)->canon->type)
1163 
1179 #define fbTemplateFieldGetRepeat(_field) ((_field)->midx)
1180 
1192 typedef struct fbTemplateIter_st {
1193  const fbTemplate_t *tmpl;
1194  uint16_t pos;
1196 
1202 #define FB_TEMPLATE_ITER_NULL {NULL, UINT16_MAX}
1203 
1213 void
1215  fbTemplateIter_t *iter,
1216  const fbTemplate_t *tmpl);
1217 
1230 const fbTemplateField_t *
1232  const fbTemplateIter_t *iter);
1233 
1244 uint16_t
1246  const fbTemplateIter_t *iter);
1247 
1254 const fbTemplate_t *
1256  const fbTemplateIter_t *iter);
1257 
1270 const fbTemplateField_t *
1272  fbTemplateIter_t *iter);
1273 
1274 
1296 typedef struct fbBasicList_st fbBasicList_t;
1297 
1322 
1357 
1358 
1377 typedef struct fbRecord_st {
1381  uint8_t *rec;
1383  size_t reccapacity;
1385  size_t recsize;
1387  uint16_t tid;
1389 
1390 
1396 #define FB_RECORD_INIT {NULL, NULL, 0, 0, 0}
1397 
1398 
1413 typedef struct fbRecordValue_st {
1417  GString *stringbuf;
1419  union v_un {
1423  uint8_t ip6[16];
1449  struct timespec dt;
1453  uint32_t ip4;
1458  uint64_t u64;
1463  int64_t s64;
1467  double dbl;
1471  uint8_t mac[6];
1472  } v;
1474 
1475 
1481 #define FB_RECORD_VALUE_INIT \
1482  { NULL, NULL, { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } }
1483 
1484 
1513 typedef struct fbInfoElementOptRec_st {
1515  uint32_t ie_pen;
1517  uint16_t ie_id;
1519  uint8_t ie_type;
1521  uint8_t ie_semantic;
1523  uint16_t ie_units;
1525  uint8_t padding[6];
1527  uint64_t ie_range_begin;
1529  uint64_t ie_range_end;
1535 
1536 
1549 #define FB_TID_AUTO 0
1550 
1554 #define FB_TID_TS 2
1555 
1559 #define FB_TID_OTS 3
1560 
1564 #define FB_TID_MIN_DATA 256
1565 
1571 #define FB_IESPEC_NULL { NULL, 0, 0 }
1572 
1581 typedef struct fbInfoElementSpec_st {
1583  const char *name;
1595  uint16_t len_override;
1602  uint32_t flags;
1604 
1613 #define FB_IESPECID_NULL { {0, 0}, 0, 0 }
1614 
1624 typedef struct fbInfoElementSpecId_st {
1629  uint32_t enterprise_id;
1631  uint16_t element_id;
1632  } ident;
1644  uint16_t len_override;
1651  uint32_t flags;
1653 
1661 typedef struct fbSession_st fbSession_t;
1662 
1664 typedef enum fbTransport_en {
1690  FB_DTLS_UDP
1692 
1697 typedef struct fbConnSpec_st {
1701  char *host;
1703  char *svc;
1716  void *vai;
1721  void *vssl_ctx;
1723 
1724 
1732 typedef struct fbTemplateInfo_st fbTemplateInfo_t;
1733 
1742 typedef struct fbBasicListInfo_st fbBasicListInfo_t;
1743 
1753  void);
1754 
1761 void
1763  fbTemplateInfo_t *tmplInfo);
1764 
1775  const fbTemplateInfo_t *tmplInfo);
1776 
1790 gboolean
1792  fbTemplateInfo_t *tmplInfo,
1793  const char *name,
1794  const char *description,
1795  uint16_t appLabel,
1796  uint16_t parentTid);
1797 
1805 #define FB_TMPL_MD_LEVEL_0 0
1806 
1812 #define FB_TMPL_MD_LEVEL_1 1
1813 
1819 #define FB_TMPL_MD_LEVEL_NA 0xFF
1820 
1837 void
1839  fbTemplateInfo_t *tmplInfo,
1840  uint32_t blEnt,
1841  uint16_t blNum,
1842  uint32_t contentEnt,
1843  uint16_t contentNum);
1844 
1850 uint16_t
1852  const fbTemplateInfo_t *tmplInfo);
1853 
1859 uint16_t
1861  const fbTemplateInfo_t *tmplInfo);
1862 
1868 const char *
1870  const fbTemplateInfo_t *tmplInfo);
1871 
1877 const char *
1879  const fbTemplateInfo_t *tmplInfo);
1880 
1886 uint16_t
1888  const fbTemplateInfo_t *tmplInfo);
1889 
1905 const fbBasicListInfo_t *
1907  const fbTemplateInfo_t *tmplInfo,
1908  const fbBasicListInfo_t *blInfo);
1909 
1928 uint16_t
1930  const fbBasicListInfo_t *blInfo,
1931  uint32_t *pen);
1932 
1948 uint16_t
1950  const fbBasicListInfo_t *blInfo,
1951  uint32_t *pen);
1952 
1953 
1963 const fbTemplateInfo_t *
1965  const fbSession_t *session,
1966  uint16_t tid);
1967 
1968 
2007 uint16_t
2009  const fbSession_t *session,
2010  const fbTemplateInfo_t *tmplInfo,
2011  uint16_t path[],
2012  uint16_t path_size,
2013  GError **err);
2014 
2015 
2019 #define FB_CONNSPEC_INIT \
2020  { FB_SCTP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
2021 
2027 typedef struct fbExporter_st fbExporter_t;
2028 
2036 typedef struct fbCollector_st fbCollector_t;
2037 
2044 typedef struct fbListener_st fbListener_t;
2045 
2046 /*
2047  * ListenerGroup and associated data type definitions
2048  */
2049 
2053 typedef struct fbListenerGroup_st fbListenerGroup_t;
2054 
2058 typedef struct fbListenerEntry_st {
2066 
2080 
2091 typedef void (*fbTemplateCtxFree_fn)(
2092  void *tmpl_ctx,
2093  void *app_ctx);
2094 
2119  fbSession_t *session,
2120  uint16_t tid,
2121  fbTemplate_t *tmpl,
2122  void *app_ctx,
2123  void **tmpl_ctx,
2124  fbTemplateCtxFree_fn *tmpl_ctx_free_fn);
2125 
2126 
2139 typedef enum fbListSemantics_en {
2165 
2177 gboolean
2179  uint8_t semantic);
2180 
2181 
2182 /****** BASICLIST FUNCTIONS AND STRUCTS *******/
2183 
2188 /* typedef struct fbBasicList_st fbBasicList_t; */
2191  uint8_t *dataPtr;
2195  uint16_t numElements;
2197  uint16_t dataLength;
2199  uint8_t semantic;
2200 };
2201 
2202 
2209 fbBasicList_t *
2211  void);
2212 
2226 void *
2228  fbBasicList_t *basicList,
2229  uint8_t semantic,
2230  const fbInfoElement_t *infoElement,
2231  uint16_t numElements);
2232 
2233 
2256 void *
2258  fbBasicList_t *basicList,
2259  uint8_t semantic,
2260  const fbInfoElement_t *infoElement,
2261  uint16_t elementLength,
2262  uint16_t numElements);
2263 
2273 void
2275  fbBasicList_t *basicList);
2276 
2286 uint16_t
2288  const fbBasicList_t *basicList);
2289 
2300 uint16_t
2302  const fbBasicList_t *basicList);
2303 
2310 uint8_t
2312  const fbBasicList_t *basicList);
2313 
2321 void
2323  fbBasicList_t *basicList,
2324  uint8_t semantic);
2325 
2333 const fbInfoElement_t *
2335  const fbBasicList_t *basicList);
2336 
2347 uint16_t
2349  const fbBasicList_t *basicList,
2350  uint32_t *pen);
2351 
2361 const fbTemplateField_t *
2363  const fbBasicList_t *basicList);
2364 
2371 void *
2373  const fbBasicList_t *basicList);
2374 
2386 void *
2388  const fbBasicList_t *basicList,
2389  uint16_t index);
2390 
2403 gboolean
2405  const fbBasicList_t *basicList,
2406  uint16_t index,
2407  fbRecordValue_t *value);
2408 
2422 void *
2424  const fbBasicList_t *basicList,
2425  const void *currentPtr);
2426 
2435 #define fbBLNext(type, basicList, current) \
2436  ((type *)(fbBasicListGetNextPtr((basicList), (current))))
2437 
2454 void *
2456  fbBasicList_t *basicList,
2457  uint16_t newCount);
2458 
2470 void *
2472  fbBasicList_t *basicList,
2473  uint16_t additional);
2474 
2485 void
2487  fbBasicList_t *basicList);
2488 
2494 void
2496  fbBasicList_t *basicList);
2497 
2505 void
2507  fbBasicList_t *basicList);
2508 
2509 
2510 /******* END OF BASICLIST ********/
2511 
2512 
2513 
2514 /******* SUBTEMPLATELIST FUNCTIONS ****/
2515 
2516 
2525  uint8_t *dataPtr;
2527  uint32_t dataLength;
2529  uint32_t recordLength;
2531  uint16_t numElements;
2533  uint16_t tmplID;
2535  uint8_t semantic;
2536 };
2537 
2549  void);
2550 
2569 void *
2571  fbSubTemplateList_t *sTL,
2572  uint8_t semantic,
2573  uint16_t tmplID,
2574  const fbTemplate_t *tmpl,
2575  uint16_t numElements);
2576 
2591 void
2593  fbSubTemplateList_t *subTemplateList);
2594 
2601 void *
2603  const fbSubTemplateList_t *subTemplateList);
2604 
2614 void *
2616  const fbSubTemplateList_t *subTemplateList,
2617  uint16_t index);
2618 
2632 void *
2634  const fbSubTemplateList_t *subTemplateList,
2635  const void *currentPtr);
2636 
2637 
2646 #define fbSTLNext(type, subTemplateList, current) \
2647  ((type *)(fbSubTemplateListGetNextPtr((subTemplateList), (current))))
2648 
2657 uint16_t
2659  const fbSubTemplateList_t *subTemplateList);
2660 
2668 void
2670  fbSubTemplateList_t *subTemplateList,
2671  uint8_t semantic);
2672 
2680 uint8_t
2682  const fbSubTemplateList_t *subTemplateList);
2683 
2690 const fbTemplate_t *
2692  const fbSubTemplateList_t *subTemplateList);
2693 
2700 uint16_t
2702  const fbSubTemplateList_t *subTemplateList);
2703 
2721 void *
2723  fbSubTemplateList_t *subTemplateList,
2724  uint16_t newCount);
2725 
2737 void *
2739  fbSubTemplateList_t *subTemplateList,
2740  uint16_t additional);
2741 
2763 void
2765  fbSubTemplateList_t *subTemplateList);
2766 
2772 void
2774  fbSubTemplateList_t *subTemplateList);
2775 
2783 void
2785  fbSubTemplateList_t *subTemplateList);
2786 
2787 /********* END OF SUBTEMPLATELIST **********/
2788 
2789 
2790 
2791 /******* SUBTEMPLATEMULTILIST FUNCTIONS ****/
2792 
2815 
2816 
2822 /* typedef struct fbSubTemplateMultiList_st fbSubTemplateMultiList_t; */
2827  uint16_t numElements;
2829  uint8_t semantic;
2830 };
2831 
2832 
2842  uint8_t *dataPtr;
2844  uint32_t dataLength;
2846  uint32_t recordLength;
2848  uint16_t numElements;
2850  uint16_t tmplID;
2851 };
2852 
2853 
2865  void);
2866 
2867 
2881  uint8_t semantic,
2882  uint16_t numElements);
2883 
2892 uint16_t
2894  const fbSubTemplateMultiList_t *STML);
2895 
2902 void
2905  uint8_t semantic);
2906 
2914 uint8_t
2916  const fbSubTemplateMultiList_t *STML);
2917 
2926 void
2928  fbSubTemplateMultiList_t *STML);
2929 
2943 void
2945  fbSubTemplateMultiList_t *STML);
2946 
2954 void
2956  fbSubTemplateMultiList_t *STML);
2957 
2978  uint16_t newCount);
2979 
2994  uint16_t additional);
2995 
3004  const fbSubTemplateMultiList_t *STML);
3005 
3017  const fbSubTemplateMultiList_t *STML,
3018  uint16_t index);
3019 
3035  const fbSubTemplateMultiList_t *STML,
3036  const fbSubTemplateMultiListEntry_t *currentEntry);
3037 
3046 #define fbSTMLNext(subTemplateMultiList, current) \
3047  fbSubTemplateMultiListGetNextEntry((subTemplateMultiList), (current))
3048 
3063 void *
3066  uint16_t tmplID,
3067  const fbTemplate_t *tmpl,
3068  uint16_t numElements);
3069 
3088 void *
3091  uint16_t newCount);
3092 
3104 void *
3107  uint16_t additional);
3108 
3120 void
3123 
3130 void *
3132  const fbSubTemplateMultiListEntry_t *entry);
3133 
3147 void *
3149  const fbSubTemplateMultiListEntry_t *entry,
3150  const void *currentPtr);
3151 
3152 
3161 #define fbSTMLEntryNext(type, subTemplateMultiListEntry, current) \
3162  ((type *)(fbSubTemplateMultiListEntryNextDataPtr( \
3163  (subTemplateMultiListEntry), (current))))
3164 
3175 void *
3177  const fbSubTemplateMultiListEntry_t *entry,
3178  uint16_t index);
3179 
3188 uint16_t
3190  const fbSubTemplateMultiListEntry_t *entry);
3191 
3198 const fbTemplate_t *
3200  const fbSubTemplateMultiListEntry_t *entry);
3201 
3208 uint16_t
3210  const fbSubTemplateMultiListEntry_t *entry);
3211 
3212 /************** END OF STML FUNCTIONS *********** */
3213 
3229 void
3231  const fbTemplate_t *tmpl,
3232  uint8_t *record);
3233 
3234 
3247  void);
3248 
3254 void
3256  fbListenerGroup_t *group);
3257 
3267 int
3269  fbListenerGroup_t *group,
3270  const fbListener_t *listener);
3271 
3281 int
3283  fbListenerGroup_t *group,
3284  const fbListener_t *listener);
3285 
3301  fbListenerGroup_t *group,
3302  GError **err);
3303 
3309 void
3311  fbListenerGroupResult_t *result);
3312 
3325 fBuf_t *
3327  fbListener_t *listener,
3328  int sock,
3329  GError **err);
3330 
3340 fBuf_t *
3342  fbListener_t *listener,
3343  int sock,
3344  GError **err);
3345 
3351 void
3353  fBuf_t *fbuf);
3354 
3355 
3384 typedef gboolean (*fbListenerAppInit_fn)(
3385  fbListener_t *listener,
3386  void **ctx,
3387  int fd,
3388  struct sockaddr *peer,
3389  size_t peerlen,
3390  GError **err);
3391 
3403 typedef void (*fbListenerAppFree_fn)(
3404  void *ctx);
3405 
3421 gboolean
3423  fBuf_t *fbuf,
3424  uint16_t int_tid,
3425  GError **err);
3426 
3443 gboolean
3445  fBuf_t *fbuf,
3446  uint16_t ext_tid,
3447  GError **err);
3448 
3461 gboolean
3463  fBuf_t *fbuf,
3464  uint16_t tid,
3465  GError **err);
3466 
3491 void
3493  fBuf_t *fbuf,
3494  gboolean automatic);
3495 
3496 
3500 void
3502  fBuf_t *fbuf,
3503  gboolean automatic);
3504 
3505 
3532 gboolean
3534  fBuf_t *fbuf,
3535  GError **err);
3536 
3546 gboolean
3548  fBuf_t *fbuf,
3549  GError **err);
3550 
3577 gboolean
3579  fBuf_t *fbuf,
3580  GError **err);
3581 
3582 
3589 fbSession_t *
3591  const fBuf_t *fbuf);
3592 
3600 void
3602  fBuf_t *fbuf);
3603 
3618 fBuf_t *
3620  fbSession_t *session,
3621  fbExporter_t *exporter);
3622 
3631 fbExporter_t *
3633  const fBuf_t *fbuf);
3634 
3644 void
3646  fBuf_t *fbuf,
3647  fbExporter_t *exporter);
3648 
3649 
3661 size_t
3663  fBuf_t *fbuf);
3664 
3665 
3681 void
3683  fBuf_t *fbuf,
3684  uint8_t *buf,
3685  size_t buflen);
3686 
3687 
3711 gboolean
3713  fBuf_t *fbuf,
3714  uint8_t *recbase,
3715  size_t recsize,
3716  GError **err);
3717 
3726 gboolean
3728  fBuf_t *fbuf,
3729  GError **err);
3730 
3741 void
3743  fBuf_t *fbuf,
3744  uint32_t extime);
3745 
3763 fBuf_t *
3765  fbSession_t *session,
3766  fbCollector_t *collector);
3767 
3776 fbCollector_t *
3778  const fBuf_t *fbuf);
3779 
3789 void
3791  fBuf_t *fbuf,
3792  fbCollector_t *collector);
3793 
3823 gboolean
3825  fBuf_t *fbuf,
3826  uint8_t *recbase,
3827  size_t *recsize,
3828  GError **err);
3829 
3854 gboolean
3856  fBuf_t *fbuf,
3857  fbRecord_t *record,
3858  GError **err);
3859 
3871 gboolean
3873  fBuf_t *fbuf,
3874  GError **err);
3875 
3882 uint32_t
3884  const fBuf_t *fbuf);
3885 
3904 fbTemplate_t *
3906  const fBuf_t *fbuf,
3907  uint16_t *ext_tid);
3908 
3926 fbTemplate_t *
3928  fBuf_t *fbuf,
3929  uint16_t *ext_tid,
3930  GError **err);
3931 
3947 fbInfoModel_t *
3949  void);
3950 
3958 void
3960  fbInfoModel_t *model);
3961 
3975 void
3977  fbInfoModel_t *model,
3978  const fbInfoElement_t *ie);
3979 
3997 void
3999  fbInfoModel_t *model,
4000  const fbInfoElement_t *ie);
4001 
4033 gboolean
4035  fbInfoModel_t *model,
4036  const gchar *filename,
4037  GError **err);
4038 
4071 gboolean
4073  fbInfoModel_t *model,
4074  const gchar *xml_data,
4075  gssize xml_data_len,
4076  GError **err);
4077 
4089 const fbInfoElement_t *
4091  const fbInfoModel_t *model,
4092  const char *name);
4093 
4106 const fbInfoElement_t *
4108  const fbInfoModel_t *model,
4109  uint16_t id,
4110  uint32_t ent);
4111 
4121 gboolean
4123  const fbInfoModel_t *model,
4124  const fbInfoElement_t *element);
4125 
4126 
4134 guint
4136  const fbInfoModel_t *model);
4137 
4146 void
4148  fbInfoModelIter_t *iter,
4149  const fbInfoModel_t *model);
4150 
4160 const fbInfoElement_t *
4162  fbInfoModelIter_t *iter);
4163 
4178 fbTemplate_t *
4180  fbInfoModel_t *model,
4181  GError **err);
4182 
4198 gboolean
4200  fBuf_t *fbuf,
4201  const fbInfoElement_t *model_ie,
4202  uint16_t itid,
4203  uint16_t etid,
4204  GError **err);
4205 
4218 gboolean
4220  fbInfoModel_t *model,
4221  const fbInfoElementOptRec_t *rec);
4222 
4263 gboolean
4265  const fbTemplate_t *tmpl,
4266  uint32_t tests);
4267 
4274 #define FB_TMPL_IS_OPTIONS (1u << 0)
4275 
4285 #define FB_TMPL_IS_META_ELEMENT (1u << 1)
4286 
4294 #define FB_TMPL_IS_META_TEMPLATE_V1 (1u << 2)
4295 
4303 #define FB_TMPL_IS_META_TEMPLATE_V3 (1u << 3)
4304 
4312 #define FB_TMPL_IS_META_BASICLIST (1u << 4)
4313 
4320 #define FB_TMPL_IS_META_TMPL_ANY \
4321  (FB_TMPL_IS_OPTIONS | \
4322  FB_TMPL_IS_META_TEMPLATE_V1 | \
4323  FB_TMPL_IS_META_BASICLIST)
4324 
4331 #define FB_TMPL_IS_META_ANY \
4332  (FB_TMPL_IS_OPTIONS | \
4333  FB_TMPL_IS_META_TMPL_ANY | \
4334  FB_TMPL_IS_META_ELEMENT)
4335 
4356 fbTemplate_t *
4358  fbInfoModel_t *model);
4359 
4388 gboolean
4390  fbTemplate_t *tmpl,
4391  const fbInfoElement_t *ex_ie,
4392  GError **err);
4393 
4423 gboolean
4425  fbTemplate_t *tmpl,
4426  const fbInfoElementSpec_t *spec,
4427  uint32_t wantedFlags,
4428  GError **err);
4429 
4442 gboolean
4444  fbTemplate_t *tmpl,
4445  const fbInfoElementSpec_t *spec,
4446  uint32_t wantedFlags,
4447  GError **err);
4448 
4479 gboolean
4481  fbTemplate_t *tmpl,
4482  const fbInfoElementSpecId_t *spec,
4483  uint32_t wantedFlags,
4484  GError **err);
4485 
4499 gboolean
4501  fbTemplate_t *tmpl,
4502  const fbInfoElementSpecId_t *spec,
4503  uint32_t wantedFlags,
4504  GError **err);
4505 
4506 
4514 #define FB_TMPL_COPY_REMOVE_PADDING 0x01u
4515 
4523 #define FB_TMPL_COPY_IGNORE_SCOPE 0x04u
4524 
4525 
4550 fbTemplate_t *
4552  const fbTemplate_t *tmpl,
4553  uint32_t flags);
4554 
4555 
4562 uint16_t
4564  const fbTemplate_t *tmpl);
4565 
4584 gboolean
4586  fbTemplate_t *tmpl,
4587  uint16_t scope_count);
4588 
4596 uint16_t
4598  const fbTemplate_t *tmpl);
4599 
4611 gboolean
4613  const fbTemplate_t *tmpl,
4614  const fbInfoElement_t *element);
4615 
4641 const fbTemplateField_t *
4643  const fbTemplate_t *tmpl,
4644  const fbInfoElement_t *ie,
4645  uint16_t *position,
4646  uint16_t skip);
4647 
4648 
4675 const fbTemplateField_t *
4677  const fbTemplate_t *tmpl,
4678  uint32_t ent,
4679  uint16_t num,
4680  uint16_t *position,
4681  uint16_t skip);
4682 
4683 
4708 const fbTemplateField_t *
4710  const fbTemplate_t *tmpl,
4711  fbInfoElementDataType_t datatype,
4712  uint16_t *position,
4713  uint16_t skip);
4714 
4715 
4730 gboolean
4732  const fbTemplate_t *tmpl,
4733  const fbInfoElementSpec_t *spec);
4734 
4756 gboolean
4758  const fbTemplate_t *tmpl,
4759  const fbInfoElementSpec_t *spec);
4760 
4786 gboolean
4788  const fbTemplate_t *tmpl,
4789  const fbInfoElementSpec_t *spec,
4790  uint32_t wantedFlags);
4791 
4808 gboolean
4810  const fbTemplate_t *tmpl,
4811  const fbInfoElementSpecId_t *spec);
4812 
4834 gboolean
4836  const fbTemplate_t *tmpl,
4837  const fbInfoElementSpecId_t *spec);
4838 
4865 gboolean
4867  const fbTemplate_t *tmpl,
4868  const fbInfoElementSpecId_t *spec,
4869  uint32_t wantedFlags);
4870 
4882 const fbTemplateField_t *
4884  const fbTemplate_t *tmpl,
4885  uint16_t position);
4886 
4897 const fbTemplateField_t *
4899  const fbTemplate_t *tmpl,
4900  uint16_t position)
4901 __attribute__((__deprecated__));
4902 
4910 fbInfoModel_t *
4912  const fbTemplate_t *tmpl);
4913 
4920 void
4922  fbTemplate_t *tmpl);
4923 
4932 void *
4934  const fbTemplate_t *tmpl);
4935 
4936 
4949 void
4951  fbTemplate_t *tmpl,
4952  void *tmpl_ctx,
4953  void *app_ctx,
4954  fbTemplateCtxFree_fn ctx_free);
4955 
4965 uint16_t
4967  const fbTemplate_t *tmpl);
4968 
4981 gboolean
4983  const fbTemplate_t *tmpl1,
4984  const fbTemplate_t *tmpl2);
4985 
4986 
5019 int
5021  const fbTemplate_t *tmpl1,
5022  const fbTemplate_t *tmpl2,
5023  unsigned int flags);
5024 
5025 
5045 
5081  const fbTemplate_t *tmpl1,
5082  const fbTemplate_t *tmpl2,
5083  uint16_t *matching_fields,
5084  unsigned int flags);
5085 
5092 #define FB_TMPL_CMP_IGNORE_PADDING 0x01u
5093 
5100 #define FB_TMPL_CMP_IGNORE_LENGTHS 0x02u
5101 
5108 #define FB_TMPL_CMP_IGNORE_SCOPE 0x04u
5109 
5110 
5117 uint16_t
5119  const fbRecord_t *record);
5120 
5131 void
5133  fbRecord_t *record);
5134 
5135 
5148 void
5150  fbRecordValue_t *value);
5151 
5174  fbRecordValue_t *dstValue,
5175  const fbRecordValue_t *srcValue);
5176 
5186 gchar *
5188  fbRecordValue_t *value);
5189 
5190 
5219 gboolean
5221  const fbRecord_t *record,
5222  const fbTemplateField_t *field,
5223  fbRecordValue_t *value);
5224 
5282 gboolean
5284  const fbRecord_t *record,
5285  const fbTemplateField_t *field,
5286  void *dest,
5287  size_t destlen);
5288 
5289 
5305 gboolean
5307  const fbRecord_t *record,
5308  const fbInfoElement_t *ie,
5309  fbRecordValue_t *value,
5310  uint16_t *position,
5311  uint16_t skip);
5312 
5335 const fbBasicList_t *
5337  const fbRecord_t *record,
5338  const fbInfoElement_t *contentsElement,
5339  uint16_t *position,
5340  uint16_t skip);
5341 
5342 
5363 const fbSubTemplateList_t *
5365  const fbRecord_t *record,
5366  const fbTemplate_t *tmpl,
5367  uint16_t *position,
5368  uint16_t skip);
5369 
5370 
5383  const fbRecord_t *parent_record,
5384  const fbBasicList_t *parent_bl,
5385  const fbInfoElement_t *field,
5386  const fbRecordValue_t *value,
5387  void *ctx);
5388 
5415 int
5417  const fbRecord_t *record,
5418  const fbInfoElement_t *ie,
5419  unsigned int flags,
5420  fbRecordValueCallback_fn callback,
5421  void *ctx);
5422 
5423 
5434  const fbRecord_t *record,
5435  void *ctx);
5436 
5437 
5460 int
5462  const fbRecord_t *record,
5463  uint16_t tid,
5464  unsigned int flags,
5466  void *ctx);
5467 
5468 
5501 gboolean
5503  const fbRecord_t *srcRec,
5504  fbRecord_t *dstRec,
5505  const fbTemplate_t *tmpl,
5506  uint16_t tid,
5507  GError **err);
5508 
5509 
5510 
5529 fbSession_t *
5531  fbInfoModel_t *model);
5532 
5533 
5558 uint16_t
5560  fbSession_t *session,
5561  gboolean enabled,
5562  uint16_t tid,
5563  GError **err);
5564 
5593 uint16_t
5595  fbSession_t *session,
5596  gboolean enabled,
5597  uint16_t tmplInfoTid,
5598  uint16_t blInfoTid,
5599  GError **err);
5600 
5607 fbInfoModel_t *
5609  const fbSession_t *session);
5610 
5639 void
5641  fbSession_t *session,
5642  fbNewTemplateCallback_fn callback,
5643  void *app_ctx);
5644 
5645 
5659 void
5661  fbSession_t *incomingSession,
5662  fbSession_t *exportSession);
5663 
5664 
5686 void
5688  fbSession_t *incomingSession,
5689  uint16_t tid,
5690  fbTemplate_t *tmpl,
5691  void *exportSession,
5692  void **tmpl_ctx,
5693  fbTemplateCtxFree_fn *tmpl_ctx_free_fn);
5694 
5729 void
5731  fbSession_t *session,
5732  uint16_t ext_tid,
5733  uint16_t int_tid);
5734 
5745 void
5747  fbSession_t *session,
5748  uint16_t ext_tid);
5749 
5764 uint16_t
5766  const fbSession_t *session,
5767  uint16_t ext_tid);
5768 
5777 void
5779  fbSession_t *session);
5780 
5792 void
5794  fbSession_t *session);
5795 
5810 void
5812  fbSession_t *session,
5813  uint32_t domain);
5814 
5821 uint32_t
5823  const fbSession_t *session);
5824 
5835 uint16_t
5837  fbSession_t *session);
5838 
5853 fbCollector_t *
5855  const fbSession_t *session);
5856 
5873 gboolean
5875  fbSession_t *session,
5876  uint16_t tid,
5877  GError **err);
5878 
5898 gboolean
5900  fbSession_t *session,
5901  GError **err);
5902 
5940 uint16_t
5942  fbSession_t *session,
5943  gboolean internal,
5944  uint16_t tid,
5945  fbTemplate_t *tmpl,
5946  fbTemplateInfo_t *tmplInfo,
5947  GError **err);
5948 
5949 
5974 uint16_t
5976  fbSession_t *session,
5977  uint16_t tid,
5978  fbTemplate_t *tmpl,
5979  fbTemplateInfo_t *tmplInfo,
5980  GError **err);
5981 
5982 
5994 gboolean
5996  fbSession_t *session,
5997  gboolean internal,
5998  uint16_t tid,
5999  GError **err);
6000 
6011 fbTemplate_t *
6013  const fbSession_t *session,
6014  gboolean internal,
6015  uint16_t tid,
6016  GError **err);
6017 
6032 fbExporter_t *
6034  const fbConnSpec_t *spec);
6035 
6048 fbExporter_t *
6050  const char *path);
6051 
6064 fbExporter_t *
6066  uint8_t *buf,
6067  uint16_t bufsize);
6068 
6069 
6079 fbExporter_t *
6081  FILE *fp);
6082 
6083 
6095 void
6097  fbExporter_t *exporter,
6098  int sctp_stream);
6099 
6111 void
6113  fbExporter_t *exporter);
6114 
6122 void
6124  fbExporter_t *exporter);
6125 
6132 size_t
6134  const fbExporter_t *exporter);
6135 
6149 size_t
6151  const fbExporter_t *exporter);
6152 
6162 size_t
6164  fbExporter_t *exporter);
6165 
6174 void
6176  fbExporter_t *exporter);
6177 
6191 fbCollector_t *
6193  void *ctx,
6194  const char *path,
6195  GError **err);
6196 
6208 fbCollector_t *
6210  void *ctx,
6211  FILE *fp);
6212 
6213 
6224 void *
6226  const fbCollector_t *collector);
6227 
6237 void
6239  fbCollector_t *collector);
6240 
6241 
6253 void
6255  fbCollector_t *collector,
6256  struct sockaddr *address,
6257  size_t address_length);
6258 
6289 fbListener_t *
6291  const fbConnSpec_t *spec,
6292  fbSession_t *session,
6293  fbListenerAppInit_fn appinit,
6294  fbListenerAppFree_fn appfree,
6295  GError **err);
6296 
6303 void
6305  fbListener_t *listener);
6306 
6331 fBuf_t *
6333  fbListener_t *listener,
6334  GError **err);
6335 
6346 fBuf_t *
6348  fbListener_t *listener,
6349  GError **err);
6350 
6358 void
6360  fbListener_t *listener);
6361 
6362 
6373 gboolean
6375  const fbListener_t *listener,
6376  fbCollector_t **collector,
6377  GError **err);
6378 
6379 
6380 
6392 gboolean
6394  fbCollector_t *collector,
6395  GError **err);
6396 
6397 
6409 gboolean
6411  fbCollector_t *collector,
6412  GError **err);
6413 
6414 
6426 gboolean
6428  fbCollector_t *collector,
6429  GError **err);
6430 
6449 uint32_t
6451  const fbCollector_t *collector,
6452  const struct sockaddr *peer,
6453  size_t peerlen,
6454  uint32_t obdomain);
6455 
6470 uint32_t
6472  const fbCollector_t *collector,
6473  const struct sockaddr *peer,
6474  size_t peerlen,
6475  uint32_t obdomain);
6476 
6483 const struct sockaddr *
6485  const fbCollector_t *collector);
6486 
6496 uint32_t
6498  const fbCollector_t *collector);
6499 
6522 void
6524  fbCollector_t *collector,
6525  gboolean multi_session);
6526 
6527 
6528 #ifdef __cplusplus
6529 } /* extern "C" */
6530 #endif
6531 
6532 #endif /* _FB_PUBLIC_H_ */
6533 
6534 /*
6535  * @DISTRIBUTION_STATEMENT_BEGIN@
6536  * libfixbuf 3.0.0
6537  *
6538  * Copyright 2022 Carnegie Mellon University.
6539  *
6540  * NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING
6541  * INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON
6542  * UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
6543  * AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR
6544  * PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF
6545  * THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF
6546  * ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT
6547  * INFRINGEMENT.
6548  *
6549  * Released under a GNU GPL 2.0-style license, please see LICENSE.txt or
6550  * contact permission@sei.cmu.edu for full terms.
6551  *
6552  * [DISTRIBUTION STATEMENT A] This material has been approved for public
6553  * release and unlimited distribution. Please see Copyright notice for
6554  * non-US Government use and distribution.
6555  *
6556  * Carnegie Mellon(R) and CERT(R) are registered in the U.S. Patent and
6557  * Trademark Office by Carnegie Mellon University.
6558  *
6559  * This Software includes and/or makes use of the following Third-Party
6560  * Software subject to its own license:
6561  *
6562  * 1. GLib-2.0 (https://gitlab.gnome.org/GNOME/glib/-/blob/main/COPYING)
6563  * Copyright 1995 GLib-2.0 Team.
6564  *
6565  * 2. Doxygen (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
6566  * Copyright 2021 Dimitri van Heesch.
6567  *
6568  * DM22-0006
6569  * @DISTRIBUTION_STATEMENT_END@
6570  */
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocates a collecting process endpoint for a named file.
void * fbSubTemplateListResize(fbSubTemplateList_t *subTemplateList, uint16_t newCount)
Resizes and zeroes the list's internal buffer for elements (sub-records).
uint16_t fbSubTemplateListGetTemplateID(const fbSubTemplateList_t *subTemplateList)
Gets the template ID for the template used by the list.
@ FB_INT_8
The "signed8" data type: An integer value in the range of -128 to 127.
Definition: public.h:720
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:2036
const fbInfoElement_t * canon
Pointer to canonical IE.
Definition: public.h:1039
void(* fbNewTemplateCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void *app_ctx, void **tmpl_ctx, fbTemplateCtxFree_fn *tmpl_ctx_free_fn)
A callback function that will be called when the session receives a new external template.
Definition: public.h:2118
@ FB_IE_UNITS_FLOWS
Describes an information element as counting flows.
Definition: public.h:578
uint8_t * dataPtr
pointer to the buffer used to hold the data in this list
Definition: public.h:2525
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Exports a single external fbTemplate_t in the current domain of a given Session.
size_t fbExporterGetMsgLen(const fbExporter_t *exporter)
Gets the (transcoded) message length that was copied to the exporting buffer upon fBufEmit() when usi...
A single IPFIX Information Element definition.
Definition: public.h:793
void fbSessionRemoveTemplatePair(fbSession_t *session, uint16_t ext_tid)
Removes a template mapping pair for list sub-records from the Session.
const fbTemplateField_t * fbBasicListGetTemplateField(const fbBasicList_t *basicList)
Returns a simulated TemplateField that describes the data within a basicList.
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1595
const fbBasicList_t * bl
Used when ie is FB_BASIC_LIST.
Definition: public.h:1427
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocates an empty transport session state container.
GHashTableIter fbInfoModelIter_t
An iterator over the information elements in an information model.
Definition: public.h:159
uint16_t numElements
number of elements in the list
Definition: public.h:2195
enum fbInfoElementSemantics_en fbInfoElementSemantics_t
fbInfoElementSemantics_t defines the possible semantics of an fbInfoElement_t.
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Sets an octet array on an fBuf for collection.
@ FB_SCTP
Partially reliable datagram transport via SCTP.
Definition: public.h:1669
void fbTemplateIterInit(fbTemplateIter_t *iter, const fbTemplate_t *tmpl)
Initializes a TemplateIter to visit the fbTemplateField_t objects in a Template.
@ FB_BOOL
The "boolean" data type: A binary value: "true" or "false".
Definition: public.h:737
@ FB_IE_UNITS_BITS
Describes an information element as counting bits.
Definition: public.h:566
uint16_t len
Octet-length of this field as specified by the template specification.
Definition: public.h:1048
void * fbBasicListGetNextPtr(const fbBasicList_t *basicList, const void *currentPtr)
Retrieves a pointer to the data element in the basicList that follows the one at currentPtr.
@ FB_DT_MILSEC
The "dateTimeMilliseconds" data type: An unsigned 64-bit integer containing the number of millisecond...
Definition: public.h:751
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition: public.h:2191
fbTemplate_t * fbInfoElementAllocTypeTemplate(fbInfoModel_t *model, GError **err)
Allocates and returns the Options Template that will be used to define Information Element Type Recor...
void fbCollectorSetAcceptOnly(fbCollector_t *collector, struct sockaddr *address, size_t address_length)
Sets the collector to only receive from the given IP address over UDP.
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initializes an information model iterator for iteration over the information elements (fbInfoElement_...
uint8_t ie_semantic
ie semantic (fbInfoElementSemantics_t)
Definition: public.h:1521
fbVarfield_t varfield
Used when ie is FB_STRING or FB_OCTET_ARRAY.
Definition: public.h:1442
void * fbTemplateGetContext(const fbTemplate_t *tmpl)
Gets the context pointer associated with a Template.
const fbTemplateField_t * fbTemplateGetIndexedIE(const fbTemplate_t *tmpl, uint16_t position) __attribute__((__deprecated__))
Deprecated alias for fbTemplateGetFieldByPosition.
uint16_t fbSubTemplateListCountElements(const fbSubTemplateList_t *subTemplateList)
Returns the number of elements (sub-records) the sub template list is capable of holding.
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition: public.h:3403
gboolean fbTemplateAppendSpecId(fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec, uint32_t wantedFlags, GError **err)
Potentially appends an information element described by the specifier to a template.
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Exports all external templates in the current domain of a given session.
void fBufFree(fBuf_t *fbuf)
Frees a buffer.
gboolean fbTemplatesAreEqual(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2)
Returns TRUE when templates tmpl1 and tmpl2 are equal.
double dbl
Used when ie is FB_FLOAT_64 or FB_FLOAT_32.
Definition: public.h:1467
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emits the message currently in a buffer using the associated exporting process endpoint.
int(* fbRecordValueCallback_fn)(const fbRecord_t *parent_record, const fbBasicList_t *parent_bl, const fbInfoElement_t *field, const fbRecordValue_t *value, void *ctx)
Signature of the callback function required by fbRecordFindAllElementValues().
Definition: public.h:5382
uint16_t fbTemplateCountElements(const fbTemplate_t *tmpl)
Determines number of information elements in a template.
gboolean fbListenerGetCollector(const fbListener_t *listener, fbCollector_t **collector, GError **err)
If a collector is associated with the listener class, this will return a handle to the collector stat...
uint16_t offset
Octet-offset of this field in a record.
Definition: public.h:1052
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns an empty ListenerGroup.
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateList)
Returns a pointer to the buffer that contains the data for the list.
@ FB_TMPL_SETCMP_EQUAL
Indicates the two templates contain the same elements.
Definition: public.h:5036
fbInfoModel_t * fbInfoModelAlloc(void)
Allocates a new information model.
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, fbTemplateInfo_t *tmplInfo, GError **err)
Adds a Template to a Session.
const char * fbTemplateInfoGetDescription(const fbTemplateInfo_t *tmplInfo)
Returns the description value specified in fbTemplateInfoInit().
const fbInfoElement_t * fbInfoModelGetElementByID(const fbInfoModel_t *model, uint16_t id, uint32_t ent)
Returns a pointer to the canonical information element within an information model given the informat...
void fBufSetAutomaticNextMessage(fBuf_t *fbuf, gboolean automatic)
Sets the automatic next-message mode flag on a Buffer.
@ FB_IE_SEM_QUANTITY
Describes an information element as a quantity.
Definition: public.h:383
gboolean fbTemplateContainsElement(const fbTemplate_t *tmpl, const fbInfoElement_t *element)
Determines if a template contains a given information element.
void fbBasicListCollectorInit(fbBasicList_t *basicList)
Initializes a BasicList for collection, setting all properties of the list to 0 or NULL.
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Returns a pointer to the next information element in the information model.
A single IPFIX Information Element specification.
Definition: public.h:1581
uint32_t fbCollectorGetObservationDomain(const fbCollector_t *collector)
Retrieves the observation domain of the node connected to the UDP collector.
fbCollector_t * fbSessionGetCollector(const fbSession_t *session)
Retrieves the Collector that was associated with session by an explicit call to fBufAllocForCollectio...
fbTemplateSetCompareStatus_en
Defines the values returned by fbTemplatesSetCompare() when checking whether one fbTemplate_t is a su...
Definition: public.h:5032
fbTransport_t transport
Transport protocol to use.
Definition: public.h:1699
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.h:2197
gboolean fbInfoElementWriteOptionsRecord(fBuf_t *fbuf, const fbInfoElement_t *model_ie, uint16_t itid, uint16_t etid, GError **err)
Exports an options record to the given fbuf with information element type information about the given...
@ FB_IE_SEM_LIST
Describes an information element as a list element.
Definition: public.h:403
fbTransport_en
Transport protocol for connection specifier.
Definition: public.h:1664
const fbBasicListInfo_t * fbTemplateInfoGetNextBasicList(const fbTemplateInfo_t *tmplInfo, const fbBasicListInfo_t *blInfo)
Returns a description of the next fbBasicList_t that is used by the fbTemplate_t described by tmplInf...
char * ssl_key_file
Path to private key file.
Definition: public.h:1709
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec, uint32_t wantedFlags, GError **err)
Potentially appends an information element described by the specifier to a template.
@ FB_IE_SEM_SNMPCOUNTER
Describes an information element as an SNMP counter.
Definition: public.h:407
char * svc
Service name or port number to connect/listen to.
Definition: public.h:1703
struct fbListenerGroupResult_st fbListenerGroupResult_t
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
@ FB_UINT_8
The "unsigned8" data type: A non-negative integer value in the range of 0 to 255 (0xFF).
Definition: public.h:707
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateList)
Clears a subTemplateList structure, notably freeing the internal buffer and setting it to NULL.
uint16_t fbRecordGetFieldCount(const fbRecord_t *record)
Returns the number of fields in a record.
struct fbRecordValue_st fbRecordValue_t
fbRecordValue_t is used to access the value of a single Element (or Field) in an fbRecord_t.
uint64_t u64
Used when ie is FB_UINT_8, FB_UINT_16, FB_UINT_32, FB_UINT_64, or FB_BOOL (0 == false,...
Definition: public.h:1458
uint16_t num
Information Element number.
Definition: public.h:802
uint32_t ip4
Used when ie is FB_IP4_ADDR.
Definition: public.h:1453
GString * stringbuf
An internal buffer used to store the varfield value.
Definition: public.h:1417
uint16_t fbTemplateInfoGetParentTid(const fbTemplateInfo_t *tmplInfo)
Returns the parentTid value specified in fbTemplateInfoInit().
fbTemplateField_t represents an fbInfoElement_t that has been added to an fbTemplate_t.
Definition: public.h:1037
@ FB_MAC_ADDR
The "macAddress" data type: A MAC-48 address as a string of 6 octets.
Definition: public.h:740
uint32_t flags
Flags.
Definition: public.h:810
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1644
void fbInfoModelAddElementArray(fbInfoModel_t *model, const fbInfoElement_t *ie)
Adds multiple information elements in an array to an information model.
@ FB_LIST_SEM_UNDEFINED
Semantic field for indicating the value has not been set.
Definition: public.h:2143
const fbTemplateField_t * fbTemplateFindFieldByDataType(const fbTemplate_t *tmpl, fbInfoElementDataType_t datatype, uint16_t *position, uint16_t skip)
Searches a Template for a TemplateField by an fbInfoElement_t's datatype.
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list (fbSubTemplateMultiListClear()), then frees the STML itself.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetNextEntry(const fbSubTemplateMultiList_t *STML, const fbSubTemplateMultiListEntry_t *currentEntry)
Retrieves a pointer to the entry in the multi list that follows the one at currentEntry.
char * ssl_key_pass
Private key decryption password.
Definition: public.h:1711
@ FB_UDP
Unreliable datagram transport via UDP.
Definition: public.h:1673
@ FB_OCTET_ARRAY
The "octetArray" data type: A finite-length string of octets.
Definition: public.h:704
gboolean fbListSemanticsIsValid(uint8_t semantic)
Validates the value of a structured data types semantic field, as defined in RFC 6313 and listed at I...
struct fbInfoElementSpecId_st fbInfoElementSpecId_t
A single IPFIX Information Element specification using the element's numeric identifier and private e...
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory holding the sub-records' data used by this entry.
An IPFIX template or options template structure.
Definition: private.h:108
gboolean(* fbListenerAppInit_fn)(fbListener_t *listener, void **ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
Application context initialization function type for fbListener_t.
Definition: public.h:3384
void fbCollectorClose(fbCollector_t *collector)
Closes the file or socket underlying a collecting process endpoint.
@ FB_IE_UNITS_MICROSECONDS
Describes an information element as counting microseconds.
Definition: public.h:590
uint8_t semantic
value used to describe the list of sub templates
Definition: public.h:2829
fbSubTemplateMultiListEntry_t represents structured data instances within a fbSubTemplateMultiList_t ...
Definition: public.h:2838
@ FB_FLOAT_32
The "float32" data type: An IEEE single-precision 32-bit floating point type.
Definition: public.h:732
@ FB_IE_SEM_FLAGS
Describes an information element as a flags element.
Definition: public.h:399
uint8_t * rec
The buffer holding the data for a record.
Definition: public.h:1381
void fBufListFree(const fbTemplate_t *tmpl, uint8_t *record)
Clears all of the memory that fixbuf allocated during transcode of this record.
const fbTemplateField_t * fbTemplateFindFieldByElement(const fbTemplate_t *tmpl, const fbInfoElement_t *ie, uint16_t *position, uint16_t skip)
Searches a Template for an Information Element and returns a TemplateField if found.
fbSubTemplateMultiList_t provides the internal representation of an fbInfoElement_t of type subTempla...
Definition: public.h:2823
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:129
const struct sockaddr * fbCollectorGetPeer(const fbCollector_t *collector)
Retrieves information about the node connected to this collector.
gboolean fBufNextRecord(fBuf_t *fbuf, fbRecord_t *record, GError **err)
Sets the internal template on a Buffer and gets its next record.
uint32_t dataLength
octet length of the buffer used to hold the data in this entry
Definition: public.h:2844
gboolean fBufSetAutomaticElementInsert(fBuf_t *fbuf, GError **err)
Enables automatic insertion of RFC 5610 elements read from a Buffer.
void fbExporterResetOctetCount(fbExporter_t *exporter)
Resets the counter that holds the number of octets written to the exporter's file,...
gboolean fbInfoElementAddOptRecElement(fbInfoModel_t *model, const fbInfoElementOptRec_t *rec)
Adds an element that we received via an RFC 5610 Options Record to the given info model.
Fixbuf's version information.
struct fbInfoElementOptRec_st fbInfoElementOptRec_t
The corresponding C struct for a record whose template is the RFC 5610 Information Element Type Optio...
@ FB_IE_UNITS_WORDS
Describes an information element as counting 4-octet words, as for IPv4-header length.
Definition: public.h:599
struct fbListenerEntry_st fbListenerEntry_t
ListenerEntry's make up an fbListenerGroup_t as a linked list.
@ FB_IE_SEM_SNMPGAUGE
Describes an information element as a SNMP gauge.
Definition: public.h:411
fbRecordValue_t * fbRecordValueCopy(fbRecordValue_t *dstValue, const fbRecordValue_t *srcValue)
Copies srcValue to dstValue and returns dstValue.
@ FB_INT_64
The "signed64" data type: An integer value in the range of -9_223_372_036_854_775_808 to 9_223_372_03...
Definition: public.h:729
void * fbBasicListInit(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes a BasicList for export.
@ FB_SUB_TMPL_LIST
The "subTemplateList" data type: A structured data element as described in RFC6313,...
Definition: public.h:771
size_t fBufRemaining(fBuf_t *fbuf)
When using fBufSetBuffer(), returns the number of unprocessed octets in the octet array.
A ListenerGroupResult contains the fbListener whose listening socket got a new connection (cf.
Definition: public.h:2072
const char * name
Information element name.
Definition: public.h:821
@ FB_TMPL_SETCMP_COMMON
Indicates the templates contain common elements but each has elements that the other does not.
Definition: public.h:5041
void * fbSubTemplateMultiListEntryNextDataPtr(const fbSubTemplateMultiListEntry_t *entry, const void *currentPtr)
Retrieves a pointer to the data record in this entry that follows the one at currentPtr.
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t additional)
Increases the size of the list's internal buffer to hold additional more elements (sub-records).
void * fbBasicListGetIndexedDataPtr(const fbBasicList_t *basicList, uint16_t index)
Retrieves the element at position index in the basic list or returns NULL if index is out of range.
uint32_t recordLength
octet length of a record (in memory) described by the template
Definition: public.h:2846
struct fbListenerEntry_st * next
pointer to the next listener entry in the linked list
Definition: public.h:2060
@ FB_IE_UNITS_PACKETS
Describes an information element as counting packets.
Definition: public.h:574
ListenerEntry's make up an fbListenerGroup_t as a linked list.
Definition: public.h:2058
void fbSessionResetExternal(fbSession_t *session)
Resets the external state (sequence numbers and templates) in a session state container.
struct fbBasicListInfo_st fbBasicListInfo_t
fbBasicListInfo_t describes a basicList and is used by fbTemplateInfo_t.
Definition: public.h:1742
size_t fbExporterGetOctetCountAndReset(fbExporter_t *exporter)
Gets the number of octets that have been written to the exporter's file, socket, or buffer since the ...
struct timespec dt
Used when ie is FB_DT_SEC, FB_DT_MILSEC, FB_DT_MICROSEC, or FB_DT_NANOSEC.
Definition: public.h:1449
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Sets the SCTP stream for the next message exported.
@ FB_LIST_SEM_ALL_OF
Semantic field for the all-of value defined in RFC 6313.
Definition: public.h:2159
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:154
fbBasicList_t * fbBasicListAlloc(void)
Allocates and returns an empty BasicList.
void fbBasicListSetSemantic(fbBasicList_t *basicList, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) for describing a basic list.
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the template pointer used to structure the data elements.
gboolean fBufSetTemplatesForExport(fBuf_t *fbuf, uint16_t tid, GError **err)
Sets the internal and external templates on a Buffer to the given template ID.
gboolean fbTemplateAppendSpecArray(fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec, uint32_t wantedFlags, GError **err)
Appends information elements described by a specifier array to a template.
@ FB_FLOAT_64
The "float64" data type: An IEEE double-precision 64-bit floating point type.
Definition: public.h:735
const fbTemplateInfo_t * fbSessionGetTemplateInfo(const fbSession_t *session, uint16_t tid)
Returns the metadata for template whose ID is tid in the current domain or NULL if no metadata is ava...
@ FB_UINT_64
The "unsigned64" data type: A non-negative integer value in the range of 0 to 18_446_744_073_709_551_...
Definition: public.h:717
@ FB_IE_UNITS_SECONDS
Describes an information element as counting seconds.
Definition: public.h:582
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t additional)
Increases the size of the list's internal data buffer to hold additional more elements.
struct fbTemplateField_st fbTemplateField_t
fbTemplateField_t represents an fbInfoElement_t that has been added to an fbTemplate_t.
gboolean fBufSetAutomaticMetadataAttach(fBuf_t *fbuf, GError **err)
Instructes a collection Buffer to process Template Metadata records.
fBuf_t * fbListenerOwnSocketCollectorTCP(fbListener_t *listener, int sock, GError **err)
Returns an fBuf wrapped around an independently managed socket and a properly created listener for TC...
void fbRecordValueClear(fbRecordValue_t *value)
Releases any memory used by the string buffer on value (that is used to store the fbVarfield_t) and r...
void * fbCollectorGetContext(const fbCollector_t *collector)
Retrieves the application context associated with a collector.
uint32_t enterprise_id
The private enterprise number (PEN) of the element or 0 for an IANA-defined element.
Definition: public.h:1629
@ FB_IE_UNITS_INFERRED
Describes an information element as having units inferred from some other element.
Definition: public.h:627
Connection specifier.
Definition: public.h:1697
uint16_t fbBasicListInfoGetContentIdent(const fbBasicListInfo_t *blInfo, uint32_t *pen)
Gets from blInfo the element numbers for the fbInfoElement_t that the BasicList contains.
const fbTemplate_t * fbTemplateIterGetTemplate(const fbTemplateIter_t *iter)
Returns the Template to which the TemplateIter is bound.
const fbInfoElement_t * fbInfoModelGetElementByName(const fbInfoModel_t *model, const char *name)
Returns a pointer to the canonical information element within an information model given the informat...
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.h:2535
@ FB_UINT_32
The "unsigned32" data type: A non-negative integer value in the range of 0 to 4_294_967_295 (0xFFFFFF...
Definition: public.h:713
struct fbTemplateIter_st fbTemplateIter_t
fbTemplateIter_t iterates over the fbTemplateField_t objects in an fbTemplate_t.
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates and returns an empty subTemplateMultiList structure.
struct fbVarfield_st fbVarfield_t
A variable-length field value.
uint16_t fbTemplateIterGetPosition(const fbTemplateIter_t *iter)
Returns the position of the fbTemplateField_t returned by the most recent call to fbTemplateIterNext(...
fbTemplate_t * fbTemplateCopy(const fbTemplate_t *tmpl, uint32_t flags)
Creates a new template that is a copy of tmpl perhaps modified by the values specified in flags.
gboolean fbRecordGetValueForField(const fbRecord_t *record, const fbTemplateField_t *field, fbRecordValue_t *value)
Gets the value from a Record given a Field used by the Record's fbTemplate_t.
uint16_t fbSessionSetMetadataExportElements(fbSession_t *session, gboolean enabled, uint16_t tid, GError **err)
Configures a session to export type information for enterprise-specific information elements as optio...
A single IPFIX Information Element specification using the element's numeric identifier and private e...
Definition: public.h:1624
void fbTemplateInfoFree(fbTemplateInfo_t *tmplInfo)
Frees a template metadata structure.
uint16_t fbSubTemplateMultiListEntryGetTemplateID(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the template ID for the template used to structure the data.
@ FB_IE_UNITS_NONE
Describes an information element as having no units.
Definition: public.h:562
int(* fbRecordSubRecordCallback_fn)(const fbRecord_t *record, void *ctx)
Signature of the callback function required by fbRecordFindAllSubRecords().
Definition: public.h:5433
uint32_t fbCollectorGetSFlowMissed(const fbCollector_t *collector, const struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
Returns the number of potential missed export packets of the SFlow session that is identified with th...
const fbSubTemplateList_t * stl
Used when ie is FB_SUB_TMPL_LIST.
Definition: public.h:1431
struct fbRecord_st fbRecord_t
fbRecord_t maintains a buffer holding an IPFIX record's data, the fbTemplate_t that describes that da...
gboolean fbTemplateContainsAllArraySpecId(const fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec)
Determines if a template contains at least one instance of each fbInfoElement_t in a specifier array.
@ FB_IP6_ADDR
The "ipv6Address" data type: A value of an IPv6 address.
Definition: public.h:765
void fbRecordFreeLists(fbRecord_t *record)
Releases all of the memory allocated during transcode of this record, freeing the list structures,...
fbTemplatesSetCompareStatus_t fbTemplatesSetCompare(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2, uint16_t *matching_fields, unsigned int flags)
Compares two Templates to determine if one is a subset of the other.
The corresponding C struct for a record whose template is the RFC 5610 Information Element Type Optio...
Definition: public.h:1513
@ FB_IE_UNITS_NANOSECONDS
Describes an information element as counting nanoseconds.
Definition: public.h:594
uint16_t fbSessionSetMetadataExportTemplates(fbSession_t *session, gboolean enabled, uint16_t tmplInfoTid, uint16_t blInfoTid, GError **err)
Configures a Session to export template metadata (fbTemplateInfo_t) as options records.
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Sets the internal template on a buffer to the given template ID.
uint8_t type
Data Type, an fbInfoElementDataType_t.
Definition: public.h:812
@ FB_IE_UNITS_FRAMES
Describes an information element as counting frames, as for Layer 2 frames.
Definition: public.h:617
void * fbBasicListResize(fbBasicList_t *basicList, uint16_t newCount)
Resizes and zeroes the list's internal buffer for elements.
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *subTemplateList)
Initializes a SubTemplateList variable on a fbCollector_t.
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition: public.h:2825
fbSubTemplateList_t provides the internal representation of an fbInfoElement_t of type subTemplateLis...
Definition: public.h:2521
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Frees the listener group result returned from fbListenerGroupWait().
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Accepts connections for multiple listeners.
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t additional)
Increases the size of the entry's internal buffer to hold additional more elements (sub-records).
@ FB_BASIC_LIST
The "basicList" data type: A structured data element as described in RFC6313, Section 4....
Definition: public.h:768
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Frees a template if it is not currently in use by any Session.
fbInfoModel_t * fbTemplateGetInfoModel(const fbTemplate_t *tmpl)
Returns the information model, as understood by the template.
const fbTemplate_t * tmpl
pointer to the template used to structure the data in this list
Definition: public.h:2523
uint8_t ip6[16]
Used when ie is FB_IP6_ADDR.
Definition: public.h:1423
void * fbSubTemplateMultiListEntryInit(fbSubTemplateMultiListEntry_t *entry, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes the multi list entry with the template values, and allocates the memory used by the entry...
@ FB_IE_UNITS_ENTRIES
Describes an information element as counting entries, as for MPLS label stack.
Definition: public.h:612
A variable-length field value.
Definition: public.h:137
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
A deprecated alias for fBufSetAutomaticElementInsert().
fbBasicList_t provides the internal representation of an fbInfoElement_t of type basicList (FB_BASIC_...
Definition: public.h:2189
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Deprecated.
fbExporter_t * fbExporterAllocFile(const char *path)
Allocates an exporting process endpoint for a named file.
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Returns the number of information elements in the information model.
struct fbTemplateInfo_st fbTemplateInfo_t
fbTemplateInfo_t describes an fbTemplate_t.
Definition: public.h:1732
@ FB_DTLS_SCTP
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1679
int64_t s64
Used when ie is FB_INT_8, FB_INT_16, FB_INT_32, or FB_INT_64.
Definition: public.h:1463
char * ssl_ca_file
Path to certificate authority file.
Definition: public.h:1705
uint8_t fbSubTemplateListGetSemantic(const fbSubTemplateList_t *subTemplateList)
Gets the list semantics value (fbListSemantics_t) from a SubTemplateList.
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.h:1721
@ FB_LIST_SEM_NONE_OF
Semantic field for none-of value defined in RFC 6313.
Definition: public.h:2147
uint64_t ie_range_end
ie range max
Definition: public.h:1529
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocates a new buffer for export.
uint64_t max
range max
Definition: public.h:816
uint8_t fbBasicListGetSemantic(const fbBasicList_t *basicList)
Returns the list semantics value (fbListSemantics_t) for a BasicList.
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocates a collecting process endpoint for an open file.
uint16_t fbTemplateInfoGetTemplateId(const fbTemplateInfo_t *tmplInfo)
Returns the Template ID value associated with this TemplateInfo.
uint16_t fbTemplateGetIELenOfMemBuffer(const fbTemplate_t *tmpl)
Returns the number of octets required for a data buffer (an octet array) to store a data record descr...
uint16_t ie_id
information element id
Definition: public.h:1517
const fbSubTemplateList_t * fbRecordFindStlOfTemplate(const fbRecord_t *record, const fbTemplate_t *tmpl, uint16_t *position, uint16_t skip)
Searches record for a subTemplateList that uses tmpl.
@ FB_IE_UNITS_MILLISECONDS
Describes an information element as counting milliseconds.
Definition: public.h:586
fbListSemantics_en
fbListSemantics_t defines the possible values for the semantics of the structured Data Types: basicLi...
Definition: public.h:2139
@ FB_IE_UNITS_HOPS
Describes an information element as counting hops, as for TTL.
Definition: public.h:607
uint8_t padding[6]
padding to align within the template
Definition: public.h:1525
@ FB_TMPL_SETCMP_SUBSET
Indicates the first template is a strict subset of the second.
Definition: public.h:5034
size_t len
Length of content in buffer.
Definition: public.h:139
@ FB_STRING
The "string" data type: A finite-length string of valid characters from the Unicode character encodin...
Definition: public.h:743
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associates an exporting process endpoint with a buffer.
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Reads a new message into a buffer using the associated collecting process endpoint.
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
@ FB_LIST_SEM_EXACTLY_ONE_OF
Semantic field for exactly-one-of value defined in RFC 6313.
Definition: public.h:2151
const fbTemplateField_t * fbTemplateFindFieldByIdent(const fbTemplate_t *tmpl, uint32_t ent, uint16_t num, uint16_t *position, uint16_t skip)
Searches a Template for a TemplateField by an fbInfoElement_t's private enterprise number and element...
uint16_t numElements
number of elements in this entry
Definition: public.h:2848
const fbInfoElement_t * fbBasicListGetInfoElement(const fbBasicList_t *basicList)
Returns a pointer to the information element used in the basic list.
uint16_t fbSubTemplateMultiListEntryCountElements(const fbSubTemplateMultiListEntry_t *entry)
Returns the number of entries the sub template multi list entry is capable of holding.
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list parameters but does not free the data ptr.
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
uint16_t ie_units
ie units (fbInfoElementUnits_t)
Definition: public.h:1523
fbInfoElementUnits_en
fbInfoElementUnits_t defines the possible units on an fbInfoElement_t.
Definition: public.h:558
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocates a new empty template.
void fbListenerInterrupt(fbListener_t *listener)
Causes the current or next call to fbListenerWait() to unblock and return.
uint32_t ie_pen
private enterprise number
Definition: public.h:1515
void * fbBasicListInitWithLength(fbBasicList_t *basicList, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t elementLength, uint16_t numElements)
Initializes a BasicList for export using a user-specified element length.
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateList, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) of a SubTemplateList.
uint16_t midx
Multiple IE index.
Definition: public.h:1044
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Appends a record to a buffer.
fbExporter_t * fBufGetExporter(const fBuf_t *fbuf)
Retrieves the exporting process endpoint associated with a buffer.
gboolean fbRecordCopyToTemplate(const fbRecord_t *srcRec, fbRecord_t *dstRec, const fbTemplate_t *tmpl, uint16_t tid, GError **err)
Copies a Record to a destination Record that uses a different Template.
uint16_t fbSessionGetTemplatePath(const fbSession_t *session, const fbTemplateInfo_t *tmplInfo, uint16_t path[], uint16_t path_size, GError **err)
Finds the template path of the fbTemplate_t described by tmplInfo.
The numeric pair to identify the element.
Definition: public.h:1626
fbExporter_t * fbExporterAllocNet(const fbConnSpec_t *spec)
Allocates an exporting process endpoint for a network connection.
fbTemplate_t * fBufGetCollectionTemplate(const fBuf_t *fbuf, uint16_t *ext_tid)
Retrieves the external template used to read the last record from the buffer.
@ FB_TLS_TCP
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1684
uint8_t mac[6]
Used when ie is FB_MAC_ADDR.
Definition: public.h:1471
uint8_t semantic
semantic field to describe the list
Definition: public.h:2199
gboolean fbInfoModelContainsElement(const fbInfoModel_t *model, const fbInfoElement_t *element)
Returns TRUE if element is present in the information model either by name or by element and enterpri...
struct fbListenerGroupResult_st * next
Pointer to the next listener group result.
Definition: public.h:2074
const fbTemplateField_t * fbTemplateIterNext(fbTemplateIter_t *iter)
Returns the next TemplateField in the fbTemplate_t.
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Removes a template from a session.
fbTemplateIter_t iterates over the fbTemplateField_t objects in an fbTemplate_t.
Definition: public.h:1192
void * fbSubTemplateMultiListEntryResize(fbSubTemplateMultiListEntry_t *entry, uint16_t newCount)
Resizes and zeroes the entry's internal buffer for elements (sub-records).
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateList)
Clears the sub template list (fbSubTemplateListClear()) then frees the subTemplateList itself.
@ FB_INT_32
The "signed32" data type: An integer value in the range of -2_147_483_648 to 2_147_483_647.
Definition: public.h:726
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates and returns an empty subTemplateList structure.
gboolean fbTemplateContainsSpecId(const fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec)
Determines if a template contains at least one instance of a given information element (fbInfoElement...
fbTemplateField_t field
the description of one element in the list
Definition: public.h:2193
void fbSessionCopyIncomingTemplatesCallback(fbSession_t *incomingSession, uint16_t tid, fbTemplate_t *tmpl, void *exportSession, void **tmpl_ctx, fbTemplateCtxFree_fn *tmpl_ctx_free_fn)
Arranges for templates read by incomingSession to be copied to exportSession.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListInit(fbSubTemplateMultiList_t *STML, uint8_t semantic, uint16_t numElements)
Initializes the multi list with the list semantic and allocates memory to store numElements entries.
gchar * fbRecordValueTakeVarfieldBuf(fbRecordValue_t *value)
Returns a pointer to the string buffer used by value to store fbVarfield_t values and transfers owner...
@ FB_IP4_ADDR
The "ipv4Address" data type: A value of an IPv4 address.
Definition: public.h:763
void * vai
Pointer to address info cache.
Definition: public.h:1716
@ FB_DT_SEC
The "dateTimeSeconds" data type: An unsigned 32-bit integer containing the number of seconds since th...
Definition: public.h:747
uint16_t fbTemplateInfoGetApplabel(const fbTemplateInfo_t *tmplInfo)
Returns the applabel value specified in fbTemplateInfoInit().
@ FB_DT_NANOSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:761
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Waits on a listener.
int fbRecordFindAllElementValues(const fbRecord_t *record, const fbInfoElement_t *ie, unsigned int flags, fbRecordValueCallback_fn callback, void *ctx)
Recursively searches a Record and all its sub-records for an Info Element.
gboolean fbTemplateAppendArraySpecId(fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec, uint32_t wantedFlags, GError **err)
Appends information elements described by a specifier array to a template.
fbSession_t * fBufGetSession(const fBuf_t *fbuf)
Retrieves the session associated with a buffer.
void * fbSubTemplateListGetIndexedDataPtr(const fbSubTemplateList_t *subTemplateList, uint16_t index)
Returns the data for the record at position index in the sub template list, or returns NULL if index ...
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert SFlow into IPFIX for the given collector.
fbVarfield_t ie_name
information element name
Definition: public.h:1531
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Clears the memory used by all the entries of a sub template multi list.
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.h:2076
void fbTemplateSetContext(fbTemplate_t *tmpl, void *tmpl_ctx, void *app_ctx, fbTemplateCtxFree_fn ctx_free)
Sets the context pointers on a Template.
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocates an exporting process endpoint for an opened ANSI C file pointer.
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Clears all of the fbSubTemplateMultiListEntry_t objects on this STML (see fbSubTemplateMultiListClear...
void fbListenerGroupFree(fbListenerGroup_t *group)
Frees a listener group.
@ FB_UINT_16
The "unsigned16" data type: A non-negative integer value in the range of 0 to 65535 (0xFFFF).
Definition: public.h:710
void fbExporterClose(fbExporter_t *exporter)
Forces the file or socket underlying an exporting process endpoint to close.
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Clears the parameters of the basic list but does not free the buffer.
uint16_t numElements
number of elements in the list
Definition: public.h:2531
uint16_t element_id
The numeric identifier of the element within its PEN.
Definition: public.h:1631
enum fbListSemantics_en fbListSemantics_t
fbListSemantics_t defines the possible values for the semantics of the structured Data Types: basicLi...
fbTemplate_t * fBufNextCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid, GError **err)
Retrieves the external template that will be used to read the next record from the buffer.
const fbTemplateField_t * fbTemplateIterGetField(const fbTemplateIter_t *iter)
Returns the same TemplateField returned by the most recent call to fbTemplateIterNext().
uint16_t tid
The template ID for tmpl.
Definition: public.h:1387
uint16_t fbSessionLookupTemplatePair(const fbSession_t *session, uint16_t ext_tid)
Finds the internal template ID to use for sub-records in a list that use the external template ext_ti...
uint32_t ent
Private Enterprise Number.
Definition: public.h:797
uint32_t flags
Application flags word.
Definition: public.h:1602
void fbSessionAddTemplatePair(fbSession_t *session, uint16_t ext_tid, uint16_t int_tid)
Adds an external-internal fbTemplate_t mapping pair for list elements in a Session.
const fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.h:2840
size_t reccapacity
The number of bytes allocated for the rec buffer.
Definition: public.h:1383
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:2044
@ FB_IE_SEM_DELTACOUNTER
Describes an information element as a deltaCounter.
Definition: public.h:391
gboolean fbInfoModelReadXMLData(fbInfoModel_t *model, const gchar *xml_data, gssize xml_data_len, GError **err)
Adds information specified in the given XML data to the information model.
size_t fbExporterGetOctetCount(const fbExporter_t *exporter)
Gets the number of octets that have been written to the exporter's file, socket, or buffer since the ...
fbVarfield_t ie_desc
information element description
Definition: public.h:1533
fbListener_t * fbListenerAlloc(const fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocates a listener.
void fbBasicListFree(fbBasicList_t *basicList)
Clears the basic list (fbBasicListClear()), then frees the basic list itself.
@ FB_TCP
Reliable stream transport via TCP.
Definition: public.h:1671
uint16_t fbSessionAddTemplatesForExport(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, fbTemplateInfo_t *tmplInfo, GError **err)
Adds a template to a session being used for export as both an internal template and an external templ...
fbRecord_t maintains a buffer holding an IPFIX record's data, the fbTemplate_t that describes that da...
Definition: public.h:1377
@ FB_TMPL_SETCMP_SUPERSET
Indicates the first template is a strict superset of the second.
Definition: public.h:5038
uint32_t fBufGetExportTime(const fBuf_t *fbuf)
Retrieves the export time on the message currently in a buffer.
const fbBasicList_t * fbRecordFindBasicListOfIE(const fbRecord_t *record, const fbInfoElement_t *contentsElement, uint16_t *position, uint16_t skip)
Searches record for a basicList of contentsElement values.
uint16_t tmplID
ID of the template used to structure the data.
Definition: public.h:2533
const fbInfoElement_t * ie
The element that describes this data.
Definition: public.h:1415
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait(), except that this function does not moni...
const fbTemplate_t * fbSubTemplateListGetTemplate(const fbSubTemplateList_t *subTemplateList)
Gets the template pointer from the list structure.
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Sets the export time on the message currently in a buffer.
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocates a new buffer for collection.
gboolean fbTemplateContainsAllFlaggedArraySpecId(const fbTemplate_t *tmpl, const fbInfoElementSpecId_t *spec, uint32_t wantedFlags)
Determines if a template contains at least one instance of each fbInfoElement_t in a specifier array ...
fbCollector_t * fBufGetCollector(const fBuf_t *fbuf)
Retrieves the collecting process endpoint associated with a buffer.
uint8_t * buf
Content buffer.
Definition: public.h:146
gboolean fbRecordCopyFieldValue(const fbRecord_t *record, const fbTemplateField_t *field, void *dest, size_t destlen)
Copies the value from a Record given a Field used by the Record's fbTemplate_t.
@ FB_DT_MICROSEC
The "dateTimeMicroseconds" data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.h:756
gboolean fbTemplateContainsAllElementsByName(const fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of each fbInfoElement_t in a given informatio...
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetIndexedEntry(const fbSubTemplateMultiList_t *STML, uint16_t index)
Retrieves a pointer to the entry at a specific index, or returns NULL if index is out of range.
uint8_t ie_type
ie data type (fbInfoElementDataType_t)
Definition: public.h:1519
void * fbSubTemplateListInit(fbSubTemplateList_t *sTL, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes a subTemplateList structure and allocates the internal buffer to a size capable of holdin...
int fbTemplatesCompare(const fbTemplate_t *tmpl1, const fbTemplate_t *tmpl2, unsigned int flags)
Compares templates tmpl1 and tmpl2 according to flags and returns 0 if the are the same and non-zero ...
uint32_t flags
Application flags word.
Definition: public.h:1651
fbTemplateInfo_t * fbTemplateInfoCopy(const fbTemplateInfo_t *tmplInfo)
Makes a copy of TemplateInfo.
uint64_t ie_range_begin
ie range min
Definition: public.h:1527
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP() but for TLS (not tested)
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t additional)
Increases the size of the list's internal buffer to hold additional more entries.
void fbInfoModelFree(fbInfoModel_t *model)
Frees an information model.
void fbInfoModelAddElement(fbInfoModel_t *model, const fbInfoElement_t *ie)
Adds a single information element to an information model.
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:2027
gboolean fbTemplateInfoInit(fbTemplateInfo_t *tmplInfo, const char *name, const char *description, uint16_t appLabel, uint16_t parentTid)
Initializes a template metadata structure.
fbTemplateInfo_t * fbTemplateInfoAlloc(void)
Allocates and returns an empty template metadata information structure.
void fbTemplateInfoAddBasicList(fbTemplateInfo_t *tmplInfo, uint32_t blEnt, uint16_t blNum, uint32_t contentEnt, uint16_t contentNum)
Adds a description for an fbBasicList_t that is used by the fbTemplate_t described by tmplInfo.
@ FB_LIST_SEM_ORDERED
Semantic field for the ordered value defined in RFC 6313.
Definition: public.h:2163
uint16_t numElements
number of sub template lists in the multi list
Definition: public.h:2827
void fbExporterAutoStream(fbExporter_t *exporter)
Enables automatic SCTP stream selection for the next message exported.
@ FB_IE_SEM_IDENTIFIER
Describes an information element as an identifier.
Definition: public.h:395
uint16_t fbBasicListGetElementIdent(const fbBasicList_t *basicList, uint32_t *pen)
Gets the element ID and enterprise number for the fbInfoElement_t used by a BasicList.
const char * name
Information element name.
Definition: public.h:1583
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocates an exporting process to use the existing buffer buf having the specified size.
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:2064
fbRecordValue_t is used to access the value of a single Element (or Field) in an fbRecord_t.
Definition: public.h:1413
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
Sets the collector input translator to convert NetFlowV9 into IPFIX for the given collector.
uint32_t fbSessionGetDomain(const fbSession_t *session)
Retrieves the current domain on a session.
gboolean fBufSetExportTemplate(fBuf_t *fbuf, uint16_t ext_tid, GError **err)
Sets the external template for export on a buffer to the given template ID.
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.h:2850
@ FB_TMPL_SETCMP_DISJOINT
Indicates the templates contain no common elements.
Definition: public.h:5043
uint16_t fbBasicListCountElements(const fbBasicList_t *basicList)
Returns the number of elements the basic list is capable of holding.
fbTemplate_t * tmpl
Octet-length of this IE in memory.
Definition: public.h:1064
void * fbBasicListGetDataPtr(const fbBasicList_t *basicList)
Gets a pointer to the data buffer for the basic list.
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
uint16_t fbSubTemplateMultiListCountElements(const fbSubTemplateMultiList_t *STML)
Returns the number of entries the sub template multi list is capable of holding.
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
Removes an input translator from a given collector such that it will operate on IPFIX protocol again.
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.h:2078
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.h:2091
void fbSessionFree(fbSession_t *session)
Frees a transport session state container.
struct fbListenerGroup_st fbListenerGroup_t
Structure that represents a group of listeners.
Definition: public.h:2053
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListResize(fbSubTemplateMultiList_t *STML, uint16_t newCount)
Resizes and zeroes the list's internal buffer for entries (fbSubTemplateMultiListEntry_t).
@ FB_IE_UNITS_MESSAGES
Describes an information element as counting messages.
Definition: public.h:603
const char * fbTemplateInfoGetName(const fbTemplateInfo_t *tmplInfo)
Returns the name value specified in fbTemplateInfoInit().
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.h:701
enum fbInfoElementUnits_en fbInfoElementUnits_t
fbInfoElementUnits_t defines the possible units on an fbInfoElement_t.
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.h:1661
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Enables or disables multi-session mode for a fbCollector_t associated with a UDP fbListener_t.
void fbListenerFree(fbListener_t *listener)
Frees a listener.
const char * description
Element description.
Definition: public.h:823
fbInfoModel_t * fbSessionGetInfoModel(const fbSession_t *session)
Gets the info model for the session.
uint16_t fbSessionGetLargestInternalTemplateSize(fbSession_t *session)
Gets the largest decoded size of an internal template in the session.
gboolean fbInfoModelReadXMLFile(fbInfoModel_t *model, const gchar *filename, GError **err)
Adds information specified in the given XML file to the information model.
gboolean fbBasicListGetIndexedRecordValue(const fbBasicList_t *basicList, uint16_t index, fbRecordValue_t *value)
Fills a RecordValue from the data for the indexth element in basicList.
@ FB_DTLS_UDP
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.h:1690
uint16_t fbBasicListGetElementLength(const fbBasicList_t *basicList)
Returns the octet length of an individual element in the BasicList.
void fbBasicListClear(fbBasicList_t *basicList)
Clears the parameters of the BasicList and frees the data buffer.
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
uint16_t fbBasicListInfoGetListIdent(const fbBasicListInfo_t *blInfo, uint32_t *pen)
Gets from blInfo the element numbers for the fbInfoElement_t used by the BasicList element itself.
gboolean fbTemplateAppend(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie, GError **err)
Appends an information element to a template.
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the list semantics value (fbListSemantics_t) for the multi list.
uint16_t fbTemplateGetOptionsScope(const fbTemplate_t *tmpl)
Determines number of scope information elements in a template.
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.h:2842
@ FB_IE_UNITS_OCTETS
Describes an information element as counting octets.
Definition: public.h:570
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(const fbSubTemplateMultiList_t *STML)
Retrieves the first entry in the multi list.
uint32_t recordLength
octet length of a record (in memory) described by the template
Definition: public.h:2529
uint32_t fbCollectorGetNetflowMissed(const fbCollector_t *collector, const struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
Returns the number of potential missed export packets of the Netflow v9 session that is currently set...
enum fbTemplateSetCompareStatus_en fbTemplatesSetCompareStatus_t
Defines the values returned by fbTemplatesSetCompare() when checking whether one fbTemplate_t is a su...
uint16_t len
Standard information element length in octets; FB_IE_VARLEN for strings, octetArrays,...
Definition: public.h:807
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associates an collecting process endpoint with a buffer.
char * host
Hostname to connect/listen to.
Definition: public.h:1701
void fbSessionSetCallbackCopyTemplates(fbSession_t *incomingSession, fbSession_t *exportSession)
Arranges for templates read by incomingSession to be copied to exportSession by setting the new templ...
char * ssl_cert_file
Path to certificate file.
Definition: public.h:1707
const fbTemplate_t * tmpl
The template that describes the bytes in rec.
Definition: public.h:1379
@ FB_IE_UNITS_PORTS
Describes an information element as counting ports.
Definition: public.h:621
const fbTemplateField_t * fbTemplateGetFieldByPosition(const fbTemplate_t *tmpl, uint16_t position)
Returns a field in a template at a specific position.
gboolean fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Sets the number of information elements in a template that are scope.
gboolean fbRecordFindValueForInfoElement(const fbRecord_t *record, const fbInfoElement_t *ie, fbRecordValue_t *value, uint16_t *position, uint16_t skip)
Searches a Record for an Element and gets its Value.
uint64_t min
range min
Definition: public.h:814
void * fbSubTemplateListGetNextPtr(const fbSubTemplateList_t *subTemplateList, const void *currentPtr)
Retrieves a pointer to the data record in the sub template list that follows the one at currentPtr.
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieves a record from a Buffer associated with a collecting process.
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
int fbRecordFindAllSubRecords(const fbRecord_t *record, uint16_t tid, unsigned int flags, fbRecordSubRecordCallback_fn callback, void *ctx)
Recursively searches a Record for uses of a fbTemplate_t having a particular ID.
gboolean fbTemplateContainsAllFlaggedElementsByName(const fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec, uint32_t wantedFlags)
Determines if a template contains at least one instance of each information element in a given inform...
The value depending on the type of ie.
Definition: public.h:1419
@ FB_IE_SEM_TOTALCOUNTER
Describes an information element as a totalCounter.
Definition: public.h:387
@ FB_SUB_TMPL_MULTI_LIST
The "subTemplateMultiList" data type: A structured data element as described in RFC6313,...
Definition: public.h:774
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Sets the current observation domain on a session.
const fbSubTemplateMultiList_t * stml
Used when ie is FB_SUB_TMPL_MULTI_LIST.
Definition: public.h:1435
struct fbListenerEntry_st * prev
pointer to the previous listener entry in the linked list
Definition: public.h:2062
@ FB_INT_16
The "signed16" data type: An integer value in the range of -32768 to 32767.
Definition: public.h:723
uint8_t fbSubTemplateMultiListGetSemantic(const fbSubTemplateMultiList_t *STML)
Gets the list semantics value (fbListSemantics_t) from the multi list.
void * fbSubTemplateMultiListEntryGetIndexedPtr(const fbSubTemplateMultiListEntry_t *entry, uint16_t index)
Retrieves a pointer to the data element in the entry at position index, or returns NULL when index is...
size_t recsize
The number of bytes used by the record current in rec.
Definition: public.h:1385
@ FB_IE_SEM_DEFAULT
Describes an information element as having no specific semantics.
Definition: public.h:379
fbInfoElementSemantics_en
fbInfoElementSemantics_t defines the possible semantics of an fbInfoElement_t.
Definition: public.h:375
void fbSessionAddNewTemplateCallback(fbSession_t *session, fbNewTemplateCallback_fn callback, void *app_ctx)
This function sets the callback that allows the application to set its own context variable with a ne...
fbTemplate_t * fbSessionGetTemplate(const fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieves a template from a session by ID.
gboolean fbTemplateIsMetadata(const fbTemplate_t *tmpl, uint32_t tests)
Checks to see if a template describes a meta-data record according to the bit-field value in tests.
gboolean fbTemplateContainsElementByName(const fbTemplate_t *tmpl, const fbInfoElementSpec_t *spec)
Determines if a template contains at least one instance of a given information element (fbInfoElement...
@ FB_LIST_SEM_ONE_OR_MORE_OF
Semantic field for the one-or-more-of value defined in RFC 6313.
Definition: public.h:2155
void * fbSubTemplateMultiListEntryGetDataPtr(const fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
uint32_t dataLength
octet length of the allocated buffer used to hold the data
Definition: public.h:2527