diff options
Diffstat (limited to 'libipulog')
-rw-r--r-- | libipulog/Makefile | 14 | ||||
-rw-r--r-- | libipulog/include/libipulog/libipulog.h | 30 |
2 files changed, 44 insertions, 0 deletions
diff --git a/libipulog/Makefile b/libipulog/Makefile new file mode 100644 index 0000000..e737363 --- /dev/null +++ b/libipulog/Makefile @@ -0,0 +1,14 @@ +CC = gcc +CFLAGS = -I./include # -g + +ulog_test: ulog_test.c libipulog.a + $(CC) $(CFLAGS) -i ulog_test.c libipulog.a -o ulog_test + +libipulog.o: libipulog.c + $(CC) $(CFLAGS) -c libipulog.c -o libipulog.o + +libipulog.a: libipulog.o + ld -i libipulog.o -o libipulog.a + +clean: + rm -f ulog_test libipulog.o libipulog.a diff --git a/libipulog/include/libipulog/libipulog.h b/libipulog/include/libipulog/libipulog.h new file mode 100644 index 0000000..9f920dd --- /dev/null +++ b/libipulog/include/libipulog/libipulog.h @@ -0,0 +1,30 @@ +#ifndef _LIBIPULOG_H +#define _LIBIPULOG_H + +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/uio.h> +#include <asm/types.h> +#include <linux/netlink.h> +#include <net/if.h> +#include <linux/netfilter_ipv4/ipt_ULOG.h> + +struct ipulog_handle; + +u_int32_t ipulog_group2gmask(u_int32_t group); + +struct ipulog_handle *ipulog_create_handle(u_int32_t gmask); + +void ipulog_destroy_handle(struct ipulog_handle *h); + +ssize_t ipulog_read(struct ipulog_handle *h, + unsigned char *buf, size_t len, int timeout); + +ulog_packet_msg_t *ipulog_get_packet(const unsigned char *buf); + +void ipulog_perror(const char *s); + +#endif /* _LIBULOG_H */ |