libiptc - 'string' match module - --hex-string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I wanted to know how to have a rule in iptables that uses the –hex-string
pattern matching module via libiptc.

Following are my xt_string_info structure:

1)

                strcpy(strinfo->algo,"bm");
                strcpy(strinfo->pattern,"|05010001|\\");
                strinfo->from_offset = 32;
                strinfo->to_offset = 36;
                strinfo->patlen = 11;

When I do iptables  -L I get the following:
STRING match  "|7c30353031303030317c5c|" ALGO name bm FROM 32 TO 36

2)
                strcpy(strinfo->algo,"bm");
                strcpy(strinfo->pattern,"05010001\\");
                strinfo->from_offset = 32;
                strinfo->to_offset = 36;
                strinfo->patlen = 9;

When I do iptables  -L I get the following:
STRING match  "|30353031303030315c|" ALGO name bm FROM 32 TO 36


Both seem incorrect. What am I missing here ?

Thanks
Sourabh
��.n��������+%������w��{.n����z��׫�)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux