[iptables] Add xtables version defines.
Patrick McHardy
netfilter-cvslog-bounces at lists.netfilter.org
Tue Jun 3 15:15:13 CEST 2008
Gitweb: http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=c634cb9cb13d6e1b6fd661b426363431f7ef321a
commit c634cb9cb13d6e1b6fd661b426363431f7ef321a
Author: Thomas Jarosch <thomas.jarosch at intra2net.com>
AuthorDate: Tue Jun 3 15:02:18 2008 +0200
Commit: Patrick McHardy <kaber at trash.net>
CommitDate: Tue Jun 3 15:02:18 2008 +0200
Add xtables version defines.
Attached is a patch to add the new defines. The macro XTABLES_VERSION
is already in use, so I named it XTABLES_VERSION_CHECK. I've also tested
that an empty XTABLES_VERSION_EXTRA in configure.ac works.
Now we can write code like this:
#warning You are obselete and will be assimilated.
Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
Signed-off-by: Patrick McHardy <kaber at trash.net>
via c634cb9cb13d6e1b6fd661b426363431f7ef321a (commit)
from 510aef98a56cdbfdb147f78b05d7554bb91770a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c634cb9cb13d6e1b6fd661b426363431f7ef321a
Author: Thomas Jarosch <thomas.jarosch at intra2net.com>
Date: Tue Jun 3 15:02:18 2008 +0200
Add xtables version defines.
Attached is a patch to add the new defines. The macro XTABLES_VERSION
is already in use, so I named it XTABLES_VERSION_CHECK. I've also tested
that an empty XTABLES_VERSION_EXTRA in configure.ac works.
Now we can write code like this:
#warning You are obselete and will be assimilated.
Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
Signed-off-by: Patrick McHardy <kaber at trash.net>
-----------------------------------------------------------------------
configure.ac | 18 +++++++++++++++++-
include/xtables.h.in | 3 +++
2 files changed, 20 insertions(+), 1 deletions(-)
Attached is a patch to add the new defines. The macro XTABLES_VERSION
is already in use, so I named it XTABLES_VERSION_CHECK. I've also tested
that an empty XTABLES_VERSION_EXTRA in configure.ac works.
Now we can write code like this:
#warning You are obselete and will be assimilated.
Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
Signed-off-by: Patrick McHardy <kaber at trash.net>
diff --git a/configure.ac b/configure.ac
index b32349a..e718eff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,11 @@
+define([_XTABLES_VERSION_MAJOR], 1)
+define([_XTABLES_VERSION_MINOR], 4)
+define([_XTABLES_VERSION_PATCH], 1)
+define([_XTABLES_VERSION_EXTRA], -rc2)
-AC_INIT([iptables], [1.4.1-rc2])
+define([_XTABLES_VERSION],_XTABLES_VERSION_MAJOR._XTABLES_VERSION_MINOR._XTABLES_VERSION_PATCH[]_XTABLES_VERSION_EXTRA)
+
+AC_INIT([iptables], _XTABLES_VERSION)
AC_CONFIG_HEADERS([config.h])
AC_PROG_INSTALL
AM_INIT_AUTOMAKE
@@ -56,4 +62,14 @@ AC_SUBST([kinclude_CFLAGS])
AC_SUBST([kbuilddir])
AC_SUBST([ksourcedir])
AC_SUBST([xtlibdir])
+
+XTABLES_VERSION_MAJOR=_XTABLES_VERSION_MAJOR
+XTABLES_VERSION_MINOR=_XTABLES_VERSION_MINOR
+XTABLES_VERSION_PATCH=_XTABLES_VERSION_PATCH
+XTABLES_VERSION_EXTRA=_XTABLES_VERSION_EXTRA
+AC_SUBST([XTABLES_VERSION_MAJOR])
+AC_SUBST([XTABLES_VERSION_MINOR])
+AC_SUBST([XTABLES_VERSION_PATCH])
+AC_SUBST([XTABLES_VERSION_EXTRA])
+
AC_OUTPUT([Makefile extensions/GNUmakefile libipq/Makefile include/xtables.h])
diff --git a/include/xtables.h.in b/include/xtables.h.in
index c8a8746..4ce73e9 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -18,6 +18,9 @@
#endif
#define XTABLES_VERSION "@PACKAGE_VERSION@"
+#define XTABLES_VERSION_CODE (0x10000 * @XTABLES_VERSION_MAJOR@ + 0x100 * @XTABLES_VERSION_MINOR@ + @XTABLES_VERSION_PATCH@)
+
+#define XTABLES_API_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
/* Include file for additions: new matches and targets. */
struct xtables_match
More information about the netfilter-cvslog
mailing list