Go to the documentation of this file.
42 #ifndef _FB_PRIVATE_H_
43 #define _FB_PRIVATE_H_
64 #define IPFIX_ENTERPRISE_BIT 0x8000
68 #define FB_MSGLEN_MAX 65535
71 #define FB_SSL_ERR_BUFSIZ 512
80 char name[MAX_GROUP_NAME];
84 #define FB_SPREAD_NUM_GROUPS 16
87 #define FB_SPREAD_MTU 8192
106 int num_groups_to_send;
151 struct sockaddr_in ip4;
152 struct sockaddr_in6 ip6;
169 #ifdef DEFINE_TEMPLATE_METADATA_SPEC
172 {
"templateId", 2, 0 },
173 {
"paddingOctets", 6, 1 },
188 uint8_t template_padding[6];
412 uint16_t len_override,
516 const char *description);
597 unsigned int num_groups);
843 struct sockaddr *peer,
862 struct sockaddr *peer,
struct fbCollector_st fbCollector_t
IPFIX Collecting Process endpoint.
Definition: public.h:1950
void(* fbNewTemplateCallback_fn)(fbSession_t *session, uint16_t tid, fbTemplate_t *tmpl, void *app_ctx, void **tmpl_ctx, fbTemplateCtxFree_fn *tmpl_ctx_free_fn)
A callback function that will be called when the session receives a new external template.
Definition: public.h:2031
void fbSessionSetCollector(fbSession_t *session, fbCollector_t *collector)
fbSessionSetCollector
void fBufSetSession(fBuf_t *fbuf, fbSession_t *session)
fBufSetSession
uint16_t scope_count
Count of scope information elements in template.
Definition: private.h:213
int fbCollectorGetFD(fbCollector_t *collector)
fbCollectorGetFD
void fBufRemoveTemplateTcplan(fBuf_t *fbuf, fbTemplate_t *tmpl)
fBufRemoveTemplateTcplan
A single IPFIX Information Element definition.
Definition: public.h:1668
pthread_t recv_thread
the receiver thread
Definition: private.h:114
int recv_num_groups
actual size of group name array
Definition: private.h:126
void fbCollectorInterruptSocket(fbCollector_t *collector)
Interrupt the socket for a given collector to stop it from reading more data.
const char * fbConnSpreadError(int err)
fbConnSpreadError
int ref_count
Reference count.
Definition: private.h:206
void fBufSetExportGroups(fBuf_t *fbuf, char **groups, int num_groups, GError **err)
fBufSetExportGroups
int fbSessionExtTmplTableFlagIsSet(fbSession_t *session)
fbSessionExtTmplTableFlagIsSet
sp_groupname_t
Definition: private.h:79
unsigned int fbSessionGetGroup(fbSession_t *session)
fbSessionGetGroup
A single IPFIX Information Element specification.
Definition: public.h:1810
gboolean fBufAppendTemplate(fBuf_t *fbuf, uint16_t tmpl_id, fbTemplate_t *tmpl, gboolean revoked, GError **err)
fBufAppendTemplate
size_t peerlen
size of peer
Definition: private.h:155
void fbCollectorRemoveListenerLastBuf(fBuf_t *fbuf, fbCollector_t *collector)
fbCollectorRemoveListenerLastBuf
gboolean active
TRUE if this template has been activated (is no longer mutable)
Definition: private.h:241
Spread connection parameters.
Definition: public.h:1922
struct fbTemplateOptRec_st fbTemplateOptRec_t
Template metadata options record structure.
fbInfoElement_t ** ie_ary
Ordered array of pointers to information elements in this template.
Definition: private.h:235
int fbSessionIntTmplTableFlagIsSet(fbSession_t *session)
fbSessionIntTmplTableFlagIsSet
An IPFIX template or options template structure.
Definition: private.h:202
fbVarfield_t template_name
Template name.
Definition: private.h:190
An UDP Connection specifier.
Definition: private.h:143
void fbTemplateRetain(fbTemplate_t *tmpl)
fbTemplateRetain
uint16_t * off_cache
Field offset cache.
Definition: private.h:239
struct fBuf_st fBuf_t
An IPFIX message buffer.
Definition: public.h:1228
Fixbuf IPFIX protocol library public interface.
const fbInfoElement_t * fbInfoModelGetElement(fbInfoModel_t *model, fbInfoElement_t *ex_ie)
fbInfoModelGetElement
Template metadata options record structure.
Definition: private.h:185
#define FB_IESPEC_NULL
Convenience macro defining a null information element specification initializer (fbInfoElementSpec_t)...
Definition: public.h:1802
gboolean fbListenerCallAppInit(fbListener_t *listener, fbUDPConnSpec_t *spec, GError **err)
call appinit from UDP
uint16_t ie_internal_len
Total length required to store this template in memory.
Definition: private.h:226
struct fbInfoModel_st fbInfoModel_t
An IPFIX information model.
Definition: public.h:1253
gboolean fbCollectorTestGroupMembership(fbCollector_t *collector, int group_offset)
fbCollectorTestGroupMembership
union fbUDPConnSpec_st::@0 peer
key to this conn spec
struct fbUDPConnSpec_st * next
link to next one in list
Definition: private.h:157
Connection specifier.
Definition: public.h:1876
gboolean fbExportMessage(fbExporter_t *exporter, uint8_t *msgbase, size_t msglen, GError **err)
fbExportMessage
void * fbSessionNewTemplateCallbackAppCtx(fbSession_t *session)
Return the callback function's application context for a given session.
GError * recv_err
GError for thread errors, set by receiver, read by main.
Definition: private.h:120
gboolean fbInfoElementCopyToTemplate(fbInfoModel_t *model, fbInfoElement_t *ex_ie, fbInfoElement_t *tmpl_ie, GError **err)
fbInfoElementCopyToTemplate
uint32_t fbInfoElementHash(fbInfoElement_t *ie)
fbInfoElementHash
void fbSessionClearIntTmplTableFlag(fbSession_t *session)
fbSessionClearIntTmplTableFlag
int recv_max_groups
max size of group name array
Definition: private.h:124
void * ctx
application context.
Definition: private.h:147
struct fbUDPConnSpec_st * prev
doubly linked to timeout faster
Definition: private.h:159
unsigned int fbSessionGetGroupOffset(fbSession_t *session, char *group)
fbSessionGetGroupOffset
void fbConnSpecFree(fbConnSpec_t *spec)
fbConnSpecFree
pthread_mutex_t write_lock
Spread write lock.
Definition: private.h:112
int num_groups
number of groups in groups
Definition: private.h:103
void fbCollectorFree(fbCollector_t *collector)
fbCollectorFree
gboolean is_varlen
Set to TRUE if this template contains any variable length IEs.
Definition: private.h:233
void fbConnSpreadFree(fbSpreadSpec_t *spec)
fbConnSpreadFree
fbInfoModel_t * model
Information model (for looking up information elements by spec)
Definition: private.h:204
gboolean fbInfoElementCopyToTemplateByName(fbInfoModel_t *model, const char *name, uint16_t len_override, fbInfoElement_t *tmpl_ie, GError **err)
fbInfoElementCopyToTemplateByName
uint16_t fBufGetExportTemplate(fBuf_t *fbuf)
fBufGetExportTemplate
mailbox recv_mbox
the receiver's mailbox
Definition: private.h:116
void fbTemplateDebug(const char *label, uint16_t tid, fbTemplate_t *tmpl)
fbTemplateDebug
gboolean fbCollectorHasTranslator(fbCollector_t *collector)
fbCollectorHasTranslator
A variable-length field value.
Definition: public.h:1236
void fbListenerRemoveLastBuf(fBuf_t *fbuf, fbListener_t *listener)
fbListenerRemoveLastBuf
uint16_t ie_len
Total length of information elements in records described by this template.
Definition: private.h:220
mailbox mbox
the mailbox for the connection
Definition: private.h:108
void fbTemplateAddMetadataRecord(fbTemplate_t *tmpl, uint16_t tid, const char *name, const char *description)
Sets the metadata_rec member of tmpl to a newly allocated fbTemplateOptRec_t, and sets its template I...
gboolean fbInfoElementEqual(const fbInfoElement_t *a, const fbInfoElement_t *b)
fbInfoElementEqual
void fbSessionSetTemplateBuffer(fbSession_t *session, fBuf_t *fbuf)
fbSessionSetTemplateBuffer
gboolean fbConnSpecInitTLS(fbConnSpec_t *spec, gboolean passive, GError **err)
fbConnSpecInitTLS
struct sp_groupname_st sp_groupname_t
sp_groupname_t
fbSession_t * session
pointer to the session, this MUST be set to a valid session before the spec is passed to fbExporterAl...
Definition: private.h:95
void fBufRewind(fBuf_t *fbuf)
fBufRewind
void fbListenerRemove(fbListener_t *listener, int fd)
fbListenerRemove
fbSpreadSpec_t
Definition: private.h:92
void fbSessionSetGroup(fbSession_t *session, char *group)
fbSessionSetGroup
fbNewTemplateCallback_fn fbSessionNewTemplateCallback(fbSession_t *session)
Returns the callback function for a given session.
void * tmpl_ctx
Template context.
Definition: private.h:253
void fbSessionSetGroupParams(fbSession_t *session, sp_groupname_t *groups, unsigned int num_groups)
fbSessionSetGroupParams
sp_groupname_t * groups
pointer to array of group names, must have at least one, and must be null term array
Definition: private.h:101
gboolean fbConnSpecLookupAI(fbConnSpec_t *spec, gboolean passive, GError **err)
fbConnSpecLookupAI
fbTemplate_t * fbTemplateAllocTemplateMetadataTmpl(fbInfoModel_t *model, gboolean internal, GError **err)
Allocates a new Template to describe a record that holds Template Metadata.
char recv_privgroup[MAX_GROUP_NAME+2]
the connection private name for the receiver
Definition: private.h:118
void fbCollectorSetFD(fbCollector_t *collector, int fd)
fbCollectorSetFD
gboolean fbExporterCheckGroups(fbExporter_t *exporter, char **groups, int num_groups)
fbExporterCheckGroups
fbCollector_t * fbCollectorAllocSocket(fbListener_t *listener, void *ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
fbCollectorAllocSocket
fbSession_t * fbSessionClone(fbSession_t *base)
fbSessionClone
char privgroup[MAX_GROUP_NAME+2]
the connection private name
Definition: private.h:110
fbVarfield_t template_description
Template description (optional)
Definition: private.h:192
char * daemon
pointer to the daemon host address, in Spread format.
Definition: private.h:98
struct fbListener_st fbListener_t
IPFIX Collecting Process session listener.
Definition: public.h:1958
uint32_t obdomain
with peer address this is the key
Definition: private.h:163
GHashTable * indices
Map of information element to index in ie_ary.
Definition: private.h:237
fbCollector_t * fbCollectorAllocTLS(fbListener_t *listener, void *ctx, int fd, struct sockaddr *peer, size_t peerlen, GError **err)
fbCollectorAllocTLS
struct fbUDPConnSpec_st fbUDPConnSpec_t
An UDP Connection specifier.
void fbListenerAppFree(fbListener_t *listener, void *ctx)
fbListenerAppFree
uint16_t fbExporterGetMTU(fbExporter_t *exporter)
fbExporterGetMTU
struct fbSpreadSpec_st fbSpreadSpec_t
fbSpreadSpec_t
void fbExporterFree(fbExporter_t *exporter)
fbExporterFree
sp_groupname_t * groups_to_send
groups to send to
Definition: private.h:105
gboolean default_length
TRUE if any field was created using an fbInfoElementSpec_t with a defaulted length.
Definition: private.h:246
uint16_t tmpl_len
Total length of the template record or options template record defining this template.
Definition: private.h:231
struct fbExporter_st fbExporter_t
IPFIX Exporting Process endpoint.
Definition: public.h:1941
uint16_t template_id
Template ID.
Definition: private.h:187
uint32_t fbSessionGetSequence(fbSession_t *session)
fbSessionGetSequence
char * recv_mess
message buffer for receive
Definition: private.h:132
sp_groupname_t * recv_groups
groups array for SP_receive
Definition: private.h:128
fbConnSpec_t * fbConnSpecCopy(fbConnSpec_t *spec)
fbConnSpecCopy
void(* fbTemplateCtxFree_fn)(void *tmpl_ctx, void *app_ctx)
A callback function that is called when a template is freed.
Definition: public.h:2005
void fbTemplateFree(fbTemplate_t *tmpl)
fbTemplateFree
gboolean reject
reject flag
Definition: private.h:165
int recv_exit
flag to tell the thread to exit
Definition: private.h:122
struct fbSession_st fbSession_t
An IPFIX Transport Session state container.
Definition: public.h:1840
gboolean fbCollectMessage(fbCollector_t *collector, uint8_t *msgbase, size_t *msglen, GError **err)
fbCollectMessage
void fbSessionClearExtTmplTableFlag(fbSession_t *session)
fbSessionClearExtTmplTableFlag
fbTemplate_t * fbInfoElementAllocTypeTemplate2(fbInfoModel_t *model, gboolean internal, GError **err)
fbInfoElementAllocTypeTemplate2
gboolean fbCollectMessageBuffer(uint8_t *hdr, size_t b_len, size_t *m_len, GError **err)
fbCollectMessageBuffer
fbConnSpec_t * fbListenerGetConnSpec(fbListener_t *listener)
fbListenerGetConnSpec
#define FB_IE_VARLEN
Information element length constant for variable-length IE.
Definition: public.h:1494
fbSession_t * session
pointer to the session for this peer address
Definition: private.h:145
int recv_max
length of message buffer
Definition: private.h:130
fbSession_t * fbListenerSetPeerSession(fbListener_t *listener, fbSession_t *session)
Set the session on the fbuf and listener.
uint16_t ie_count
Count of information elements in template.
Definition: private.h:208
fbTemplateCtxFree_fn ctx_free
Callback to free the ctx pointer when template is freed.
Definition: private.h:257
void fbInfoElementDebug(gboolean tmpl, fbInfoElement_t *ie)
fbInfoElementDebug
void * app_ctx
The application's Context pointer for the ctx_free function.
Definition: private.h:261
void fbExporterSetGroupsToSend(fbExporter_t *exporter, char **groups, int num_groups)
fbExporterSetGroupToSend
const fbInfoElement_t * fbInfoModelAddAlienElement(fbInfoModel_t *model, fbInfoElement_t *ex_ie)
fbInfoModelAddAlienElement
time_t last_seen
last seen time
Definition: private.h:161
void fbSessionSetSequence(fbSession_t *session, uint32_t sequence)
fbSessionSetSequence
uint16_t fBufGetInternalTemplate(fBuf_t *fbuf)
fBufGetInternalTemplate
void fbTemplateRelease(fbTemplate_t *tmpl)
fbTemplateRelease
fbSpreadSpec_t * fbConnSpreadCopy(fbSpreadParams_t *spec)
fbConnSpreadCopy
void fbSessionSetPrivateGroup(fbSession_t *session, char *group, char *privgroup)
fbSessionSetPrivateGroup