From 0cb8827243cd63a72c0121293aa6f38809543390 Mon Sep 17 00:00:00 2001 From: laforge Date: Mon, 31 Jul 2000 14:52:46 +0000 Subject: rustys fixes merged in --- ulogd/libipulog/libipulog.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'ulogd/libipulog') 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 #include #include +#include #include +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); } -- cgit v1.2.3