diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-01-22 22:00:54 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-01-22 22:02:56 +0100 |
commit | 451dafe6f5e1add75793597ba9bd0e3fddf2d7f9 (patch) | |
tree | c7b98e060b716c54df8ac733232c7b7909da58d5 /src/sync-mode.c | |
parent | b5ca4272d185171971872a9a2ee677cd66c8386b (diff) | |
download | conntrack-tools-451dafe6f5e1add75793597ba9bd0e3fddf2d7f9.tar.gz conntrack-tools-451dafe6f5e1add75793597ba9bd0e3fddf2d7f9.zip |
conntrackd: support `-i exp -x' and `-e exp -x' options
This patch allows you to dump the internal and external expectation
cache in XML.
% conntrackd -i exp -x
<flow><layer3 protonum="2" protoname="ipv4"><expected><src>192.168.1.135</src><dst>130.89.148.12</dst></expected><mask><src>255.255.255.255</src><dst>255.255.255.255</dst></mask><master><src>192.168.1.135</src><dst>130.89.148.12</dst></master></layer3><layer4 protonum="6" protoname="tcp"><expected><sport>0</sport><dport>9082</dport></expected><mask><sport>0</sport><dport>65535</dport></mask><master><sport>50518</sport><dport>21</dport></master></layer4><meta><helper-name>ftp</helper-name></meta></flow>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/sync-mode.c')
-rw-r--r-- | src/sync-mode.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sync-mode.c b/src/sync-mode.c index 2505631..10fdb9e 100644 --- a/src/sync-mode.c +++ b/src/sync-mode.c @@ -706,6 +706,18 @@ static int local_handler_sync(int fd, int type, void *data) } local_commit(fd); break; + case EXP_DUMP_INT_XML: + if (fork_process_new(CTD_PROC_ANY, 0, NULL, NULL) == 0) { + STATE(mode)->internal->exp.dump(fd, NFCT_O_XML); + exit(EXIT_SUCCESS); + } + break; + case EXP_DUMP_EXT_XML: + if (fork_process_new(CTD_PROC_ANY, 0, NULL, NULL) == 0) { + STATE_SYNC(external)->exp.dump(fd, NFCT_O_XML); + exit(EXIT_SUCCESS); + } + break; default: if (STATE_SYNC(sync)->local) ret = STATE_SYNC(sync)->local(fd, type, data); |