ipfdemo_example.c

Reference Documentation

Platform
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.6
Napatech Software Suite: examples/net/ipfdemo/ipfdemo_example.c File Reference
ipfdemo_example.c File Reference
#include <argparse.h>
#include <nt.h>

Go to the source code of this file.

Functions

static uint64_t GetSystemTimeNoArg (void)
 
static int SendToReasm (unmThread_t *pUnm, NtNetBuf_t *phNetBuf)
 
 snprintf (streamName, sizeof(streamName),"IPFUnm_%i", pUnm->streamId)
 
 for (i=1;i< MAX_WAIT_ELEM;i++)
 
 if ((status=NT_NetRxOpen(&hNetRx, streamName, NT_NET_INTERFACE_PACKET, pUnm->streamId,-1))!=NT_SUCCESS)
 
 while (pUnm->pIpDefrag->Running)
 
 while (pWait)
 
 for (i=0;i< pUnm->pIpDefrag->reasmCnt;i++)
 
 if ((status=NT_NetRxClose(hNetRx))!=NT_SUCCESS)
 
static void _FreeUnmFragment (reasmThread_t *pReasm, int unmIndex, NtNetBuf_t hNetBuf)
 
static void _ReleaseDgramTblEntry (reasmThread_t *pReasm, tbl_entry_t *tbl_entry, NtNetStreamRx_t hNetRx)
 
static int _CheckDatagramComplete (reasmThread_t *pReasm, tbl_entry_t *tbl_entry, NtNetStreamRx_t hNetRx)
 
 snprintf (tmpBuffer, sizeof(tmpBuffer),"IPFReasm_%i", pReasm->streamId)
 
 if ((status=NT_NetRxOpen(&hNetRx, tmpBuffer, NT_NET_INTERFACE_PACKET, pReasm->streamId,-1))!=NT_SUCCESS)
 
 while (pReasm->pIpDefrag->Running)
 
 while (pTbl)
 
static void StopApplication (int sig __attribute__((unused)))
 
int main (int argc, const char *argv[])
 

Data Structures

struct  iphdr_s
 
union  _DOI_dgramId_u
 
struct  _DOI_dgramTbl_t
 
struct  frag_s
 
struct  _hashTbl_entry_s
 
struct  _msg_box_s
 
struct  wait_list_s
 
struct  _unmThread_s
 
struct  _reasmThread_s
 
struct  _ipDefrag
 

Macros

#define FRAG_OFFS_MASK   0x1FFF
 
#define LAST_FRAG_BITS   0x00E0
 
#define L3_ADDR(_NetBuf_)   ((uint8_t *)NT_NET_GET_PKT_L2_PTR(_NetBuf_)+NT_NET_GET_PKT_L3_OFFSET(_NetBuf_))
 
#define IPVERSION(_NetBuf_)   (((iphdr_t *)L3_ADDR(_NetBuf_))->ipVer)
 
#define IPV4_HDR_LENGTH(_NetBuf_)   ((uint8_t)(((iphdr_t *)L3_ADDR(_NetBuf_))->ipHlen)<<2)
 
#define IPV4_TOT_LEN(_NetBuf_)   (ntohs(((iphdr_t *)L3_ADDR(_NetBuf_))->ipTotlen))
 
#define IPV4_FRAGMENT_ID(_NetBuf_)   (ntohs(((iphdr_t *)L3_ADDR(_NetBuf_))->Id))
 
#define IPV4_FRAGMENT_OFFSET(_NetBuf_)   ((ntohs(((iphdr_t *)L3_ADDR(_NetBuf_))->fragOffs)&FRAG_OFFS_MASK)<<3)
 
#define IPV4_LAST_FRAG(_NetBuf_)   (((((iphdr_t *)L3_ADDR(_NetBuf_))->fragOffs)&LAST_FRAG_BITS)==0)
 
#define IPV4_SRC_ADDR(_NetBuf_)   (((iphdr_t *)L3_ADDR(_NetBuf_))->srcAddr)
 
#define IPV4_DST_ADDR(_NetBuf_)   (((iphdr_t *)L3_ADDR(_NetBuf_))->dstAddr)
 
#define IPV4_PROTOCOL(_NetBuf_)   (((iphdr_t *)L3_ADDR(_NetBuf_))->prot)
 
#define IPV4_GET_DGRAM_ID(_NetBuf_, _src_, _dst_, _id_, _prot_)
 
#define IPV4_DATA_LEN(_NetBuf_)   (IPV4_TOT_LEN(_NetBuf_)-IPV4_HDR_LENGTH(_NetBuf_))
 
#define MAX_SRC_ID   8
 
#define DOI_FRAG_TBL_SIZE   8081 /* Prime number */
 
#define DOI_HASH_GET_KEY(_entry_, _src_, _id_)   (_entry_ = (_src_+_id_)%DOI_FRAG_TBL_SIZE)
 
#define MAX_FRAG_CNT   18
 
#define REASSEMBLY_HASH_TBL_SIZE   1021 /* Prime number */
 
#define INITIAL_HASH_TBL_ENTRY_CNT   1024
 
#define LOOKUP_ENTRY(_tbl_base_, _tbl_entry_type_, _tbl_size_, _id1_, _id2_, _tbl_entry_)
 
#define GET_NEW_TBL_ENTRY(_tbl_free_, _tbl_entry_type_, _tbl_entry_)
 
#define RELEASE_TBL_ENTRY(_tbl_free_, _tbl_entry_)
 
#define ADD_ENTRY_TO_TBL(_tbl_base_, _tbl_entry_type_, _tbl_size_, _tbl_entry_)
 
#define DEL_ENTRY_FROM_TBL(_tbl_base_, _tbl_entry_type_, _tbl_size_, _tbl_entry_)
 
#define MSG_BOX_DEPTH   0x2000
 
#define MSG_BOX_EMPTY(_fifo_)   ((_fifo_)->wrIdx==(_fifo_)->rdIdx)
 
#define MSG_BOX_FULL(_fifo_)   (((_fifo_)->wrIdx-(_fifo_)->rdIdx) >= MSG_BOX_DEPTH)
 
#define MSG_BOX_GET(_fifo_)   (_fifo_)->data[(_fifo_)->rdIdx&(MSG_BOX_DEPTH-1)]; compiler_barrier(); (_fifo_)->rdIdx++
 
#define MSG_BOX_PUT(_fifo_, _elem_)
 
#define MAX_WAIT_ELEM   1024
 
#define NO_OPTIONS   0
 
#define OPTION_HELP   (1<<1)
 
#define OPTION_ADAPTER   (1<<2)
 
#define OPTION_NUM_REASM   (1<<3)
 
#define OPTION_NUM_UNM   (1<<4)
 
#define OPTION_TIMEOUT   (1<<5)
 
#define OPTION_TABLE_PERSIST   (1<<6)
 
#define OPTION_TABLE_TIMEOUT   (1<<7)
 
#define INPUT_ADAPTER   0
 
#define FRAGMENT_TIMEOUT   2000
 
#define NUM_STREAMS   4
 
#define NUM_UNM_STREAMS   4
 
#define TABLE_TIMEOUT   125
 
#define TABLE_PERSIST_TIMEOUT   0
 
#define NUM_NTPL   3
 

Typedefs

typedef struct iphdr_s iphdr_t
 
typedef union _DOI_dgramId_u DOI_dgramId_u
 
typedef struct _DOI_dgramTbl_t DOI_dgramTbl_t
 
typedef struct _hashTbl_entry_s tbl_entry_t
 
typedef struct _ipDefrag ipDefrag_t
 
typedef struct _msg_box_s msg_box_t
 
typedef struct wait_list_s wait_list_t
 
typedef struct _unmThread_s unmThread_t
 
typedef struct _reasmThread_s reasmThread_t
 

Variables

static int opt_adapter = -1
 
static int opt_reasm = -1
 
static int opt_unm = -1
 
static int opt_frag = -1
 
static char * opt_persist = NULL
 
static int opt_timeout = -1
 
struct argparse_option arg_options []
 
static struct _ipDefrag IpDefrag
 
static const char * usageText []
 
char streamName [20]
 
char errorBuffer [NT_ERRBUF_SIZE]
 
NtNetStreamRx_t hNetRx
 
NtNetBuf_t hNetBuf = NULL
 
int i
 
int status
 
int invalidPkt
 
int checkTimeout = 0
 
uint64_t sysTs = 0
 
int deleteIt
 
wait_list_tpWait = pUnm->pWait
 
pUnm WaitListElem[0] pNext = NULL
 
pUnm pFree = &pUnm->WaitListElem[MAX_WAIT_ELEM - 1]
 
char tmpBuffer [20]
 
int ii
 
uint8_t fromUnm
 
uint8_t unmIndex
 
int timeoutChkCnt = 0
 
DOI_dgramId_u val
 
DOI_dgramId_u val1
 
tbl_entry_tpTbl
 
EXIT __pad0__
 
i< REASSEMBLY_HASH_TBL_SIZE;i++){pTbl=pReasm-> tbl [i]
 

Function Documentation

static uint64_t GetSystemTimeNoArg ( void  )
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 608 of file ipfdemo_example.c.

Referenced by while().

static int SendToReasm ( unmThread_t pUnm,
NtNetBuf_t phNetBuf 
)
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 621 of file ipfdemo_example.c.

Referenced by while().

for ( )

Definition at line 702 of file ipfdemo_example.c.

if ( (status=NT_NetRxOpen(&hNetRx, streamName, NT_NET_INTERFACE_PACKET, pUnm->streamId,-1))!  = NT_SUCCESS)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 708 of file ipfdemo_example.c.

Referenced by _nt_net_get_next_packet(), and main().

while ( pUnm->pIpDefrag->  Running = = 0)

Definition at line 719 of file ipfdemo_example.c.

while ( pWait  )

Definition at line 842 of file ipfdemo_example.c.

for ( i  = 0; i < pUnm->pIpDefrag->reasmCnt; i++)

Definition at line 855 of file ipfdemo_example.c.

if ( (status=NT_NetRxClose(hNetRx))!  = NT_SUCCESS)

Definition at line 863 of file ipfdemo_example.c.

static void _FreeUnmFragment ( reasmThread_t pReasm,
int  unmIndex,
NtNetBuf_t  hNetBuf 
)
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 877 of file ipfdemo_example.c.

Referenced by _ReleaseDgramTblEntry(), and while().

static void _ReleaseDgramTblEntry ( reasmThread_t pReasm,
tbl_entry_t tbl_entry,
NtNetStreamRx_t  hNetRx 
)
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 904 of file ipfdemo_example.c.

Referenced by _CheckDatagramComplete(), and while().

static int _CheckDatagramComplete ( reasmThread_t pReasm,
tbl_entry_t tbl_entry,
NtNetStreamRx_t  hNetRx 
)
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 934 of file ipfdemo_example.c.

Referenced by while().

snprintf ( tmpBuffer  ,
sizeof(tmpBuffer ,
"IPFReasm_%i ,
pReasm->  streamId 
)
if ( (status=NT_NetRxOpen(&hNetRx, tmpBuffer, NT_NET_INTERFACE_PACKET, pReasm->streamId,-1))!  = NT_SUCCESS)

Definition at line 999 of file ipfdemo_example.c.

while ( pReasm->pIpDefrag->  Running)

Definition at line 1011 of file ipfdemo_example.c.

while ( pTbl  )

Definition at line 1185 of file ipfdemo_example.c.

static void StopApplication ( int sig   __attribute__(unused))
static

Definition at line 1225 of file ipfdemo_example.c.

Referenced by main(), and while().

int main ( int  argc,
const char *  argv[] 
)

Definition at line 1250 of file ipfdemo_example.c.

Macro Definition Documentation

#define FRAG_OFFS_MASK   0x1FFF

Definition at line 328 of file ipfdemo_example.c.

#define LAST_FRAG_BITS   0x00E0

Definition at line 329 of file ipfdemo_example.c.

#define L3_ADDR (   _NetBuf_)    ((uint8_t *)NT_NET_GET_PKT_L2_PTR(_NetBuf_)+NT_NET_GET_PKT_L3_OFFSET(_NetBuf_))

Definition at line 339 of file ipfdemo_example.c.

#define IPVERSION (   _NetBuf_)    (((iphdr_t *)L3_ADDR(_NetBuf_))->ipVer)

Definition at line 340 of file ipfdemo_example.c.

#define IPV4_HDR_LENGTH (   _NetBuf_)    ((uint8_t)(((iphdr_t *)L3_ADDR(_NetBuf_))->ipHlen)<<2)

Definition at line 343 of file ipfdemo_example.c.

#define IPV4_TOT_LEN (   _NetBuf_)    (ntohs(((iphdr_t *)L3_ADDR(_NetBuf_))->ipTotlen))

Definition at line 344 of file ipfdemo_example.c.

#define IPV4_FRAGMENT_ID (   _NetBuf_)    (ntohs(((iphdr_t *)L3_ADDR(_NetBuf_))->Id))

Definition at line 345 of file ipfdemo_example.c.

#define IPV4_FRAGMENT_OFFSET (   _NetBuf_)    ((ntohs(((iphdr_t *)L3_ADDR(_NetBuf_))->fragOffs)&FRAG_OFFS_MASK)<<3)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 346 of file ipfdemo_example.c.

Referenced by while().

#define IPV4_LAST_FRAG (   _NetBuf_)    (((((iphdr_t *)L3_ADDR(_NetBuf_))->fragOffs)&LAST_FRAG_BITS)==0)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 347 of file ipfdemo_example.c.

Referenced by while().

#define IPV4_SRC_ADDR (   _NetBuf_)    (((iphdr_t *)L3_ADDR(_NetBuf_))->srcAddr)

Definition at line 348 of file ipfdemo_example.c.

#define IPV4_DST_ADDR (   _NetBuf_)    (((iphdr_t *)L3_ADDR(_NetBuf_))->dstAddr)

Definition at line 349 of file ipfdemo_example.c.

#define IPV4_PROTOCOL (   _NetBuf_)    (((iphdr_t *)L3_ADDR(_NetBuf_))->prot)

Definition at line 350 of file ipfdemo_example.c.

#define IPV4_GET_DGRAM_ID (   _NetBuf_,
  _src_,
  _dst_,
  _id_,
  _prot_ 
)
Value:
do {iphdr_t *_ip_=(iphdr_t *)L3_ADDR(_NetBuf_);_src_=_ip_->srcAddr;_dst_=_ip_->dstAddr;\
_id_=_ip_->Id;_prot_=_ip_->prot;}while(0)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 352 of file ipfdemo_example.c.

Referenced by SendToReasm(), and while().

#define IPV4_DATA_LEN (   _NetBuf_)    (IPV4_TOT_LEN(_NetBuf_)-IPV4_HDR_LENGTH(_NetBuf_))
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 356 of file ipfdemo_example.c.

Referenced by while().

#define MAX_SRC_ID   8
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 368 of file ipfdemo_example.c.

Referenced by SendToReasm(), and while().

#define DOI_FRAG_TBL_SIZE   8081 /* Prime number */
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 374 of file ipfdemo_example.c.

Referenced by main(), SendToReasm(), and while().

#define DOI_HASH_GET_KEY (   _entry_,
  _src_,
  _id_ 
)    (_entry_ = (_src_+_id_)%DOI_FRAG_TBL_SIZE)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 375 of file ipfdemo_example.c.

