![]() |
Flowgrind
Advanced TCP traffic generator
|
Common definitions used by the Flowgrind daemon, controller, and libs. More...
#include "config.h"
Go to the source code of this file.
Macros | |
#define | ASSIGN_MAX(s, c) |
Assign value if it's greater than current one. More... | |
#define | ASSIGN_MIN(s, c) |
Assign value if it less than current one. More... | |
#define | FN_APPLY(type, fn, ...) |
To vectorize an arbitrary function that takes any type of pointer. More... | |
#define | foreach(iter, ...) |
foreach macro for iterating through enum values. More... | |
#define | free_all(...) FN_APPLY(void, free, __VA_ARGS__); |
To free() an arbitrary number of variables. More... | |
#define | likely(x) __builtin_expect(!!(x), 1) |
These macros gain us a few percent of speed. More... | |
#define | NARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) |
To determine the number of arguments in VA_ARGS. More... | |
#define | unlikely(x) __builtin_expect(!!(x), 0) /** @} */ |
These macros gain us a few percent of speed. More... | |
#define | UNUSED_ARGUMENT(x) (void)x |
Suppress warning for unused argument. More... | |
Common definitions used by the Flowgrind daemon, controller, and libs.
Definition in file fg_definitions.h.
#define ASSIGN_MAX | ( | s, | |
c | |||
) |
Assign value if it's greater than current one.
Definition at line 68 of file fg_definitions.h.
#define ASSIGN_MIN | ( | s, | |
c | |||
) |
Assign value if it less than current one.
Definition at line 62 of file fg_definitions.h.
#define FN_APPLY | ( | type, | |
fn, | |||
... | |||
) |
To vectorize an arbitrary function that takes any type of pointer.
Definition at line 51 of file fg_definitions.h.
#define foreach | ( | iter, | |
... | |||
) |
foreach macro for iterating through enum values.
Definition at line 44 of file fg_definitions.h.
#define free_all | ( | ... | ) | FN_APPLY(void, free, __VA_ARGS__); |
To free() an arbitrary number of variables.
Definition at line 59 of file fg_definitions.h.
#define likely | ( | x | ) | __builtin_expect(!!(x), 1) |
These macros gain us a few percent of speed.
Definition at line 34 of file fg_definitions.h.
#define NARGS | ( | ... | ) | (sizeof((int[]){__VA_ARGS__})/sizeof(int)) |
To determine the number of arguments in VA_ARGS.
Definition at line 41 of file fg_definitions.h.
#define unlikely | ( | x | ) | __builtin_expect(!!(x), 0) /** @} */ |
These macros gain us a few percent of speed.
Definition at line 35 of file fg_definitions.h.
#define UNUSED_ARGUMENT | ( | x | ) | (void)x |
Suppress warning for unused argument.
Definition at line 38 of file fg_definitions.h.