fixbuf - API Documentation
Documentation | Downloads

private.h

Go to the documentation of this file.
00001 /*
00002  ** private.h
00003  ** fixbuf IPFIX Implementation Private Interface
00004  **
00005  ** ------------------------------------------------------------------------
00006  ** Copyright (C) 2006-2008 Carnegie Mellon University. All Rights Reserved.
00007  ** ------------------------------------------------------------------------
00008  ** Authors: Brian Trammell <bht@cert.org>
00009  ** ------------------------------------------------------------------------
00010  ** GNU Lesser GPL Rights pursuant to Version 2.1, February 1999 
00011  ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.225-7013
00012  ** ------------------------------------------------------------------------
00013  */
00014 
00015 #ifndef _FB_PRIVATE_H_
00016 #define _FB_PRIVATE_H_
00017 #include <fixbuf/public.h>
00018 
00034 struct fbTemplate_st {
00036     fbInfoModel_t       *model;
00038     int                 ref_count;
00040     uint16_t            ie_count;
00045     uint16_t            scope_count;
00052     uint16_t            ie_len;
00057     uint16_t            tmpl_len;
00059     gboolean            is_varlen;
00061     fbInfoElement_t     **ie_ary;
00063     GHashTable          *indices;
00065     uint16_t            *off_cache;
00067     gboolean            active;
00068 };
00069 
00070 void                fBufRewind(
00071     fBuf_t              *fbuf);
00072 
00073 gboolean            fBufAppendTemplate(
00074     fBuf_t              *fbuf,
00075     uint16_t            tmpl_id,
00076     fbTemplate_t        *tmpl,
00077     gboolean            revoke,
00078     GError              **err);
00079    
00080 uint32_t            fbInfoElementHash(
00081     fbInfoElement_t     *ie);
00082 
00083 gboolean            fbInfoElementEqual(
00084     const fbInfoElement_t   *a,
00085     const fbInfoElement_t   *b);
00086 
00087 void                fbInfoElementDebug(
00088     gboolean            tmpl,
00089     fbInfoElement_t     *ie);
00090 
00091 const fbInfoElement_t     *fbInfoModelGetElement(
00092     fbInfoModel_t       *model,
00093     fbInfoElement_t     *ex_ie);
00094 
00095 gboolean            fbInfoElementCopyToTemplate(
00096     fbInfoModel_t       *model,
00097     fbInfoElement_t     *ex_ie,
00098     fbInfoElement_t     *tmpl_ie);
00099 
00100 gboolean            fbInfoElementCopyToTemplateByName(
00101     fbInfoModel_t       *model,
00102     const char          *name,
00103     uint16_t            len_override,
00104     fbInfoElement_t     *tmpl_ie);
00105 
00106 void                fbTemplateRetain(
00107     fbTemplate_t        *tmpl);
00108 
00109 void                fbTemplateRelease(
00110     fbTemplate_t        *tmpl);
00111 
00112 void                fbTemplateFree(
00113     fbTemplate_t        *tmpl);
00114 
00115 void                fbTemplateDebug(
00116     const char          *label,
00117     uint16_t            tid,
00118     fbTemplate_t        *tmpl);
00119 
00120 fbSession_t         *fbSessionClone(
00121     fbSession_t         *base);
00122 
00123 uint32_t            fbSessionGetSequence(
00124     fbSession_t         *session);
00125 
00126 void                fbSessionSetSequence(
00127     fbSession_t         *session,
00128     uint32_t            sequence);
00129 
00130 void                fbSessionSetTemplateBuffer(
00131     fbSession_t         *session,
00132     fBuf_t              *fbuf);
00133 
00134 fbInfoModel_t       *fbSessionGetInfoModel(
00135     fbSession_t         *session);
00136 
00137 gboolean            fbConnSpecLookupAI(
00138     fbConnSpec_t        *spec,
00139     gboolean            passive,
00140     GError              **err);
00141 
00142 gboolean            fbConnSpecInitTLS(
00143     fbConnSpec_t        *spec,
00144     gboolean            passive,
00145     GError              **err);
00146 
00147 fbConnSpec_t        *fbConnSpecCopy(
00148     fbConnSpec_t        *spec);
00149 
00150 void                fbConnSpecFree(
00151     fbConnSpec_t        *spec);
00152 
00153 uint16_t            fbExporterGetMTU(
00154     fbExporter_t        *exporter);
00155        
00156 gboolean            fbExportMessage(
00157     fbExporter_t        *exporter,
00158     uint8_t             *msgbase,
00159     size_t              msglen,
00160     GError              **err);
00161     
00162 void                fbExporterFree(
00163     fbExporter_t       *exporter);
00164 
00165 fbCollector_t       *fbCollectorAllocSocket(
00166     fbListener_t        *listener,
00167     void                *ctx,
00168     int                 fd,
00169     struct sockaddr     *peer,
00170     size_t              peerlen);
00171 
00172 fbCollector_t       *fbCollectorAllocTLS(
00173     fbListener_t        *listener,
00174     void                *ctx,
00175     int                 fd,
00176     struct sockaddr     *peer,
00177     size_t              peerlen,
00178     GError              **err);
00179 
00180 gboolean            fbCollectMessage(
00181     fbCollector_t       *collector,
00182     uint8_t             *msgbase,
00183     size_t              *msglen,
00184     GError              **err);
00185 
00186 int                 fbCollectorGetFD(
00187     fbCollector_t       *collector);
00188 
00189 void                fbCollectorFree(
00190     fbCollector_t       *collector);
00191 
00192 void fbListenerRemove(
00193     fbListener_t        *listener,
00194     int                 fd);
00195 
00196 fbConnSpec_t        *fbListenerGetConnSpec(
00197     fbListener_t        *listener);
00198 
00199 #endif