Referenced by SendToReasm(), and while().

#define MAX_FRAG_CNT   18
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 389 of file ipfdemo_example.c.

Referenced by while().

#define REASSEMBLY_HASH_TBL_SIZE   1021 /* Prime number */
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 390 of file ipfdemo_example.c.

Referenced by _ReleaseDgramTblEntry(), main(), and while().

#define INITIAL_HASH_TBL_ENTRY_CNT   1024
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 391 of file ipfdemo_example.c.

Referenced by main().

#define LOOKUP_ENTRY (   _tbl_base_,
  _tbl_entry_type_,
  _tbl_size_,
  _id1_,
  _id2_,
  _tbl_entry_ 
)
Value:
{ \
uint32_t _key_ = (uint32_t)((_id1_ ^ _id2_) % _tbl_size_); \
_tbl_entry_type_ *_tbl_; \
_tbl_ = _tbl_base_[_key_]; \
while (_tbl_ && (_tbl_->id1 != _id1_ || _tbl_->id2 != _id2_)) { \
_tbl_ = _tbl_->pNext; \
} \
_tbl_entry_=_tbl_; \
}
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 403 of file ipfdemo_example.c.

Referenced by while().

#define GET_NEW_TBL_ENTRY (   _tbl_free_,
  _tbl_entry_type_,
  _tbl_entry_ 
)
Value:
{ \
if (!_tbl_free_) { \
int __o__; \
_tbl_entry_type_ *__plm__; \
for (__o__ = 0; __o__ < 64; __o__++) { \
__plm__ = calloc(1, sizeof(_tbl_entry_type_)); \
if (!__plm__) assert(0); \
__plm__->pNext = _tbl_free_; \
_tbl_free_ = __plm__; \
} \
} \
_tbl_entry_ = _tbl_free_; \
_tbl_free_ = _tbl_free_->pNext; \
tbl_entry->pNext = NULL; \
}
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 414 of file ipfdemo_example.c.

