Skip to contentSkip to conversation

about "struct ct_foo_info" in hacking howto

DISCUSSION luoqiang 2 participants 2 messages Jun 28, 2002 netfilter

lore
Share & tools
lore

luoqiang

author
#0 lore raw

Hi,all

In hacking howto "4.4.5.3 Example skeleton of a conntrack helper module":

              ......
              if (there_will_be_new_packets_related_to_this_connection)
               {
                       t = new_tuple_specifying_related_packets;
                       ip_conntrack_expect_related(ct, &t);
 
                       /* save information important for NAT in
                               ct->help.ct_foo_info;   */
                               ~~~~~~~~~~~~~~~~~~~~here!!
               }
              ......

but in ip_conntrack.help,there is no member ct_foo_info in union help. how can I do? Fill in ct->nat.info?

thanks
luoqiang

#1 lore raw

Hi,

Quoted 5 lines
                       /* save information important for NAT in
                               ct->help.ct_foo_info;   */
                               ~~~~~~~~~~~~~~~~~~~~here!!

but in ip_conntrack.help,there is no member ct_foo_info in union help.

The "foo" was an _example_, of course it is not in the real codebase. It stands for a data structure that is defined anew for each helper.

Quoted 1 line

how can I do? Fill in ct->nat.info?

Define your own helper specific 'struct ct_XXX_info', and put that into the definition of the ct->help union type (found somewhere under include/linux/netfilter_ipv4/ - grep is your friend, as always)

best regards
Patrick