netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* libiptc - 'string' match module - --hex-string
@ 2014-06-19 12:38 Sourabh Nanoti
  0 siblings, 0 replies; only message in thread
From: Sourabh Nanoti @ 2014-06-19 12:38 UTC (permalink / raw)
  To: netfilter

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-19 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 12:38 libiptc - 'string' match module - --hex-string Sourabh Nanoti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).