On Thu, 21 Feb 2002, andre achternaam wrote: > In the if statement ctinfo is checked for some conditions. The way they test > the conditions tells me that the IP_CT_ESTABLISHED and IP_CT_IS_REPLY are > bitmasks because they are added and they are part of an enumaration. When i
ctinfo doesn't store a bitmap. It is never set or checked in that way. ctinfo stores a plain number, which encodes the (general) state of the connection and the direction of the packet in question. > enum ip_conntrack_info > { > /* Part of an established connection (either direction). */ > IP_CT_ESTABLISHED, > > /* Like NEW, but related to an existing connection, or ICMP error > (in either direction). */ > IP_CT_RELATED, > > /* Started a new connection to track (only > IP_CT_DIR_ORIGINAL); may be a retransmission. */ > IP_CT_NEW, > > /* >= this indicates reply direction */ > IP_CT_IS_REPLY, > > /* Number of distinct IP_CT types (no NEW in reply dirn). */ > IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 > }; The possible "states" are: IP_CT_ESTABLISHED IP_CT_RELATED IP_CT_NEW IP_CT_ESTABLISHED + IP_CT_IS_REPLY IP_CT_RELATED + IP_CT_IS_REPLY and therefore IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 Regards, Jozsef - E-mail : [EMAIL PROTECTED], [EMAIL PROTECTED] WWW-Home: http://www.kfki.hu/~kadlec Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary