summaryrefslogtreecommitdiffstats
path: root/utils/expect_events.c
Commit message (Collapse)AuthorAgeFilesLines
* expect: add XML support for nfexp_snprintf()Pablo Neira Ayuso2012-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example of the XML output: <flow type="new"> <layer3 protonum="2" protoname="IPv4"> <expected> <src>192.168.0.2</src> <dst>192.168.1.2</dst> </expected> <mask> <src>255.255.255.255</src> <dst>255.255.255.255</dst> </mask> <master> <src>192.168.0.2</src> <dst>192.168.1.2</dst> </master> </layer3> <layer4 protonum="6" protoname="tcp"> <expected> <sport>0</sport> <dport>41739</dport> </expected> <mask> <sport>0</sport> <dport>65535</dport> </mask> <master> <sport>36390</sport> <dport>21</dport> </master> </layer4> <meta> <helper-name>ftp</helper-name> <timeout>300</timeout> <zone>0</zone> </meta> </flow> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* utils: resolve compiler warningsJan Engelhardt2010-12-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addition of -Wall flagged some legitimate warnings: make expect_dump expect_create expect_get expect_delete expect_flush expect_events expect_create_userspace conntrack_create conntrack_dump conntrack_update conntrack_delete conntrack_flush conntrack_create_nat conntrack_get conntrack_events conntrack_master conntrack_filter conntrack_grp_create ctexp_events make[1]: Entering directory `/home/jengelh/code/libnetfilter_conntrack/utils' CC expect_dump.o expect_dump.c: In function "main": expect_dump.c:36:3: warning: implicit declaration of function "strerror" expect_dump.c:36:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_dump CC expect_create.o expect_create.c: In function "main": expect_create.c:31:2: warning: implicit declaration of function "inet_addr" expect_create.c:54:3: warning: implicit declaration of function "strerror" expect_create.c:54:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ expect_create.c:117:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_create CC expect_get.o expect_get.c: In function "main": expect_get.c:33:2: warning: implicit declaration of function "inet_addr" expect_get.c:59:3: warning: implicit declaration of function "strerror" expect_get.c:59:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_get CC expect_delete.o expect_delete.c: In function "main": expect_delete.c:21:2: warning: implicit declaration of function "inet_addr" expect_delete.c:46:3: warning: implicit declaration of function "strerror" expect_delete.c:46:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_delete CC expect_flush.o expect_flush.c: In function "main": expect_flush.c:23:3: warning: implicit declaration of function "strerror" expect_flush.c:23:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_flush CC expect_events.o expect_events.c: In function "main": expect_events.c:44:3: warning: implicit declaration of function "strerror" expect_events.c:44:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_events CC expect_create_userspace.o expect_create_userspace.c: In function "main": expect_create_userspace.c:31:2: warning: implicit declaration of function "inet_addr" expect_create_userspace.c:58:3: warning: implicit declaration of function "strerror" expect_create_userspace.c:58:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ expect_create_userspace.c:121:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD expect_create_userspace CC conntrack_create.o conntrack_create.c: In function "main": conntrack_create.c:21:2: warning: implicit declaration of function "inet_addr" conntrack_create.c:43:3: warning: implicit declaration of function "strerror" conntrack_create.c:43:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_create CC conntrack_dump.o conntrack_dump.c: In function "main": conntrack_dump.c:37:3: warning: implicit declaration of function "strerror" conntrack_dump.c:37:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ conntrack_dump.c:24:7: warning: unused variable "buf" CCLD conntrack_dump CC conntrack_update.o conntrack_update.c: In function "main": conntrack_update.c:21:2: warning: implicit declaration of function "inet_addr" conntrack_update.c:43:3: warning: implicit declaration of function "strerror" conntrack_update.c:43:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_update CC conntrack_delete.o conntrack_delete.c: In function "main": conntrack_delete.c:21:2: warning: implicit declaration of function "inet_addr" conntrack_delete.c:38:3: warning: implicit declaration of function "strerror" conntrack_delete.c:38:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_delete CC conntrack_flush.o conntrack_flush.c: In function "main": conntrack_flush.c:24:3: warning: implicit declaration of function "strerror" conntrack_flush.c:24:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ conntrack_flush.c:12:7: warning: unused variable "buf" CCLD conntrack_flush CC conntrack_create_nat.o conntrack_create_nat.c: In function "main": conntrack_create_nat.c:21:2: warning: implicit declaration of function "inet_addr" conntrack_create_nat.c:45:3: warning: implicit declaration of function "strerror" conntrack_create_nat.c:45:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_create_nat CC conntrack_get.o conntrack_get.c: In function "main": conntrack_get.c:33:2: warning: implicit declaration of function "inet_addr" conntrack_get.c:52:3: warning: implicit declaration of function "strerror" conntrack_get.c:52:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_get CC conntrack_events.o conntrack_events.c: In function "main": conntrack_events.c:45:3: warning: implicit declaration of function "strerror" conntrack_events.c:45:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ conntrack_events.c:29:7: warning: unused variable "buf" conntrack_events.c:28:23: warning: unused variable "ct" conntrack_events.c:26:11: warning: unused variable "family" CCLD conntrack_events CC conntrack_master.o conntrack_master.c: In function "main": conntrack_master.c:22:2: warning: implicit declaration of function "inet_addr" conntrack_master.c:44:3: warning: implicit declaration of function "strerror" conntrack_master.c:44:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ conntrack_master.c:86:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_master CC conntrack_filter.o conntrack_filter.c: In function "main": conntrack_filter.c:58:3: warning: implicit declaration of function "inet_addr" conntrack_filter.c:98:3: warning: implicit declaration of function "strerror" conntrack_filter.c:98:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ conntrack_filter.c:31:7: warning: unused variable "buf" conntrack_filter.c:30:23: warning: unused variable "ct" conntrack_filter.c:27:11: warning: unused variable "family" CCLD conntrack_filter CC conntrack_grp_create.o conntrack_grp_create.c: In function "main": conntrack_grp_create.c:21:3: warning: implicit declaration of function "inet_addr" conntrack_grp_create.c:49:3: warning: implicit declaration of function "strerror" conntrack_grp_create.c:49:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD conntrack_grp_create CC ctexp_events.o ctexp_events.c: In function "main": ctexp_events.c:63:3: warning: implicit declaration of function "strerror" ctexp_events.c:63:3: warning: format "%s" expects type ‘char *’, but argument 3 has type ‘int’ CCLD ctexp_events make[1]: Leaving directory `/home/jengelh/code/libnetfilter_conntrack/utils' Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* utils: expect_events now listens to all sort of expectation eventsPablo Neira Ayuso2010-11-091-1/+3
| | | | | | | With this patch, the expect_events example also listens to other sort of expectation events that were added in Linux kernel 2.6.37-rc. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* utils: fix wrong use of errno in example filesPablo Neira Ayuso2008-12-101-5/+6
| | | | | | | | | | | | This patch removes the use of strerr(errno) when the returned valued is != -1. This fixes random segfaults in my x86_64 machines. According to the documentation, errno should not be used unless the returned value is -1. This patch also includes some missing nfct_close() calls in the examples. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* - add warning note to ctnl_test.c: old API is deprecated/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org2007-05-061-0/+48
- split expect_api_test.c into small example files expect_*.c - introduce alias tags for original tuple attributes - introduce nfexp_sizeof and nfexp_maxsize - build expectation attributes iif they are set - fix l3num setting in expect/build.c