secgateway/Platform/user/pdeliv_u/dpi_rcv_test.c

48 lines
729 B
C
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <netinet/in.h>
#include <linux/types.h>
#include <errno.h>
#include "libnetlinku.h"
#include "commuapinl.h"
#if 0
static int process_pkt(struct pdelivnl_ctrl_data *ctrl,
struct nlmsghdr *n, void *arg)
{
printf("pdelivery main process_msg begin:\r\n");
//if (timestamp)
//print_timestamp(fp);
switch (n->nlmsg_type) {
case NLMSG_RECV_RAW_PKT:
printf("netlink msg type RAW_pkt:\r\n");
printf_mem(NLMSG_DATA(n),n->nlmsg_len-NLMSG_HDRLEN);
break;
default:
return 0;
}
return 0;
}
int main( int argc, char **argv)
{
int ret = -1;
ret = pdeliv_main(process_pkt);
}
#endif