summaryrefslogtreecommitdiff
path: root/src/network.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-23 12:30:36 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-23 12:30:36 +0000
commit379125b1f618b3102015a64b1e9be0bdbe883930 (patch)
treea79eb6f4f0cec0019a02552d895c20e02d987cc0 /src/network.c
parentd658f3ed913affe96511309c6bf3d37aaec2910f (diff)
downloadconntrack-tools-379125b1f618b3102015a64b1e9be0bdbe883930.tar.gz
conntrack-tools-379125b1f618b3102015a64b1e9be0bdbe883930.zip
Max Kellermann <max@duempel.org>:
use size_t
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/network.c b/src/network.c
index da26545..92999a1 100644
--- a/src/network.c
+++ b/src/network.c
@@ -27,7 +27,7 @@
static unsigned int seq_set, cur_seq;
-static int __do_send(struct mcast_sock *m, void *data, int len)
+static size_t __do_send(struct mcast_sock *m, void *data, size_t len)
{
struct nethdr *net = data;
@@ -50,7 +50,7 @@ static int __do_send(struct mcast_sock *m, void *data, int len)
return mcast_send(m, net, len);
}
-static int __do_prepare(struct mcast_sock *m, void *data, int len)
+static size_t __do_prepare(struct mcast_sock *m, void *data, size_t len)
{
struct nethdr *net = data;
@@ -66,12 +66,12 @@ static int __do_prepare(struct mcast_sock *m, void *data, int len)
return len;
}
-static int __prepare_ctl(struct mcast_sock *m, void *data)
+static size_t __prepare_ctl(struct mcast_sock *m, void *data)
{
return __do_prepare(m, data, NETHDR_ACK_SIZ);
}
-static int __prepare_data(struct mcast_sock *m, void *data)
+static size_t __prepare_data(struct mcast_sock *m, void *data)
{
struct nethdr *net = (struct nethdr *) data;
struct netpld *pld = NETHDR_DATA(net);
@@ -79,7 +79,7 @@ static int __prepare_data(struct mcast_sock *m, void *data)
return __do_prepare(m, data, ntohs(pld->len) + NETPLD_SIZ + NETHDR_SIZ);
}
-int prepare_send_netmsg(struct mcast_sock *m, void *data)
+size_t prepare_send_netmsg(struct mcast_sock *m, void *data)
{
int ret = 0;
struct nethdr *net = (struct nethdr *) data;
@@ -92,8 +92,8 @@ int prepare_send_netmsg(struct mcast_sock *m, void *data)
return ret;
}
-static int tx_buflenmax;
-static int tx_buflen = 0;
+static size_t tx_buflenmax;
+static size_t tx_buflen = 0;
static char *tx_buf;
#define HEADERSIZ 28 /* IP header (20 bytes) + UDP header 8 (bytes) */
@@ -121,7 +121,7 @@ void mcast_buffered_destroy(void)
}
/* return 0 if it is not sent, otherwise return 1 */
-int mcast_buffered_send_netmsg(struct mcast_sock *m, void *data, int len)
+int mcast_buffered_send_netmsg(struct mcast_sock *m, void *data, size_t len)
{
int ret = 0;
struct nethdr *net = data;
@@ -140,9 +140,9 @@ retry:
return ret;
}
-int mcast_buffered_pending_netmsg(struct mcast_sock *m)
+ssize_t mcast_buffered_pending_netmsg(struct mcast_sock *m)
{
- int ret;
+ ssize_t ret;
if (tx_buflen == 0)
return 0;
@@ -156,7 +156,7 @@ int mcast_buffered_pending_netmsg(struct mcast_sock *m)
int mcast_send_netmsg(struct mcast_sock *m, void *data)
{
int ret;
- int len = prepare_send_netmsg(m, data);
+ size_t len = prepare_send_netmsg(m, data);
ret = mcast_buffered_send_netmsg(m, data, len);
mcast_buffered_pending_netmsg(m);