00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _FB_PRIVATE_H_
00017 #define _FB_PRIVATE_H_
00018 #include <fixbuf/public.h>
00019
00020 #ident "$Id: private.h 12404 2008-09-04 21:16:48Z inacio_svn $"
00021
00034 #define IPFIX_ENTERPRISE_BIT 0x8000
00035
00037 #define IPFIX_REVERSE_PEN 29305
00038
00041 #define FB_MSGLEN_MAX 65535
00042
00043
00049 struct fbTemplate_st {
00051 fbInfoModel_t *model;
00053 int ref_count;
00055 uint16_t ie_count;
00060 uint16_t scope_count;
00067 uint16_t ie_len;
00072 uint16_t tmpl_len;
00074 gboolean is_varlen;
00076 fbInfoElement_t **ie_ary;
00078 GHashTable *indices;
00080 uint16_t *off_cache;
00082 gboolean active;
00083 };
00084
00091 void fBufRewind(
00092 fBuf_t *fbuf);
00093
00105 gboolean fBufAppendTemplate(
00106 fBuf_t *fbuf,
00107 uint16_t tmpl_id,
00108 fbTemplate_t *tmpl,
00109 gboolean revoke,
00110 GError **err);
00111
00119 uint32_t fbInfoElementHash(
00120 fbInfoElement_t *ie);
00121
00130 gboolean fbInfoElementEqual(
00131 const fbInfoElement_t *a,
00132 const fbInfoElement_t *b);
00133
00141 void fbInfoElementDebug(
00142 gboolean tmpl,
00143 fbInfoElement_t *ie);
00144
00152 const fbInfoElement_t *fbInfoModelGetElement(
00153 fbInfoModel_t *model,
00154 fbInfoElement_t *ex_ie);
00155
00164 gboolean fbInfoElementCopyToTemplate(
00165 fbInfoModel_t *model,
00166 fbInfoElement_t *ex_ie,
00167 fbInfoElement_t *tmpl_ie);
00168
00179 gboolean fbInfoElementCopyToTemplateByName(
00180 fbInfoModel_t *model,
00181 const char *name,
00182 uint16_t len_override,
00183 fbInfoElement_t *tmpl_ie);
00184
00192 void fbTemplateRetain(
00193 fbTemplate_t *tmpl);
00194
00202 void fbTemplateRelease(
00203 fbTemplate_t *tmpl);
00204
00212 void fbTemplateFree(
00213 fbTemplate_t *tmpl);
00214
00223 void fbTemplateDebug(
00224 const char *label,
00225 uint16_t tid,
00226 fbTemplate_t *tmpl);
00227
00234 fbSession_t *fbSessionClone(
00235 fbSession_t *base);
00236
00244 uint32_t fbSessionGetSequence(
00245 fbSession_t *session);
00246
00254 void fbSessionSetSequence(
00255 fbSession_t *session,
00256 uint32_t sequence);
00257
00265 void fbSessionSetTemplateBuffer(
00266 fbSession_t *session,
00267 fBuf_t *fbuf);
00268
00276 fbInfoModel_t *fbSessionGetInfoModel(
00277 fbSession_t *session);
00278
00287 gboolean fbConnSpecLookupAI(
00288 fbConnSpec_t *spec,
00289 gboolean passive,
00290 GError **err);
00291
00300 gboolean fbConnSpecInitTLS(
00301 fbConnSpec_t *spec,
00302 gboolean passive,
00303 GError **err);
00304
00312 fbConnSpec_t *fbConnSpecCopy(
00313 fbConnSpec_t *spec);
00314
00322 void fbConnSpecFree(
00323 fbConnSpec_t *spec);
00324
00332 uint16_t fbExporterGetMTU(
00333 fbExporter_t *exporter);
00334
00344 gboolean fbExportMessage(
00345 fbExporter_t *exporter,
00346 uint8_t *msgbase,
00347 size_t msglen,
00348 GError **err);
00349
00357 void fbExporterFree(
00358 fbExporter_t *exporter);
00359
00370 fbCollector_t *fbCollectorAllocSocket(
00371 fbListener_t *listener,
00372 void *ctx,
00373 int fd,
00374 struct sockaddr *peer,
00375 size_t peerlen);
00376
00388 fbCollector_t *fbCollectorAllocTLS(
00389 fbListener_t *listener,
00390 void *ctx,
00391 int fd,
00392 struct sockaddr *peer,
00393 size_t peerlen,
00394 GError **err);
00395
00405 gboolean fbCollectMessage(
00406 fbCollector_t *collector,
00407 uint8_t *msgbase,
00408 size_t *msglen,
00409 GError **err);
00410
00418 int fbCollectorGetFD(
00419 fbCollector_t *collector);
00420
00428 void fbCollectorFree(
00429 fbCollector_t *collector);
00430
00438 gboolean fbCollectorHasTranslator(
00439 fbCollector_t *collector);
00440
00441
00449 void fbListenerRemove(
00450 fbListener_t *listener,
00451 int fd);
00452
00460 fbConnSpec_t *fbListenerGetConnSpec(
00461 fbListener_t *listener);
00462
00463 #endif