Hi

I want to store tcp_src, dst port in a variable.
This is what I am doing:
1. Retrieve packet from dp_packet_batch one by one.
2. Retrieving field values by extracting packets headers:

struct ip_header *ip = dp_packet_l3(packet);
nw_proto = ip->ip_proto;
if(nw_proto == 6)
{
struct tcp_header *th = dp_packet_l4(packet);
// The following are the 2 different ways I am trying to print the tcp_src.
I have tried it 1 and 2 separately not at the same time.
                //1 . Ovs crash at the below statement
                uint16_t src = (uint16_t) ntohs(th->tcp_src);
                VLOG_DBG( "tcp_src ---> %d", src );
                //2. When I enable logging ovs crashes at this point
                VLOG_DBG( "tcp_src ---> %d", ntohs(th->tcp_src) );


                 }

Can anyone please help how to store tcp_src port value in a variable and
print it in vlogs?
Statement 2 is working fine if vlogs are disabled, but I want the port
value to be stored in a variable and then print.



Thanks
Krish
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to