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-2014 Carnegie Mellon University. All Rights Reserved.
7  ** ------------------------------------------------------------------------
8  ** Authors: Brian Trammell, Dan Ruef
9  ** ------------------------------------------------------------------------
10  ** Use of the libfixbuf system and related source code is subject to the terms
11  ** of the following licenses:
12  **
13  ** GNU Lesser GPL (LGPL) Rights pursuant to Version 2.1, February 1999
14  ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.227.7013
15  **
16  ** NO WARRANTY
17  **
18  ** ANY INFORMATION, MATERIALS, SERVICES, INTELLECTUAL PROPERTY OR OTHER
19  ** PROPERTY OR RIGHTS GRANTED OR PROVIDED BY CARNEGIE MELLON UNIVERSITY
20  ** PURSUANT TO THIS LICENSE (HEREINAFTER THE "DELIVERABLES") ARE ON AN
21  ** "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY
22  ** KIND, EITHER EXPRESS OR IMPLIED AS TO ANY MATTER INCLUDING, BUT NOT
23  ** LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE,
24  ** MERCHANTABILITY, INFORMATIONAL CONTENT, NONINFRINGEMENT, OR ERROR-FREE
25  ** OPERATION. CARNEGIE MELLON UNIVERSITY SHALL NOT BE LIABLE FOR INDIRECT,
26  ** SPECIAL OR CONSEQUENTIAL DAMAGES, SUCH AS LOSS OF PROFITS OR INABILITY
27  ** TO USE SAID INTELLECTUAL PROPERTY, UNDER THIS LICENSE, REGARDLESS OF
28  ** WHETHER SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH DAMAGES.
29  ** LICENSEE AGREES THAT IT WILL NOT MAKE ANY WARRANTY ON BEHALF OF
30  ** CARNEGIE MELLON UNIVERSITY, EXPRESS OR IMPLIED, TO ANY PERSON
31  ** CONCERNING THE APPLICATION OF OR THE RESULTS TO BE OBTAINED WITH THE
32  ** DELIVERABLES UNDER THIS LICENSE.
33  **
34  ** Licensee hereby agrees to defend, indemnify, and hold harmless Carnegie
35  ** Mellon University, its trustees, officers, employees, and agents from
36  ** all claims or demands made against them (and any related losses,
37  ** expenses, or attorney's fees) arising out of, or relating to Licensee's
38  ** and/or its sub licensees' negligent use or willful misuse of or
39  ** negligent conduct or willful misconduct regarding the Software,
40  ** facilities, or other rights or assistance granted by Carnegie Mellon
41  ** University under this License, including, but not limited to, any
42  ** claims of product liability, personal injury, death, damage to
43  ** property, or violation of any laws or regulations.
44  **
45  ** Carnegie Mellon University Software Engineering Institute authored
46  ** documents are sponsored by the U.S. Department of Defense under
47  ** Contract FA8721-05-C-0003. Carnegie Mellon University retains
48  ** copyrights in all material produced under this contract. The U.S.
49  ** Government retains a non-exclusive, royalty-free license to publish or
50  ** reproduce these documents, or allow others to do so, for U.S.
51  ** Government purposes only pursuant to the copyright license under the
52  ** contract clause at 252.227.7013.
53  **
54  ** ------------------------------------------------------------------------
55  */
56 
818 #ifndef _FB_PUBLIC_H_
819 #define _FB_PUBLIC_H_
820 #include <fixbuf/autoinc.h>
821 
822 #ifdef __cplusplus
823 extern "C" {
824 #endif
825 
826 #ident "$Id$"
827 
828 /*
829  * Error Handling Definitions
830  */
831 
833 #define FB_ERROR_DOMAIN g_quark_from_string("fixbufError")
834 
835 #define FB_ERROR_TMPL 1
836 
840 #define FB_ERROR_EOM 2
841 
846 #define FB_ERROR_EOF 3
847 
851 #define FB_ERROR_IPFIX 4
852 
857 #define FB_ERROR_BUFSZ 5
858 
859 #define FB_ERROR_IMPL 6
860 
861 #define FB_ERROR_IO 7
862 
866 #define FB_ERROR_NLREAD 8
867 
872 #define FB_ERROR_NLWRITE 9
873 
876 #define FB_ERROR_NOELEMENT 10
877 
880 #define FB_ERROR_CONN 11
881 
885 #define FB_ERROR_NETFLOWV9 12
886 
889 #define FB_ERROR_TRANSMISC 13
890 
891 /*
892  * Public Datatypes and Constants
893  */
894 
895 struct fBuf_st;
901 typedef struct fBuf_st fBuf_t;
902 
909 typedef struct fbVarfield_st {
911  size_t len;
918  uint8_t *buf;
919 } fbVarfield_t;
920 
921 
922 struct fbInfoModel_st;
927 typedef struct fbInfoModel_st fbInfoModel_t;
928 
932 typedef struct fbInfoModelIter_st {
940  guint index;
942 
948 #define FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_)\
949  { {(const struct fbInfoElement_st*)_name_}, 0, _ent_, _num_, _len_, _flags_, _min_, _max_, _type_, _desc_ }
950 
956 #define FB_IE_INIT(_name_, _ent_, _num_, _len_, _flags_) \
957  FB_IE_INIT_FULL(_name_, _ent_, _num_, _len_, _flags_, 0, 0, 0, (char*)NULL)
958 
959 
965 #define FB_IE_NULL FB_IE_INIT(NULL, 0, 0, 0, 0)
966 
972 #define FB_IE_SEMANTIC(flags) ((flags & 0x0000ff00) >> 8)
973 
979 #define FB_IE_UNITS(flags) ((flags & 0xFFFF0000) >> 16)
980 
985 #define FB_IE_F_NONE 0x00000000
986 
991 #define FB_IE_F_ENDIAN 0x00000001
992 
1002 #define FB_IE_F_REVERSIBLE 0x00000040
1003 
1011 #define FB_IE_F_ALIEN 0x00000080
1012 
1017 #define FB_IE_QUANTITY 0x00000100
1018 
1024 #define FB_IE_TOTALCOUNTER 0x00000200
1025 
1030 #define FB_IE_DELTACOUNTER 0x00000300
1031 
1036 #define FB_IE_IDENTIFIER 0x00000400
1037 
1042 #define FB_IE_FLAGS 0x00000500
1043 
1049 #define FB_IE_LIST 0x00000600
1050 
1056 #define FB_IE_DEFAULT 0x00000000
1057 
1068 #define FB_UNITS_BITS 0x00010000
1069 
1074 #define FB_UNITS_OCTETS 0x00020000
1075 
1080 #define FB_UNITS_PACKETS 0x00030000
1081 
1086 #define FB_UNITS_FLOWS 0x00040000
1087 
1092 #define FB_UNITS_SECONDS 0x00050000
1093 
1098 #define FB_UNITS_MILLISECONDS 0x00060000
1099 
1104 #define FB_UNITS_MICROSECONDS 0x00070000
1105 
1110 #define FB_UNITS_NANOSECONDS 0x00080000
1111 
1116 #define FB_UNITS_WORDS 0x00090000
1117 
1122 #define FB_UNITS_MESSAGES 0x000A0000
1123 
1128 #define FB_UNITS_HOPS 0x000B0000
1129 
1134 #define FB_UNITS_ENTRIES 0x000C0000
1135 
1140 #define FB_UNITS_FRAMES 0x000D0000
1141 
1145 #define FB_IE_VARLEN 65535
1146 
1151 #define FB_IE_BASIC_LIST 291
1152 
1156 #define FB_IE_SUBTEMPLATE_LIST 292
1157 
1161 #define FB_IE_SUBTEMPLATE_MULTILIST 293
1162 
1170 #define FB_IE_PEN_REVERSE 29305
1171 
1180 #define FB_IE_VENDOR_BIT_REVERSE 0x4000
1181 
1187 #define FB_CISCO_GENERIC 9999
1188 
1195 #define FB_CISCO_ASA_EVENT_ID 9998
1196 
1205 #define FB_CISCO_ASA_EVENT_XTRA 9997
1206 
1211 #define FB_IE_REVERSE_STR "reverse"
1212 
1214 #define FB_IE_REVERSE_STRLEN 7
1215 
1222  FB_OCTET_ARRAY,
1223  FB_UINT_8,
1224  FB_UINT_16,
1225  FB_UINT_32,
1226  FB_UINT_64,
1227  FB_INT_8,
1228  FB_INT_16,
1229  FB_INT_32,
1230  FB_INT_64,
1231  FB_FLOAT_32,
1232  FB_FLOAT_64,
1233  FB_BOOL,
1234  FB_MAC_ADDR,
1235  FB_STRING,
1236  FB_DT_SEC,
1237  FB_DT_MILSEC,
1238  FB_DT_MICROSEC,
1239  FB_DT_NANOSEC,
1240  FB_IP4_ADDR,
1241  FB_IP6_ADDR,
1242  FB_BASIC_LIST,
1243  FB_SUB_TMPL_LIST,
1244  FB_SUB_TMPL_MULTI_LIST
1246 
1255 typedef struct fbInfoElement_st {
1257  union {
1263  const struct fbInfoElement_st *canon;
1268  const char *name;
1269  } ref;
1270 
1276  uint32_t midx;
1278  uint32_t ent;
1283  uint16_t num;
1285  uint16_t len;
1288  uint32_t flags;
1290  uint64_t min;
1292  uint64_t max;
1294  uint8_t type;
1296  const char *description;
1297 } fbInfoElement_t;
1298 
1305 typedef struct fbInfoElementOptRec_st {
1307  uint64_t ie_range_begin;
1309  uint64_t ie_range_end;
1311  uint32_t ie_pen;
1313  uint16_t ie_units;
1315  uint16_t ie_id;
1317  uint8_t ie_type;
1319  uint8_t ie_semantic;
1321  uint8_t padding[6];
1327 
1332 #define FB_TID_AUTO 0
1333 
1337 #define FB_TID_TS 2
1338 
1342 #define FB_TID_OTS 3
1343 
1347 #define FB_TID_MIN_DATA 256
1348 
1349 struct fbTemplate_st;
1356 
1362 #define FB_IESPEC_NULL { NULL, 0, 0 }
1363 
1369 typedef struct fbInfoElementSpec_st {
1371  char *name;
1376  uint16_t len_override;
1383  uint32_t flags;
1385 
1386 struct fbSession_st;
1393 typedef struct fbSession_st fbSession_t;
1394 
1396 typedef enum fbTransport_en {
1423 } fbTransport_t;
1424 
1429 typedef struct fbConnSpec_st {
1433  char *host;
1435  char *svc;
1448  void *vai;
1453  void *vssl_ctx;
1454 } fbConnSpec_t;
1455 
1459 #define FB_CONNSPEC_INIT { FB_SCTP, NULL, NULL, \
1460  NULL, NULL, NULL, NULL, \
1461  NULL, NULL }
1462 
1463 #if HAVE_SPREAD
1464 
1469 #define FB_SPREADPARAMS_INIT { 0, 0, 0 }
1470 
1471 typedef struct fbSpreadParams_st {
1474  fbSession_t * session;
1477  char * daemon;
1480  char ** groups;
1481 } fbSpreadParams_t;
1482 
1483 #endif /* HAVE_SPREAD */
1484 
1485 struct fbExporter_st;
1491 typedef struct fbExporter_st fbExporter_t;
1492 
1493 struct fbCollector_st;
1501 typedef struct fbCollector_st fbCollector_t;
1502 
1503 struct fbListener_st;
1510 typedef struct fbListener_st fbListener_t;
1511 
1516 
1521 {
1528 };
1529 
1534 
1541 {
1548 };
1549 
1550 struct fbListenerGroup_st;
1554 typedef struct fbListenerGroup_st fbListenerGroup_t;
1555 
1572 typedef void (*fbNewTemplateCallback_fn) (
1573  fbSession_t *session,
1574  uint16_t tid,
1575  fbTemplate_t *tmpl);
1576 
1584 typedef void (*fbTemplateCtxFree_fn)(
1585  void *ctx);
1586 
1587 
1609 typedef void (*fbTemplateCtxCallback_fn) (
1610  fbSession_t *session,
1611  uint16_t tid,
1612  fbTemplate_t *tmpl,
1613  void **ctx,
1614  fbTemplateCtxFree_fn *fn);
1615 
1616 
1624 #define FB_LIST_SEM_UNDEFINED 0xFF
1625 
1628 #define FB_LIST_SEM_NONE_OF 0x00
1629 
1632 #define FB_LIST_SEM_EXACTLY_ONE_OF 0x01
1633 
1636 #define FB_LIST_SEM_ONE_OR_MORE_OF 0x02
1637 
1640 #define FB_LIST_SEM_ALL_OF 0x03
1641 
1644 #define FB_LIST_SEM_ORDERED 0x04
1645 
1652 gboolean fbListValidSemantic(
1653  uint8_t semantic);
1654 
1655 /****** BASICLIST FUNCTIONS AND STRUCTS *******/
1661 typedef struct fbBasicList_st {
1665  uint8_t *dataPtr;
1667  uint16_t numElements;
1669  uint16_t dataLength;
1671  uint8_t semantic;
1672 } fbBasicList_t;
1673 
1674 
1681  void);
1682 
1695 void* fbBasicListInit(
1696  fbBasicList_t *basicListPtr,
1697  uint8_t semantic,
1698  const fbInfoElement_t *infoElement,
1699  uint16_t numElements);
1700 
1716  fbBasicList_t *basicListPtr,
1717  uint8_t semantic,
1718  const fbInfoElement_t *infoElement,
1719  uint16_t numElements,
1720  uint16_t dataLength,
1721  uint8_t *dataPtr);
1722 
1736  fbBasicList_t *basicListPtr);
1737 
1738 
1746 uint8_t fbBasicListGetSemantic(
1747  fbBasicList_t *basicListPtr);
1748 
1758  fbBasicList_t *basicListPtr,
1759  uint8_t semantic);
1760 
1761 
1770  fbBasicList_t *basicListPtr);
1771 
1777 void* fbBasicListGetDataPtr(
1778  fbBasicList_t *basicListPtr);
1779 
1789  fbBasicList_t *basicListPtr,
1790  uint16_t bl_index);
1791 
1800 void* fbBasicListGetNextPtr(
1801  fbBasicList_t *basicListPtr,
1802  void *currentPtr);
1803 
1813 void* fbBasicListRealloc(
1814  fbBasicList_t *basicList,
1815  uint16_t newNumElements);
1816 
1825  fbBasicList_t *basicList,
1826  uint16_t numNewElements);
1827 
1833 void fbBasicListClear(
1834  fbBasicList_t *basicListPtr);
1835 
1843  fbBasicList_t *basicList);
1844 
1850 void fbBasicListFree(
1851  fbBasicList_t *basicListPtr);
1852 
1853 /******* END OF BASICLIST ********/
1854 
1855 
1856 
1857 /******* SUBTEMPLATELIST FUNCTIONS ****/
1858 
1866 typedef struct fbSubTemplateList_st {
1869  union {
1870  size_t length;
1871  uint64_t extra;
1872  } dataLength;
1876  uint8_t *dataPtr;
1878  uint16_t tmplID;
1880  uint16_t numElements;
1882  uint8_t semantic;
1884 
1892  void);
1893 
1906 void* fbSubTemplateListInit(
1907  fbSubTemplateList_t *sTL,
1908  uint8_t semantic,
1909  uint16_t tmplID,
1910  const fbTemplate_t *tmpl,
1911  uint16_t numElements);
1912 
1928  fbSubTemplateList_t *subTemplateList,
1929  uint8_t semantic,
1930  uint16_t tmplID,
1931  const fbTemplate_t *tmpl,
1932  uint16_t numElements,
1933  uint16_t dataLength,
1934  uint8_t *dataPtr);
1935 
1947  fbSubTemplateList_t *STL);
1948 
1955  const fbSubTemplateList_t *subTemplateListPtr);
1956 
1965  const fbSubTemplateList_t *subTemplateListPtr,
1966  uint16_t index);
1967 
1980  const fbSubTemplateList_t *subTemplateListPtr,
1981  void *currentPtr);
1982 
1990  fbSubTemplateList_t *subTemplateListPtr,
1991  uint8_t semantic);
1992 
1999  fbSubTemplateList_t *subTemplateListPtr);
2000 
2007  fbSubTemplateList_t *subTemplateListPtr);
2008 
2015  fbSubTemplateList_t *subTemplateListPtr);
2016 
2028  fbSubTemplateList_t *subTemplateList,
2029  uint16_t newNumElements);
2030 
2040  fbSubTemplateList_t *subTemplateList,
2041  uint16_t numNewElements);
2042 
2057  fbSubTemplateList_t *subTemplateListPtr);
2058 
2068  fbSubTemplateList_t *subTemplateListPtr);
2069 
2078  fbSubTemplateList_t *subTemplateListPtr);
2079 
2080 /********* END OF SUBTEMPLATELIST **********/
2102  uint8_t *dataPtr;
2104  size_t dataLength;
2106  uint16_t tmplID;
2108  uint16_t numElements;
2110 
2119  uint16_t numElements;
2121  uint8_t semantic;
2123 
2135  uint8_t semantic,
2136  uint16_t numElements);
2137 
2146  uint8_t semantic);
2147 
2154  fbSubTemplateMultiList_t *STML);
2155 
2163  fbSubTemplateMultiList_t *STML);
2164 
2175  fbSubTemplateMultiList_t *STML);
2176 
2183  fbSubTemplateMultiList_t *STML);
2184 
2196  uint16_t newNumEntries);
2197 
2208  uint16_t numNewEntries);
2209 
2216  fbSubTemplateMultiList_t *STML);
2217 
2227  uint16_t index);
2228 
2242  fbSubTemplateMultiListEntry_t *currentEntry);
2243 
2257  uint16_t tmplID,
2258  fbTemplate_t *tmpl,
2259  uint16_t numElements);
2260 
2273  uint16_t newNumElements);
2274 
2283 
2292 
2306  void *currentPtr);
2307 
2320  uint16_t index);
2321 
2330 
2339 
2340 /************** END OF STML FUNCTIONS */
2341 
2348  void);
2349 
2356 void fbListenerGroupFree(
2357  fbListenerGroup_t *group);
2358 
2369  fbListenerGroup_t *group,
2370  const fbListener_t *listener);
2371 
2382  fbListenerGroup_t *group,
2383  const fbListener_t *listener);
2384 
2396  fbListenerGroup_t *group,
2397  GError **err);
2398 
2399 
2407  fbListenerGroupResult_t *result);
2408 
2422  fbListener_t *listener,
2423  int sock,
2424  GError **err);
2425 
2436  fbListener_t *listener,
2437  int sock,
2438  GError **err);
2439 
2445 void fBufInterruptSocket(
2446  fBuf_t *fbuf);
2447 
2448 
2469 typedef gboolean (*fbListenerAppInit_fn) (
2470  fbListener_t *listener,
2471  void **ctx,
2472  int fd,
2473  struct sockaddr *peer,
2474  size_t peerlen,
2475  GError **err);
2476 
2484 typedef void (*fbListenerAppFree_fn) (
2485  void *ctx);
2486 
2487 /*
2488  * Public Function Calls. These calls will remain available and retain
2489  * their functionality in all subsequent versions of libfixbuf.
2490  */
2491 
2492 
2509 gboolean fBufSetInternalTemplate(
2510  fBuf_t *fbuf,
2511  uint16_t int_tid,
2512  GError **err);
2513 
2531 gboolean fBufSetExportTemplate(
2532  fBuf_t *fbuf,
2533  uint16_t ext_tid,
2534  GError **err);
2535 
2536 #if HAVE_SPREAD
2537 
2554 void fBufSetSpreadExportGroup(
2555  fBuf_t *fbuf,
2556  char **groups,
2557  int num_groups,
2558  GError **err);
2559 #endif
2560 
2576  fBuf_t *fbuf,
2577  gboolean automatic);
2578 
2593 gboolean fBufSetAutomaticInsert(
2594  fBuf_t *fbuf,
2595  GError **err);
2596 
2597 
2606  fBuf_t *fbuf);
2607 
2616 void fBufFree(
2617  fBuf_t *fbuf);
2618 
2632  fbSession_t *session,
2633  fbExporter_t *exporter);
2634 
2645  fBuf_t *fbuf);
2646 
2657 void fBufSetExporter(
2658  fBuf_t *fbuf,
2659  fbExporter_t *exporter);
2660 
2661 
2673 size_t fBufRemaining(
2674  fBuf_t *fbuf);
2675 
2676 
2689 void fBufSetBuffer(
2690  fBuf_t *fbuf,
2691  uint8_t *buf,
2692  size_t buflen);
2693 
2694 
2718 gboolean fBufAppend(
2719  fBuf_t *fbuf,
2720  uint8_t *recbase,
2721  size_t recsize,
2722  GError **err);
2723 
2733 gboolean fBufEmit(
2734  fBuf_t *fbuf,
2735  GError **err);
2736 
2748 void fBufSetExportTime(
2749  fBuf_t *fbuf,
2750  uint32_t extime);
2751 
2765  fbSession_t *session,
2766  fbCollector_t *collector);
2767 
2778  fBuf_t *fbuf);
2779 
2790 void fBufSetCollector(
2791  fBuf_t *fbuf,
2792  fbCollector_t *collector);
2793 
2823 gboolean fBufNext(
2824  fBuf_t *fbuf,
2825  uint8_t *recbase,
2826  size_t *recsize,
2827  GError **err);
2828 
2842 gboolean fBufNextMessage(
2843  fBuf_t *fbuf,
2844  GError **err);
2845 
2853 uint32_t fBufGetExportTime(
2854  fBuf_t *fbuf);
2855 
2876  fBuf_t *fbuf,
2877  uint16_t *ext_tid);
2878 
2898  fBuf_t *fbuf,
2899  uint16_t *ext_tid,
2900  GError **err);
2901 
2914 
2923 void fbInfoModelFree(
2924  fbInfoModel_t *model);
2925 
2941  fbInfoModel_t *model,
2942  fbInfoElement_t *ie);
2943 
2959  fbInfoModel_t *model,
2960  fbInfoElement_t *ie);
2961 
2974  fbInfoModel_t *model,
2975  const char *name);
2976 
2991  fbInfoModel_t *model,
2992  uint16_t id,
2993  uint32_t ent);
2994 
3003  const fbInfoModel_t *model);
3004 
3012 void fbInfoModelIterInit(
3013  fbInfoModelIter_t *iter,
3014  const fbInfoModel_t *model);
3015 
3027  fbInfoModelIter_t *iter);
3028 
3043  fbInfoModel_t *model,
3044  GError **err);
3045 
3060  fBuf_t *fbuf,
3061  const fbInfoElement_t *model_ie,
3062  uint16_t tid,
3063  GError **err);
3064 
3077  fbInfoModel_t *model,
3078  fbInfoElementOptRec_t *rec);
3079 
3089 gboolean fbInfoModelTypeInfoRecord(
3090  fbTemplate_t *tmpl);
3091 
3110  fbInfoModel_t *model);
3111 
3128 gboolean fbTemplateAppend(
3129  fbTemplate_t *tmpl,
3130  fbInfoElement_t *ex_ie,
3131  GError **err);
3132 
3148 gboolean fbTemplateAppendSpec(
3149  fbTemplate_t *tmpl,
3150  fbInfoElementSpec_t *spec,
3151  uint32_t flags,
3152  GError **err);
3153 
3171 gboolean fbTemplateAppendSpecArray(
3172  fbTemplate_t *tmpl,
3173  fbInfoElementSpec_t *spec,
3174  uint32_t flags,
3175  GError **err);
3176 
3184 uint32_t fbTemplateCountElements(
3185  fbTemplate_t *tmpl);
3186 
3197  fbTemplate_t *tmpl,
3198  uint16_t scope_count);
3199 
3207 uint32_t fbTemplateGetOptionsScope(
3208  fbTemplate_t *tmpl);
3209 
3221 gboolean fbTemplateContainsElement(
3222  fbTemplate_t *tmpl,
3223  const fbInfoElement_t *ex_ie);
3224 
3235  fbTemplate_t *tmpl,
3236  fbInfoElementSpec_t *spec);
3237 
3248  fbTemplate_t *tmpl,
3249  fbInfoElementSpec_t *spec);
3250 
3262  fbTemplate_t *tmpl,
3263  fbInfoElementSpec_t *spec,
3264  uint32_t flags);
3265 
3275  fbTemplate_t *tmpl,
3276  uint32_t IEindex);
3277 
3286  fbTemplate_t *tmpl);
3287 
3295 void *fbTemplateGetContext(
3296  fbTemplate_t *tmpl);
3297 
3316  fbInfoModel_t *model);
3317 
3327  fbSession_t *session);
3328 
3329 
3354  fbSession_t *session,
3355  fbNewTemplateCallback_fn callback);
3356 
3389  fbSession_t *session,
3390  fbTemplateCtxCallback_fn callback);
3391 
3392 
3417  fbSession_t *session,
3418  uint16_t ent_tid,
3419  uint16_t int_tid);
3420 
3431  fbSession_t *session,
3432  uint16_t ext_tid);
3433 
3443  fbSession_t *session,
3444  uint16_t ext_tid);
3445 
3455 void fbSessionFree(
3456  fbSession_t *session);
3457 
3471  fbSession_t *session);
3472 
3488 void fbSessionSetDomain(
3489  fbSession_t *session,
3490  uint32_t domain);
3491 
3499 uint32_t fbSessionGetDomain(
3500  fbSession_t *session);
3501 
3510  fbSession_t *session);
3511 
3512 #if HAVE_SPREAD
3513 
3534 gboolean fbSessionAddTemplatesMulticast(
3535  fbSession_t *session,
3536  char **groups,
3537  gboolean internal,
3538  uint16_t tid,
3539  fbTemplate_t *tmpl,
3540  GError **err);
3541 
3542 #endif
3543 
3556 gboolean fbSessionExportTemplate(
3557  fbSession_t *session,
3558  uint16_t tid,
3559  GError **err);
3560 
3572 gboolean fbSessionExportTemplates(
3573  fbSession_t *session,
3574  GError **err);
3575 
3594 uint16_t fbSessionAddTemplate(
3595  fbSession_t *session,
3596  gboolean internal,
3597  uint16_t tid,
3598  fbTemplate_t *tmpl,
3599  GError **err);
3600 
3613 gboolean fbSessionRemoveTemplate(
3614  fbSession_t *session,
3615  gboolean internal,
3616  uint16_t tid,
3617  GError **err);
3618 
3631  fbSession_t *session,
3632  gboolean internal,
3633  uint16_t tid,
3634  GError **err);
3635 
3649  fbConnSpec_t *spec);
3650 
3651 #if HAVE_SPREAD
3652 
3663 int fbCollectorGetSpreadReturnGroups(
3664  fbCollector_t *collector,
3665  char *groups[]);
3666 
3680 fbExporter_t *fbExporterAllocSpread(
3681  fbSpreadParams_t *params );
3682 
3683 #endif /* HAVE_SPREAD */
3684 
3697  const char *path);
3698 
3708  FILE *fp);
3709 
3722 void fbExporterSetStream(
3723  fbExporter_t *exporter,
3724  int sctp_stream);
3725 
3739  fbExporter_t *exporter);
3740 
3748 void fbExporterClose(
3749  fbExporter_t *exporter);
3750 
3764  void *ctx,
3765  const char *path,
3766  GError **err);
3767 
3779  void *ctx,
3780  FILE *fp);
3781 
3782 
3783 #if HAVE_SPREAD
3784 
3794 fbCollector_t *fbCollectorAllocSpread(
3795  void *ctx,
3796  fbSpreadParams_t *params,
3797  GError **err );
3798 
3799 #endif /* HAVE_SPREAD */
3800 
3811 void *fbCollectorGetContext(
3812  fbCollector_t *collector);
3813 
3824 void fbCollectorClose(
3825  fbCollector_t *collector);
3826 
3827 
3840  fbCollector_t *collector,
3841  struct sockaddr *address,
3842  size_t address_length);
3843 
3873  fbConnSpec_t *spec,
3874  fbSession_t *session,
3875  fbListenerAppInit_fn appinit,
3876  fbListenerAppFree_fn appfree,
3877  GError **err);
3878 
3886 void fbListenerFree(
3887  fbListener_t *listener);
3888 
3912  fbListener_t *listener,
3913  GError **err);
3914 
3926  fbListener_t *listener,
3927  GError **err);
3928 
3936 void fbListenerInterrupt(
3937  fbListener_t *listener);
3938 
3939 
3955 gboolean fbListenerGetCollector(
3956  fbListener_t *listener,
3957  fbCollector_t **collector,
3958  GError **err);
3959 
3960 
3961 
3962 
3979  fbCollector_t *collector,
3980  GError **err);
3981 
3982 
3999  fbCollector_t *collector,
4000  GError **err);
4001 
4023  fbCollector_t *collector,
4024  struct sockaddr *peer,
4025  size_t peerlen,
4026  uint32_t obdomain);
4027 
4034 struct sockaddr* fbCollectorGetPeer(
4035  fbCollector_t *collector);
4036 
4044  fbCollector_t *collector);
4045 
4059  fbCollector_t *collector,
4060  gboolean multi_session);
4061 
4077  fbCollector_t *collector,
4078  gboolean manage_port);
4079 
4080 #ifdef __cplusplus
4081 } /* extern "C" */
4082 #endif
4083 
4084 #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:1278
struct fbSubTemplateMultiListEntry_st fbSubTemplateMultiListEntry_t
Entries contain the same type of information at SubTemplateLists: template ID and template pointers t...
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:1545
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:1437
void * vai
Pointer to address info cache.
Definition: public.h:1448
uint32_t ie_pen
private enterprise number
Definition: public.h:1311
A variable-length field value.
Definition: public.h:909
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.
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:1439
Partially reliable datagram transport via SCTP.
Definition: public.h:1401
uint64_t ie_range_begin
ie range min
Definition: public.h:1307
uint16_t numElements
number of elements in the list
Definition: public.h:1880
uint64_t min
range min
Definition: public.h:1290
uint64_t ie_range_end
ie range max
Definition: public.h:1309
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:1547
uint16_t tmplID
ID of the template used to structure the data in this entry.
Definition: public.h:2106
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:2115
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:1501
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:1491
uint8_t semantic
value used to describe the contents of the list, all-of, one-of, etc
Definition: public.h:1882
Secure, reliable stream transport via TLS over TCP.
Definition: public.h:1416
const fbTemplate_t * tmpl
pointer to the template used to structure the data
Definition: public.h:1874
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:1393
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:2104
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:1554
void * fbSubTemplateListInit(fbSubTemplateList_t *sTL, uint8_t semantic, uint16_t tmplID, const fbTemplate_t *tmpl, uint16_t numElements)
Initializes a subTemplateList structure and alloc's the dataPtr to get a buffer able to hold numEleme...
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:1510
size_t len
Length of content in buffer.
Definition: public.h:911
Unreliable datagram transport via UDP.
Definition: public.h:1405
void(* fbTemplateCtxFree_fn)(void *ctx)
A callback function that is called when a template is freed.
Definition: public.h:1584
uint16_t dataLength
length of the buffer used to store the elements in the list
Definition: public.h:1669
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:1665
uint16_t num
Information Element number.
Definition: public.h:1283
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:1667
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:2117
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 fbSessionAddTemplateCallback(fbSession_t *session, fbNewTemplateCallback_fn callback)
This function sets the callback to let the user know when a new template has arrived from the connect...
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:1285
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.
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:1663
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:2469
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'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:1383
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:1317
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:2119
guint index
iterator index
Definition: public.h:940
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's make up a listener group as a linked list.
Definition: public.h:1520
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:2484
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.
void(* fbTemplateCtxCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void **ctx, fbTemplateCtxFree_fn *fn)
A new callback function that will be called when the session receives a new external template...
Definition: public.h:1609
ListenerGroupResult's contain the listener who's listening socket got a new connection.
Definition: public.h:1540
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:1876
fbInfoModel_t * fbInfoModelAlloc(void)
Allocate a new information model.
fbVarfield_t ie_name
information element name
Definition: public.h:1323
uint8_t semantic
value used to describe the list of sub templates
Definition: public.h:2121
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:1866
char * name
Information element name.
Definition: public.h:1371
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:1453
uint32_t midx
Multiple IE index.
Definition: public.h:1276
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:1525
char * host
Hostname to connect/listen to.
Definition: public.h:1433
An iterator over the information elements in an information model.
Definition: public.h:932
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:1321
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:1878
void fbSubTemplateListSetSemantic(fbSubTemplateList_t *subTemplateListPtr, uint8_t semantic)
Sets the semantic parameter of a subTemplateList.
const struct fbInfoElement_st * canon
Pointer to canonical copy of IE.
Definition: public.h:1263
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.
gboolean fbInfoElementWriteOptionsRecord(fBuf_t *fbuf, const fbInfoElement_t *model_ie, uint16_t tid, GError **err)
Export an options record to the given fbuf with information element type information about the given ...
void * fbCollectorGetContext(fbCollector_t *collector)
Retrieve the application context associated with a collector.
void(* fbNewTemplateCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl)
The callback function to be called when the session receives a new external template from the connect...
Definition: public.h:1572
The corresponding struct to the Information Element Type Options Template.
Definition: public.h:1305
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:1422
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:927
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:1288
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:1296
uint16_t numElements
number of elements in this entry
Definition: public.h:2108
gboolean fbTemplateContainsElementByName(fbTemplate_t *tmpl, fbInfoElementSpec_t *spec)
Determine if a template contains at least one instance of a given information element, specified by name in the template's information model.
Reliable stream transport via TCP.
Definition: public.h:1403
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:2098
fbVarfield_t ie_desc
information element description
Definition: public.h:1325
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 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.
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:1431
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:1435
void fbCollectorSetUDPMultiSession(fbCollector_t *collector, gboolean multi_session)
Attempt to maintain backwards compatibility with UDP.
void fbSessionAddTemplateCtxCallback(fbSession_t *session, fbTemplateCtxCallback_fn callback)
This function sets the callback that allows the application to set its own context variable with a ne...
uint8_t * dataPtr
pointer to the buffer used to hold the data in this entry
Definition: public.h:2102
void fbCollectorManageUDPStreamByPort(fbCollector_t *collector, gboolean manage_port)
An attempt to fix what some netflow v9 exporters do wrong.
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:1443
uint16_t ie_id
information element id
Definition: public.h:1315
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'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:1221
const fbInfoModel_t * model
information Model
Definition: public.h:936
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:918
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:1396
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:184
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:1523
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:1313
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:1543
void fbListenerFreeGroupResult(fbListenerGroupResult_t *result)
Free the fbListenerGroupResult_t returned from fbListenerGroupWait.
Secure, partially reliable datagram transport via DTLS over SCTP.
Definition: public.h:1411
uint32_t fbTemplateCountElements(fbTemplate_t *tmpl)
Determine number of information elements in a template.
uint32_t fbCollectorGetObservationDomain(fbCollector_t *collector)
Retrieves the observation domain of the node connected to the 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:1661
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:1429
fbListener_t * listener
pointer to the listener to add to the list
Definition: public.h:1527
fbTemplate_t * tmpl
pointer to the template used to structure the data in this entry
Definition: public.h:2100
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:901
uint64_t max
range max
Definition: public.h:1292
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
Length override; if nonzero, replace the length of the IE from the model with this length...
Definition: public.h:1376
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:1255
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:1671
const char * name
Information element name.
Definition: public.h:1268
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:1294
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
A single IPFIX Information Element specification.
Definition: public.h:1369
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:1441
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:1319
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.