summaryrefslogtreecommitdiffstats
path: root/ulogd/libipulog
diff options
context:
space:
mode:
authorlaforge <laforge>2000-07-31 14:52:46 +0000
committerlaforge <laforge>2000-07-31 14:52:46 +0000
commit0cb8827243cd63a72c0121293aa6f38809543390 (patch)
tree7f08d1424bba6b21f3321dbfeef5132f0106e5c2 /ulogd/libipulog
parent3f5246293cb446a170fbbed8e770bb97730d5797 (diff)
rustys fixes merged in
Diffstat (limited to 'ulogd/libipulog')
-rw-r--r--ulogd/libipulog/libipulog.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/ulogd/libipulog/libipulog.c b/ulogd/libipulog/libipulog.c
index 725bb9f..5d111f6 100644
--- a/ulogd/libipulog/libipulog.c
+++ b/ulogd/libipulog/libipulog.c
@@ -1,5 +1,5 @@
/*
- * libipulog.c, Version $Revision$
+ * libipulog.c, $Revision$
*
* netfilter ULOG userspace library.
*
@@ -16,8 +16,17 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <net/if.h>
#include <libipulog/libipulog.h>
+struct ipulog_handle
+{
+ int fd;
+ u_int8_t blocking;
+ struct sockaddr_nl local;
+ struct sockaddr_nl peer;
+};
+
/* internal */
enum
@@ -111,7 +120,7 @@ u_int32_t ipulog_group2gmask(u_int32_t group)
ipulog_errno = IPULOG_ERR_INVGR;
return 0;
}
- return (1 << group - 1);
+ return (1 << (group - 1));
}
/* create a ipulog handle for the reception of packets sent to gmask */
@@ -156,22 +165,21 @@ struct ipulog_handle *ipulog_create_handle(unsigned int gmask)
}
/* destroy a ipulog handle */
-int ipulog_destroy_handle(struct ipulog_handle *h)
+void ipulog_destroy_handle(struct ipulog_handle *h)
{
- if (h)
- {
- close(h->fd);
- free(h);
- }
+ close(h->fd);
+ free(h);
}
+#if 0
int ipulog_set_mode()
{
}
+#endif
/* do a BLOCKING read on an ipulog handle */
-ssize_t ipulog_read(const struct ipulog_handle *h, unsigned char *buf,
- size_t len, int timeout)
+ssize_t ipulog_read(struct ipulog_handle *h, unsigned char *buf,
+ size_t len, int timeout)
{
return ipulog_netlink_recvfrom(h, buf, len);
}