Go to the source code of this file.
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 |
Functions | |
| static uint64_t | GetSystemTimeNoArg (void) |
| static int | SendToReasm (unmThread_t *pUnm, NtNetBuf_t *phNetBuf) |
| static void * | _UnMatchedThread (void *arg) |
| static void | _FreeUnmFragment (reasmThread_t *pReasm, unsigned 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) |
| static void * | _ReassemblyThread (void *arg) |
| static void | StopApplication (int sig) |
| int | main (int argc, const char *argv[]) |
Variables | |
| atomic_int | appRunning = 0 |
| 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 [] |
Macro Definition Documentation
| #define FRAG_OFFS_MASK 0x1FFF |
Definition at line 301 of file ipfdemo_example.c.
| #define LAST_FRAG_BITS 0x00E0 |
Definition at line 302 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 312 of file ipfdemo_example.c.
Definition at line 313 of file ipfdemo_example.c.
Definition at line 316 of file ipfdemo_example.c.
Definition at line 317 of file ipfdemo_example.c.
Definition at line 318 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 319 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
| #define IPV4_LAST_FRAG | ( | _NetBuf_ | ) | (((((iphdr_t *)L3_ADDR(_NetBuf_))->fragOffs)&LAST_FRAG_BITS)==0) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 320 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
Definition at line 321 of file ipfdemo_example.c.
Definition at line 322 of file ipfdemo_example.c.
Definition at line 323 of file ipfdemo_example.c.
| #define IPV4_GET_DGRAM_ID | ( | _NetBuf_, | |
| _src_, | |||
| _dst_, | |||
| _id_, | |||
| _prot_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 325 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and SendToReasm().
| #define IPV4_DATA_LEN | ( | _NetBuf_ | ) | (IPV4_TOT_LEN(_NetBuf_)-IPV4_HDR_LENGTH(_NetBuf_)) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 329 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
| #define MAX_SRC_ID 8 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 341 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and SendToReasm().
| #define DOI_FRAG_TBL_SIZE 8081 /* Prime number */ |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 347 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), main(), and SendToReasm().
| #define DOI_HASH_GET_KEY | ( | _entry_, | |
| _src_, | |||
| _id_ | |||
| ) | (_entry_ = (_src_+_id_)%DOI_FRAG_TBL_SIZE) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 348 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and SendToReasm().
| #define MAX_FRAG_CNT 18 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 362 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
| #define REASSEMBLY_HASH_TBL_SIZE 1021 /* Prime number */ |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 363 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), _ReleaseDgramTblEntry(), and main().
| #define INITIAL_HASH_TBL_ENTRY_CNT 1024 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 364 of file ipfdemo_example.c.
Referenced by main().
| #define LOOKUP_ENTRY | ( | _tbl_base_, | |
| _tbl_entry_type_, | |||
| _tbl_size_, | |||
| _id1_, | |||
| _id2_, | |||
| _tbl_entry_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 376 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
| #define GET_NEW_TBL_ENTRY | ( | _tbl_free_, | |
| _tbl_entry_type_, | |||
| _tbl_entry_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 387 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
| #define RELEASE_TBL_ENTRY | ( | _tbl_free_, | |
| _tbl_entry_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 404 of file ipfdemo_example.c.
Referenced by _ReleaseDgramTblEntry().
| #define ADD_ENTRY_TO_TBL | ( | _tbl_base_, | |
| _tbl_entry_type_, | |||
| _tbl_size_, | |||
| _tbl_entry_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 410 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
| #define DEL_ENTRY_FROM_TBL | ( | _tbl_base_, | |
| _tbl_entry_type_, | |||
| _tbl_size_, | |||
| _tbl_entry_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 427 of file ipfdemo_example.c.
Referenced by _ReleaseDgramTblEntry().
| #define MSG_BOX_DEPTH 0x2000 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 460 of file ipfdemo_example.c.
| #define MSG_BOX_EMPTY | ( | _fifo_ | ) | ((_fifo_)->wrIdx==(_fifo_)->rdIdx) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 468 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and _UnMatchedThread().
| #define MSG_BOX_FULL | ( | _fifo_ | ) | (((_fifo_)->wrIdx-(_fifo_)->rdIdx) >= MSG_BOX_DEPTH) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 469 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 470 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and _UnMatchedThread().
| #define MSG_BOX_PUT | ( | _fifo_, | |
| _elem_ | |||
| ) |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 471 of file ipfdemo_example.c.
Referenced by _FreeUnmFragment(), and SendToReasm().
| #define MAX_WAIT_ELEM 1024 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 481 of file ipfdemo_example.c.
Referenced by _UnMatchedThread().
| #define NO_OPTIONS 0 |
Definition at line 538 of file ipfdemo_example.c.
| #define OPTION_HELP (1<<1) |
Definition at line 539 of file ipfdemo_example.c.
| #define OPTION_ADAPTER (1<<2) |
Definition at line 540 of file ipfdemo_example.c.
| #define OPTION_NUM_REASM (1<<3) |
Definition at line 541 of file ipfdemo_example.c.
| #define OPTION_NUM_UNM (1<<4) |
Definition at line 542 of file ipfdemo_example.c.
| #define OPTION_TIMEOUT (1<<5) |
Definition at line 543 of file ipfdemo_example.c.
| #define OPTION_TABLE_PERSIST (1<<6) |
Definition at line 544 of file ipfdemo_example.c.
| #define OPTION_TABLE_TIMEOUT (1<<7) |
Definition at line 545 of file ipfdemo_example.c.
| #define INPUT_ADAPTER 0 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 1210 of file ipfdemo_example.c.
Referenced by main().
| #define FRAGMENT_TIMEOUT 2000 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 1211 of file ipfdemo_example.c.
Referenced by main().
| #define NUM_STREAMS 4 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 1212 of file ipfdemo_example.c.
Referenced by main().
| #define NUM_UNM_STREAMS 4 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 1213 of file ipfdemo_example.c.
Referenced by main().
| #define TABLE_TIMEOUT 125 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 1214 of file ipfdemo_example.c.
Referenced by main().
| #define TABLE_PERSIST_TIMEOUT 0 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 1215 of file ipfdemo_example.c.
Referenced by main().
| #define NUM_NTPL 3 |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Referenced by main().
Typedef Documentation
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef union _DOI_dgramId_u DOI_dgramId_u |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef struct _DOI_dgramTbl_t DOI_dgramTbl_t |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef struct _hashTbl_entry_s tbl_entry_t |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef struct _ipDefrag ipDefrag_t |
Definition at line 449 of file ipfdemo_example.c.
| typedef struct _msg_box_s msg_box_t |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef struct wait_list_s wait_list_t |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef struct _unmThread_s unmThread_t |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
| typedef struct _reasmThread_s reasmThread_t |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Function Documentation
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 580 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and _UnMatchedThread().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 593 of file ipfdemo_example.c.
Referenced by _UnMatchedThread().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 654 of file ipfdemo_example.c.
Referenced by main(), and SendToReasm().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 849 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and _ReleaseDgramTblEntry().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 876 of file ipfdemo_example.c.
Referenced by _CheckDatagramComplete(), and _ReassemblyThread().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 906 of file ipfdemo_example.c.
Referenced by _ReassemblyThread().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 950 of file ipfdemo_example.c.
Referenced by _CheckDatagramComplete(), and main().
|
static |
Definition at line 1202 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), and main().
| int main | ( | int | argc, |
| const char * | argv[] | ||
| ) |
Definition at line 1222 of file ipfdemo_example.c.
Variable Documentation
| atomic_int appRunning = 0 |
Definition at line 290 of file ipfdemo_example.c.
Referenced by _ReassemblyThread(), _UnMatchedThread(), main(), and StopApplication().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 547 of file ipfdemo_example.c.
Referenced by main().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 548 of file ipfdemo_example.c.
Referenced by main().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 549 of file ipfdemo_example.c.
Referenced by main().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 550 of file ipfdemo_example.c.
Referenced by main().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 551 of file ipfdemo_example.c.
Referenced by main().
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 552 of file ipfdemo_example.c.
Referenced by main().
| struct argparse_option arg_options[] |
Table of valid options.
Definition at line 557 of file ipfdemo_example.c.
|
static |
- Examples:
- net/ipfdemo/ipfdemo_example.c.
Definition at line 568 of file ipfdemo_example.c.
Referenced by main().
|
static |
Definition at line 570 of file ipfdemo_example.c.
Referenced by main().