Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: NTop: Misc

PF_RING plugins

 

 

NTop misc RSS feed   Index | Next | Previous | View Threaded


mike.drangula at gigamon

May 11, 2012, 7:50 AM

Post #1 of 2 (195 views)
Permalink
PF_RING plugins

Hi. I'm trying to write a PF_RING plugin and I need to understand the context and usage of the displ argument passed to pfring_plugin_filter_skb and pfring_plugin_handle_skb.

I've been browsing the source and the real meaning of displ is not obvious.

Thanks in advance for your help,

Mike Drangula | Sr. Software Engineer
Gigamon | www.gigamon.com<http://www.gigamon.com/>
Home Office: 437 Glen Rd, Sparta, NJ 07871
Gigamon HQ: 598 Gibraltar Drive, Milpitas, CA 95035
Office: +1.914.930.6702 | Mobile: +1.973.222.4232
E-Mail: mike.drangula [at] gigamon<mailto:mike.drangula [at] gigamon>

Intelligent Traffic Visibility Networks<http://www.gigamon.com/about-gigamon-traffic-visibility-networks--tvn->


cardigliano at ntop

May 12, 2012, 8:16 AM

Post #2 of 2 (166 views)
Permalink
Re: PF_RING plugins [In reply to]

Mike
the "displ" parameter (usually 0 or 14) contains the displacement of the ethernet header with respect to the ska->data pointer.
In a nutshell, when you have to access the packet data you should take into account "displ" when computing the offset.
Example:

u_int payload_offset = hdr->extended_hdr.parsed_pkt.offset.payload_offset - displ;
char *payload = &skb->data[payload_offset];

Regards
Alfredo

On May 11, 2012, at 4:50 PM, Mike Drangula wrote:

> Hi. I’m trying to write a PF_RING plugin and I need to understand the context and usage of the displ argument passed to pfring_plugin_filter_skb and pfring_plugin_handle_skb.
>
> I’ve been browsing the source and the real meaning of displ is not obvious.
>
> Thanks in advance for your help,
>
> Mike Drangula | Sr. Software Engineer
> Gigamon | www.gigamon.com
> Home Office: 437 Glen Rd, Sparta, NJ 07871
> Gigamon HQ: 598 Gibraltar Drive, Milpitas, CA 95035
> Office: +1.914.930.6702 | Mobile: +1.973.222.4232
> E-Mail: mike.drangula [at] gigamon
>
> Intelligent Traffic Visibility Networks
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc [at] listgateway
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc

NTop misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.