Referenced by while().

#define RELEASE_TBL_ENTRY (   _tbl_free_,
  _tbl_entry_ 
)
Value:
{ \
_tbl_entry_->pNext = _tbl_free_; \
_tbl_free_ = _tbl_entry_; \
}
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 431 of file ipfdemo_example.c.

Referenced by _ReleaseDgramTblEntry().

#define ADD_ENTRY_TO_TBL (   _tbl_base_,
  _tbl_entry_type_,
  _tbl_size_,
  _tbl_entry_ 
)
Value:
{ \
uint32_t _key_ = (uint32_t)((_tbl_entry_->id1 ^ _tbl_entry_->id2) % _tbl_size_); \
_tbl_entry_type_ *_tbl_; \
_tbl_ = _tbl_base_[_key_]; \
while (_tbl_ && (_tbl_->id1 != _tbl_entry_->id1 || _tbl_->id2 != _tbl_entry_->id2)) { \
_tbl_ = _tbl_->pNext; \
} \
if (_tbl_ == NULL) { \
_tbl_entry_->pNext = _tbl_base_[_key_]; \
_tbl_base_[_key_] = _tbl_entry_; \
} \
else { \
assert(_tbl_==_tbl_entry_); \
} \
}
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 437 of file ipfdemo_example.c.

Referenced by while().

#define DEL_ENTRY_FROM_TBL (   _tbl_base_,
  _tbl_entry_type_,
  _tbl_size_,
  _tbl_entry_ 
)
Value:
{ \
uint32_t _key_ = (uint32_t)((_tbl_entry_->id1 ^ _tbl_entry_->id2) % _tbl_size_); \
_tbl_entry_type_ *_tbl_, *_prev_ = NULL; \
_tbl_ = _tbl_base_[_key_]; \
while (_tbl_ && (_tbl_->id1 != _tbl_entry_->id1 || _tbl_->id2 != _tbl_entry_->id2)) { \
_prev_ = _tbl_;_tbl_ = _tbl_->pNext; \
} \
if (_tbl_) { \
if (_prev_) { \
_prev_->pNext = _tbl_->pNext; \
} \
else { \
_tbl_base_[_key_] = _tbl_->pNext; \
} \
} \
else { \
assert(0); \
} \
}
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 454 of file ipfdemo_example.c.

Referenced by _ReleaseDgramTblEntry().

#define MSG_BOX_DEPTH   0x2000
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 487 of file ipfdemo_example.c.

#define MSG_BOX_EMPTY (   _fifo_)    ((_fifo_)->wrIdx==(_fifo_)->rdIdx)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 495 of file ipfdemo_example.c.

Referenced by for(), and while().

#define MSG_BOX_FULL (   _fifo_)    (((_fifo_)->wrIdx-(_fifo_)->rdIdx) >= MSG_BOX_DEPTH)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 496 of file ipfdemo_example.c.

Referenced by _FreeUnmFragment(), and SendToReasm().

#define MSG_BOX_GET (   _fifo_)    (_fifo_)->data[(_fifo_)->rdIdx&(MSG_BOX_DEPTH-1)]; compiler_barrier(); (_fifo_)->rdIdx++
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 497 of file ipfdemo_example.c.

