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  ** Use of the libfixbuf system and related source code is subject to the terms
11  ** of the following licenses:
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® and CERT® are registered in the U.S. Patent and
33  ** Trademark Office by Carnegie Mellon University.
34  **
35  ** ------------------------------------------------------------------------
36  */
37 
921 #ifndef _FB_PUBLIC_H_
922 #define _FB_PUBLIC_H_
923 #include <fixbuf/autoinc.h>
924 #include "version.h"
925 
926 #ifdef __cplusplus
927 extern "C" {
928 #endif
929 
930 
931 /*
932  * Version check macro
933  */
934 #define FIXBUF_CHECK_VERSION(major, minor, release) \
935  (FIXBUF_VERSION_MAJOR > (major) || \
936  (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR > (minor)) || \
937  (FIXBUF_VERSION_MAJOR == (major) && FIXBUF_VERSION_MINOR == (minor) && \
938  FIXBUF_VERSION_RELEASE >= (release)))
939 
940 /*
941  * Error Handling Definitions
942  */
943 
945 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
946 
947 #define FB_ERROR_TMPL 1
948 
952 #define FB_ERROR_EOM 2
953 
958 #define FB_ERROR_EOF 3
959 
963 #define FB_ERROR_IPFIX 4
964 
969 #define FB_ERROR_BUFSZ 5
970 
971 #define FB_ERROR_IMPL 6
972 
973 #define FB_ERROR_IO 7
974 
978 #define FB_ERROR_NLREAD 8
979 
984 #define FB_ERROR_NLWRITE 9
985 
988 #define FB_ERROR_NOELEMENT 10
989 
992 #define FB_ERROR_CONN 11
993 
997 #define FB_ERROR_NETFLOWV9 12
998 
1001 #define FB_ERROR_TRANSMISC 13
1002 
1005 #define FB_ERROR_SFLOW 14
1006 
1009 #define FB_ERROR_SETUP 15
1010 
1013 #define FB_ERROR_LAXSIZE 16
1014 
1015 /*
1016  * Public Datatypes and Constants
1017  */
1018 
1019 struct fBuf_st;
1025 typedef struct fBuf_st fBuf_t;
1026 
1033 typedef struct fbVarfield_st {
1035  size_t len;
1042  uint8_t *buf;
1043 } fbVarfield_t;
1044 
1045 
1046 struct fbInfoModel_st;
1051 typedef struct fbInfoModel_st fbInfoModel_t;
1052 
1056 typedef struct fbInfoModelIter_st {
1064  guint index;
1066 
1072 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_)\
1073  { {(const struct fbInfoElement_st*)_name_}, 0, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_ }
1074 
1080 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
1081  FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char*)NULL)
1082 
1083 
1089 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
1090 
1096 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
1097 
1103 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
1104 
1109 #define FB_IE_F_NONE 0x00000000
1110 
1115 #define FB_IE_F_ENDIAN 0x00000001
1116 
1126 #define FB_IE_F_REVERSIBLE 0x00000040
1127 
1135 #define FB_IE_F_ALIEN 0x00000080
1136 
1141 #define FB_IE_QUANTITY 0x00000100
1142 
1148 #define FB_IE_TOTALCOUNTER 0x00000200
1149 
1154 #define FB_IE_DELTACOUNTER 0x00000300
1155 
1160 #define FB_IE_IDENTIFIER 0x00000400
1161 
1166 #define FB_IE_FLAGS 0x00000500
1167 
1173 #define FB_IE_LIST 0x00000600
1174 
1180 #define FB_IE_SNMPCOUNTER 0x00000700
1181 
1187 #define FB_IE_SNMPGAUGE 0x00000800
1188 
1194 #define FB_IE_DEFAULT 0x00000000
1195 
1206 #define FB_UNITS_BITS 0x00010000
1207 
1212 #define FB_UNITS_OCTETS 0x00020000
1213 
1218 #define FB_UNITS_PACKETS 0x00030000
1219 
1224 #define FB_UNITS_FLOWS 0x00040000
1225 
1230 #define FB_UNITS_SECONDS 0x00050000
1231 
1236 #define FB_UNITS_MILLISECONDS 0x00060000
1237 
1242 #define FB_UNITS_MICROSECONDS 0x00070000
1243 
1248 #define FB_UNITS_NANOSECONDS 0x00080000
1249 
1254 #define FB_UNITS_WORDS 0x00090000
1255 
1260 #define FB_UNITS_MESSAGES 0x000A0000
1261 
1266 #define FB_UNITS_HOPS 0x000B0000
1267 
1272 #define FB_UNITS_ENTRIES 0x000C0000
1273 
1278 #define FB_UNITS_FRAMES 0x000D0000
1279 
1283 #define FB_IE_VARLEN 65535
1284 
1289 #define FB_IE_BASIC_LIST 291
1290 
1294 #define FB_IE_SUBTEMPLATE_LIST 292
1295 
1299 #define FB_IE_SUBTEMPLATE_MULTILIST 293
1300 
1308 #define FB_IE_PEN_REVERSE 29305
1309 
1318 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
1319 
1325 #define FB_CISCO_GENERIC 9999
1326 
1333 #define FB_CISCO_ASA_EVENT_ID 9998
1334 
1343 #define FB_CISCO_ASA_EVENT_XTRA 9997
1344 
1349 #define FB_IE_REVERSE_STR "reverse"
1350 
1352 #define FB_IE_REVERSE_STRLEN 7
1353 
1360  FB_OCTET_ARRAY,
1361  FB_UINT_8,
1362  FB_UINT_16,
1363  FB_UINT_32,
1364  FB_UINT_64,
1365  FB_INT_8,
1366  FB_INT_16,
1367  FB_INT_32,
1368  FB_INT_64,
1369  FB_FLOAT_32,
1370  FB_FLOAT_64,
1371  FB_BOOL,
1372  FB_MAC_ADDR,
1373  FB_STRING,
1374  FB_DT_SEC,
1375  FB_DT_MILSEC,
1376  FB_DT_MICROSEC,
1377  FB_DT_NANOSEC,
1378  FB_IP4_ADDR,
1379  FB_IP6_ADDR,
1380  FB_BASIC_LIST,
1381  FB_SUB_TMPL_LIST,
1382  FB_SUB_TMPL_MULTI_LIST
1384 
1393 typedef struct fbInfoElement_st {
1395  union {
1401  const struct fbInfoElement_st *canon;
1406  const char *name;
1407  } ref;
1408 
1414  uint32_t midx;
1416  uint32_t ent;
1421  uint16_t num;
1423  uint16_t len;
1426  uint32_t flags;
1428  uint64_t min;
1430  uint64_t max;
1432  uint8_t type;
1434  const char *description;
1435 } fbInfoElement_t;
1436 
1443 typedef struct fbInfoElementOptRec_st {
1445  uint32_t ie_pen;
1447  uint16_t ie_id;
1449  uint8_t ie_type;
1451  uint8_t ie_semantic;
1453  uint16_t ie_units;
1455  uint8_t padding[6];
1457  uint64_t ie_range_begin;
1459  uint64_t ie_range_end;
1465 
1466 
1471 #define FB_TID_AUTO 0
1472 
1476 #define FB_TID_TS 2
1477 
1481 #define FB_TID_OTS 3
1482 
1486 #define FB_TID_MIN_DATA 256
1487 
1488 struct fbTemplate_st;
1495 
1501 #define FB_IESPEC_NULL { NULL, 0, 0 }
1502 
1508 typedef struct fbInfoElementSpec_st {
1510  char *name;
1522  uint16_t len_override;
1529  uint32_t flags;
1531 
1532 struct fbSession_st;
1539 typedef struct fbSession_st fbSession_t;
1540 
1542 typedef enum fbTransport_en {
1569 } fbTransport_t;
1570 
1575 typedef struct fbConnSpec_st {
1579  char *host;
1581  char *svc;
1594  void *vai;
1599  void *vssl_ctx;
1600 } fbConnSpec_t;
1601 
1605 #define FB_CONNSPEC_INIT { FB_SCTP, NULL, NULL, \
1606  NULL, NULL, NULL, NULL, \
1607  NULL, NULL }
1608 
1609 #if HAVE_SPREAD
1610 
1615 #define FB_SPREADPARAMS_INIT { 0, 0, 0 }
1616 
1617 typedef struct fbSpreadParams_st {
1620  fbSession_t * session;
1623  char * daemon;
1626  char ** groups;
1627 } fbSpreadParams_t;
1628 
1629 #endif /* HAVE_SPREAD */
1630 
1631 struct fbExporter_st;
1637 typedef struct fbExporter_st fbExporter_t;
1638 
1639 struct fbCollector_st;
1647 typedef struct fbCollector_st fbCollector_t;
1648 
1649 struct fbListener_st;
1656 typedef struct fbListener_st fbListener_t;
1657 
1662 
1667 {
1674 };
1675 
1680 
1687 {
1694 };
1695 
1696 struct fbListenerGroup_st;
1700 typedef struct fbListenerGroup_st fbListenerGroup_t;
1701 
1711 typedef void (*fbTemplateCtxFree_fn)(
1712  void *tmpl_ctx,
1713  void *app_ctx);
1714 
1738 typedef void (*fbNewTemplateCallback_fn) (
1739  fbSession_t *session,
1740  uint16_t tid,
1741  fbTemplate_t *tmpl,
1742  void *app_ctx,
1743  void **tmpl_ctx,
1744  fbTemplateCtxFree_fn *fn);
1745 
1746 
1754 #define FB_LIST_SEM_UNDEFINED 0xFF
1755 
1758 #define FB_LIST_SEM_NONE_OF 0x00
1759 
1762 #define FB_LIST_SEM_EXACTLY_ONE_OF 0x01
1763 
1766 #define FB_LIST_SEM_ONE_OR_MORE_OF 0x02
1767 
1770 #define FB_LIST_SEM_ALL_OF 0x03
1771 
1774 #define FB_LIST_SEM_ORDERED 0x04
1775 
1782 gboolean fbListValidSemantic(
1783  uint8_t semantic);
1784 
1785 /****** BASICLIST FUNCTIONS AND STRUCTS *******/
1791 typedef struct fbBasicList_st {
1795  uint8_t *dataPtr;
1797  uint16_t numElements;
1799  uint16_t dataLength;
1801  uint8_t semantic;
1802 } fbBasicList_t;
1803 
1804 
1811  void);
1812 
1825 void* fbBasicListInit(
1826  fbBasicList_t *basicListPtr,
1827  uint8_t semantic,
1828  const fbInfoElement_t *infoElement,
1829  uint16_t numElements);
1830 
1846  fbBasicList_t *basicListPtr,
1847  uint8_t semantic,
1848  const fbInfoElement_t *infoElement,
1849  uint16_t numElements,
1850  uint16_t dataLength,
1851  uint8_t *dataPtr);
1852 
1866  fbBasicList_t *basicListPtr);
1867 
1868 
1876 uint8_t fbBasicListGetSemantic(
1877  fbBasicList_t *basicListPtr);
1878 
1888  fbBasicList_t *basicListPtr,
1889  uint8_t semantic);
1890 
1891 
1900  fbBasicList_t *basicListPtr);
1901 
1907 void* fbBasicListGetDataPtr(
1908  fbBasicList_t *basicListPtr);
1909 
1919  fbBasicList_t *basicListPtr,
1920  uint16_t bl_index);
1921 
1930 void* fbBasicListGetNextPtr(
1931  fbBasicList_t *basicListPtr,
1932  void *currentPtr);
1933 
1943 void* fbBasicListRealloc(
1944  fbBasicList_t *basicList,
1945  uint16_t newNumElements);
1946 
1955  fbBasicList_t *basicList,
1956  uint16_t numNewElements);
1957 
1963 void fbBasicListClear(
1964  fbBasicList_t *basicListPtr);
1965 
1973  fbBasicList_t *basicList);
1974 
1980 void fbBasicListFree(
1981  fbBasicList_t *basicListPtr);
1982 
1983 
1984 /******* END OF BASICLIST ********/
1985 
1986 
1987 
1988 /******* SUBTEMPLATELIST FUNCTIONS ****/
1989 
1997 typedef struct fbSubTemplateList_st {
2000  union {
2001  size_t length;
2002  uint64_t extra;
2003  } dataLength;
2007  uint8_t *dataPtr;
2009  uint16_t tmplID;
2011  uint16_t numElements;
2013  uint8_t semantic;
2015 
2023  void);
2024 
2037 void* fbSubTemplateListInit(
2038  fbSubTemplateList_t *sTL,
2039  uint8_t semantic,
2040  uint16_t tmplID,
2041  const fbTemplate_t *tmpl,
2042  uint16_t numElements);
2043 
2059  fbSubTemplateList_t *subTemplateList,
2060  uint8_t semantic,
2061  uint16_t tmplID,
2062  const fbTemplate_t *tmpl,
2063  uint16_t numElements,
2064  uint16_t dataLength,
2065  uint8_t *dataPtr);
2066 
2078  fbSubTemplateList_t *STL);
2079 
2086  const fbSubTemplateList_t *subTemplateListPtr);
2087 
2096  const fbSubTemplateList_t *subTemplateListPtr,
2097  uint16_t index);
2098 
2111  const fbSubTemplateList_t *subTemplateListPtr,
2112  void *currentPtr);
2113 
2121  fbSubTemplateList_t *subTemplateListPtr,
2122  uint8_t semantic);
2123 
2130  fbSubTemplateList_t *subTemplateListPtr);
2131 
2138  fbSubTemplateList_t *subTemplateListPtr);
2139 
2146  fbSubTemplateList_t *subTemplateListPtr);
2147 
2159  fbSubTemplateList_t *subTemplateList,
2160  uint16_t newNumElements);
2161 
2171  fbSubTemplateList_t *subTemplateList,
2172  uint16_t numNewElements);
2173 
2188  fbSubTemplateList_t *subTemplateListPtr);
2189 
2199  fbSubTemplateList_t *subTemplateListPtr);
2200 
2209  fbSubTemplateList_t *subTemplateListPtr);
2210 
2211 /********* END OF SUBTEMPLATELIST **********/
2233  uint8_t *dataPtr;
2235  size_t dataLength;
2237  uint16_t tmplID;
2239  uint16_t numElements;
2241 
2250  uint16_t numElements;
2252  uint8_t semantic;
2254 
2255 
2264  void);
2265 
2266 
2278  uint8_t semantic,
2279  uint16_t numElements);
2280 
2289  uint8_t semantic);
2290 
2297  fbSubTemplateMultiList_t *STML);
2298 
2306  fbSubTemplateMultiList_t *STML);
2307 
2318  fbSubTemplateMultiList_t *STML);
2319 
2326  fbSubTemplateMultiList_t *STML);
2327 
2339  uint16_t newNumEntries);
2340 
2351  uint16_t numNewEntries);
2352 
2359  fbSubTemplateMultiList_t *STML);
2360 
2370  uint16_t index);
2371 
2385  fbSubTemplateMultiListEntry_t *currentEntry);
2386 
2400  uint16_t tmplID,
2401  fbTemplate_t *tmpl,
2402  uint16_t numElements);
2403 
2416  uint16_t newNumElements);
2417 
2429  uint16_t numNewElements);
2430 
2439 
2448 
2462  void *currentPtr);
2463 
2476  uint16_t index);
2477 
2486 
2495 
2496 /************** END OF STML FUNCTIONS *********** */
2497 
2513 void fBufListFree(
2514  fbTemplate_t *tmpl,
2515  uint8_t *record);
2516 
2517 
2524  void);
2525 
2532 void fbListenerGroupFree(
2533  fbListenerGroup_t *group);
2534 
2545  fbListenerGroup_t *group,
2546  const fbListener_t *listener);
2547 
2558  fbListenerGroup_t *group,
2559  const fbListener_t *listener);
2560 
2572  fbListenerGroup_t *group,
2573  GError **err);
2574 
2575 
2583  fbListenerGroupResult_t *result);
2584 
2598  fbListener_t *listener,
2599  int sock,
2600  GError **err);
2601 
2612  fbListener_t *listener,
2613  int sock,
2614  GError **err);
2615 
2621 void fBufInterruptSocket(
2622  fBuf_t *fbuf);
2623 
2624 
2645 typedef gboolean (*fbListenerAppInit_fn) (
2646  fbListener_t *listener,
2647  void **ctx,
2648  int fd,
2649  struct sockaddr *peer,
2650  size_t peerlen,
2651  GError **err);
2652 
2660 typedef void (*fbListenerAppFree_fn) (
2661  void *ctx);
2662 
2663 /*
2664  * Public Function Calls. These calls will remain available and retain
2665  * their functionality in all subsequent versions of libfixbuf.
2666  */
2667 
2668 
2685 gboolean fBufSetInternalTemplate(
2686  fBuf_t *fbuf,
2687  uint16_t int_tid,
2688  GError **err);
2689 
2707 gboolean fBufSetExportTemplate(
2708  fBuf_t *fbuf,
2709  uint16_t ext_tid,
2710  GError **err);
2711 
2712 #if HAVE_SPREAD
2713 
2730 void fBufSetSpreadExportGroup(
2731  fBuf_t *fbuf,
2732  char **groups,
2733  int num_groups,
2734  GError **err);
2735 #endif
2736 
2752  fBuf_t *fbuf,
2753  gboolean automatic);
2754 
2769 gboolean fBufSetAutomaticInsert(
2770  fBuf_t *fbuf,
2771  GError **err);
2772 
2773 
2782  fBuf_t *fbuf);
2783 
2792 void fBufFree(
2793  fBuf_t *fbuf);
2794 
2808  fbSession_t *session,
2809  fbExporter_t *exporter);
2810 
2821  fBuf_t *fbuf);
2822 
2833 void fBufSetExporter(
2834  fBuf_t *fbuf,
2835  fbExporter_t *exporter);
2836 
2837 
2849 size_t fBufRemaining(
2850  fBuf_t *fbuf);
2851 
2852 
2865 void fBufSetBuffer(
2866  fBuf_t *fbuf,
2867  uint8_t *buf,
2868  size_t buflen);
2869 
2870 
2894 gboolean fBufAppend(
2895  fBuf_t *fbuf,
2896  uint8_t *recbase,
2897  size_t recsize,
2898  GError **err);
2899 
2909 gboolean fBufEmit(
2910  fBuf_t *fbuf,
2911  GError **err);
2912 
2924 void fBufSetExportTime(
2925  fBuf_t *fbuf,
2926  uint32_t extime);
2927 
2941  fbSession_t *session,
2942  fbCollector_t *collector);
2943 
2954  fBuf_t *fbuf);
2955 
2966 void fBufSetCollector(
2967  fBuf_t *fbuf,
2968  fbCollector_t *collector);
2969 
2999 gboolean fBufNext(
3000  fBuf_t *fbuf,
3001  uint8_t *recbase,
3002  size_t *recsize,
3003  GError **err);
3004 
3018 gboolean fBufNextMessage(
3019  fBuf_t *fbuf,
3020  GError **err);
3021 
3029 uint32_t fBufGetExportTime(
3030  fBuf_t *fbuf);
3031 
3052  fBuf_t *fbuf,
3053  uint16_t *ext_tid);
3054 
3074  fBuf_t *fbuf,
3075  uint16_t *ext_tid,
3076  GError **err);
3077 
3090 
3099 void fbInfoModelFree(
3100  fbInfoModel_t *model);
3101 
3117  fbInfoModel_t *model,
3118  fbInfoElement_t *ie);
3119 
3135  fbInfoModel_t *model,
3136  fbInfoElement_t *ie);
3137 
3150  fbInfoModel_t *model,
3151  const char *name);
3152 
3167  fbInfoModel_t *model,
3168  uint16_t id,
3169  uint32_t ent);
3170 
3179  const fbInfoModel_t *model);
3180 
3188 void fbInfoModelIterInit(
3189  fbInfoModelIter_t *iter,
3190  const fbInfoModel_t *model);
3191 
3203  fbInfoModelIter_t *iter);
3204 
3219  fbInfoModel_t *model,
3220  GError **err);
3221 
3237  fBuf_t *fbuf,
3238  const fbInfoElement_t *model_ie,
3239  uint16_t itid,
3240  uint16_t etid,
3241  GError **err);
3242 
3255  fbInfoModel_t *model,
3256  fbInfoElementOptRec_t *rec);
3257 
3267 gboolean fbInfoModelTypeInfoRecord(
3268  fbTemplate_t *tmpl);
3269 
3288  fbInfoModel_t *model);
3289 
3306 gboolean fbTemplateAppend(
3307  fbTemplate_t *tmpl,
3308  fbInfoElement_t *ex_ie,
3309  GError **err);
3310 
3326 gboolean fbTemplateAppendSpec(
3327  fbTemplate_t *tmpl,
3328  fbInfoElementSpec_t *spec,
3329  uint32_t flags,
3330  GError **err);
3331 
3349 gboolean fbTemplateAppendSpecArray(
3350  fbTemplate_t *tmpl,
3351  fbInfoElementSpec_t *spec,
3352  uint32_t flags,
3353  GError **err);
3354 
3362 uint32_t fbTemplateCountElements(
3363  fbTemplate_t *tmpl);
3364 
3375  fbTemplate_t *tmpl,
3376  uint16_t scope_count);
3377 
3385 uint32_t fbTemplateGetOptionsScope(
3386  fbTemplate_t *tmpl);
3387 
3399 gboolean fbTemplateContainsElement(
3400  fbTemplate_t *tmpl,
3401  const fbInfoElement_t *ex_ie);
3402 
3413  fbTemplate_t *tmpl,
3414  fbInfoElementSpec_t *spec);
3415 
3426  fbTemplate_t *tmpl,
3427  fbInfoElementSpec_t *spec);
3428 
3440  fbTemplate_t *tmpl,
3441  fbInfoElementSpec_t *spec,
3442  uint32_t flags);
3443 
3453  fbTemplate_t *tmpl,
3454  uint32_t IEindex);
3455 
3464  fbTemplate_t *tmpl);
3465 
3473 void *fbTemplateGetContext(
3474  fbTemplate_t *tmpl);
3475 
3494  fbInfoModel_t *model);
3495 
3506  fbSession_t *session,
3507  gboolean enabled,
3508  GError **err);
3509 
3519  fbSession_t *session,
3520  gboolean enabled,
3521  GError **err);
3522 
3539  fbSession_t *session,
3540  gboolean internal,
3541  uint16_t tid,
3542  fbTemplate_t *tmpl,
3543  const char *name,
3544  const char *description,
3545  GError **err);
3546 
3558  fbSession_t *session,
3559  uint16_t tid,
3560  const char *name,
3561  const char *description,
3562  GError **err);
3563 
3573  fbSession_t *session);
3574 
3603  fbSession_t *session,
3604  fbNewTemplateCallback_fn callback,
3605  void *app_ctx);
3606 
3631  fbSession_t *session,
3632  uint16_t ent_tid,
3633  uint16_t int_tid);
3634 
3645  fbSession_t *session,
3646  uint16_t ext_tid);
3647 
3657  fbSession_t *session,
3658  uint16_t ext_tid);
3659 
3669 void fbSessionFree(
3670  fbSession_t *session);
3671 
3685  fbSession_t *session);
3686 
3702 void fbSessionSetDomain(
3703  fbSession_t *session,
3704  uint32_t domain);
3705 
3713 uint32_t fbSessionGetDomain(
3714  fbSession_t *session);
3715 
3724  fbSession_t *session);
3725 
3726 #if HAVE_SPREAD
3727 
3749 uint16_t fbSessionAddTemplatesMulticast(
3750  fbSession_t *session,
3751  char **groups,
3752  gboolean internal,
3753  uint16_t tid,
3754  fbTemplate_t *tmpl,
3755  GError **err);
3756 
3781 uint16_t fbSessionAddTemplatesMulticastWithMetadata(
3782  fbSession_t *session,
3783  char **groups,
3784  gboolean internal,
3785  uint16_t tid,
3786  fbTemplate_t *tmpl,
3787  char *name,
3788  char *description,
3789  GError **err);
3790 
3806 gboolean fbSessionSpreadEnableTemplateMetadata(
3807  fbSession_t *session,
3808  char **groups,
3809  gboolean enabled,
3810  GError **err);
3811 
3826 gboolean fbSessionSpreadEnableTypeMetadata(
3827  fbSession_t *session,
3828  char **groups,
3829  gboolean enabled,
3830  GError **err);
3831 
3832 #endif
3833 
3846 gboolean fbSessionExportTemplate(
3847  fbSession_t *session,
3848  uint16_t tid,
3849  GError **err);
3850 
3862 gboolean fbSessionExportTemplates(
3863  fbSession_t *session,
3864  GError **err);
3865 
3884 uint16_t fbSessionAddTemplate(
3885  fbSession_t *session,
3886  gboolean internal,
3887  uint16_t tid,
3888  fbTemplate_t *tmpl,
3889  GError **err);
3890 
3903 gboolean fbSessionRemoveTemplate(
3904  fbSession_t *session,
3905  gboolean internal,
3906  uint16_t tid,
3907  GError **err);
3908 
3921  fbSession_t *session,
3922  gboolean internal,
3923  uint16_t tid,
3924  GError **err);
3925 
3939  fbConnSpec_t *spec);
3940 
3941 #if HAVE_SPREAD
3942 
3953 int fbCollectorGetSpreadReturnGroups(
3954  fbCollector_t *collector,
3955  char *groups[]);
3956 
3970 fbExporter_t *fbExporterAllocSpread(
3971  fbSpreadParams_t *params );
3972 
3973 #endif /* HAVE_SPREAD */
3974 
3987  const char *path);
3988 
3999  uint8_t *buf,
4000  uint16_t bufsize);
4001 
4002 
4012  FILE *fp);
4013 
4026 void fbExporterSetStream(
4027  fbExporter_t *exporter,
4028  int sctp_stream);
4029 
4043  fbExporter_t *exporter);
4044 
4052 void fbExporterClose(
4053  fbExporter_t *exporter);
4054 
4061 size_t fbExporterGetMsgLen(
4062  fbExporter_t *exporter);
4063 
4077  void *ctx,
4078  const char *path,
4079  GError **err);
4080 
4092  void *ctx,
4093  FILE *fp);
4094 
4095 
4096 #if HAVE_SPREAD
4097 
4107 fbCollector_t *fbCollectorAllocSpread(
4108  void *ctx,
4109  fbSpreadParams_t *params,
4110  GError **err );
4111 
4112 #endif /* HAVE_SPREAD */
4113 
4124 void *fbCollectorGetContext(
4125  fbCollector_t *collector);
4126 
4137 void fbCollectorClose(
4138  fbCollector_t *collector);
4139 
4140 
4153  fbCollector_t *collector,
4154  struct sockaddr *address,
4155  size_t address_length);
4156 
4186  fbConnSpec_t *spec,
4187  fbSession_t *session,
4188  fbListenerAppInit_fn appinit,
4189  fbListenerAppFree_fn appfree,
4190  GError **err);
4191 
4199 void fbListenerFree(
4200  fbListener_t *listener);
4201 
4225  fbListener_t *listener,
4226  GError **err);
4227 
4239  fbListener_t *listener,
4240  GError **err);
4241 
4249 void fbListenerInterrupt(
4250  fbListener_t *listener);
4251 
4252 
4268 gboolean fbListenerGetCollector(
4269  fbListener_t *listener,
4270  fbCollector_t **collector,
4271  GError **err);
4272 
4273 
4274 
4275 
4292  fbCollector_t *collector,
4293  GError **err);
4294 
4295 
4312  fbCollector_t *collector,
4313  GError **err);
4314 
4315 
4332  fbCollector_t *collector,
4333  GError **err);
4334 
4356  fbCollector_t *collector,
4357  struct sockaddr *peer,
4358  size_t peerlen,
4359  uint32_t obdomain);
4360 
4378 uint32_t fbCollectorGetSFlowMissed(
4379  fbCollector_t *collector,
4380  struct sockaddr *peer,
4381  size_t peerlen,
4382  uint32_t obdomain);
4383 
4390 struct sockaddr* fbCollectorGetPeer(
4391  fbCollector_t *collector);
4392 
4403  fbCollector_t *collector);
4404 
4418  fbCollector_t *collector,
4419  gboolean multi_session);
4420 
4421 
4422 #ifdef __cplusplus
4423 } /* extern "C" */
4424 #endif
4425 
4426 #endif
fbInfoElement_t * fbTemplateGetIndexedIE(fbTemplate_t *tmpl, uint32_t IEindex)
Return the information element in the template referenced by the index.
uint32_t ent
Private Enterprise Number.
Definition: public.h:1416
struct fbSubTemplateMultiListEntry_st fbSubTemplateMultiListEntry_t
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
struct fbInfoElement_st * canon
Pointer to canonical copy of IE.
Definition: public.h:1401
fbExporter_t * fbExporterAllocFile(const char *path)
Allocate an exporting process endpoint for a named file.
fbListener_t * listener
pointer to the listener that received a new connection
Definition: public.h:1691
void fbTemplateFreeUnused(fbTemplate_t *tmpl)
Free a template if it is not currently in use by any Session.
char * ssl_ca_file
Path to certificate authority file.
Definition: public.h:1583
fbExporter_t * fbExporterAllocBuffer(uint8_t *buf, uint16_t bufsize)
Allocate an exporting process for a buffer.
void * vai
Pointer to address info cache.
Definition: public.h:1594
uint32_t ie_pen
private enterprise number
Definition: public.h:1445
A variable-length field value.
Definition: public.h:1033
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...
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.
void * fbSubTemplateMultiListEntryAddNewElements(fbSubTemplateMultiListEntry_t *entry, uint16_t numNewElements)
Allocates space for a number of additional elements in the sub template multi list entry...
fbExporter_t * fbExporterAllocFP(FILE *fp)
Allocate an exporting process endpoint for an opened ANSI C file pointer.
gboolean fBufAppend(fBuf_t *fbuf, uint8_t *recbase, size_t recsize, GError **err)
Append a record to a buffer.
char * ssl_cert_file
Path to certificate file.
Definition: public.h:1585
Partially reliable datagram transport via SCTP.
Definition: public.h:1547
void fBufListFree(fbTemplate_t *tmpl, uint8_t *record)
Clear all of the memory that fixbuf allocated during transcode of this record.
uint64_t ie_range_begin
ie range min
Definition: public.h:1457
uint16_t numElements
number of elements in the list
Definition: public.h:2011
uint64_t min
range min
Definition: public.h:1428
uint64_t ie_range_end
ie range max
Definition: public.h:1459
void fbBasicListFree(fbBasicList_t *basicListPtr)
Clear the basic list, then free the basic list pointer.
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 fbExporterClose(fbExporter_t *exporter)
Force the file or socket underlying an exporting process endpoint to close.
fBuf_t * fbuf
pointer to the fbuf created for that new connection
Definition: public.h:1693
gboolean fbSessionEnableTypeMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configure a session to export type information for enterprise-specific information elements as option...
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.h:2237
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...
void fbSessionSetDomain(fbSession_t *session, uint32_t domain)
Set the current observation domain on a session.
fbCollector_t * fbSessionGetCollector(fbSession_t *session)
Retrieve collector that was created with the session.
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...
fBuf_t * fbListenerWait(fbListener_t *listener, GError **err)
Wait on a listener.
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
Definition: public.h:2246
struct fbConnSpec_st fbConnSpec_t
Connection specifier.
void fBufSetAutomaticMode(fBuf_t *fbuf, gboolean automatic)
Set the automatic mode flag on a buffer.
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...
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:1647
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:1637
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.h:2013
fbSubTemplateMultiList_t * fbSubTemplateMultiListAlloc(void)
Allocates a subTemplateMultiList_t Based on how subTemplateMultiLists will be used and set up amidst ...
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1562
const fbTemplate_t * tmpl
pointer to the template used to structure the data
Definition: public.h:2005
void fbSubTemplateMultiListSetSemantic(fbSubTemplateMultiList_t *STML, uint8_t semantic)
Sets the semantic field for the multi list.
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.h:1539
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...
size_t dataLength
length of the buffer used to hold the data in this entry
Definition: public.h:2235
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 fbListenerGroup_st fbListenerGroup_t
Structure that holds the listeners that are added to the group.
Definition: public.h:1700
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...
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:1656
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.h:1738
size_t len
Length of content in buffer.
Definition: public.h:1035
Unreliable datagram transport via UDP.
Definition: public.h:1551
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.h:1799
void fbSubTemplateListFree(fbSubTemplateList_t *subTemplateListPtr)
Frees and clears a subTemplateList struct.
void fbSubTemplateListClear(fbSubTemplateList_t *subTemplateListPtr)
Clears a subtemplate list struct, notably freeing the dataPtr and setting it to NULL.
uint32_t fbCollectorGetNetflowMissed(fbCollector_t *collector, struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
fbCollectorGetNetflowMissed
gboolean fbTemplateAppendSpecArray(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Append information elements described by a specifier array to a template.
uint8_t * dataPtr
pointer to the memory that stores the elements in the list
Definition: public.h:1795
uint16_t num
Information Element number.
Definition: public.h:1421
fbSubTemplateList_t * fbSubTemplateListAlloc(void)
Allocates a subTemplateList_t Based on how subTemplateLists will be used and set up amidst data struc...
gboolean fbCollectorSetNetflowV9Translator(fbCollector_t *collector, GError **err)
fbCollectorSetNetflowV9Translator
struct sockaddr * fbCollectorGetPeer(fbCollector_t *collector)
Retrieves information about the node connected to this collector.
uint16_t numElements
number of elements in the list
Definition: public.h:1797
gboolean fbTemplateAppend(fbTemplate_t *tmpl, fbInfoElement_t *ex_ie, GError **err)
Append an information element to a template.
gboolean fBufEmit(fBuf_t *fbuf, GError **err)
Emit the message currently in a buffer using the associated exporting process endpoint.
fbSubTemplateMultiListEntry_t * firstEntry
pointer to the first entry in the multi list
Definition: public.h:2248
struct fbInfoElement_st fbInfoElement_t
A single IPFIX Information Element definition.
struct fbBasicList_st fbBasicList_t
A basic list element in a template which structure represents a basic list on the internal side...
fbCollector_t * fbCollectorAllocFP(void *ctx, FILE *fp)
Allocate a collecting process endpoint for an open file.
void fBufInterruptSocket(fBuf_t *fbuf)
Interrupts the select call of a specific collector by way of its fBuf.
uint16_t len
Information element length in octets.
Definition: public.h:1423
fbExporter_t * fbExporterAllocNet(fbConnSpec_t *spec)
Allocate an exporting process endpoint for a network connection.
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...
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListRealloc(fbSubTemplateMultiList_t *STML, uint16_t newNumEntries)
Clears the entries used by the multi list, then if newNumElements is different than numElements...
void fbSessionAddTemplatePair(fbSession_t *session, uint16_t ent_tid, uint16_t int_tid)
Adds an external-internal template pair to the session.
gboolean fBufNext(fBuf_t *fbuf, uint8_t *recbase, size_t *recsize, GError **err)
Retrieve a record from a buffer.
fBuf_t * fBufAllocForCollection(fbSession_t *session, fbCollector_t *collector)
Allocate a new buffer for collection.
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 * fbSubTemplateListGetDataPtr(const fbSubTemplateList_t *subTemplateListPtr)
Returns a pointer to the buffer that contains the data for the list.
void fBufFree(fBuf_t *fbuf)
Free a buffer.
gboolean fbSessionEnableTemplateMetadata(fbSession_t *session, gboolean enabled, GError **err)
Configure a session to export template metadata as options records.
void fbBasicListClear(fbBasicList_t *basicListPtr)
Clear the parameters of the basic list and free the data buffer.
const fbInfoElement_t * infoElement
pointer to the information element that is repeated in the list
Definition: public.h:1793
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:2645
void * fbBasicListGetDataPtr(fbBasicList_t *basicListPtr)
void fbSubTemplateListCollectorInit(fbSubTemplateList_t *STL)
Initializes a sub template list variable on a collector.
void fbSubTemplateListClearWithoutFree(fbSubTemplateList_t *subTemplateListPtr)
Clears the sub template list parameters but does not free the data ptr.
void fBufSetBuffer(fBuf_t *fbuf, uint8_t *buf, size_t buflen)
Set a buffer on an fBuf for collection.
fbSession_t * fbSessionAlloc(fbInfoModel_t *model)
Allocate a transport session state container.
fBuf_t * fbListenerWaitNoCollectors(fbListener_t *listener, GError **err)
Waits for an incoming connection, just like fbListenerWait, except that this function doesn&#39;t monitor...
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.
uint32_t flags
Application flags word.
Definition: public.h:1529
fbExporter_t * fBufGetExporter(fBuf_t *fbuf)
Retrieve the exporting process endpoint associated with a buffer.
struct fbSubTemplateList_st fbSubTemplateList_t
Structure used to hold information of a sub template list.
uint8_t ie_type
ie data type
Definition: public.h:1449
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...
uint16_t numElements
number of sub template lists in the multi list
Definition: public.h:2250
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.h:1711
guint index
iterator index
Definition: public.h:1064
void fbSubTemplateMultiListFree(fbSubTemplateMultiList_t *STML)
Clears the multi list, then frees the memory pointed to by STML.
void fbSubTemplateMultiListClear(fbSubTemplateMultiList_t *STML)
Clears all of the entries (frees their data pointers), then frees the memory containing the entries...
struct fbInfoElementSpec_st fbInfoElementSpec_t
A single IPFIX Information Element specification.
ListenerEntry&#39;s make up a listener group as a linked list.
Definition: public.h:1666
fBuf_t * fBufAllocForExport(fbSession_t *session, fbExporter_t *exporter)
Allocate a new buffer for export.
void(* fbListenerAppFree_fn)(void *ctx)
Application context free function type for fbListener_t.
Definition: public.h:2660
gboolean fbTemplateContainsElement(fbTemplate_t *tmpl, const fbInfoElement_t *ex_ie)
Determine if a template contains a given information element.
void * fbSubTemplateMultiListEntryGetDataPtr(fbSubTemplateMultiListEntry_t *entry)
Retrieves the data pointer for this entry.
ListenerGroupResult&#39;s contain the listener who&#39;s listening socket got a new connection.
Definition: public.h:1686
fbListenerGroup_t * fbListenerGroupAlloc(void)
Allocates and returns a fbListenerGroup with no entries.
enum fbTransport_en fbTransport_t
Transport protocol for connection specifier.
uint8_t * dataPtr
pointer to the buffer used to hold the data
Definition: public.h:2007
fbInfoModel_t * fbInfoModelAlloc(void)
Allocate a new information model.
fbVarfield_t ie_name
information element name
Definition: public.h:1461
uint8_t semantic
value used to describe the list of sub templates
Definition: public.h:2252
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.
uint8_t fbSubTemplateMultiListGetSemantic(fbSubTemplateMultiList_t *STML)
Get the semantic paramter from the multi list.
Structure used to hold information of a sub template list.
Definition: public.h:1997
char * name
Information element name.
Definition: public.h:1510
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 ...
void fBufSetExportTime(fBuf_t *fbuf, uint32_t extime)
Set the export time on the message currently in a buffer.
void * vssl_ctx
Pointer to SSL context cache.
Definition: public.h:1599
uint32_t midx
Multiple IE index.
Definition: public.h:1414
size_t fbExporterGetMsgLen(fbExporter_t *exporter)
Get the (transcoded) message length that was copied to the exporting buffer upon fBufEmit().
void * fbBasicListGetNextPtr(fbBasicList_t *basicListPtr, void *currentPtr)
Function returns the next element in the list based on the currentPtr.
fbListenerEntry_t * prev
pointer to the previous listener entry in the linked list
Definition: public.h:1671
char * host
Hostname to connect/listen to.
Definition: public.h:1579
An iterator over the information elements in an information model.
Definition: public.h:1056
gboolean fbSessionExportTemplates(fbSession_t *session, GError **err)
Export all external templates in the current domain of a given session.
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...
uint8_t padding[6]
padding to align with template
Definition: public.h:1455
gboolean fbSessionSetTemplateMetadata(fbSession_t *session, uint16_t tid, const char *name, const char *description, GError **err)
Add template metadata for a given template.
uint32_t fbCollectorGetSFlowMissed(fbCollector_t *collector, struct sockaddr *peer, size_t peerlen, uint32_t obdomain)
fbCollectorGetSFlowMissed
union fbSubTemplateList_st::@2 dataLength
length of the allocated buffer used to hold the data
void fbInfoModelFree(fbInfoModel_t *model)
Free an information model.
uint16_t tmplID
ID of the template used to structure the data.
Definition: public.h:2009
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateListPtr, uint8_t semantic)
Sets the semantic parameter of a subTemplateList.
fbTemplate_t * fBufGetCollectionTemplate(fBuf_t *fbuf, uint16_t *ext_tid)
Retrieve the external template used to read the last record from the buffer.
fbCollector_t * fBufGetCollector(fBuf_t *fbuf)
Retrieve the collecting process endpoint associated with a buffer.
void * fbCollectorGetContext(fbCollector_t *collector)
Retrieve the application context associated with a collector.
The corresponding struct to the Information Element Type Options Template.
Definition: public.h:1443
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 * fbBasicListRealloc(fbBasicList_t *basicList, uint16_t newNumElements)
Free the current data pointer, allocating a new buffer to accomodate the new number of elements...
Secure, unreliable datagram transport via DTLS over UDP.
Definition: public.h:1568
void fbExporterSetStream(fbExporter_t *exporter, int sctp_stream)
Set the SCTP stream for the next message exported.
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...
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:1051
void * fbSubTemplateMultiListEntryGetIndexedPtr(fbSubTemplateMultiListEntry_t *entry, uint16_t index)
Returns a pointer to a data element in the entry based on the index.
uint32_t flags
Flags.
Definition: public.h:1426
gboolean fbInfoElementAddOptRecElement(fbInfoModel_t *model, fbInfoElementOptRec_t *rec)
Add an element that we received via an Options Record to the given info model.
const char * description
description
Definition: public.h:1434
uint16_t numElements
number of elements in this entry
Definition: public.h:2239
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.
Reliable stream transport via TCP.
Definition: public.h:1549
void fbInfoModelAddElement(fbInfoModel_t *model, fbInfoElement_t *ie)
Add a single information element to an information model.
uint32_t fbSessionGetDomain(fbSession_t *session)
Retrieve the current domain on a session.
void * fbBasicListAddNewElements(fbBasicList_t *basicList, uint16_t numNewElements)
Allocates an additional elememnt into the basic list must be called after calling BasicListInit...
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
Definition: public.h:2229
fbVarfield_t ie_desc
information element description
Definition: public.h:1463
void * fbBasicListInit(fbBasicList_t *basicListPtr, uint8_t semantic, const fbInfoElement_t *infoElement, uint16_t numElements)
Initializes the basic list structure based on the parameters.
int fbListenerGroupAddListener(fbListenerGroup_t *group, const fbListener_t *listener)
Adds a previously allocated listener to the previously allocated group.
gboolean fbInfoModelTypeInfoRecord(fbTemplate_t *tmpl)
Checks to see if the template contains all of the elements the RFC 5610 info element type record shou...
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 ...
gboolean fBufSetAutomaticInsert(fBuf_t *fbuf, GError **err)
Set the automatic insert flag on a buffer.
void fbExporterAutoStream(fbExporter_t *exporter)
Enable automatic SCTP stream selection for the next message exported.
struct fbVarfield_st fbVarfield_t
A variable-length field value.
fbInfoModel_t * fbSessionGetInfoModel(fbSession_t *session)
fbSessionGetInfoModel
guint fbInfoModelCountElements(const fbInfoModel_t *model)
Return the number of information elements in the information model.
Fixbuf&#39;s version information.
enum fbInfoElementDataType_en fbInfoElementDataType_t
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
union fbInfoElement_st::@1 ref
Information element name.
fbTransport_t transport
Transport protocol to use.
Definition: public.h:1577
void fbSubTemplateMultiListEntryClear(fbSubTemplateMultiListEntry_t *entry)
Frees the memory pointed to by the data buffer holding the data elements.
const fbTemplate_t * fbSubTemplateMultiListEntryGetTemplate(fbSubTemplateMultiListEntry_t *entry)
Retrieve the template pointer used to structure the data elements.
struct fbInfoModelIter_st fbInfoModelIter_t
An iterator over the information elements in an information model.
char * svc
Service name or port number to connect/listen to.
Definition: public.h:1581
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Attempt to maintain backwards compatibility with UDP.
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.h:2233
fbListener_t * fbListenerAlloc(fbConnSpec_t *spec, fbSession_t *session, fbListenerAppInit_fn appinit, fbListenerAppFree_fn appfree, GError **err)
Allocate a listener.
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...
char * ssl_key_pass
Private key decryption password.
Definition: public.h:1589
uint16_t ie_id
information element id
Definition: public.h:1447
gboolean fBufNextMessage(fBuf_t *fbuf, GError **err)
Read a new message into a buffer using the associated collecting process endpoint.
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...
void * fbBasicListGetIndexedDataPtr(fbBasicList_t *basicListPtr, uint16_t bl_index)
Function retrieves the index&#39;th element in the list index is 0-based.
fbInfoElementDataType_en
From RFC 5610: A description of the abstract data type of an IPFIX information element as registered ...
Definition: public.h:1359
const fbInfoModel_t * model
information Model
Definition: public.h:1060
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 ...
uint32_t fBufGetExportTime(fBuf_t *fbuf)
Retrieve the export time on the message currently in a buffer.
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.
uint8_t * buf
Content buffer.
Definition: public.h:1042
fbListenerGroupResult_t * fbListenerGroupWait(fbListenerGroup_t *group, GError **err)
Similar to fbListenerWait, except that is looks for connections for multiple listeners.
uint16_t fbSubTemplateListGetTemplateID(fbSubTemplateList_t *subTemplateListPtr)
Gets the template ID for the template used by the list.
fbBasicList_t * fbBasicListAlloc(void)
allocates a Basic List Structure
fbTransport_en
Transport protocol for connection specifier.
Definition: public.h:1542
const fbInfoElement_t * fbInfoModelIterNext(fbInfoModelIter_t *iter)
Return a pointer to the next information element in the information model.
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 fBufSetExporter(fBuf_t *fbuf, fbExporter_t *exporter)
Associate an exporting process endpoint with a buffer.
An IPFIX template or options template structure.
Definition: private.h:191
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetFirstEntry(fbSubTemplateMultiList_t *STML)
Retrieve the first entry in the multi list.
void * fbTemplateGetContext(fbTemplate_t *tmpl)
Get the ctx pointer associated with a Template.
fbListenerEntry_t * next
pointer to the next listener entry in the linked list
Definition: public.h:1669
fbTemplate_t * fbTemplateAlloc(fbInfoModel_t *model)
Allocate a new empty template.
fbCollector_t * fbCollectorAllocFile(void *ctx, const char *path, GError **err)
Allocate a collecting process endpoint for a named file.
struct fbSubTemplateMultiList_st fbSubTemplateMultiList_t
Multilists just contain the semantic to describe the sub lists, the number of sub lists...
fbSession_t * fBufGetSession(fBuf_t *fbuf)
Retrieve the session associated with a buffer.
uint16_t ie_units
ie units
Definition: public.h:1453
void fbBasicListCollectorInit(fbBasicList_t *basicListPtr)
This initializes a basic list structure for collection.
fbListenerGroupResult_t * next
Pointer to the next listener group result.
Definition: public.h:1689
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Free the fbListenerGroupResult_t returned from fbListenerGroupWait.
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1557
uint32_t fbTemplateCountElements(fbTemplate_t *tmpl)
Determine number of information elements in a template.
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.
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.
void fbCollectorClose(fbCollector_t *collector)
Close the file or socket underlying a collecting process endpoint.
A basic list element in a template which structure represents a basic list on the internal side...
Definition: public.h:1791
void fbListenerGroupFree(fbListenerGroup_t *group)
frees a listener group
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 fbBasicListGetSemantic(fbBasicList_t *basicListPtr)
Get Semantic field for Basic List presumably used in collectors after decoding.
Connection specifier.
Definition: public.h:1575
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:1673
fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.h:2231
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:1025
uint64_t max
range max
Definition: public.h:1430
fbTemplate_t * fbSessionGetTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Retrieve a template from a session by ID.
uint16_t len_override
The size of the information element in bytes.
Definition: public.h:1522
gboolean fbSessionExportTemplate(fbSession_t *session, uint16_t tid, GError **err)
Export a single external template in the current domain of a given session.
uint16_t fbSessionAddTemplate(fbSession_t *session, gboolean internal, uint16_t tid, fbTemplate_t *tmpl, GError **err)
Add a template to a session.
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...
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 ...
uint8_t fbSubTemplateListGetSemantic(fbSubTemplateList_t *subTemplateListPtr)
Gets the semantic value from a sub template list.
gboolean fbTemplateAppendSpec(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec, uint32_t flags, GError **err)
Append an information element described by specifier to a template.
A single IPFIX Information Element definition.
Definition: public.h:1393
int fbListenerGroupDeleteListener(fbListenerGroup_t *group, const fbListener_t *listener)
Removes the listener from the group.
gboolean fbSessionRemoveTemplate(fbSession_t *session, gboolean internal, uint16_t tid, GError **err)
Remove a template from a session.
uint8_t semantic
semantic field to describe the list
Definition: public.h:1801
const char * name
Information element name.
Definition: public.h:1406
const fbTemplate_t * fbSubTemplateListGetTemplate(fbSubTemplateList_t *subTemplateListPtr)
Gets the template pointer from the list structure.
void fbInfoModelIterInit(fbInfoModelIter_t *iter, const fbInfoModel_t *model)
Initialize an information model iterator for iteration.
void fbSessionResetExternal(fbSession_t *session)
Reset the external state (sequence numbers and templates) in a session state container.
uint8_t type
Data Type.
Definition: public.h:1432
uint16_t fbSubTemplateMultiListEntryGetTemplateID(fbSubTemplateMultiListEntry_t *entry)
Retrieve the template ID for the template used to structure the data.
gboolean fbListenerGetCollector(fbListener_t *listener, fbCollector_t **collector, GError **err)
fbListenerGetCollector
gboolean fbCollectorSetSFlowTranslator(fbCollector_t *collector, GError **err)
fbCollectorSetSFlowTranslator
A single IPFIX Information Element specification.
Definition: public.h:1508
void fbListenerInterrupt(fbListener_t *listener)
Cause the current or next call to fbListenerWait to unblock and return.
fBuf_t * fbListenerOwnSocketCollectorTLS(fbListener_t *listener, int sock, GError **err)
Same as fbListenerOwnSocketCollectorTCP but for TLS (not tested)
fbSubTemplateMultiListEntry_t * fbSubTemplateMultiListGetIndexedEntry(fbSubTemplateMultiList_t *STML, uint16_t index)
Retrieve a pointer to the entry of a specific index.
gboolean fbCollectorClearTranslator(fbCollector_t *collector, GError **err)
fbCollectorClearTranslator
char * ssl_key_file
Path to private key file.
Definition: public.h:1587
void fbInfoModelAddElementArray(fbInfoModel_t *model, fbInfoElement_t *ie)
Add multiple information elements in an array to an information model.
void fbBasicListSetSemantic(fbBasicList_t *basicListPtr, uint8_t semantic)
Sets the semantic for describing a basic list generally used in exporters before decoding.
gboolean fBufSetInternalTemplate(fBuf_t *fbuf, uint16_t int_tid, GError **err)
Set the internal template on a buffer to the given template ID.
uint8_t ie_semantic
ie semantic
Definition: public.h:1451
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...
void fbListenerFree(fbListener_t *listener)
Free a listener.
gboolean fbListValidSemantic(uint8_t semantic)
validates the value of the semantic field,
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.