All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch: add id to libnetfilter_conntrack XML export
@ 2007-01-05 13:27 Victor Stinner
  2007-01-05 14:45 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Victor Stinner @ 2007-01-05 13:27 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hi,

I heard that connection identifiers may disappear. Is it true? I like unique 
identifier because it's small (only 32 bits) and easy to manipulate. It's 
hard to identify a connection without such identifier.

I attached a patch to add connection identifier to XML export.

Victor Stinner
http://www.inl.fr/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libnetfilter_conntrack_xml_id.patch --]
[-- Type: text/x-diff; charset="us-ascii"; name="libnetfilter_conntrack_xml_id.patch", Size: 570 bytes --]

Index: src/conntrack/snprintf_xml.c
===================================================================
--- src/conntrack/snprintf_xml.c	(révision 6720)
+++ src/conntrack/snprintf_xml.c	(copie de travail)
@@ -364,6 +364,13 @@
 		buffer_size(ret, &size, &len);
 	}
 
+	if (test_bit(ATTR_ID, ct->set)) {
+		ret = snprintf(buf+size, len, "<id>%u</id>", ct->id);
+		if (ret == -1)
+			return -1;
+		buffer_size(ret, &size, &len);
+	}
+
 	if (test_bit(ATTR_MARK, ct->set)) {
 		ret = snprintf(buf+size, len, "<mark>%u</mark>", ct->mark);
 		if (ret == -1)

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

end of thread, other threads:[~2007-01-11 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-05 13:27 Patch: add id to libnetfilter_conntrack XML export Victor Stinner
2007-01-05 14:45 ` Pablo Neira Ayuso
     [not found]   ` <200701051618.09855.victor.stinner@inl.fr>
2007-01-05 22:44     ` Pablo Neira Ayuso
2007-01-11 13:00       ` Amin Azez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.