Referenced by for(), and while().

#define MSG_BOX_PUT (   _fifo_,
  _elem_ 
)
Value:
do { \
(_fifo_)->data[(_fifo_)->wrIdx&(MSG_BOX_DEPTH-1)]=_elem_; \
compiler_barrier(); \
(_fifo_)->wrIdx++; \
} while (0)
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 498 of file ipfdemo_example.c.

Referenced by _FreeUnmFragment(), and SendToReasm().

#define MAX_WAIT_ELEM   1024
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 508 of file ipfdemo_example.c.

#define NO_OPTIONS   0

Definition at line 566 of file ipfdemo_example.c.

#define OPTION_HELP   (1<<1)

Definition at line 567 of file ipfdemo_example.c.

#define OPTION_ADAPTER   (1<<2)

Definition at line 568 of file ipfdemo_example.c.

#define OPTION_NUM_REASM   (1<<3)

Definition at line 569 of file ipfdemo_example.c.

#define OPTION_NUM_UNM   (1<<4)

Definition at line 570 of file ipfdemo_example.c.

#define OPTION_TIMEOUT   (1<<5)

Definition at line 571 of file ipfdemo_example.c.

#define OPTION_TABLE_PERSIST   (1<<6)

Definition at line 572 of file ipfdemo_example.c.

#define OPTION_TABLE_TIMEOUT   (1<<7)

Definition at line 573 of file ipfdemo_example.c.

#define INPUT_ADAPTER   0
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1238 of file ipfdemo_example.c.

Referenced by main().

#define FRAGMENT_TIMEOUT   2000
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1239 of file ipfdemo_example.c.

Referenced by main().

#define NUM_STREAMS   4
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1240 of file ipfdemo_example.c.

Referenced by main().

#define NUM_UNM_STREAMS   4
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1241 of file ipfdemo_example.c.

Referenced by main().

#define TABLE_TIMEOUT   125
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1242 of file ipfdemo_example.c.

Referenced by main().

#define TABLE_PERSIST_TIMEOUT   0
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1243 of file ipfdemo_example.c.

Referenced by main().

#define NUM_NTPL   3
Examples:
net/ipfdemo/ipfdemo_example.c.

Referenced by main().

Typedef Documentation

typedef struct iphdr_s iphdr_t
typedef struct _ipDefrag ipDefrag_t

Definition at line 476 of file ipfdemo_example.c.

Variable Documentation

int opt_adapter = -1
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 575 of file ipfdemo_example.c.

Referenced by main().

int opt_reasm = -1
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 576 of file ipfdemo_example.c.

Referenced by main().

int opt_unm = -1
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 577 of file ipfdemo_example.c.

Referenced by main().

int opt_frag = -1
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 578 of file ipfdemo_example.c.

char* opt_persist = NULL
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 579 of file ipfdemo_example.c.

int opt_timeout = -1
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 580 of file ipfdemo_example.c.

struct argparse_option arg_options[]
Initial value:
= {
OPT_INTEGER('a', "adapter", &opt_adapter, "The adapter to run tests on", NULL, 0, 0, "adapter number"),
OPT_INTEGER('r', "reasm", &opt_reasm, "Number of concurrent IP fragments re-assembling streams/threads", NULL, 0, 0, "number"),
OPT_INTEGER('u', "unm", &opt_unm, "Number of concurrent un-matched streams/threads", NULL, 0, 0, "number"),
OPT_INTEGER('f', "fragtimeout", &opt_frag, "How old fragments may get before they are deleted from tables (ms)", NULL, 0, 0, "ms"),
OPT_STRING( 'p', "tablepersist", &opt_persist, "FPGA TablePersist", NULL, 0, 0, "timeout|lastfragment"),
OPT_INTEGER('t', "tabletimeout", &opt_timeout, "FPGA table timeout", NULL, 0, 0, "value"),
}

Table of valid options.

Definition at line 585 of file ipfdemo_example.c.

struct _ipDefrag IpDefrag
static
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 596 of file ipfdemo_example.c.

Referenced by main(), and StopApplication().

