summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX/log.c')
-rw-r--r--VNFs/DPPD-PROX/log.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/VNFs/DPPD-PROX/log.c b/VNFs/DPPD-PROX/log.c
index 56338f89..2094c185 100644
--- a/VNFs/DPPD-PROX/log.c
+++ b/VNFs/DPPD-PROX/log.c
@@ -81,6 +81,13 @@ void plog_init(const char *log_name, int log_name_pid)
tsc_off = rte_rdtsc() + 2500000000;
}
+void plog_end(void)
+{
+ if (fp)
+ fclose(fp);
+ fp = NULL;
+}
+
int plog_set_lvl(int lvl)
{
if (lvl <= PROX_MAX_LOG_LVL) {
@@ -144,8 +151,8 @@ static const char* lvl_to_str(int lvl, int always)
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;