{"action":"created","issue":{"url":"https://api.github.com/repos/ntop/nDPI/issues/223","repository_url":"https://api.github.com/repos/ntop/nDPI","labels_url":"https://api.github.com/repos/ntop/nDPI/issues/223/labels{/name}","comments_url":"https://api.github.com/repos/ntop/nDPI/issues/223/comments","events_url":"https://api.github.com/repos/ntop/nDPI/issues/223/events","html_url":"https://github.com/ntop/nDPI/issues/223","id":163766365,"number":223,"title":"can nDPI use PF_RNG DNA or ZC mode to capture packet?","user":{"login":"chinasun021","id":3906374,"avatar_url":"https://avatars.githubusercontent.com/u/3906374?v=3","gravatar_id":"","url":"https://api.github.com/users/chinasun021","html_url":"https://github.com/chinasun021","followers_url":"https://api.github.com/users/chinasun021/followers","following_url":"https://api.github.com/users/chinasun021/following{/other_user}","gists_url":"https://api.github.com/users/chinasun021/gists{/gist_id}","starred_url":"https://api.github.com/users/chinasun021/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinasun021/subscriptions","organizations_url":"https://api.github.com/users/chinasun021/orgs","repos_url":"https://api.github.com/users/chinasun021/repos","events_url":"https://api.github.com/users/chinasun021/events{/privacy}","received_events_url":"https://api.github.com/users/chinasun021/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-05T03:36:40Z","updated_at":"2016-07-06T06:05:48Z","closed_at":null,"body":"Hi,\r\n    nDPI can support analyze 10Gbit/s data？\r\n\r\n    I find example/ndpiReader.c use libpcap to capture packet,can we use pfring interface(such as  pfring_open instead of pcap_open_live) to capture packet to achieve 10Gbit/s speed.\r\n\r\n   "},"comment":{"url":"https://api.github.com/repos/ntop/nDPI/issues/comments/230678504","html_url":"https://github.com/ntop/nDPI/issues/223#issuecomment-230678504","issue_url":"https://api.github.com/repos/ntop/nDPI/issues/223","id":230678504,"user":{"login":"Skryabind","id":4038319,"avatar_url":"https://avatars.githubusercontent.com/u/4038319?v=3","gravatar_id":"","url":"https://api.github.com/users/Skryabind","html_url":"https://github.com/Skryabind","followers_url":"https://api.github.com/users/Skryabind/followers","following_url":"https://api.github.com/users/Skryabind/following{/other_user}","gists_url":"https://api.github.com/users/Skryabind/gists{/gist_id}","starred_url":"https://api.github.com/users/Skryabind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skryabind/subscriptions","organizations_url":"https://api.github.com/users/Skryabind/orgs","repos_url":"https://api.github.com/users/Skryabind/repos","events_url":"https://api.github.com/users/Skryabind/events{/privacy}","received_events_url":"https://api.github.com/users/Skryabind/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T06:05:48Z","updated_at":"2016-07-06T06:05:48Z","body":"@mmanoj \r\nFirst, for high speed you can use threading, so look at example how to use zc cluster and balancer in  PF_RING/userland/examples_zc/zbalance.c\r\nIn this file find a line:\r\n`if(pfring_zc_recv_pkt(outzq[id], &b, wait_for_packet) > 0) {`\r\n\r\nb - is packet buffer, let's get a header and packet data:\r\n```\r\nu_char *packet = pfring_zc_pkt_buff_data(b, outzq[id]);\r\n\r\nstruct pfring_pkthdr header;\r\nmemset(&header, 0, sizeof(header));\r\nheader.len = b->len;\r\nheader.caplen = b->len;\r\nmemset((void*)&header.extended_hdr.parsed_pkt, 0, sizeof(struct pkt_parsing_info));\r\npfring_parse_pkt((u_char*)packet, (struct pfring_pkthdr*)header, 4, 1, 1);\r\n```\r\n\r\nNow you can use a code from pcap_packet_callback (in ndpiReader.c file) to get nDPI functionality. Just use a _packet_ and _header_ variables defined above."}}
{"actor":{"display_login":"Skryabind"}}