summaryrefslogtreecommitdiff
path: root/include/network.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-12-13 17:24:47 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-12-13 17:24:47 +0100
commit08f59121eb907802d490601f5e54dcd0fbc1d695 (patch)
treedcad67050eb09c141feb1429362be02cb1bcd71d /include/network.h
parent74455dae1d095178b09ea3f1b1e8b005076e7a94 (diff)
downloadconntrack-tools-08f59121eb907802d490601f5e54dcd0fbc1d695.tar.gz
conntrack-tools-08f59121eb907802d490601f5e54dcd0fbc1d695.zip
ftfw: shrink alive message size
This patch reduces the size of alive messages by removing the "from" and "to" fields which are not of any help. This patch also removes the IS_CTL() macro since it does not return true for the control messages anymore but only for IS_ACK(), IS_NACK() and IS_RESYNC(). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/network.h')
-rw-r--r--include/network.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/network.h b/include/network.h
index f9756db..40bb2b2 100644
--- a/include/network.h
+++ b/include/network.h
@@ -29,6 +29,7 @@ int nethdr_align(int len);
int nethdr_size(int len);
void nethdr_set(struct nethdr *net, int type);
void nethdr_set_ack(struct nethdr *net);
+void nethdr_set_ctl(struct nethdr *net);
#define NETHDR_DATA(x) \
(struct netattr *)(((char *)x) + NETHDR_SIZ)
@@ -102,7 +103,6 @@ ssize_t mcast_buffered_pending_netmsg(struct mcast_sock *m);
#define IS_NACK(x) (x->type == NET_T_CTL && x->flags & NET_F_NACK)
#define IS_RESYNC(x) (x->type == NET_T_CTL && x->flags & NET_F_RESYNC)
#define IS_ALIVE(x) (x->type == NET_T_CTL && x->flags & NET_F_ALIVE)
-#define IS_CTL(x) IS_ACK(x) || IS_NACK(x) || IS_RESYNC(x) || IS_ALIVE(x)
#define IS_HELLO(x) (x->flags & NET_F_HELLO)
#define IS_HELLO_BACK(x)(x->flags & NET_F_HELLO_BACK)
@@ -110,7 +110,7 @@ ssize_t mcast_buffered_pending_netmsg(struct mcast_sock *m);
({ \
x->len = ntohs(x->len); \
x->seq = ntohl(x->seq); \
- if (IS_CTL(x)) { \
+ if (IS_ACK(x) || IS_NACK(x) || IS_RESYNC(x)) { \
struct nethdr_ack *__ack = (struct nethdr_ack *) x; \
__ack->from = ntohl(__ack->from); \
__ack->to = ntohl(__ack->to); \
@@ -119,7 +119,7 @@ ssize_t mcast_buffered_pending_netmsg(struct mcast_sock *m);
#define HDR_HOST2NETWORK(x) \
({ \
- if (IS_CTL(x)) { \
+ if (IS_ACK(x) || IS_NACK(x) || IS_RESYNC(x)) { \
struct nethdr_ack *__ack = (struct nethdr_ack *) x; \
__ack->from = htonl(__ack->from); \
__ack->to = htonl(__ack->to); \