From 33cfa4c4e74a17f93e740a304e2bb8a80665fd46 Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org" Date: Sun, 6 Nov 2005 11:42:39 +0000 Subject: - add librarry api versioning - add missing dependency from libipulog to libnetfilter_log --- include/libnetfilter_log/libnetfilter_log.h | 2 +- src/Makefile.am | 13 ++++++++----- src/libnetfilter_log.c | 13 +++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/include/libnetfilter_log/libnetfilter_log.h b/include/libnetfilter_log/libnetfilter_log.h index 64904bb..0629180 100644 --- a/include/libnetfilter_log/libnetfilter_log.h +++ b/include/libnetfilter_log/libnetfilter_log.h @@ -48,7 +48,7 @@ extern int nflog_handle_packet(struct nflog_handle *h, char *buf, int len); extern struct nfulnl_msg_packet_hdr *nflog_get_msg_packet_hdr(struct nflog_data *nfad); extern u_int32_t nflog_get_nfmark(struct nflog_data *nfad); -extern struct nfulnl_msg_packet_timestamp *nflog_get_timestamp(struct nflog_data *nfad); +extern int nflog_get_timestamp(struct nflog_data *nfad, struct timeval *tv); extern u_int32_t nflog_get_indev(struct nflog_data *nfad); extern u_int32_t nflog_get_physindev(struct nflog_data *nfad); extern u_int32_t nflog_get_outdev(struct nflog_data *nfad); diff --git a/src/Makefile.am b/src/Makefile.am index b180575..412bfee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ -#AUTOMAKE_OPTIONS = no-dependencies foreign - -#EXTRA_DIST = $(man_MANS) acinclude.m4 +# This is _NOT_ the library release version, it's an API version. +# Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification +LIBVERSION=1:0:0 INCLUDES = $(all_includes) -I$(top_srcdir)/include -I${KERNELDIR} AM_CFLAGS=-fPIC -Wall @@ -8,8 +8,11 @@ LIBS= lib_LTLIBRARIES = libnetfilter_log.la libnetfilter_log_libipulog.la -libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles -lnfnetlink +libnetfilter_log_la_LDFLAGS = -Wc,-nostartfiles -lnfnetlink \ + -version-info $(LIBVERSION) libnetfilter_log_la_SOURCES = libnetfilter_log.c -libnetfilter_log_libipulog_la_LDFLAGS = -Wc,-nostartfiles +libnetfilter_log_libipulog_la_LDFLAGS = -Wc,-nostartfiles \ + -version-info 1:0:0 +libnetfilter_log_libipulog_la_LIBADD = libnetfilter_log.la libnetfilter_log_libipulog_la_SOURCES = libipulog_compat.c diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c index 7d5900e..45d4b13 100644 --- a/src/libnetfilter_log.c +++ b/src/libnetfilter_log.c @@ -341,10 +341,19 @@ u_int32_t nflog_get_nfmark(struct nflog_data *nfad) return ntohl(nfnl_get_data(nfad->nfa, NFULA_MARK, u_int32_t)); } -struct nfulnl_msg_packet_timestamp *nflog_get_timestamp(struct nflog_data *nfad) +int nflog_get_timestamp(struct nflog_data *nfad, struct timeval *tv) { - return nfnl_get_pointer_to_data(nfad->nfa, NFULA_TIMESTAMP, + struct nfulnl_msg_packet_timestamp *uts; + + uts = nfnl_get_pointer_to_data(nfad->nfa, NFULA_TIMESTAMP, struct nfulnl_msg_packet_timestamp); + if (!uts) + return -1; + + tv->tv_sec = __be64_to_cpu(uts->sec); + tv->tv_usec = __be64_to_cpu(uts->usec); + + return 0; } u_int32_t nflog_get_indev(struct nflog_data *nfad) -- cgit v1.2.3