Hi Dave,

Thanks (again) for your reply.

> Brief commercial: hopefully you added your node to the ip4 unicast feature 
> arc,
> configured to grab pkts, pre-ip4/6-lookup.

Indeed, I added my node to the ip4-unicast feature arc.

> In feature-arc land, the following one-liner sets next0 so pkts will visit the
> next enabled feature. The last node in the ip4-unicast feature arc is
> ip4-lookup...
> 
>          /* Next node in unicast feature arc */
>         vnet_get_config_data (em->config_main[table_index],
>                               &b0->current_config_index, &next0,
>                               /* # bytes of config data */ 0);
> 
> Check the ip protocol and ignore any non-TCP pkts:
> 
>              ip40 = vlib_buffer_get_current (b0);
>              if (ip40->protocol != IP_PROTOCOL_TCP)
>                goto trace0;
> 
> Then use ip4_next_header() to find the tcp layer, etc. etc.

Actually, I'm already able to access L3 and L4 structures. But, when I have the 
following, for instance:

ip40 = vlib_buffer_get_current (b0);
if (ip40->protocol == IP_PROTOCOL_TCP)
{
  tcp_header_t *tcp = ip4_next_header(ip40);
  // where are options (tcp_options_t) ?
}

How am I able to access TCP options for each packet ? I mean, I could directly 
parse them by moving the data pointer but I've also seen a function called 
tcp_options_parse (see my previous email) that already does this job. How would 
you proceed to do this ? The expected behavior is to match some options and 
strip them.

Thanks,

Justin
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to