mirror of
https://passt.top/passt
synced 2025-08-15 03:03:14 +02:00
passt: Run in background, add message logging with severities
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
8bfcc9208c
commit
48ca38c606
6 changed files with 109 additions and 71 deletions
18
util.c
18
util.c
|
@ -21,9 +21,27 @@
|
|||
#include <netinet/tcp.h>
|
||||
#include <netinet/udp.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <syslog.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "passt.h"
|
||||
|
||||
#define logfn(name, level) \
|
||||
void name(const char *format, ...) { \
|
||||
va_list args; \
|
||||
\
|
||||
va_start(args, format); \
|
||||
vsyslog(level, format, args); \
|
||||
va_end(args); \
|
||||
}
|
||||
|
||||
logfn(err, LOG_ERR)
|
||||
logfn(warn, LOG_WARNING)
|
||||
logfn(info, LOG_INFO)
|
||||
#ifdef DEBUG
|
||||
logfn(debug, LOG_DEBUG)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* csum_fold() - Fold long sum for IP and TCP checksum
|
||||
* @sum: Original long sum
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue