Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Packet Filtering. pfil hook not working for TCP and UDP: (1 Item)
   
Packet Filtering. pfil hook not working for TCP and UDP  
Hi, 

I' trying to compile and build the packet filtering hooks given in the below link 
http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/filtering.html

Im able to mount the .so file to io-pkt driver. I have a MPC8548 CDS eval board with 4 Ethernet ports. When I try to 
send the TCP or UDP packet say for example between en0 and en1 I'm able to count the exact number of packets sent 
between en0 and en1 using the pfil hook . 


 static int input_hook( void *arg, struct mbuf **m, struct ifnet *ifp, int dir ) {
         static int NumberofPackets= 0;
 	in_bytes += ( *m )->m_len;
        NumberofPackets++;
        printf("Number of Packets = %d\n",NumberofPackets);    

 	return 0;
 }

But when I try to send TCP or UDP packets between en0 and to a PC connected to en1 the pfil hook is not called. But the 
ping packets gets counted between en0 and PC
 
Is there any way so that the pfill hook is called irrespective of ICMP ,UDP ,tcp protocol ?