const char* usageText[]
static
Initial value:
= {
"Syntax:\n"
"\n"
"ipfdemo_example [-a <adapter number>] [-r <number>] [-u <number>] [-f <ms>] [-p <timeout|lastfragment>] [-t <value>]\n"
"\nCommands:\n",

Definition at line 598 of file ipfdemo_example.c.

char streamName[20]
Initial value:
{
unmThread_t *pUnm = (unmThread_t *)arg
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 684 of file ipfdemo_example.c.

int status
Examples:
bypass/config/bypass_config_example.c, bypass/info/bypass_info_example.c, bypass/watchdog/bypass_watchdog_example.c, config/config_example.c, event/event_example.c, eventMonitor_example.c, flowmatch/flowmatch_example_main.cpp, info/info_example.c, net/analysis/analysis_example.c, net/capture/capture_example.c, net/checksum/checksum_example.cpp, net/inline/inline_example.c, net/ipfdemo/ipfdemo_example.c, net/netflow/netflow_example.c, net/numa/numa_example.c, net/readcapfile/readcapfile_example.c, net/replay/replay_example.c, net/replay4GA/replay4ga_example.c, net/replayGS/replayGS_example.c, net/streamidstatistics/streamidstatistics_example.c, net/timestamp_inject/timestamp_inject_example.cpp, net/transmit_multifunction/transmit_multifunction_example.c, net/transmit_on_timestamp/transmit_on_timestamp_example.c, net/transmit_on_timestamp_setclock/transmit_on_timestamp_setclock_example.c, net/transmit_packet/transmit_packet_example.c, net/transmit_pcap/transmit_pcap_example.c, net/transmit_segment/transmit_segment_example.c, net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp, net/vlandemo/vlandemo_example.c, pps/pps_example.c, sensor/sensor_example.c, stat/stat_example.c, and statUsage/statUsage_example.c.

Definition at line 691 of file ipfdemo_example.c.

Referenced by _NetTxDataCheckHbInfo(), _TxPortRateLimit(), applyNtpl(), assignNtplFilters(), DumpEvent(), DumpSensor(), featuresAvailable(), ForceAnEvent(), get_max_packet_size(), GetAdapterTimestamp(), GetSensorData(), GetTimeStamp(), Is4GATxSupported(), main(), anonymous_namespace{flowmatch_example_ntpl.cpp}::ntplCall(), openAndClearFlowStats(), printAndCloseFlowStats(), printTransmissionStart(), PacketReaderThread::processPackets(), SetGlobalSync(), setHostLoopback(), showProductInfo(), taskReceiverCounter(), taskReceiverMiss(), taskTransmitter(), PacketTransmitterThread::transmitPackets(), and PacketTransmitterThread::txPacket().

int invalidPkt
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 692 of file ipfdemo_example.c.

int checkTimeout = 0
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 693 of file ipfdemo_example.c.

uint64_t sysTs = 0
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 694 of file ipfdemo_example.c.

int deleteIt
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 695 of file ipfdemo_example.c.

pWait = pUnm->pWait
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 696 of file ipfdemo_example.c.

pUnm WaitListElem [0] pNext = NULL
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 701 of file ipfdemo_example.c.

pUnm pFree = &pUnm->WaitListElem[MAX_WAIT_ELEM - 1]
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 705 of file ipfdemo_example.c.

int ii
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 986 of file ipfdemo_example.c.

Referenced by main().

uint8_t fromUnm
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 988 of file ipfdemo_example.c.

Referenced by while().

uint8_t unmIndex
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 990 of file ipfdemo_example.c.

Referenced by while().

timeoutChkCnt = 0
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 992 of file ipfdemo_example.c.

Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 994 of file ipfdemo_example.c.

Referenced by SendToReasm().

Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 994 of file ipfdemo_example.c.

Referenced by SendToReasm().

tbl_entry_t* pTbl
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 995 of file ipfdemo_example.c.

Referenced by SendToReasm().

EXIT __pad0__

Definition at line 1183 of file ipfdemo_example.c.

i< REASSEMBLY_HASH_TBL_SIZE; i++) { pTbl = pReasm-> tbl[i]
Examples:
net/ipfdemo/ipfdemo_example.c.

Definition at line 1184 of file ipfdemo_example.c.

Referenced by main().