Skip to content

Commit

Permalink
Pull request #56: geneve: add geneve decode capability flag
Browse files Browse the repository at this point in the history
Merge in SNORT/libdaq from ~RAMANKS/libdaq:geneve to master

Squashed commit of the following:

commit bcbc2656a9c8e815d7b5cecff392f2148dc3d5f2
Author: Raman Krishnan <[email protected]>
Date:   Wed Nov 30 00:04:14 2022 +0000

    geneve: add geneve decode capability flag
  • Loading branch information
stechew committed Dec 5, 2022
1 parent 2b1d981 commit 96263fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/daq_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ typedef struct _daq_msg_pool_info
#define DAQ_CAPA_DECODE_6IN6 0x00010000 /* decodes and tracks flows of IPv6 within IPv6. */
#define DAQ_CAPA_DECODE_MPLS 0x00020000 /* decodes and tracks flows within MPLS. */
#define DAQ_CAPA_DECODE_VXLAN 0x00040000 /* decodes and tracks flows within VXLAN. */
#define DAQ_CAPA_DECODE_GENEVE 0x00080000 /* decodes and tracks flows within Geneve. */

/*
* DAQ I/O Controls (DIOCTLs)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

m4_define([daq_major_version], [3])
m4_define([daq_minor_version], [0])
m4_define([daq_patch_version], [9])
m4_define([daq_patch_version], [10])
m4_define([daq_version_str], [daq_major_version.daq_minor_version.daq_patch_version])

# Kill the 'divert' macro with extreme prejudice so it stops clashing with references
Expand Down
13 changes: 12 additions & 1 deletion modules/gwlb/daq_gwlb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#define CALL_SUBAPI(ctxt, fname, ...) \
ctxt->subapi.fname.func(ctxt->subapi.fname.context, __VA_ARGS__)

#define CALL_SUBAPI_NOARGS(ctxt, fname) \
ctxt->subapi.fname.func(ctxt->subapi.fname.context)

struct vlan_header {
uint16_t tpid;
uint16_t ether_type;
Expand Down Expand Up @@ -283,6 +286,14 @@ static int gwlb_daq_inject_relative (void* handle, const DAQ_Msg_t* msg, const u
return CALL_SUBAPI(ctx, inject_relative, msg, data, dlen, reverse);
}

static uint32_t gwlb_daq_get_capabilities(void *handle)
{
GWLBContext* ctx = static_cast<GWLBContext*>(handle);

return (CALL_SUBAPI_NOARGS(ctx, get_capabilities) | DAQ_CAPA_DECODE_GENEVE);
}


extern "C" {
#ifdef BUILDING_SO
DAQ_SO_PUBLIC DAQ_ModuleAPI_t DAQ_MODULE_DATA =
Expand Down Expand Up @@ -310,7 +321,7 @@ DAQ_ModuleAPI_t gwlb_daq_module_data =
/* .get_stats = */ NULL,
/* .reset_stats = */ NULL,
/* .get_snaplen = */ NULL,
/* .get_capabilities = */ NULL,
/* .get_capabilities = */ gwlb_daq_get_capabilities,
/* .get_datalink_type = */ NULL,
/* .config_load = */ NULL,
/* .config_swap = */ NULL,
Expand Down

0 comments on commit 96263fe

Please sign in to comment.