![]() |
Flowgrind
Advanced TCP traffic generator
|
Error-reporting routines used by Flowgrind. More...
Go to the source code of this file.
Macros | |
#define | crit(...) (error(ERR_CRIT, errno, __VA_ARGS__)) |
To report an critical error w/ the corresponding system error message. More... | |
#define | critc(code, ...) (error(ERR_CRIT, code, __VA_ARGS__)) |
To report an critical error w/ the system error message 'code'. More... | |
#define | critx(...) (error(ERR_CRIT, 0, __VA_ARGS__)) |
To report an critical error w/o a system error message. More... | |
#define | err(...) (error(ERR_ERROR, errno, __VA_ARGS__)) |
To report an error w/ the corresponding system error message. More... | |
#define | errc(code, ...) (error(ERR_ERROR, code, __VA_ARGS__)) |
To report an error w/ the system error message 'code'. More... | |
#define | errx(...) (error(ERR_ERROR, 0, __VA_ARGS__)) |
To report an error w/o a system error message. More... | |
#define | warn(...) (error(ERR_WARNING, errno, __VA_ARGS__)) |
To report a warning w/ the corresponding system error message. More... | |
#define | warnc(code, ...) (error(ERR_WARNING, code, __VA_ARGS__)) |
To report a warning w/ the system error message 'code'. More... | |
#define | warnx(...) (error(ERR_WARNING, 0, __VA_ARGS__)) |
To report a warning w/ a system error message. More... | |
Enumerations | |
enum | error_levels { ERR_WARNING = 0, ERR_ERROR, ERR_CRIT } |
Error level, in order of increasing importance. More... | |
Functions | |
void | error (enum error_levels level, int errnum, const char *fmt,...) __attribute__((format(printf |
General error-reporting function. More... | |
Error-reporting routines used by Flowgrind.
Definition in file fg_error.h.
To report an critical error w/ the corresponding system error message.
Definition at line 36 of file fg_error.h.
To report an critical error w/ the system error message 'code'.
Definition at line 38 of file fg_error.h.
To report an critical error w/o a system error message.
Definition at line 40 of file fg_error.h.
To report an error w/ the corresponding system error message.
Definition at line 43 of file fg_error.h.
To report an error w/ the system error message 'code'.
Definition at line 45 of file fg_error.h.
To report an error w/o a system error message.
Definition at line 47 of file fg_error.h.
#define warn | ( | ... | ) | (error(ERR_WARNING, errno, __VA_ARGS__)) |
To report a warning w/ the corresponding system error message.
Definition at line 50 of file fg_error.h.
#define warnc | ( | code, | |
... | |||
) | (error(ERR_WARNING, code, __VA_ARGS__)) |
To report a warning w/ the system error message 'code'.
Definition at line 52 of file fg_error.h.
#define warnx | ( | ... | ) | (error(ERR_WARNING, 0, __VA_ARGS__)) |
To report a warning w/ a system error message.
Definition at line 54 of file fg_error.h.
enum error_levels |
Error level, in order of increasing importance.
Enumerator | |
---|---|
ERR_WARNING | Warning conditions. |
ERR_ERROR | Error conditions. |
ERR_CRIT | Critical conditions. |
Definition at line 57 of file fg_error.h.
void error | ( | enum error_levels | level, |
int | errnum, | ||
const char * | fmt, | ||
... | |||
) |
General error-reporting function.
It outputs to stderr the program name, a colon and a space, a fixed error message based on the error level, and a second colon and a space followed by the error message. If errnum is nonzero, a third colon and a space followed by the string given by strerror(errnum) is printed.
[in] | level | error level. An error level higher then ERR_ERROR calls exit() to terminate using given status |
[in] | errnum | error number. If nonzero the corresponding system error message is printed |
[in] | fmt | error message in printf-style format with optional args |