Handling UDP packets

Douglas S. J. De Couto decouto at lcs.mit.edu
Mon Nov 4 10:13:17 EST 2002


you have to make sure that the ip6_header annotation is set before 
calling p->ip6_header().  You can accomplish this by sending the packet 
through one of CheckIP6Header, MarkIP6Header, etc.

d

Juan Luis Baptiste wrote:
> Hi,
> 
> When handling UDP packets, how I get to the packets contents? I'm doing it like this, but I'm getting the wrong values:
> 
>   const click_ip6 *ip6h = p->ip6_header();
> //  const click_udp *udph = (click_udp *)(ip6h + 1);
>     const click_udp *udph = p->udp_header();
>   const unsigned char *data = (unsigned char *)udph + udph->uh_ulen;
> 
>   unsigned len =   p->length() - p->ip6_header_offset();
> 
> 
> Any ideas? or where can I find an example where to look how to handle data in udp packets?
> 
> 
> 
> As always, thanks!
> 
> 
> Juan Luis Baptiste M.
> 



-- 
Douglas S. J. De Couto    decouto at lcs.mit.edu





More information about the click mailing list