[netfilter-cvslog] r4488 - in trunk/libnetfilter_log:
include/libnetfilter_log src
laforge at netfilter.org
laforge at netfilter.org
Sun Nov 6 12:42:40 CET 2005
Author: laforge at netfilter.org
Date: 2005-11-06 12:42:39 +0100 (Sun, 06 Nov 2005)
New Revision: 4488
Modified:
trunk/libnetfilter_log/include/libnetfilter_log/libnetfilter_log.h
trunk/libnetfilter_log/src/Makefile.am
trunk/libnetfilter_log/src/libnetfilter_log.c
Log:
- add librarry api versioning
- add missing dependency from libipulog to libnetfilter_log
Modified: trunk/libnetfilter_log/include/libnetfilter_log/libnetfilter_log.h
===================================================================
--- trunk/libnetfilter_log/include/libnetfilter_log/libnetfilter_log.h 2005-11-06 11:41:27 UTC (rev 4487)
+++ trunk/libnetfilter_log/include/libnetfilter_log/libnetfilter_log.h 2005-11-06 11:42:39 UTC (rev 4488)
@@ -48,7 +48,7 @@
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);
Modified: trunk/libnetfilter_log/src/Makefile.am
===================================================================
--- trunk/libnetfilter_log/src/Makefile.am 2005-11-06 11:41:27 UTC (rev 4487)
+++ trunk/libnetfilter_log/src/Makefile.am 2005-11-06 11:42:39 UTC (rev 4488)
@@ -1,15 +1,18 @@
-#AUTOMAKE_OPTIONS = no-dependencies foreign
+# 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
-#EXTRA_DIST = $(man_MANS) acinclude.m4
-
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I${KERNELDIR}
AM_CFLAGS=-fPIC -Wall
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
Modified: trunk/libnetfilter_log/src/libnetfilter_log.c
===================================================================
--- trunk/libnetfilter_log/src/libnetfilter_log.c 2005-11-06 11:41:27 UTC (rev 4487)
+++ trunk/libnetfilter_log/src/libnetfilter_log.c 2005-11-06 11:42:39 UTC (rev 4488)
@@ -341,10 +341,19 @@
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)
More information about the netfilter-cvslog
mailing list