summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-01-23 23:20:25 +0000
committerLennart Poettering <lennart@poettering.net>2004-01-23 23:20:25 +0000
commit95c6823f9d0eb7110d8327bccfa52f57cc391bc4 (patch)
treeedbefa79d13e8954db50e52bc819b7e8f61f1fb2
parentb651436a9783a7b2c929ab6b7f4c08cc2454f623 (diff)
compatibility with 2.6
documentation update git-svn-id: file:///home/lennart/svn/public/ifmetric/trunk@16 b1ab5a0b-19c4-0310-9d9a-ef184d715f50
-rw-r--r--configure.ac33
-rw-r--r--doc/README.html.in18
-rw-r--r--doc/style.css24
-rw-r--r--man/Makefile.am15
-rw-r--r--man/ifmetric.8.xml.in5
-rw-r--r--man/xmltoman.css30
-rw-r--r--man/xmltoman.dtd39
-rw-r--r--man/xmltoman.xsl120
-rw-r--r--src/nlrequest.c9
9 files changed, 259 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac
index 576d77c..6fe9404 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,14 +19,27 @@
# along with ifmetric; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-AC_PREREQ(2.57)
-AC_INIT([ifmetric], [0.2b], [mzvszrgevp (at) 0pointer (dot) de])
+AC_PREREQ(2.59)
+AC_INIT([ifmetric],[0.3],[mzvszrgevp (at) 0pointer (dot) de])
AC_CONFIG_SRCDIR([src/ifmetric.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
+AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/ifmetric/])
+
+if test -d /usr/local/stow ; then
+ AC_MSG_NOTICE([*** Found /usr/local/stow: installing to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
+ AC_PREFIX_DEFAULT([/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}])
+fi
+
# Checks for programs.
AC_PROG_CC
+
+# If using GCC specifiy some additional parameters
+if test "x$GCC" = "xyes" ; then
+ CFLAGS="$CFLAGS -pipe -Wall"
+fi
+
AC_CHECK_FUNCS([memset socket strerror strrchr])
AC_CHECK_HEADERS([stdlib.h string.h sys/socket.h unistd.h])
AC_FUNC_MALLOC
@@ -37,21 +50,9 @@ AC_TYPE_PID_T
AC_CHECK_HEADER([linux/version.h],, [AC_MSG_ERROR([*** Sorry, you have to install the kernel header files ***])])
-AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/ifmetric/])
-
-if test -d /usr/local/stow ; then
- AC_MSG_NOTICE([*** Found /usr/local/stow: installing to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
- AC_PREFIX_DEFAULT([/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}])
-fi
-
-# If using GCC specifiy some additional parameters
-if test "x$GCC" = "xyes" ; then
- CFLAGS="$CFLAGS -pipe -Wall"
-fi
-
# LYNX documentation generation
AC_ARG_ENABLE(lynx,
- AC_HELP_STRING([--disable-lynx], [Turn off lynx usage for documentation generation]),
+ AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
[case "${enableval}" in
yes) lynx=yes ;;
no) lynx=no ;;
@@ -70,7 +71,7 @@ AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
# XMLTOMAN manpage generation
AC_ARG_ENABLE(xmltoman,
- AC_HELP_STRING([--disable-xmltoman], [Disable rebuilding of man pages with xmltoman]),
+ AS_HELP_STRING(--disable-xmltoman,Disable rebuilding of man pages with xmltoman),
[case "${enableval}" in
yes) xmltoman=yes ;;
no) xmltoman=no ;;
diff --git a/doc/README.html.in b/doc/README.html.in
index 2287644..e897992 100644
--- a/doc/README.html.in
+++ b/doc/README.html.in
@@ -10,7 +10,7 @@
<body>
<h1><a name="top">ifmetric @PACKAGE_VERSION@</a></h1>
-<p><i>Copyright 2003 Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;</i></p>
+<p><i>Copyright 2003,2004 Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;</i></p>
<ul class="toc">
<li><a href="#license">License</a></li>
@@ -42,11 +42,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</p>
<h2><a name="news">News</a></h2>
-<div class="news-date">Sa Aug 23 2003: </div> <p class="news-text"><a
+<div class="news-date">Sat Jan 24 2004: </div> <p class="news-text"><a
+href="@PACKAGE_URL@ifmetric-0.3.tar.gz">Version
+0.3</a> release; fix compatibility with Linux 2.6</p>
+
+<div class="news-date">Sat Aug 23 2003: </div> <p class="news-text"><a
href="@PACKAGE_URL@ifmetric-0.2b.tar.gz">Version
0.2b</a> release; URL fix</p>
-<div class="news-date">Sa Aug 23 2003: </div> <p class="news-text"><a
+<div class="news-date">Sat Aug 23 2003: </div> <p class="news-text"><a
href="@PACKAGE_URL@ifmetric-0.2.tar.gz">Version
0.2</a> released; changes include updated documentation, build system, contact information</p>
@@ -92,6 +96,8 @@ modifying them.</p>
<h3>Usage</h3>
+<p>Have a look on the manual page <a href="@PACKAGE_URL@ifmetric.8.xml"><tt>ifmetric(8)</tt></a>.
+
<p>To give all other interfaces a higher priority than <tt>wlan0</tt> simply run:</p>
<pre>ifmetric wlan0 1</pre>
@@ -131,11 +137,13 @@ on their source codes for learning how to use NETLINK.</p>
<p>The current release is <a href="@PACKAGE_URL@ifmetric-@PACKAGE_VERSION@.tar.gz">@PACKAGE_VERSION@</a></p>
+<p>If you want to be notified whenever I release a new version of this software use the subscription feature of <a href="http://freshmeat.net/projects/ifmetric/">Freshmeat</a>.</p>
+
<hr/>
-<address>Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, July 2003</address>
+<address class="grey">Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, January 2004</address>
-<div><i>$Id$</i></div>
+<div class="grey"><i>$Id$</i></div>
</body>
</html>
diff --git a/doc/style.css b/doc/style.css
index 0a40aef..2f41be1 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -1,12 +1,32 @@
/* $Id$ */
+
+/***
+ * This file is part of aeswepd.
+ *
+ * aeswepd is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * aeswepd is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with aeswepd; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ ***/
+
body { color: black; background-color: white; margin: 0.5cm; }
a:link, a:visited { color: #900000; }
p { margin-left: 0.5cm; margin-right: 0.5cm; }
div.news-date { margin-left: 0.5cm; font-size: 80%; color: #4f0000; }
p.news-text { margin-left: 1cm; }
-ul { margin-left: .5cm; }
-ol { margin-left: .5cm; }
h1 { color: #00009F; }
h2 { color: #00009F; }
h3 { color: #00004F; margin-left: 0.5cm; }
+ul { margin-left: .5cm; }
+ol { margin-left: .5cm; }
pre { margin-left: .5cm; background-color: #f0f0f0; padding: 0.4cm;}
+.grey { color: #afafaf; }
diff --git a/man/Makefile.am b/man/Makefile.am
index 8523d68..11c8dd1 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -18,13 +18,20 @@
man_MANS = ifmetric.8
-EXTRA_DIST = $(man_MANS) ifmetric.8.xml.in
+noinst_DATA = ifmetric.8.xml
+
+EXTRA_DIST = $(man_MANS) ifmetric.8.xml.in xmltoman.css xmltoman.xsl xmltoman.dtd
+
+CLEANFILES = ifmetric.8.xml
+
+ifmetric.8.xml: ifmetric.8.xml.in Makefile
+ sed -e 's,@sysconfdir\@,$(sysconfdir),g' -e 's,@sbindir\@,$(sbindir),g' -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' $< > $@
if USE_XMLTOMAN
-CLEANFILES = $(man_MANS)
+CLEANFILES += $(man_MANS)
-ifmetric.8: ifmetric.8.xml.in Makefile
- sed -e 's,@sysconfdir\@,$(sysconfdir),g' -e 's,@sbindir\@,$(sbindir),g' -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' $< | xmltoman - > $@
+ifmetric.8: ifmetric.8.xml Makefile
+ xmltoman $< > $@
endif
diff --git a/man/ifmetric.8.xml.in b/man/ifmetric.8.xml.in
index f0aa960..ca539cf 100644
--- a/man/ifmetric.8.xml.in
+++ b/man/ifmetric.8.xml.in
@@ -1,5 +1,6 @@
-<?xml version="1.0" standalone='no'?>
-<!DOCTYPE spec SYSTEM "man.dtd">
+<?xml version="1.0" standalone='no'?> <!--*-nxml-*-->
+<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
+<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
<!-- $Id$ -->
diff --git a/man/xmltoman.css b/man/xmltoman.css
new file mode 100644
index 0000000..ea0760c
--- /dev/null
+++ b/man/xmltoman.css
@@ -0,0 +1,30 @@
+/* $Id$ */
+
+/***
+ This file is part of ifmetric.
+
+ ifmetric is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ ifmetric is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with ifmetric; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+***/
+
+body { color: black; background-color: white; margin: 0.5cm; }
+a:link, a:visited { color: #900000; }
+h1 { text-transform:uppercase; font-size: 18pt; color: #00009F; }
+p { margin-left:1cm; margin-right:1cm; }
+.cmd { font-family:monospace; }
+.file { font-family:monospace; }
+.arg { text-transform:uppercase; font-family:monospace; font-style: italic; }
+.opt { font-family:monospace; font-weight: bold; }
+.manref { font-family:monospace; }
+.option .optdesc { margin-left:2cm; }
diff --git a/man/xmltoman.dtd b/man/xmltoman.dtd
new file mode 100644
index 0000000..0b502c2
--- /dev/null
+++ b/man/xmltoman.dtd
@@ -0,0 +1,39 @@
+<!-- $Id$ -->
+
+<!--
+ This file is part of ifmetric.
+
+ ifmetric is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ ifmetric is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with ifmetric; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+-->
+
+<!ELEMENT manpage (synopsis | description | section | options | seealso)*>
+<!ATTLIST manpage name CDATA #REQUIRED section CDATA #REQUIRED desc CDATA #IMPLIED>
+<!ELEMENT arg (#PCDATA)>
+<!ELEMENT p (#PCDATA | arg | url | manref | opt | file )*>
+<!ELEMENT synopsis (cmd | p)+>
+<!ELEMENT description (p)+>
+<!ELEMENT section (p | option)*>
+<!ATTLIST section name CDATA #REQUIRED>
+<!ELEMENT option (#PCDATA | p | optdesc)*>
+<!ELEMENT optdesc (#PCDATA | p )*>
+<!ELEMENT cmd (#PCDATA | arg)*>
+<!ELEMENT options (p | option)*>
+<!ELEMENT seealso (p)*>
+<!ELEMENT opt (#PCDATA)>
+<!ELEMENT file (#PCDATA)>
+<!ELEMENT manref EMPTY>
+<!ATTLIST manref name CDATA #REQUIRED section CDATA #REQUIRED href CDATA #IMPLIED>
+<!ELEMENT url EMPTY>
+<!ATTLIST url href CDATA #REQUIRED>
diff --git a/man/xmltoman.xsl b/man/xmltoman.xsl
new file mode 100644
index 0000000..c387877
--- /dev/null
+++ b/man/xmltoman.xsl
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+
+<!--
+ This file is part of ifmetric.
+
+ ifmetric is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ ifmetric is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with ifmetric; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+-->
+
+<xsl:template match="/manpage">
+ <xsl:text disable-output-escaping="yes">
+ &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
+ </xsl:text>
+ <html>
+
+ <head>
+ <title>
+ <xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>)
+ </title>
+ <link rel="stylesheet" type="text/css" href="xmltoman.css"/>
+ </head>
+ <body>
+ <h1>Name</h1>
+ <p><xsl:value-of select="@name"/>
+ <xsl:if test="string-length(@desc) &gt; 0">
+ - <xsl:value-of select="@desc"/>
+ </xsl:if>
+ </p>
+ <xsl:apply-templates />
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="p">
+ <p>
+ <xsl:apply-templates/>
+ </p>
+</xsl:template>
+
+<xsl:template match="cmd">
+ <p class="cmd">
+ <xsl:apply-templates/>
+ </p>
+</xsl:template>
+
+<xsl:template match="arg">
+ <span class="arg"><xsl:apply-templates/></span>
+</xsl:template>
+
+<xsl:template match="opt">
+ <span class="opt"><xsl:apply-templates/></span>
+</xsl:template>
+
+<xsl:template match="file">
+ <span class="file"><xsl:apply-templates/></span>
+</xsl:template>
+
+<xsl:template match="optdesc">
+ <div class="optdesc">
+ <xsl:apply-templates/>
+ </div>
+</xsl:template>
+
+<xsl:template match="synopsis">
+ <h1>Synopsis</h1>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="seealso">
+ <h1>Synopsis</h1>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="description">
+ <h1>Description</h1>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="options">
+ <h1>Options</h1>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="section">
+ <h1><xsl:value-of select="@name"/></h1>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="option">
+ <div class="option"><xsl:apply-templates/></div>
+</xsl:template>
+
+<xsl:template match="manref">
+ <xsl:choose>
+ <xsl:when test="string-length(@href) &gt; 0">
+ <a class="manref"><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>)</a>
+ </xsl:when>
+ <xsl:otherwise>
+ <span class="manref"><xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>)</span>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="url">
+ <a class="url"><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:value-of select="@href"/></a>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/src/nlrequest.c b/src/nlrequest.c
index 1f72357..99fd3d0 100644
--- a/src/nlrequest.c
+++ b/src/nlrequest.c
@@ -44,7 +44,7 @@ int netlink_request(int s, struct nlmsghdr *n, int (*callback) (struct nlmsghdr
for (;;) {
int bytes;
- char replybuf[1024];
+ char replybuf[2048];
struct nlmsghdr *p = (struct nlmsghdr *) replybuf;
if ((bytes = recv(s, &replybuf, sizeof(replybuf), 0)) < 0) {
@@ -55,8 +55,8 @@ int netlink_request(int s, struct nlmsghdr *n, int (*callback) (struct nlmsghdr
for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
int ret;
- if (!NLMSG_OK(p, bytes) || bytes < sizeof(struct nlmsghdr) || bytes < p->nlmsg_len) {
- fprintf(stderr, "NETLINK: Packet too small or truncated!\n");
+ if (!NLMSG_OK(p, bytes) || bytes < sizeof(struct nlmsghdr) || bytes < p->nlmsg_len) {
+ fprintf(stderr, "NETLINK: Packet too small or truncated! %u!=%u!=%u\n", bytes, sizeof(struct nlmsghdr), p->nlmsg_len);
return -1;
}
@@ -114,11 +114,10 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen) {
}
/*
- * Utility function comes from iproute2.
+ * Utility function originated from iproute2.
* Author: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
-
int addattr32(struct nlmsghdr *n, int maxlen, int type, int data) {
int len;
struct rtattr *rta;