Linux Netfilter discussions
 help / color / mirror / Atom feed
* nfct_query return code
@ 2007-06-21 20:53 switcher
  2007-06-22  7:08 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: switcher @ 2007-06-21 20:53 UTC (permalink / raw)
  To: netfilter

Hi All,
Just a little question about nfct_query used to check the state of a connection.
What is it supposed to return ?
I guess it's 0 if the packet is part of an active connection (tell me if I'm
wrong) but what does a "-1" value mean ? An error or a packet seen for the
first time ?

For information, my piece (truncated) of code :
ct = nfct_new();
nfct_set_attr_u8(ct, ATTR_ORIG_L3PROTO, AF_INET);
nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_SRC, iph->saddr);
nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_DST, iph->daddr);
nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO, iph->protocol);
nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, tcp->source);
nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, tcp->dest);
cth = nfct_open(CONNTRACK, 0);
nfct_callback_register(cth, NFCT_T_ALL, cb, NULL)
conn_state = nfct_query(cth, NFCT_Q_GET, ct);
nfct_close(cth);
return conn_state;


Thanks,
julien
-- 

www.linuxwall.info



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-22  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-21 20:53 nfct_query return code switcher
2007-06-22  7:08 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox