From 08f59121eb907802d490601f5e54dcd0fbc1d695 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 13 Dec 2008 17:24:47 +0100 Subject: 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 --- include/network.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/network.h') 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); \ -- cgit v1.2.3