Code Review
/
samplevnf.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Prepare for DPDK 19.08 support
[samplevnf.git]
/
VNFs
/
DPPD-PROX
/
log.c
diff --git
a/VNFs/DPPD-PROX/log.c
b/VNFs/DPPD-PROX/log.c
index
cd8ee00
..
b07076d
100644
(file)
--- a/
VNFs/DPPD-PROX/log.c
+++ b/
VNFs/DPPD-PROX/log.c
@@
-26,8
+26,10
@@
#include "log.h"
#include "display.h"
#include "log.h"
#include "display.h"
+#include "defaults.h"
#include "etypes.h"
#include "prox_cfg.h"
#include "etypes.h"
#include "prox_cfg.h"
+#include "prox_compat.h"
static pthread_mutex_t file_mtx = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
int log_lvl = PROX_MAX_LOG_LVL;
static pthread_mutex_t file_mtx = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
int log_lvl = PROX_MAX_LOG_LVL;
@@
-55,7
+57,7
@@
const char *get_warning(int i)
static void store_warning(const char *warning)
{
static void store_warning(const char *warning)
{
- strncpy(last_warn[n_warnings % 5], warning, sizeof(last_warn[0]));
+
prox_
strncpy(last_warn[n_warnings % 5], warning, sizeof(last_warn[0]));
n_warnings++;
}
n_warnings++;
}
@@
-68,10
+70,10
@@
void plog_init(const char *log_name, int log_name_pid)
if (log_name_pid)
snprintf(buf, sizeof(buf), "%s-%u.log", "prox", getpid());
else
if (log_name_pid)
snprintf(buf, sizeof(buf), "%s-%u.log", "prox", getpid());
else
- strncpy(buf, "prox.log", sizeof(buf));
+
prox_
strncpy(buf, "prox.log", sizeof(buf));
}
else {
}
else {
- strncpy(buf, log_name, sizeof(buf));
+
prox_
strncpy(buf, log_name, sizeof(buf));
}
fp = fopen(buf, "w");
}
fp = fopen(buf, "w");
@@
-140,11
+142,10
@@
static const char* lvl_to_str(int lvl, int always)
}
}
}
}
-#define DUMP_PKT_LEN 128
static int dump_pkt(char *dst, size_t dst_size, const struct rte_mbuf *mbuf)
{
static int dump_pkt(char *dst, size_t dst_size, const struct rte_mbuf *mbuf)
{
- const
struct ether_hdr *peth = rte_pktmbuf_mtod(mbuf, const struct
ether_hdr *);
- const
struct ipv4_hdr *dpip = (const struct
ipv4_hdr *)(peth + 1);
+ const
prox_rte_ether_hdr *peth = rte_pktmbuf_mtod(mbuf, const prox_rte_
ether_hdr *);
+ const
prox_rte_ipv4_hdr *dpip = (const prox_rte_
ipv4_hdr *)(peth + 1);
const uint8_t *pkt_bytes = (const uint8_t *)peth;
const uint16_t len = rte_pktmbuf_pkt_len(mbuf);
size_t str_len = 0;
const uint8_t *pkt_bytes = (const uint8_t *)peth;
const uint16_t len = rte_pktmbuf_pkt_len(mbuf);
size_t str_len = 0;