public.h
Go to the documentation of this file.
1 /*
2  ** public.h
3  ** fixbuf IPFIX Implementation Public Interface
4  **
5  ** ------------------------------------------------------------------------
6  ** Copyright (C) 2006-2018 Carnegie Mellon University. All Rights Reserved.
7  ** ------------------------------------------------------------------------
8  ** Authors: Brian Trammell, Dan Ruef
9  ** ------------------------------------------------------------------------
10  ** @OPENSOURCE_LICENSE_START@
11  ** libfixbuf 2.0
12  **
13  ** Copyright 2018 Carnegie Mellon University. All Rights Reserved.
14  **
15  ** NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE
16  ** ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS"
17  ** BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND,
18  ** EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT
19  ** LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY,
20  ** EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE
21  ** MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF
22  ** ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR
23  ** COPYRIGHT INFRINGEMENT.
24  **
25  ** Released under a GNU-Lesser GPL 3.0-style license, please see
26  ** LICENSE.txt or contact permission@sei.cmu.edu for full terms.
27  **
28  ** [DISTRIBUTION STATEMENT A] This material has been approved for
29  ** public release and unlimited distribution. Please see Copyright
30  ** notice for non-US Government use and distribution.
31  **
32  ** Carnegie Mellon(R) and CERT(R) are registered in the U.S. Patent
33  ** and Trademark Office by Carnegie Mellon University.
34  **
35  ** DM18-0325
36  ** @OPENSOURCE_LICENSE_END@
37  **
38  ** ------------------------------------------------------------------------
39  */
40 
946 #ifndef _FB_PUBLIC_H_
947 #define _FB_PUBLIC_H_
948 #include <fixbuf/autoinc.h>
949 #include "version.h"
950 
951 #ifdef __cplusplus
952 extern "C" {
953 #endif
954 
955 
960 #define FIXBUF_CHECK_VERSION(major, minor, release) \
961  (FIXBUF_VERSION_MAJOR > (major) || \
962  (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
963  (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
964  FIXBUF_VERSION_RELEASE >= (release)))
965 
966 /*
967  * Error Handling Definitions
968  */
969 
971 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
972 
973 #define FB_ERROR_TMPL 1
974 
978 #define FB_ERROR_EOM 2
979 
984 #define FB_ERROR_EOF 3
985 
989 #define FB_ERROR_IPFIX 4
990 
995 #define FB_ERROR_BUFSZ 5
996 
997 #define FB_ERROR_IMPL 6
998 
999 #define FB_ERROR_IO 7
1000 
1004 #define FB_ERROR_NLREAD 8
1005 
1010 #define FB_ERROR_NLWRITE 9
1011 
1014 #define FB_ERROR_NOELEMENT 10
1015 
1018 #define FB_ERROR_CONN 11
1019 
1023 #define FB_ERROR_NETFLOWV9 12
1024 
1027 #define FB_ERROR_TRANSMISC 13
1028 
1031 #define FB_ERROR_SFLOW 14
1032 
1035 #define FB_ERROR_SETUP 15
1036 
1039 #define FB_ERROR_LAXSIZE 16
1040 
1041 /*
1042  * Public Datatypes and Constants
1043  */
1044 
1045 struct fBuf_st;
1051 typedef struct fBuf_st fBuf_t;
1052 
1059 typedef struct fbVarfield_st {
1061  size_t len;
1068  uint8_t *buf;
1069 } fbVarfield_t;
1070 
1071 
1072 struct fbInfoModel_st;
1077 typedef struct fbInfoModel_st fbInfoModel_t;
1078 
1082 typedef struct fbInfoModelIter_st {
1086  const fbInfoModel_t *model;
1090  guint index;
1092 
1098 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_)\
1099  { {(const struct fbInfoElement_st*)_name_}, 0, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_ }
1100 
1106 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
1107  FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char*)NULL)
1108 
1109 
1115 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
1116 
1122 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
1123 
1129 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
1130 
1135 #define FB_IE_F_NONE 0x00000000
1136 
1141 #define FB_IE_F_ENDIAN 0x00000001
1142 
1153 #define FB_IE_F_REVERSIBLE 0x00000040
1154 
1162 #define FB_IE_F_ALIEN 0x00000080
1163 
1168 #define FB_IE_QUANTITY 0x00000100
1169 
1175 #define FB_IE_TOTALCOUNTER 0x00000200
1176 
1181 #define FB_IE_DELTACOUNTER 0x00000300
1182 
1187 #define FB_IE_IDENTIFIER 0x00000400
1188 
1193 #define FB_IE_FLAGS 0x00000500
1194 
1200 #define FB_IE_LIST 0x00000600
1201 
1207 #define FB_IE_SNMPCOUNTER 0x00000700
1208 
1214 #define FB_IE_SNMPGAUGE 0x00000800
1215 
1221 #define FB_IE_DEFAULT 0x00000000
1222 
1233 #define FB_UNITS_BITS 0x00010000
1234 
1239 #define FB_UNITS_OCTETS 0x00020000
1240 
1245 #define FB_UNITS_PACKETS 0x00030000
1246 
1251 #define FB_UNITS_FLOWS 0x00040000
1252 
1257 #define FB_UNITS_SECONDS 0x00050000
1258 
1263 #define FB_UNITS_MILLISECONDS 0x00060000
1264 
1269 #define FB_UNITS_MICROSECONDS 0x00070000
1270 
1275 #define FB_UNITS_NANOSECONDS 0x00080000
1276 
1281 #define FB_UNITS_WORDS 0x00090000
1282 
1287 #define FB_UNITS_MESSAGES 0x000A0000
1288 
1293 #define FB_UNITS_HOPS 0x000B0000
1294 
1299 #define FB_UNITS_ENTRIES 0x000C0000
1300 
1305 #define FB_UNITS_FRAMES 0x000D0000
1306 
1311 #define FB_UNITS_PORTS 0x000E0000
1312 
1317 #define FB_UNITS_INFERRED 0x000F0000
1318 
1322 #define FB_IE_VARLEN 65535
1323 
1328 #define FB_IE_BASIC_LIST 291
1329 
1333 #define FB_IE_SUBTEMPLATE_LIST 292
1334 
1338 #define FB_IE_SUBTEMPLATE_MULTILIST 293
1339 
1348 #define FB_IE_PEN_REVERSE 29305
1349 
1358 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
1359 
1365 #define FB_CISCO_GENERIC 9999
1366 
1373 #define FB_CISCO_ASA_EVENT_ID 9998
1374 
1383 #define FB_CISCO_ASA_EVENT_XTRA 9997
1384 
1389 #define FB_IE_REVERSE_STR "reverse"
1390 
1392 #define FB_IE_REVERSE_STRLEN 7
1393 
1474 
1483 typedef struct fbInfoElement_st {
1485  union {
1491  const struct fbInfoElement_st *canon;
1496  const char *name;
1497  } ref;
1498 
1504  uint32_t midx;
1506  uint32_t ent;
1511  uint16_t num;
1513  uint16_t len;
1516  uint32_t flags;
1518  uint64_t min;
1520  uint64_t max;
1522  uint8_t type;
1524  const char *description;
1525 } fbInfoElement_t;
1526 
1533 typedef struct fbInfoElementOptRec_st {
1535  uint32_t ie_pen;
1537  uint16_t ie_id;
1539  uint8_t ie_type;
1541  uint8_t ie_semantic;
1543  uint16_t ie_units;
1545  uint8_t padding[6];
1547  uint64_t ie_range_begin;
1549  uint64_t ie_range_end;
1555 
1556 
1561 #define FB_TID_AUTO 0
1562 
1566 #define FB_TID_TS 2
1567 
1571 #define FB_TID_OTS 3
1572 
1576 #define FB_TID_MIN_DATA 256
1577 
1578 struct fbTemplate_st;
1585 
1591 #define FB_IESPEC_NULL { NULL, 0, 0 }
1592 
1598 typedef struct fbInfoElementSpec_st {
1600  char *name;
1612  uint16_t len_override;
1619  uint32_t flags;
1621 
1622 struct fbSession_st;
1629 typedef struct fbSession_st fbSession_t;
1630 
1632 typedef enum fbTransport_en {
1659 } fbTransport_t;
1660 
1665 typedef struct fbConnSpec_st {
1669  char *host;
1671  char *svc;
1673  char *ssl_ca_file;
1675  char *ssl_cert_file;
1677  char *ssl_key_file;
1679  char *ssl_key_pass;
1684  void *vai;
1689  void *vssl_ctx;
1690 } fbConnSpec_t;
1691 
1695 #define FB_CONNSPEC_INIT { FB_SCTP, NULL, NULL, \
1696  NULL, NULL, NULL, NULL, \
1697  NULL, NULL }
1698 
1699 #if HAVE_SPREAD
1700 
1705 #define FB_SPREADPARAMS_INIT { 0, 0, 0 }
1706 
1707 typedef struct fbSpreadParams_st {
1710  fbSession_t * session;
1713  char * daemon;
1716  char ** groups;
1717 } fbSpreadParams_t;
1718 
1719 #endif /* HAVE_SPREAD */
1720 
1721 struct fbExporter_st;
1727 typedef struct fbExporter_st fbExporter_t;
1728 
1729 struct fbCollector_st;
1737 typedef struct fbCollector_st fbCollector_t;
1738 
1739 struct fbListener_st;
1746 typedef struct fbListener_st fbListener_t;
1747 
1752 
1756 struct fbListenerEntry_st
1757 {
1764 };
1765 
1770 
1777 {
1783  fBuf_t *fbuf;
1784 };
1785 
1786 struct fbListenerGroup_st;
1790 typedef struct fbListenerGroup_st fbListenerGroup_t;
1791 
1801 typedef void (*fbTemplateCtxFree_fn)(
1802  void *tmpl_ctx,
1803  void *app_ctx);
1804 
1828 typedef void (*fbNewTemplateCallback_fn) (
1829  fbSession_t *session,
1830  uint16_t tid,
1831  fbTemplate_t *tmpl,
1832  void *app_ctx,
1833  void **tmpl_ctx,
1834  fbTemplateCtxFree_fn *fn);
1835 
1836 
1844 #define FB_LIST_SEM_UNDEFINED 0xFF
1845 
1848 #define FB_LIST_SEM_NONE_OF 0x00
1849 
1852 #define FB_LIST_SEM_EXACTLY_ONE_OF 0x01
1853 
1856 #define FB_LIST_SEM_ONE_OR_MORE_OF 0x02
1857 
1860 #define FB_LIST_SEM_ALL_OF 0x03
1861 
1864 #define FB_LIST_SEM_ORDERED 0x04
1865 
1872 gboolean fbListValidSemantic(
1873  uint8_t semantic);
1874 
1875 /****** BASICLIST FUNCTIONS AND STRUCTS *******/
1881 typedef struct fbBasicList_st {
1885  uint8_t *dataPtr;
1887  uint16_t numElements;
1889  uint16_t dataLength;
1891  uint8_t semantic;
1892 } fbBasicList_t;
1893 
1894 
1901  void);
1902 
1915 void* fbBasicListInit(
1916  fbBasicList_t *basicListPtr,
1917  uint8_t semantic,
1918  const fbInfoElement_t *infoElement,
1919  uint16_t numElements);
1920 
1936  fbBasicList_t *basicListPtr,
1937  uint8_t semantic,
1938  const fbInfoElement_t *infoElement,
1939  uint16_t numElements,
1940  uint16_t dataLength,
1941  uint8_t *dataPtr);
1942 
1956  fbBasicList_t *basicListPtr);
1957 
1958 
1966 uint8_t fbBasicListGetSemantic(
1967  fbBasicList_t *basicListPtr);
1968 
1978  fbBasicList_t *basicListPtr,
1979  uint8_t semantic);
1980 
1981 
1990  fbBasicList_t *basicListPtr);
1991 
1997 void* fbBasicListGetDataPtr(
1998  fbBasicList_t *basicListPtr);
1999 
2009  fbBasicList_t *basicListPtr,
2010  uint16_t bl_index);
2011 
2020 void* fbBasicListGetNextPtr(
2021  fbBasicList_t *basicListPtr,
2022  void *currentPtr);
2023 
2033 void* fbBasicListRealloc(
2034  fbBasicList_t *basicList,
2035  uint16_t newNumElements);
2036 
2045  fbBasicList_t *basicList,
2046  uint16_t numNewElements);
2047 
2053 void fbBasicListClear(
2054  fbBasicList_t *basicListPtr);
2055 
2063  fbBasicList_t *basicList);
2064 
2070 void fbBasicListFree(
2071  fbBasicList_t *basicListPtr);
2072 
2073 
2074 /******* END OF BASICLIST ********/
2075 
2076 
2077 
2078 /******* SUBTEMPLATELIST FUNCTIONS ****/
2079 
2087 typedef struct fbSubTemplateList_st {
2090  union {
2091  size_t length;
2092  uint64_t extra;
2093  } dataLength;
2095  const fbTemplate_t *tmpl;
2097  uint8_t *dataPtr;
2099  uint16_t tmplID;
2101  uint16_t numElements;
2103  uint8_t semantic;
2105 
2113  void);
2114 
2127 void* fbSubTemplateListInit(
2128  fbSubTemplateList_t *sTL,
2129  uint8_t semantic,
2130  uint16_t tmplID,
2131  const fbTemplate_t *tmpl,
2132  uint16_t numElements);
2133 
2149  fbSubTemplateList_t *subTemplateList,
2150  uint8_t semantic,
2151  uint16_t tmplID,
2152  const fbTemplate_t *tmpl,
2153  uint16_t numElements,
2154  uint16_t dataLength,
2155  uint8_t *dataPtr);
2156 
2168  fbSubTemplateList_t *STL);
2169 
2176  const fbSubTemplateList_t *subTemplateListPtr);
2177 
2186  const fbSubTemplateList_t *subTemplateListPtr,
2187  uint16_t index);
2188 
2201  const fbSubTemplateList_t *subTemplateListPtr,
2202  void *currentPtr);
2203 
2211  fbSubTemplateList_t *subTemplateListPtr,
2212  uint8_t semantic);
2213 
2220  fbSubTemplateList_t *subTemplateListPtr);
2221 
2228  fbSubTemplateList_t *subTemplateListPtr);
2229 
2236  fbSubTemplateList_t *subTemplateListPtr);
2237 
2249  fbSubTemplateList_t *subTemplateList,
2250  uint16_t newNumElements);
2251 
2261  fbSubTemplateList_t *subTemplateList,
2262  uint16_t numNewElements);
2263 
2278  fbSubTemplateList_t *subTemplateListPtr);
2279 
2289  fbSubTemplateList_t *subTemplateListPtr);
2290 
2299  fbSubTemplateList_t *subTemplateListPtr);
2300 
2301 /********* END OF SUBTEMPLATELIST **********/
2319 typedef struct fbSubTemplateMultiListEntry_st {
2321  fbTemplate_t *tmpl;
2323  uint8_t *dataPtr;
2325  size_t dataLength;
2327  uint16_t tmplID;
2329  uint16_t numElements;
2331 
2336 typedef struct fbSubTemplateMultiList_st {
2340  uint16_t numElements;
2342  uint8_t semantic;
2344 
2345 
2354  void);
2355 
2356 
2368  uint8_t semantic,
2369  uint16_t numElements);
2370 
2379  uint8_t semantic);
2380 
2387  fbSubTemplateMultiList_t *STML);
2388 
2396  fbSubTemplateMultiList_t *STML);
2397 
2408  fbSubTemplateMultiList_t *STML);
2409 
2416  fbSubTemplateMultiList_t *STML);
2417 
2429  uint16_t newNumEntries);
2430 
2441  uint16_t numNewEntries);
2442 
2449  fbSubTemplateMultiList_t *STML);
2450 
2460  uint16_t index);
2461 
2475  fbSubTemplateMultiListEntry_t *currentEntry);
2476 
2490  uint16_t tmplID,
2491  fbTemplate_t *tmpl,
2492  uint16_t numElements);
2493 
2506  uint16_t newNumElements);
2507 
2519  uint16_t numNewElements);
2520 
2529 
2538 
2552  void *currentPtr);
2553 
2566  uint16_t index);
2567 
2576 
2585 
2586 /************** END OF STML FUNCTIONS *********** */
2587 
2603 void fBufListFree(
2604  fbTemplate_t *tmpl,
2605  uint8_t *record);
2606 
2607 
2614  void);
2615 
2622 void fbListenerGroupFree(
2623  fbListenerGroup_t *group);
2624 
2635  fbListenerGroup_t *group,
2636  const fbListener_t *listener);
2637 
2648  fbListenerGroup_t *group,
2649  const fbListener_t *listener);
2650 
2662  fbListenerGroup_t *group,
2663  GError **err);
2664 
2665 
2673  fbListenerGroupResult_t *result);
2674 
2688  fbListener_t *listener,
2689  int sock,
2690  GError **err);
2691 
2702  fbListener_t *listener,
2703  int sock,
2704  GError **err);
2705 
2711 void fBufInterruptSocket(
2712  fBuf_t *fbuf);
2713 
2714 
2735 typedef gboolean (*fbListenerAppInit_fn) (
2736  fbListener_t *listener,
2737  void **ctx,
2738  int fd,
2739  struct sockaddr *peer,
2740  size_t peerlen,
2741  GError **err);
2742 
2750 typedef void (*fbListenerAppFree_fn) (
2751  void *ctx);
2752 
2753 /*
2754  * Public Function Calls. These calls will remain available and retain
2755  * their functionality in all subsequent versions of libfixbuf.
2756  */
2757 
2758 
2775 gboolean fBufSetInternalTemplate(
2776  fBuf_t *fbuf,
2777  uint16_t int_tid,
2778  GError **err);
2779 
2797 gboolean fBufSetExportTemplate(
2798  fBuf_t *fbuf,
2799  uint16_t ext_tid,
2800  GError **err);
2801 
2802 #if HAVE_SPREAD
2803 
2820 void fBufSetSpreadExportGroup(
2821  fBuf_t *fbuf,
2822  char **groups,
2823  int num_groups,
2824  GError **err);
2825 #endif
2826 
2842  fBuf_t *fbuf,
2843  gboolean automatic);
2844 
2859 gboolean fBufSetAutomaticInsert(
2860  fBuf_t *fbuf,
2861  GError **err);
2862 
2863 
2872  fBuf_t *fbuf);
2873 
2882 void fBufFree(
2883  fBuf_t *fbuf);
2884 
2898  fbSession_t *session,
2899  fbExporter_t *exporter);
2900 
2911  fBuf_t *fbuf);
2912 
2923 void fBufSetExporter(
2924  fBuf_t *fbuf,
2925  fbExporter_t *exporter);
2926 
2927 
2939 size_t fBufRemaining(
2940  fBuf_t *fbuf);
2941 
2942 
2955 void fBufSetBuffer(
2956  fBuf_t *fbuf,
2957  uint8_t *buf,
2958  size_t buflen);
2959 
2960 
2984 gboolean fBufAppend(
2985  fBuf_t *fbuf,
2986  uint8_t *recbase,
2987  size_t recsize,
2988  GError **err);
2989 
2999 gboolean fBufEmit(
3000  fBuf_t *fbuf,
3001  GError **err);
3002 
3014 void fBufSetExportTime(
3015  fBuf_t *fbuf,
3016  uint32_t extime);
3017 
3031  fbSession_t *session,
3032  fbCollector_t *collector);
3033 
3044  fBuf_t *fbuf);
3045 
3056 void fBufSetCollector(
3057  fBuf_t *fbuf,
3058  fbCollector_t *collector);
3059 
3089 gboolean fBufNext(
3090  fBuf_t *fbuf,
3091  uint8_t *recbase,
3092  size_t *recsize,
3093  GError **err);
3094 
3108 gboolean fBufNextMessage(
3109  fBuf_t *fbuf,
3110  GError **err);
3111 
3119 uint32_t fBufGetExportTime(
3120  fBuf_t *fbuf);
3121 
3142  fBuf_t *fbuf,
3143  uint16_t *ext_tid);
3144 
3164  fBuf_t *fbuf,
3165  uint16_t *ext_tid,
3166  GError **err);
3167 
3181 
3190 void fbInfoModelFree(
3191  fbInfoModel_t *model);
3192 
3208  fbInfoModel_t *model,
3209  fbInfoElement_t *ie);
3210 
3230  fbInfoModel_t *model,
3231  fbInfoElement_t *ie);
3232 
3263 gboolean fbInfoModelReadXMLFile(
3264  fbInfoModel_t *model,
3265  const gchar *filename,
3266  GError **error);
3267 
3299 gboolean fbInfoModelReadXMLData(
3300  fbInfoModel_t *model,
3301  const gchar *xml_data,
3302  gssize xml_data_len,
3303  GError **error);
3304 
3317  fbInfoModel_t *model,
3318  const char *name);
3319 
3334  fbInfoModel_t *model,
3335  uint16_t id,
3336  uint32_t ent);
3337 
3346  const fbInfoModel_t *model);
3347 
3355 void fbInfoModelIterInit(
3356  fbInfoModelIter_t *iter,
3357  const fbInfoModel_t *model);
3358 
3370  fbInfoModelIter_t *iter);
3371 
3386  fbInfoModel_t *model,
3387  GError **err);
3388 
3404  fBuf_t *fbuf,
3405  const fbInfoElement_t *model_ie,
3406  uint16_t itid,
3407  uint16_t etid,
3408  GError **err);
3409 
3422  fbInfoModel_t *model,
3423  fbInfoElementOptRec_t *rec);
3424 
3434 gboolean fbInfoModelTypeInfoRecord(
3435  fbTemplate_t *tmpl);
3436 
3455  fbInfoModel_t *model);
3456 
3473 gboolean fbTemplateAppend(
3474  fbTemplate_t *tmpl,
3475  fbInfoElement_t *ex_ie,
3476  GError **err);
3477 
3493 gboolean fbTemplateAppendSpec(
3494  fbTemplate_t *tmpl,
3495  fbInfoElementSpec_t *spec,
3496  uint32_t flags,
3497  GError **err);
3498 
3516 gboolean fbTemplateAppendSpecArray(
3517  fbTemplate_t *tmpl,
3518  fbInfoElementSpec_t *spec,
3519  uint32_t flags,
3520  GError **err);
3521 
3529 uint32_t fbTemplateCountElements(
3530  fbTemplate_t *tmpl);
3531 
3542  fbTemplate_t *tmpl,
3543  uint16_t scope_count);
3544 
3552 uint32_t fbTemplateGetOptionsScope(
3553  fbTemplate_t *tmpl);
3554 
3566 gboolean fbTemplateContainsElement(
3567  fbTemplate_t *tmpl,
3568  const fbInfoElement_t *ex_ie);
3569 
3580  fbTemplate_t *tmpl,
3581  fbInfoElementSpec_t *spec);
3582 
3593  fbTemplate_t *tmpl,
3594  fbInfoElementSpec_t *spec);
3595 
3607  fbTemplate_t *tmpl,
3608  fbInfoElementSpec_t *spec,
3609  uint32_t flags);
3610 
3620  fbTemplate_t *tmpl,
3621  uint32_t IEindex);
3622 
3623 
3632  fbTemplate_t *tmpl);
3633 
3642  fbTemplate_t *tmpl);
3643 
3651 void *fbTemplateGetContext(
3652  fbTemplate_t *tmpl);
3653 
3672  fbInfoModel_t *model);
3673 
3684  fbSession_t *session,
3685  gboolean enabled,
3686  GError **err);
3687 
3697  fbSession_t *session,
3698  gboolean enabled,
3699  GError **err);
3700 
3717  fbSession_t *session,
3718  gboolean internal,
3719  uint16_t tid,
3720  fbTemplate_t *tmpl,
3721  const char *name,
3722  const char *description,
3723  GError **err);
3724 
3736  fbSession_t *session,
3737  uint16_t tid,
3738  const char *name,
3739  const char *description,
3740  GError **err);
3741 
3751  fbSession_t *session);
3752 
3781  fbSession_t *session,
3782  fbNewTemplateCallback_fn callback,
3783  void *app_ctx);
3784 
3809  fbSession_t *session,
3810  uint16_t ent_tid,
3811  uint16_t int_tid);
3812 
3823  fbSession_t *session,
3824  uint16_t ext_tid);
3825 
3835  fbSession_t *session,
3836  uint16_t ext_tid);
3837 
3847 void fbSessionFree(
3848  fbSession_t *session);
3849 
3863  fbSession_t *session);
3864 
3880 void fbSessionSetDomain(
3881  fbSession_t *session,
3882  uint32_t domain);
3883 
3891 uint32_t fbSessionGetDomain(
3892  fbSession_t *session);
3893 
3902  fbSession_t *session);
3903 
3904 #if HAVE_SPREAD
3905 
3927 uint16_t fbSessionAddTemplatesMulticast(
3928  fbSession_t *session,
3929  char **groups,
3930  gboolean internal,
3931  uint16_t tid,
3932  fbTemplate_t *tmpl,
3933  GError **err);
3934 
3959 uint16_t fbSessionAddTemplatesMulticastWithMetadata(
3960  fbSession_t *session,
3961  char **groups,
3962  gboolean internal,
3963  uint16_t tid,
3964  fbTemplate_t *tmpl,
3965  char *name,
3966  char *description,
3967  GError **err);
3968 
3984 gboolean fbSessionSpreadEnableTemplateMetadata(
3985  fbSession_t *session,
3986  char **groups,
3987  gboolean enabled,
3988  GError **err);
3989 
4004 gboolean fbSessionSpreadEnableTypeMetadata(
4005  fbSession_t *session,
4006  char **groups,
4007  gboolean enabled,
4008  GError **err);
4009 
4010 #endif
4011 
4024 gboolean fbSessionExportTemplate(
4025  fbSession_t *session,
4026  uint16_t tid,
4027  GError **err);
4028 
4040 gboolean fbSessionExportTemplates(
4041  fbSession_t *session,
4042  GError **err);
4043 
4062 uint16_t fbSessionAddTemplate(
4063  fbSession_t *session,
4064  gboolean internal,
4065  uint16_t tid,
4066  fbTemplate_t *tmpl,
4067  GError **err);
4068 
4081 gboolean fbSessionRemoveTemplate(
4082  fbSession_t *session,
4083  gboolean internal,
4084  uint16_t tid,
4085  GError **err);
4086 
4099  fbSession_t *session,
4100  gboolean internal,
4101  uint16_t tid,
4102  GError **err);
4103 
4117  fbConnSpec_t *spec);
4118 
4119 #if HAVE_SPREAD
4120 
4131 int fbCollectorGetSpreadReturnGroups(
4132  fbCollector_t *collector,
4133  char *groups[]);
4134 
4148 fbExporter_t *fbExporterAllocSpread(
4149  fbSpreadParams_t *params );
4150 
4151 #endif /* HAVE_SPREAD */
4152 
4165  const char *path);
4166 
4177  uint8_t *buf,
4178  uint16_t bufsize);
4179 
4180 
4190  FILE *fp);
4191 
4204 void fbExporterSetStream(
4205  fbExporter_t *exporter,
4206  int sctp_stream);
4207 
4221  fbExporter_t *exporter);
4222 
4230 void fbExporterClose(
4231  fbExporter_t *exporter);
4232 
4239 size_t fbExporterGetMsgLen(
4240  fbExporter_t *exporter);
4241 
4255  void *ctx,
4256  const char *path,
4257  GError **err);
4258 
4270  void *ctx,
4271  FILE *fp);
4272 
4273 
4274 #if HAVE_SPREAD
4275 
4285 fbCollector_t *fbCollectorAllocSpread(
4286  void *ctx,
4287  fbSpreadParams_t *params,
4288  GError **err );
4289 
4290 #endif /* HAVE_SPREAD */
4291 
4302 void *fbCollectorGetContext(
4303  fbCollector_t *collector);
4304 
4315 void fbCollectorClose(
4316  fbCollector_t *collector);
4317 
4318 
4331  fbCollector_t *collector,
4332  struct sockaddr *address,
4333  size_t address_length);
4334 
4364  fbConnSpec_t *spec,
4365  fbSession_t *session,
4366  fbListenerAppInit_fn appinit,
4367  fbListenerAppFree_fn appfree,
4368  GError **err);
4369 
4377 void fbListenerFree(
4378  fbListener_t *listener);
4379 
4403  fbListener_t *listener,
4404  GError **err);
4405 
4417  fbListener_t *listener,
4418  GError **err);
4419 
4427 void fbListenerInterrupt(
4428  fbListener_t *listener);
4429 
4430 
4446 gboolean fbListenerGetCollector(
4447  fbListener_t *listener,
4448  fbCollector_t **collector,
4449  GError **err);
4450 
4451 
4452 
4453 
4470  fbCollector_t *collector,
4471  GError **err);
4472 
4473 
4490  fbCollector_t *collector,
4491  GError **err);
4492 
4493 
4510  fbCollector_t *collector,
4511  GError **err);
4512 
4534  fbCollector_t *collector,
4535  struct sockaddr *peer,
4536  size_t peerlen,
4537  uint32_t obdomain);
4538 
4556 uint32_t fbCollectorGetSFlowMissed(
4557  fbCollector_t *collector,
4558  struct sockaddr *peer,
4559  size_t peerlen,
4560  uint32_t obdomain);
4561 
4568 struct sockaddr* fbCollectorGetPeer(
4569  fbCollector_t *collector);
4570 
4581  fbCollector_t *collector);
4582 
4596  fbCollector_t *collector,
4597  gboolean multi_session);
4598 
4599 
4600 #ifdef __cplusplus
4601 } /* extern "C" */
4602 #endif
4603 
4604 #endif
The &quot;signed32&quot; data type: An integer value in the range of -2_147_483_648 to 2_147_483_647.
Definition: public.c:1424
uint32_t ent
Private Enterprise Number.
Definition: public.c:1506
void fbSubTemplateMultiListClearEntries(fbSubTemplateMultiList_t *STML)
Clears the memory used by the entries of a sub template multi list NOTE: if any of those entries cont...
struct fbInfoElement_st * canon
Pointer to canonical copy of IE.
Definition: public.c:1491
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocate a new empty template.
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Append a record to a buffer.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListAddNewEntries(fbSubTemplateMultiList_t *STML, uint16_t numNewEntries)
Adds entries to the multi list of entries can only be run after the list has been initialized...
uint32_t ie_pen
private enterprise number
Definition: public.c:1535
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the semantic field for the multi list.
A variable-length field value.
Definition: public.c:1059
void fbExporterClose(fbExporter_t *exporter)
Force the file or socket underlying an exporting process endpoint to close.
uint32_t fbCollectorGetObservationDomain(fbCollector_t *collector)
Retrieves the observation domain of the node connected to the UDP collector.
size_t fBufRemaining(fBuf_t *fbuf)
Retrieve the length of the buffer that is remaining after processing.
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocate a new buffer for collection.
void * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateListPtr)
Returns a pointer to the buffer that contains the data for the list.
void fbListenerInterrupt(fbListener_t *listener)
Cause the current or next call to fbListenerWait to unblock and return.
uint64_t ie_range_begin
ie range min
Definition: public.c:1547
uint16_t numElements
number of elements in the list
Definition: public.c:2101
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP but for TLS (not tested)
void fbBasicListClear(fbBasicList_t *basicListPtr)
Clear the parameters of the basic list and free the data buffer.
uint64_t min
range min
Definition: public.c:1518
The &quot;subTemplateMultiList&quot; data type: A structured data element as described in RFC6313, Section 4.5.3.
Definition: public.c:1472
fbTemplate_t * fBufGetCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid)
Retrieve the external template used to read the last record from the buffer.
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.c:1051
uint64_t ie_range_end
ie range max
Definition: public.c:1549
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.c:2735
The &quot;unsigned16&quot; data type: A non-negative integer value in the range of 0 to 65535 (0xffff)...
Definition: public.c:1408
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.c:2327
void fbSessionFree(fbSession_t *session)
Free a transport session state container.
void fbTemplateSetOptionsScope(fbTemplate_t *tmpl, uint16_t scope_count)
Set the number of information elements in a template that are scope.
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.c:1737
The &quot;dateTimeSeconds&quot; data type: An unsigned 32-bit integer containing the number of seconds since th...
Definition: public.c:1445
uint8_t fbSubTemplateListGetSemantic(fbSubTemplateList_t *subTemplateListPtr)
Gets the semantic value from a sub template list.
uint32_t fBufGetExportTime(fBuf_t *fbuf)
Retrieve the export time on the message currently in a buffer.
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.c:1077
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
Definition: public.c:2336
The &quot;macAddress&quot; data type: A MAC-48 address as a string of 6 octets.
Definition: public.c:1438
fbListenerGroupResult_t * next
Pointer to the next listener group result.
Definition: public.c:1779
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieve a record from a buffer.
fbExporter_t * fbExporterAllocFile(const char *path)
Allocate an exporting process endpoint for a named file.
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateListPtr)
Clears a subtemplate list struct, notably freeing the dataPtr and setting it to NULL.
void fBufFree(fBuf_t *fbuf)
Free a buffer.
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.c:2103
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.c:1647
char * host
Hostname to connect/listen to.
Definition: public.c:1669
gboolean fbTemplateAppendSpecArray(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Append information elements described by a specifier array to a template.
void fbInfoModelAddElement(fbInfoModel_t *model, fbInfoElement_t *ie)
Add a single information element to an information model.
size_t dataLength
length of the buffer used to hold the data in this entry
Definition: public.c:2325
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Set the internal template on a buffer to the given template ID.
size_t len
Length of content in buffer.
Definition: public.c:1061
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.c:1889
fbSession_t * fBufGetSession(fBuf_t *fbuf)
Retrieve the session associated with a buffer.
void fBufListFree(fbTemplate_t *tmpl, uint8_t *record)
Clear all of the memory that fixbuf allocated during transcode of this record.
gboolean fbInfoModelReadXMLData(fbInfoModel_t *model, const gchar *xml_data, gssize xml_data_len, GError **error)
Add information specified in the given XML data to the information model.
void fbBasicListCollectorInit(fbBasicList_t *basicListPtr)
Initializes a basic list structure for collection.
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.c:1727
fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.c:2321
uint8_t fbSubTemplateMultiListGetSemantic(fbSubTemplateMultiList_t *STML)
Get the semantic paramter from the multi list.
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates a subTemplateMultiList_t Based on how subTemplateMultiLists will be used and set up amidst ...
fbInfoModel_t * fbSessionGetInfoModel(fbSession_t *session)
fbSessionGetInfoModel
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Set the export time on the message currently in a buffer.
uint32_t fbTemplateCountElements(fbTemplate_t *tmpl)
Determine number of information elements in a template.
uint16_t num
Information Element number.
Definition: public.c:1511
void fbSessionAddTemplatePair(fbSession_t *session, uint16_t ent_tid, uint16_t int_tid)
Adds an external-internal template pair to the session.
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.c:1746
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list, then frees the memory pointed to by STML.
void * fbBasicListInitWithOwnBuffer(fbBasicList_t *basicListPtr, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements, uint16_t dataLength, uint8_t *dataPtr)
use this function to initialize the basic list, but it gets the pointer to a buffer and its length al...
uint16_t numElements
number of elements in the list
Definition: public.c:1887
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.c:2323
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateListPtr)
Frees and clears a subTemplateList struct.
struct fbInfoModelIter_st fbInfoModelIter_t
An iterator over the information elements in an information model.
The &quot;signed64&quot; data type: An integer value in the range of -9_223_372_036_854_775_808 to 9_223_372_03...
Definition: public.c:1427
uint16_t len
Information element length in octets.
Definition: public.c:1513
void fbBasicListClearWithoutFree(fbBasicList_t *basicList)
Clear the parameters of the basic list, but do not free the buffer.
uint32_t fbTemplateGetOptionsScope(fbTemplate_t *tmpl)
Determine number of scope information elements in a template.
const char * description
description
Definition: public.c:1524
The &quot;ipv6Address&quot; data type: A value of an IPv6 address.
Definition: public.c:1463
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
The &quot;basicList&quot; data type: A structured data element as described in RFC6313, Section 4...
Definition: public.c:1466
char * ssl_ca_file
Path to certificate authority file.
Definition: public.c:1673
The &quot;string&quot; data type: A finite-length string of valid characters from the Unicode character encodin...
Definition: public.c:1441
struct fbBasicList_st fbBasicList_t
A basic list element in a template which structure represents a basic list on the internal side...
The &quot;boolean&quot; data type: A binary value: &quot;true&quot; or &quot;false&quot;.
Definition: public.c:1435
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocate a collecting process endpoint for an open file.
fbExporter_t * fbExporterAllocNet(fbConnSpec_t *spec)
Allocate an exporting process endpoint for a network connection.
void fbSessionResetExternal(fbSession_t *session)
Reset the external state (sequence numbers and templates) in a session state container.
Partially reliable datagram transport via SCTP.
Definition: public.c:1637
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListRealloc(fbSubTemplateMultiList_t *STML, uint16_t newNumEntries)
Clears the entries used by the multi list, then if newNumElements is different than numElements...
uint8_t padding[6]
padding to align with template
Definition: public.c:1545
gboolean fbSessionEnableTypeMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configure a session to export type information for enterprise-specific information elements as option...
The &quot;subTemplateList&quot; data type: A structured data element as described in RFC6313, Section 4.5.2.
Definition: public.c:1469
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocate a new buffer for export.
fbTemplate_t * fBufNextCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid, GError **err)
Retrieve the external template that will be used to read the next record from the buffer...
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
fbCollectorSetSFlowTranslator
gboolean fbSessionSetTemplateMetadata(fbSession_t *session, uint16_t tid, const char *name, const char *description, GError **err)
Add template metadata for a given template.
const fbInfoElement_t * fbBasicListGetInfoElement(fbBasicList_t *basicListPtr)
This function returns a pointer to the information element used in the list it is mainly used in coll...
uint32_t flags
Application flags word.
Definition: public.c:1619
void fbInfoModelAddElementArray(fbInfoModel_t *model, fbInfoElement_t *ie)
Add multiple information elements in an array to an information model.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(fbSubTemplateMultiList_t *STML)
Retrieve the first entry in the multi list.
uint8_t ie_type
ie data type
Definition: public.c:1539
void fbBasicListSetSemantic(fbBasicList_t *basicListPtr, uint8_t semantic)
Sets the semantic for describing a basic list generally used in exporters before decoding.
uint16_t numElements
number of sub template lists in the multi list
Definition: public.c:2340
The &quot;ipv4Address&quot; data type: A value of an IPv4 address.
Definition: public.c:1461
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
fbCollectorSetNetflowV9Translator
void fbListenerFree(fbListener_t *listener)
Free a listener.
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
guint index
iterator index
Definition: public.c:1090
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocate a collecting process endpoint for a named file.
void * fbSubTemplateMultiListEntryRealloc(fbSubTemplateMultiListEntry_t *entry, uint16_t newNumElements)
Frees the memory for the data used by the entry, then allocates a new buffer based on the size of the...
ListenerEntry&#39;s make up a listener group as a linked list.
Definition: public.c:1756
gboolean fbTemplateAppend(fbTemplate_t *tmpl, fbInfoElement_t *ex_ie, GError **err)
Append an information element to a template.
fbInfoModel_t * fbInfoModelAlloc(void)
Allocate a new information model.
void * fbCollectorGetContext(fbCollector_t *collector)
Retrieve the application context associated with a collector.
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Set a buffer on an fBuf for collection.
uint8_t * dataPtr
pointer to the buffer used to hold the data
Definition: public.c:2097
ListenerGroupResult&#39;s contain the listener who&#39;s listening socket got a new connection.
Definition: public.c:1776
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
uint16_t fbSessionAddTemplateWithMetadata(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, const char *name, const char *description, GError **err)
Add a template to the session with the provided metadata.
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Return the number of information elements in the information model.
Reliable stream transport via TCP.
Definition: public.c:1639
void fbCollectorClose(fbCollector_t *collector)
Close the file or socket underlying a collecting process endpoint.
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.c:1689
fbVarfield_t ie_name
information element name
Definition: public.c:1551
uint8_t semantic
value used to describe the list of sub templates
Definition: public.c:2342
The &quot;dateTimeMilliseconds&quot; data type: An unsigned 64-bit integer containing the number of millisecond...
Definition: public.c:1449
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Free a template if it is not currently in use by any Session.
Structure used to hold information of a sub template list.
Definition: public.c:2087
Unreliable datagram transport via UDP.
Definition: public.c:1641
uint32_t midx
Multiple IE index.
Definition: public.c:1504
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.c:1763
char * ssl_cert_file
Path to certificate file.
Definition: public.c:1675
char * ssl_key_pass
Private key decryption password.
Definition: public.c:1679
fbTemplate_t * fbSessionGetTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieve a template from a session by ID.
An iterator over the information elements in an information model.
Definition: public.c:1082
void * fbBasicListInit(fbBasicList_t *basicListPtr, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes the basic list structure based on the parameters.
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateListPtr)
Clears the sub template list parameters but does not free the data ptr.
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emit the message currently in a buffer using the associated exporting process endpoint.
void * fbBasicListGetIndexedDataPtr(fbBasicList_t *basicListPtr, uint16_t bl_index)
Function retrieves the index&#39;th element in the list index is 0-based.
void * fbBasicListRealloc(fbBasicList_t *basicList, uint16_t newNumElements)
Free the current data pointer, allocating a new buffer to accomodate the new number of elements...
uint16_t fbSessionLookupTemplatePair(fbSession_t *session, uint16_t ext_tid)
Function to find a pair, uniquely identified by the external ID, and return the associated internal t...
struct fbInfoElementOptRec_st fbInfoElementOptRec_t
The corresponding struct to the Information Element Type Options Template.
union fbSubTemplateList_st::@2 dataLength
length of the allocated buffer used to hold the data
char * ssl_key_file
Path to private key file.
Definition: public.c:1677
uint16_t tmplID
ID of the template used to structure the data.
Definition: public.c:2099
struct fbVarfield_st fbVarfield_t
A variable-length field value.
fbExporter_t * fBufGetExporter(fBuf_t *fbuf)
Retrieve the exporting process endpoint associated with a buffer.
The &quot;float32&quot; data type: An IEEE single-precision 32-bit floating point type.
Definition: public.c:1430
void * fbSubTemplateListGetNextPtr(const fbSubTemplateList_t *subTemplateListPtr, void *currentPtr)
This function also traverses the elements in the list by accepting a pointer to the last element the ...
size_t fbExporterGetMsgLen(fbExporter_t *exporter)
Get the (transcoded) message length that was copied to the exporting buffer upon fBufEmit().
void fbBasicListFree(fbBasicList_t *basicListPtr)
Clear the basic list, then free the basic list pointer.
const fbTemplate_t * fbSubTemplateListGetTemplate(fbSubTemplateList_t *subTemplateListPtr)
Gets the template pointer from the list structure.
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.c:1801
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initialize an information model iterator for iteration.
uint16_t fbSubTemplateMultiListEntryGetTemplateID(fbSubTemplateMultiListEntry_t *entry)
Retrieve the template ID for the template used to structure the data.
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
uint16_t fbSubTemplateListGetTemplateID(fbSubTemplateList_t *subTemplateListPtr)
Gets the template ID for the template used by the list.
gboolean fbTemplateContainsAllFlaggedElementsByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags)
Determine if a template contains at least one instance of each information element in a given informa...
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Set the current observation domain on a session.
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition: public.c:2750
The corresponding struct to the Information Element Type Options Template.
Definition: public.c:1533
void fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associate an exporting process endpoint with a buffer.
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t numNewElements)
Allocates an additional element into the basic list must be called after calling BasicListInit.
fbListener_t * fbListenerAlloc(fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocate a listener.
void * fbSubTemplateMultiListEntryInit(fbSubTemplateMultiListEntry_t *entry, uint16_t tmplID, fbTemplate_t *tmpl, uint16_t numElements)
Initializes the multi list entry with the template values, and allocates the memory used by the entry...
uint32_t flags
Flags.
Definition: public.c:1516
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Set the automatic mode flag on a buffer.
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *STL)
Initializes a sub template list variable on a collector.
gboolean fbInfoElementWriteOptionsRecord(fBuf_t *fbuf, const fbInfoElement_t *model_ie, uint16_t itid, uint16_t etid, GError **err)
Export an options record to the given fbuf with information element type information about the given ...
uint16_t numElements
number of elements in this entry
Definition: public.c:2329
const fbTemplate_t * tmpl
pointer to the template used to structure the data
Definition: public.c:2095
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocate a transport session state container.
void fbExporterAutoStream(fbExporter_t *exporter)
Enable automatic SCTP stream selection for the next message exported.
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListInit(fbSubTemplateMultiList_t *STML, uint8_t semantic, uint16_t numElements)
Initializes the multi list with semantic, numbers of elements, and allocates memory to store numEleme...
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
Definition: public.c:2319
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 * fbInfoElementAllocTypeTemplate(fbInfoModel_t *model, GError **err)
Allocate the Options Template that will be used to define Information Element Type Records...
void * fbBasicListGetNextPtr(fbBasicList_t *basicListPtr, void *currentPtr)
Function returns the next element in the list based on the currentPtr.
fbVarfield_t ie_desc
information element description
Definition: public.c:1553
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.c:1783
void * fbSubTemplateListInit(fbSubTemplateList_t *sTL, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes a subTemplateList structure and alloc&#39;s the dataPtr to get a buffer able to hold numEleme...
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
fbBasicList_t * fbBasicListAlloc(void)
allocates a Basic List Structure
gboolean fbTemplateContainsElement(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie)
Determine if a template contains a given information element.
fbTransport_en
Transport protocol for connection specifier.
Definition: public.c:1632
uint32_t fbCollectorGetSFlowMissed(fbCollector_t *collector, struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
fbCollectorGetSFlowMissed
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocate an exporting process for a buffer.
void * fbTemplateGetContext(fbTemplate_t *tmpl)
Get the ctx pointer associated with a Template.
const fbInfoElement_t * fbInfoModelGetElementByID(fbInfoModel_t *model, uint16_t id, uint32_t ent)
Return a pointer to the canonical information element within an information model given the informati...
fbCollector_t * fBufGetCollector(fBuf_t *fbuf)
Retrieve the collecting process endpoint associated with a buffer.
Fixbuf&#39;s version information.
union fbInfoElement_st::@1 ref
Information element name.
gboolean fbInfoModelTypeInfoRecord(fbTemplate_t *tmpl)
Checks to see if the template contains all of the elements the RFC 5610 info element type record shou...
The &quot;signed8&quot; data type: An integer value in the range of -128 to 127.
Definition: public.c:1418
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
Set the automatic insert flag on a buffer.
fbTransport_t transport
Transport protocol to use.
Definition: public.c:1667
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocate an exporting process endpoint for an opened ANSI C file pointer.
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Read a new message into a buffer using the associated collecting process endpoint.
The &quot;unsigned8&quot; data type: A non-negative integer value in the range of 0 to 255 (0xff).
Definition: public.c:1405
gboolean fBufSetExportTemplate(fBuf_t *fbuf, uint16_t ext_tid, GError **err)
Set the external template for export on a buffer to the given template ID.
void fbCollectorSetAcceptOnly(fbCollector_t *collector, struct sockaddr *address, size_t address_length)
Set the collector to only receive from the given IP address over UDP.
void * fbSubTemplateListAddNewElements(fbSubTemplateList_t *subTemplateList, uint16_t numNewElements)
Allocates space for a number of additional element in the sub template list must be called after the ...
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Free the fbListenerGroupResult_t returned from fbListenerGroupWait.
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Remove a template from a session.
gboolean fbInfoElementAddOptRecElement(fbInfoModel_t *model, fbInfoElementOptRec_t *rec)
Add an element that we received via an Options Record to the given info model.
void fBufSetCollector(fBuf_t *fbuf, fbCollector_t *collector)
Associate an collecting process endpoint with a buffer.
gboolean fbTemplateContainsAllElementsByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determine if a template contains at least one instance of each information element in a given informa...
uint16_t ie_id
information element id
Definition: public.c:1537
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.c:1658
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...
uint8_t * buf
Content buffer.
Definition: public.c:1068
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetIndexedEntry(fbSubTemplateMultiList_t *STML, uint16_t index)
Retrieve a pointer to the entry of a specific index.
gboolean fbSessionEnableTemplateMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configure a session to export template metadata as options records.
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition: public.c:1885
The &quot;signed16&quot; data type: An integer value in the range of -32768 to 32767.
Definition: public.c:1421
fbListenerEntry_t * next
pointer to the next listener entry in the linked list
Definition: public.c:1759
gboolean fbListValidSemantic(uint8_t semantic)
validates the value of the semantic field,
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Export a single external template in the current domain of a given session.
void * fbSubTemplateListGetIndexedDataPtr(const fbSubTemplateList_t *subTemplateListPtr, uint16_t index)
This function is used to iterate over the elements in the list by passing in a counter to indicate wh...
const fbInfoModel_t * model
information Model
Definition: public.c:1086
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, GError **err)
Add a template to a session.
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.c:1399
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait, except that this function doesn&#39;t monitor...
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetNextEntry(fbSubTemplateMultiList_t *STML, fbSubTemplateMultiListEntry_t *currentEntry)
This function also traverses the elements in the list by accepting a pointer to the last element the ...
The &quot;unsigned64&quot; data type: A non-negative integer value in the range of 0 to 1_844_674_407_370_955_1...
Definition: public.c:1415
An IPFIX template or options template structure.
Definition: private.h:187
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Set the SCTP stream for the next message exported.
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.c:1629
void * fbSubTemplateMultiListEntryNextDataPtr(fbSubTemplateMultiListEntry_t *entry, void *currentPtr)
This function traverses the elements in the entry by accepting a pointer to the last element the user...
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition: public.c:2338
void * fbSubTemplateMultiListEntryGetIndexedPtr(fbSubTemplateMultiListEntry_t *entry, uint16_t index)
Returns a pointer to a data element in the entry based on the index.
The &quot;octetArray&quot; data type: A finite-length string of octets.
Definition: public.c:1402
void(* fbNewTemplateCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void *app_ctx, void **tmpl_ctx, fbTemplateCtxFree_fn *fn)
A callback function that will be called when the session receives a new external template.
Definition: public.c:1828
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Similar to fbListenerWait, except that is looks for connections for multiple listeners.
void fbListenerGroupFree(fbListenerGroup_t *group)
frees a listener group
uint8_t fbBasicListGetSemantic(fbBasicList_t *basicListPtr)
Get Semantic field for Basic List presumably used in collectors after decoding.
uint16_t ie_units
ie units
Definition: public.c:1543
void * fbSubTemplateMultiListEntryGetDataPtr(fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
uint32_t fbCollectorGetNetflowMissed(fbCollector_t *collector, struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
fbCollectorGetNetflowMissed
gboolean fbTemplateContainsElementByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determine if a template contains at least one instance of a given information element, specified by name in the template&#39;s information model.
The &quot;unsigned32&quot; data type: A non-negative integer value in the range of 0 to 4_294_967_295 (0xffffff...
Definition: public.c:1411
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
fbCollectorClearTranslator
uint32_t fbSessionGetDomain(fbSession_t *session)
Retrieve the current domain on a session.
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns a fbListenerGroup with no entries.
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates a subTemplateList_t Based on how subTemplateLists will be used and set up amidst data struc...
struct sockaddr * fbCollectorGetPeer(fbCollector_t *collector)
Retrieves information about the node connected to this collector.
A basic list element in a template which structure represents a basic list on the internal side...
Definition: public.c:1881
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
Connection specifier.
Definition: public.c:1665
fbInfoElement_t * fbTemplateGetIndexedIE(fbTemplate_t *tmpl, uint32_t IEindex)
Return the information element in the template referenced by the index.
void * fbSubTemplateListInitWithOwnBuffer(fbSubTemplateList_t *subTemplateList, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements, uint16_t dataLength, uint8_t *dataPtr)
Initializes the subTemplateList but does not allocate a buffer.
The &quot;dateTimeMicroseconds&quot; data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.c:1454
The &quot;dateTimeMicroseconds&quot; data type: Two 32-bit fields where the first is the number seconds since t...
Definition: public.c:1459
uint64_t max
range max
Definition: public.c:1520
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.c:1781
uint16_t len_override
The size of the information element in bytes.
Definition: public.c:1612
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Export all external templates in the current domain of a given session.
gboolean fbListenerGetCollector(fbListener_t *listener, fbCollector_t **collector, GError **err)
fbListenerGetCollector
The &quot;float64&quot; data type: An IEEE double-precision 64-bit floating point type.
Definition: public.c:1433
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory pointed to by the data buffer holding the data elements.
void * vai
Pointer to address info cache.
Definition: public.c:1684
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(fbSubTemplateMultiListEntry_t *entry)
Retrieve the template pointer used to structure the data elements.
fbCollector_t * fbSessionGetCollector(fbSession_t *session)
Retrieve collector that was created with the session.
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Return a pointer to the next information element in the information model.
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Attempt to maintain backwards compatibility with UDP.
const fbInfoElement_t * infoElement
pointer to the information element that is repeated in the list
Definition: public.c:1883
void * fbSubTemplateListRealloc(fbSubTemplateList_t *subTemplateList, uint16_t newNumElements)
Free the current data pointer, allocating a new buffer to accomodate the new number of elements...
void fbInfoModelFree(fbInfoModel_t *model)
Free an information model.
A single IPFIX Information Element definition.
Definition: public.c:1483
char * name
Information element name.
Definition: public.c:1600
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateListPtr, uint8_t semantic)
Sets the semantic parameter of a subTemplateList.
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Wait on a listener.
uint8_t semantic
semantic field to describe the list
Definition: public.c:1891
Secure, reliable stream transport via TLS over TCP.
Definition: public.c:1652
const char * name
Information element name.
Definition: public.c:1496
uint8_t type
Data Type.
Definition: public.c:1522
void * fbBasicListGetDataPtr(fbBasicList_t *basicListPtr)
struct fbSubTemplateMultiList_st fbSubTemplateMultiList_t
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t numNewElements)
Allocates space for a number of additional elements in the sub template multi list entry...
A single IPFIX Information Element specification.
Definition: public.c:1598
char * svc
Service name or port number to connect/listen to.
Definition: public.c:1671
fbListenerEntry_t * prev
pointer to the previous listener entry in the linked list
Definition: public.c:1761
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Append an information element described by specifier to a template.
struct fbSubTemplateList_st fbSubTemplateList_t
Structure used to hold information of a sub template list.
uint8_t ie_semantic
ie semantic
Definition: public.c:1541
void fbSessionRemoveTemplatePair(fbSession_t *session, uint16_t ext_tid)
remove a template pair from the list this is called by fixbuf when a template is revoked from the ses...
struct fbSubTemplateMultiListEntry_st fbSubTemplateMultiListEntry_t
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
struct fbListenerGroup_st fbListenerGroup_t
Structure that holds the listeners that are added to the group.
Definition: public.c:1790
const fbInfoElement_t * fbInfoModelGetElementByName(fbInfoModel_t *model, const char *name)
Return a pointer to the canonical information element within an information model given the informati...
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Clears all of the entries (frees their data pointers), then frees the memory containing the entries...
fbInfoModel_t * fbTemplateGetInfoModel(fbTemplate_t *tmpl)
Return the information model, as understood by the template.
gboolean fbInfoModelReadXMLFile(fbInfoModel_t *model, const gchar *filename, GError **error)
Add information specified in the given XML file to the information model.