[Winpcap-users] how to provide ipv6 address for filtering condition.

Umesh Chandra Sahoo USahoo at ixiacom.com
Thu Sep 20 16:01:40 GMT 2007


Hi,

 

Can it be possible to give an IPV6 address in the filtering string for
pcap_compile.

 

I tried the following cases:

 

{

filter = (char *) calloc(255, sizeof(char));

strcat(filter, "(ip proto 6) and (dst host 1.2.3.4)" );

 

if (pcap_compile(fp, &fcode, filter, 1, NetMask) < 0)

 

}                       It works fine.

 

 

 

{

filter = (char *) calloc(255, sizeof(char));

strcat(filter, "(ip6 proto 6) and (dst host 1::4)" );

 

if (pcap_compile(fp, &fcode, filter, 1, NetMask) < 0)

 

}                       It doesnot work . pcap_compile failed

 

 

I tried many types of ipv6 address format but no luck.

 

But I m sure that pcap_compile supports ipv6. Since I succeeded in the
following string

 

{

strcat(filter, "ip6 proto 6)" );

 

if (pcap_compile(fp, &fcode, filter, 1, NetMask) < 0)

 

}           It works fine

 

So can any one suggest me how to filter on an IPV6 address? In which
format we need to give an ipv6 address to the filtering string for
libpcap_filter???

 

 

Thanx in advance

Umesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20070920/39809728/attachment.htm


More information about the Winpcap-users mailing list