2019-06-24 09:33:16 +00:00
|
|
|
#if 1
|
|
|
|
|
2019-06-14 09:14:06 +00:00
|
|
|
#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"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
2019-06-25 06:42:36 +00:00
|
|
|
|
|
|
|
return ret;
|
2019-06-14 09:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|