summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2016-06-21 12:58:16 +0200
committerAndrew Shadura <andrew@shadura.me>2016-06-21 12:58:16 +0200
commitd7004250c6315849f46a9546c7f7da600ba916f6 (patch)
tree4375e4d4497abe067951c167868f692ec8e1a07d
parent9113f492926c8ad32b5e481d2071eac8bbb843d8 (diff)
Apply patches for dgit.debian/0.28-19.2
-rw-r--r--doc/ChangeLog116
-rw-r--r--doc/FAQ63
-rw-r--r--doc/NEWS2
-rw-r--r--doc/README258
-rw-r--r--doc/README.html2
-rw-r--r--doc/README.html.in2
-rw-r--r--man/ifplugd.887
-rw-r--r--man/ifplugd.8.xml.in33
-rw-r--r--man/ifplugd.conf.55
-rw-r--r--man/ifplugd.conf.5.xml.in14
-rw-r--r--man/ifplugstatus.810
-rw-r--r--src/ifplugd.c66
-rw-r--r--src/interface.c1
-rw-r--r--src/interface.h3
14 files changed, 338 insertions, 324 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
new file mode 100644
index 0000000..b953ccb
--- /dev/null
+++ b/doc/ChangeLog
@@ -0,0 +1,116 @@
+ Sat Jun 4 2005:
+
+ [10]Version 0.28 released, changes include: build fixes from Stefan
+ Seyfried.
+
+ Wed Mar 30 2005:
+
+ [11]Version 0.27 released, changes include: new option --no-startup.
+
+ Sun Dec 19 2004:
+
+ [12]Version 0.26 released, changes include: changed MII code for
+ better compatibility with some 3COM Boomerang cards.
+
+ Mon May 10 2004:
+
+ [13]Version 0.25 released, changes include: Revert to more classic
+ link checking support. The new checking order is: ETHTOOL, MII, WLAN,
+ IFF. The obsolete API "PRIV" is no longer checked by the automatic API
+ detection code. However, you may enable it forcibly by passing -m priv
+ on the command line.
+
+ Mon Apr 12 2004:
+
+ [14]Version 0.24 released, changes include: add IFF_RUNNING link check
+ support and make it the default. This might break some setups. You may
+ workaround this by passing -m to the daemon for selecting a different
+ API. Please report breakages!
+
+ Wed Apr 7 2004:
+
+ [15]Version 0.23 released, changes include: don't make /dev/tty1 the
+ controlling TTY when beeping
+
+ Tue Feb 10 2004:
+
+ [16]Version 0.22 released, changes include: rename ifstatus to
+ ifplugstatus due to namespace collision, minor fixes
+
+ Mon Jan 26 2004:
+
+ [17]Version 0.21b released, added missing file.
+
+ Mon Jan 26 2004:
+
+ [18]Version 0.21 released, changes include: better compatibility with
+ wireless devices, compatibility with newer kernels
+
+ Sun Nov 9 2003:
+
+ [19]Version 0.20 released, changes include: fix wrong message, build
+ fix
+
+ Mon Oct 20 2003:
+
+ [20]Version 0.19 released, changes include: New option
+ --wait-for-kill, this requires [21]libdaemon 0.3
+
+ Fri Oct 17 2003:
+
+ [22]Version 0.18 released, changes include: Some bugs fixed
+
+ Fri Sep 13 2003:
+
+ [23]Version 0.17b released, changes include: typo and date fix
+
+ Fri Sep 13 2003:
+
+ [24]Version 0.17 released, changes include: documentation update,
+ better support for multiple interfaces, gcc 2.95 build fix
+
+ Thu Aug 13 2003:
+
+ [25]Version 0.16 released, changes include: RPM spec file added, build
+ fixes, WLAN improvements (including compatibility with the upcoming
+ waproamd, a WLAN roaming daemon), monitor mode for use in conjunction
+ with PCMCIA devices, better support for multiple interface setups,
+ SUPPORTED_DRIVERS returns
+
+ Thu July 10 2003:
+
+ [26]Version 0.15 released, changes include: bad umask fix,
+ documentation update
+
+ Mon July 7 2003:
+
+ [27]Version 0.14 released, changes include: autoconf usage, new
+ dependency [28]libdaemon, wireless LAN support, support for
+ suspending/resuming, many fixes
+
+ Lennart Poettering <mzvscyhtq (at) 0pointer (dot) de>, June 2005
+
+ $Id: README.html.in 124 2005-06-04 19:22:59Z lennart $
+
+References
+
+ 9. README#download
+ 10. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.27.tar.gz
+ 11. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.27.tar.gz
+ 12. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.26.tar.gz
+ 13. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.25.tar.gz
+ 14. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.24.tar.gz
+ 15. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.23.tar.gz
+ 16. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.22.tar.gz
+ 17. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.21b.tar.gz
+ 18. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.21.tar.gz
+ 19. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.20.tar.gz
+ 20. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.19.tar.gz
+ 21. http://0pointer.de/lennart/projects/libdaemon/
+ 22. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.18.tar.gz
+ 23. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.17b.tar.gz
+ 24. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.17.tar.gz
+ 25. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.16.tar.gz
+ 26. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.15.tar.gz
+ 27. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.14.tar.gz
+ 28. http://0pointer.de/lennart/projects/libdaemon/
diff --git a/doc/FAQ b/doc/FAQ
new file mode 100644
index 0000000..96bf250
--- /dev/null
+++ b/doc/FAQ
@@ -0,0 +1,63 @@
+
+ FAQ
+
+ 1. Q: I want to use ifplugd with my PCMCIA device, but ifplugd quits
+ when it doesn't find eth0, when I have not inserted the card. What
+ can I do?
+ A: Use the -f switch. This is not very clean however, since
+ modprobe is called on each cable detection query of ifplugd to
+ load a module for the network device. This is suboptimal. You
+ should probably run ifplugd only when the card is really inserted.
+ 2. Q: I am using the -f switch, but the kernel logs are getting
+ filled with messages like "modprobe: modprobe: Can't locate module
+ eth0". What can I do?
+ A: Make sure you have a line like alias eth0 off in your
+ /etc/modules.conf
+ 3. Q: When the cable is unplugged and the interface shut down it is
+ still available with ifconfig and markes as UP. Why this?
+ A: ifplugd cannot detect the link beat with a shut down interface
+ on certain (most as of kernel 2.4.19) network drivers. Thus
+ ifplugd enables the interface before querying the link status.
+ This may be switched off with -a flag. You might want to use it if
+ you have a sane network driver (e.g. eepro100). The subdirectory
+ patches/ in the ifplugd distribution includes a patch for the
+ 8139too 0.9.26 driver, which makes the driver compatible with -a.
+ Don't ask me how to apply this patch. If you don't know, you won't
+ need it.
+ 4. Q: Does it work with anything else than plain ethernet or wireless
+ LAN?
+ A: Certainly not, since the MII and ETHTOOL ioctl()s and the
+ wireless extension don't exist on other network device types.
+ 5. Q: I have a Realtek 8139 based network card. Everytime ifplugd
+ starts on bootup my machine freezes. What can I do?
+ A: This is a bug in the 8139too driver 0.9.25 (at least) shipped
+ with Linux 2.4.19, please upgrade to 8139too 0.9.26 (Linux 2.4.20
+ or seperately at
+ [33]http://www.sourceforge.net/projects/gkernel/).
+ 6. Q: There are already laptop-net's ifd and miid, why did you write
+ your own daemon?
+ A: laptop-net was too integrated with its profile system and
+ didn't work on my hardware when I had a look on it. It seemed
+ easier to me to write a simple but feature complete replacement
+ than using laptop-net without most of the special features
+ disabled. I didn't know about miid when I wrote ifplugd, but in
+ any case ifplugd is much better than miid. For a comparison of
+ miid and ifplugd, have a look on
+ [34]http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162763&repeat
+ merged=yes
+ 7. Q: I have two interfaces (e.g. WLAN and copper ethernet), both
+ controlled by ifplugd, and want to force the network traffic to go
+ over the faster one of them, in case both are available at the
+ same time. How can I do this?
+ A: A tool I wrote called [35]ifmetric might be exactly what you're
+ looking for.
+
+ Lennart Poettering <mzvscyhtq (at) 0pointer (dot) de>, June 2005
+
+ $Id: README.html.in 124 2005-06-04 19:22:59Z lennart $
+
+References
+
+ 33. http://www.sourceforge.net/projects/gkernel/
+ 34. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162763&repeatmerged=yes
+ 35. http://0pointer.de/lennart/projects/ifmetric/
diff --git a/doc/NEWS b/doc/NEWS
index f52dd1f..a7e046f 100644
--- a/doc/NEWS
+++ b/doc/NEWS
@@ -1,5 +1,5 @@
-[[[ newer changes are recorded in the README file only ]]]
+[[[ newer changes are recorded in the ChangeLog file only ]]]
0.20 :: 9 Nov 2003 :: SVN 71
diff --git a/doc/README b/doc/README
index 9a143dd..7507439 100644
--- a/doc/README
+++ b/doc/README
@@ -1,126 +1,4 @@
-
ifplugd 0.28
-
- Copyright 2002-2005 Lennart Poettering <mzvscyhtq (at) 0pointer (dot)
- de>
- * [1]License
- * [2]News
- * [3]Overview
- * [4]Current Status
- * [5]Documentation
- * [6]Requirements
- * [7]Installation
- * [8]Acknowledgements
- * [9]Download
-
-License
-
- This program 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.
-
- This program 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 this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-News
-
- Sat Jun 4 2005:
-
- [10]Version 0.28 released, changes include: build fixes from Stefan
- Seyfried.
-
- Wed Mar 30 2005:
-
- [11]Version 0.27 released, changes include: new option --no-startup.
-
- Sun Dec 19 2004:
-
- [12]Version 0.26 released, changes include: changed MII code for
- better compatibility with some 3COM Boomerang cards.
-
- Mon May 10 2004:
-
- [13]Version 0.25 released, changes include: Revert to more classic
- link checking support. The new checking order is: ETHTOOL, MII, WLAN,
- IFF. The obsolete API "PRIV" is no longer checked by the automatic API
- detection code. However, you may enable it forcibly by passing -m priv
- on the command line.
-
- Mon Apr 12 2004:
-
- [14]Version 0.24 released, changes include: add IFF_RUNNING link check
- support and make it the default. This might break some setups. You may
- workaround this by passing -m to the daemon for selecting a different
- API. Please report breakages!
-
- Wed Apr 7 2004:
-
- [15]Version 0.23 released, changes include: don't make /dev/tty1 the
- controlling TTY when beeping
-
- Tue Feb 10 2004:
-
- [16]Version 0.22 released, changes include: rename ifstatus to
- ifplugstatus due to namespace collision, minor fixes
-
- Mon Jan 26 2004:
-
- [17]Version 0.21b released, added missing file.
-
- Mon Jan 26 2004:
-
- [18]Version 0.21 released, changes include: better compatibility with
- wireless devices, compatibility with newer kernels
-
- Sun Nov 9 2003:
-
- [19]Version 0.20 released, changes include: fix wrong message, build
- fix
-
- Mon Oct 20 2003:
-
- [20]Version 0.19 released, changes include: New option
- --wait-for-kill, this requires [21]libdaemon 0.3
-
- Fri Oct 17 2003:
-
- [22]Version 0.18 released, changes include: Some bugs fixed
-
- Fri Sep 13 2003:
-
- [23]Version 0.17b released, changes include: typo and date fix
-
- Fri Sep 13 2003:
-
- [24]Version 0.17 released, changes include: documentation update,
- better support for multiple interfaces, gcc 2.95 build fix
-
- Thu Aug 13 2003:
-
- [25]Version 0.16 released, changes include: RPM spec file added, build
- fixes, WLAN improvements (including compatibility with the upcoming
- waproamd, a WLAN roaming daemon), monitor mode for use in conjunction
- with PCMCIA devices, better support for multiple interface setups,
- SUPPORTED_DRIVERS returns
-
- Thu July 10 2003:
-
- [26]Version 0.15 released, changes include: bad umask fix,
- documentation update
-
- Mon July 7 2003:
-
- [27]Version 0.14 released, changes include: autoconf usage, new
- dependency [28]libdaemon, wireless LAN support, support for
- suspending/resuming, many fixes
-
Overview
ifplugd is a Linux daemon which will automatically configure your
@@ -186,7 +64,7 @@ Documentation
When you are using the hotplug subsystem (Debian package hotplug) you
may notice that the network device is configured even when it is not
- listed on an auto line in /etc/network/interface. This may be due to
+ listed on an auto line in /etc/network/interfaces. This may be due to
hotplug being configured to ifup the network interface when it becomes
available. This was the default behavior in the Debian hotplug package
prior to release 0.0.20030117-1, for example. To prevent this you
@@ -212,59 +90,6 @@ Documentation
software for the Linux distributions to add such scripts to their
packages.
- FAQ
-
- 1. Q: I want to use ifplugd with my PCMCIA device, but ifplugd quits
- when it doesn't find eth0, when I have not inserted the card. What
- can I do?
- A: Use the -f switch. This is not very clean however, since
- modprobe is called on each cable detection query of ifplugd to
- load a module for the network device. This is suboptimal. You
- should probably run ifplugd only when the card is really inserted.
- 2. Q: I am using the -f switch, but the kernel logs are getting
- filled with messages like "modprobe: modprobe: Can't locate module
- eth0". What can I do?
- A: Make sure you have a line like alias eth0 off in your
- /etc/modules.conf
- 3. Q: When the cable is unplugged and the interface shut down it is
- still available with ifconfig and markes as UP. Why this?
- A: ifplugd cannot detect the link beat with a shut down interface
- on certain (most as of kernel 2.4.19) network drivers. Thus
- ifplugd enables the interface before querying the link status.
- This may be switched off with -a flag. You might want to use it if
- you have a sane network driver (e.g. eepro100). The subdirectory
- patches/ in the ifplugd distribution includes a patch for the
- 8139too 0.9.26 driver, which makes the driver compatible with -a.
- Don't ask me how to apply this patch. If you don't know, you won't
- need it.
- 4. Q: Does it work with anything else than plain ethernet or wireless
- LAN?
- A: Certainly not, since the MII and ETHTOOL ioctl()s and the
- wireless extension don't exist on other network device types.
- 5. Q: I have a Realtek 8139 based network card. Everytime ifplugd
- starts on bootup my machine freezes. What can I do?
- A: This is a bug in the 8139too driver 0.9.25 (at least) shipped
- with Linux 2.4.19, please upgrade to 8139too 0.9.26 (Linux 2.4.20
- or seperately at
- [33]http://www.sourceforge.net/projects/gkernel/).
- 6. Q: There are already laptop-net's ifd and miid, why did you write
- your own daemon?
- A: laptop-net was too integrated with its profile system and
- didn't work on my hardware when I had a look on it. It seemed
- easier to me to write a simple but feature complete replacement
- than using laptop-net without most of the special features
- disabled. I didn't know about miid when I wrote ifplugd, but in
- any case ifplugd is much better than miid. For a comparison of
- miid and ifplugd, have a look on
- [34]http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162763&repeat
- merged=yes
- 7. Q: I have two interfaces (e.g. WLAN and copper ethernet), both
- controlled by ifplugd, and want to force the network traffic to go
- over the faster one of them, in case both are available at the
- same time. How can I do this?
- A: A tool I wrote called [35]ifmetric might be exactly what you're
- looking for.
-
Requirements
A newer Linux Kernel (I think 2.2 is good enough, alltough I tested it
@@ -282,20 +107,6 @@ Requirements
ifplugd needs [36]libdaemon.
-Installation
-
- As this package is made with the GNU autotools you should run
- ./configure inside the distribution directory for configuring the
- source tree. After that you should run make for compilation and make
- install (as root) for installation of ifplugd.
-
- The installation scripts create an init script in
- ${sysconfdir}/init.d/ifplugd, however no /etc/rc?.d/ links are created
- for it.
-
- Extensive installation instructions for installation of ifplugd on
- Fedora Core 1 are available at [37]Geoff Ericksson's web site.
-
Acknowledgements
For the developers of mii-diag, ethtool and laptop-net, since I looked
@@ -309,82 +120,15 @@ Acknowledgements
Frederic Lepied for integrating ifplugd into Mandrake Linux
-Download
-
- The newest release is always available from
- [38]http://0pointer.de/lennart/projects/ifplugd/
-
- The current release is [39]0.28
-
- Get ifplugd's development sources from the [40]Subversion
- [41]repository ([42]viewcvs):
-svn checkout svn://seth.intheinter.net/ifplugd/trunk ifplugd
-
- You may find an up to date Debian package of ifplugd on the [43]Debian
- package repository.
-
- ifplugd is nowadays included in many popular distributions (Mandrake,
- Gentoo, Suse, Debian, Ubuntu); [44]Conectiva packages are available
- courtesy of Gonzalo Nemmi. Fedora Core packages are available from
- [45]Dag Wieers.
-
- If you want to be notified whenever I release a new version of this
- software use the subscription feature of [46]Freshmeat.
-
- New! There is a joint ifplugd and waproamd [47]mailing list available.
- _________________________________________________________________
-
-
Lennart Poettering <mzvscyhtq (at) 0pointer (dot) de>, June 2005
$Id: README.html.in 124 2005-06-04 19:22:59Z lennart $
References
- 1. README#license
- 2. README#news
- 3. README#overview
- 4. README#status
- 5. README#documentation
- 6. README#requirements
- 7. README#installation
- 8. README#acks
- 9. README#download
- 10. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.27.tar.gz
- 11. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.27.tar.gz
- 12. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.26.tar.gz
- 13. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.25.tar.gz
- 14. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.24.tar.gz
- 15. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.23.tar.gz
- 16. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.22.tar.gz
- 17. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.21b.tar.gz
- 18. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.21.tar.gz
- 19. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.20.tar.gz
- 20. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.19.tar.gz
- 21. http://0pointer.de/lennart/projects/libdaemon/
- 22. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.18.tar.gz
- 23. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.17b.tar.gz
- 24. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.17.tar.gz
- 25. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.16.tar.gz
- 26. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.15.tar.gz
- 27. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.14.tar.gz
28. http://0pointer.de/lennart/projects/libdaemon/
29. http://0pointer.de/lennart/projects/waproamd/
30. http://0pointer.de/lennart/projects/ifplugd/ifplugd.8.xml
31. http://0pointer.de/lennart/projects/ifplugd/ifplugstatus.8.xml
32. http://0pointer.de/lennart/projects/ifplugd/ifplugd.conf.5.xml
33. http://www.sourceforge.net/projects/gkernel/
- 34. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162763&repeatmerged=yes
- 35. http://0pointer.de/lennart/projects/ifmetric/
- 36. http://0pointer.de/lennart/projects/libdaemon/
- 37. http://www.acmc.uq.edu.au/~gbe/linux/installation_of_ifplugd.html
- 38. http://0pointer.de/lennart/projects/ifplugd/
- 39. http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.28.tar.gz
- 40. http://subversion.tigris.org/
- 41. svn://seth.intheinter.net/ifplugd
- 42. http://0pointer.de/cgi-bin/viewcvs.cgi/?root=ifplugd
- 43. http://packages.debian.org/ifplugd
- 44. http://www.linuxdicas.com.ar/caleb/rpm
- 45. http://dag.wieers.com/packages/ifplugd/
- 46. http://freshmeat.net/projects/ifplugd/
- 47. https://seth.intheinter.net/mailman/listinfo/ifplugd-discuss
diff --git a/doc/README.html b/doc/README.html
index 3160855..abcd0b7 100644
--- a/doc/README.html
+++ b/doc/README.html
@@ -188,7 +188,7 @@ an "auto" stanza in <tt>/etc/network/interfaces</tt>.</p>
<p>When you are using the hotplug subsystem (Debian package
<tt>hotplug</tt>) you may notice that the network device is configured
even when it is not listed on an <tt>auto</tt> line in
-<tt>/etc/network/interface</tt>. This may be due to <tt>hotplug</tt>
+<tt>/etc/network/interfaces</tt>. This may be due to <tt>hotplug</tt>
being configured to <tt>ifup</tt> the network interface when it
becomes available. This was the default behavior in the Debian
<tt>hotplug</tt> package prior to release <tt>0.0.20030117-1</tt>, for
diff --git a/doc/README.html.in b/doc/README.html.in
index baf63e0..3d8131a 100644
--- a/doc/README.html.in
+++ b/doc/README.html.in
@@ -188,7 +188,7 @@ an "auto" stanza in <tt>/etc/network/interfaces</tt>.</p>
<p>When you are using the hotplug subsystem (Debian package
<tt>hotplug</tt>) you may notice that the network device is configured
even when it is not listed on an <tt>auto</tt> line in
-<tt>/etc/network/interface</tt>. This may be due to <tt>hotplug</tt>
+<tt>/etc/network/interfaces</tt>. This may be due to <tt>hotplug</tt>
being configured to <tt>ifup</tt> the network interface when it
becomes available. This was the default behavior in the Debian
<tt>hotplug</tt> package prior to release <tt>0.0.20030117-1</tt>, for
diff --git a/man/ifplugd.8 b/man/ifplugd.8
index cafa94e..07457a1 100644
--- a/man/ifplugd.8
+++ b/man/ifplugd.8
@@ -9,88 +9,97 @@ ifplugd is a daemon which will automatically configure your ethernet device when
It uses your distribution's native ifup/ifdown programs, but can be configured to do anything you wish when the state of the interface changes. It may ignore short unplugged whiles (\fB-d\f1 option) or plugged whiles (\fB-u\f1 option).
-ifplugd may be used in "compatibility mode" by specifying -F on the command line. Than ifplugd will treat network drivers which do not support link beat querying as always online.
+ifplugd may be used in "compatibility mode" by specifying \-F on the command line. Than ifplugd will treat network drivers which do not support link beat querying as always online.
.SH OPTIONS
.TP
-\fB-a | --no-auto\f1
+\fB\-a | \-\-no-auto\f1
Do not enable interface automatically (default: off)
.TP
-\fB-n | --no-daemon\f1
+\fB\-n | \-\-no-daemon\f1
Do not daemonize (for debugging) (default: off)
.TP
-\fB-s | --no-syslog\f1
+\fB\-s | \-\-no-syslog\f1
Do not use syslog, use stdout instead (for debugging) (default: off).
.TP
-\fB-b | --no-beep\f1
-Do not beep (off)
+\fB\-b | \-\-no-beep\f1
+Do not beep (off), overrides \fB\-\-no-beep-up\f1 and \fB\-\-no-beep-down\f1.
.TP
-\fB-f | --ignore-fail\f1
+\fB\-U | \-\-no-beep-up\f1
+Do not beep on interface up (off)
+.TP
+\fB\-D | \-\-no-beep-down\f1
+Do not beep on interface down (off)
+.TP
+\fB\-f | \-\-ignore-fail\f1
Ignore detection failure, retry instead. Failure is treated as "no link". (default: off)
.TP
-\fB-F | --ignore-fail-positive\f1
+\fB\-F | \-\-ignore-fail-positive\f1
Ignore detection failure, retry instead. Failure is treated as "link detected". (default: off)
.TP
-\fB-i | --iface=\f1 \fIIFACE\f1
+\fB\-i | \-\-iface=\f1 \fIIFACE\f1
Specify ethernet interface (default: eth0)
.TP
-\fB-r | --run=\f1 \fIEXEC\f1
+\fB\-r | \-\-run=\f1 \fIEXEC\f1
Specify program to execute when link status changes (default: \fI/etc/ifplugd/ifplugd.action\f1)
.TP
-\fB-I | --ignore-retval\f1
+\fB\-I | \-\-ignore-retval\f1
Don't exit on nonzero return value of program executed on link change. (default: off)
.TP
-\fB-t | --poll-time=\f1 \fISECS\f1
+\fB\-t | \-\-poll-time=\f1 \fISECS\f1
Specify poll time in seconds (default: 1)
.TP
-\fB-u | --delay-up=\f1 \fISECS\f1
+\fB\-T | \-\-poll-utime=\f1 \fIUSECS\f1
+Specify poll time in microseconds, added to -t (default: 0)
+.TP
+\fB\-u | \-\-delay-up=\f1 \fISECS\f1
Specify delay for configuring interface (default: 0)
.TP
-\fB-d | --delay-down=\f1 \fISECS\f1
+\fB\-d | \-\-delay-down=\f1 \fISECS\f1
Specify delay for deconfiguring interface (default: 5)
.TP
-\fB-m | --api-mode=\f1 \fIMODE\f1
+\fB\-m | \-\-api-mode=\f1 \fIMODE\f1
Force a specific link beat detection ioctl() API. Possible values are auto, iff, wlan, ethtool, mii, and priv for automatic detection, interface flag (IFF_RUNNING), wireless extension, SIOCETHTOOL, SIOCGMIIREG resp. SIOCPRIV. Only the first character of the argument is relevant, case insensitive. (default: auto)
.TP
-\fB-p | --no-startup\f1
+\fB\-p | \-\-no-startup\f1
Don't call the script to bring up network on deamon start (default: off)
.TP
-\fB-q | --no-shutdown\f1
+\fB\-q | \-\-no-shutdown\f1
Don't call the script for network shutdown on deamon quit (default: off)
.TP
-\fB-w | --wait-on-fork\f1
-When daemonizing, wait until the background process finished with the initial link beat detection. When this is enabled, the parent process will return the link status on exit. 1 means link beat detected, 2 stands for link beat not detected, everything else is an error.
+\fB\-w | \-\-wait-on-fork\f1
+When daemonizing, wait until the background process finished with the initial link beat detection. When this is enabled, the parent process will return the link status on exit. 2 means link beat detected, 3 stands for link beat not detected, everything else is an error.
.TP
-\fB-W | --wait-on-kill\f1
-When killing a running daemon (with -k) wait until the daemon died.
+\fB\-W | \-\-wait-on-kill\f1
+When killing a running daemon (with \-k) wait until the daemon died.
.TP
-\fB-x | --extra-arg=\f1 \fIARG\f1
+\fB\-x | \-\-extra-arg=\f1 \fIARG\f1
Specify an extra argument to be passed to the action script.
.TP
-\fB-M | --monitor\f1
+\fB\-M | \-\-monitor\f1
Don't fail when the network interface is not available, instead use NETLINK to monitor device avaibility. The is useful for PCMCIA devices and similar.
.TP
-\fB-h | --help\f1
+\fB\-h | \-\-help\f1
Show help
.TP
-\fB-k | --kill\f1
-Kill a running daemon (Specify -i to select the daemon instance to kill)
+\fB\-k | \-\-kill\f1
+Kill a running daemon (Specify \-i to select the daemon instance to kill)
.TP
-\fB-c | --check-running\f1
+\fB\-c | \-\-check-running\f1
Check if a daemon is running for a given network interface. Sets the return value to 0 if a daemon is already running or to 255 if not.
.TP
-\fB-v | --version\f1
+\fB\-v | \-\-version\f1
Show version
.TP
-\fB-S | --supend\f1
-Suspend a running daemon. The daemon will no longer check the link status until it is resumed (-R) again. (Specify -i to select the daemon instance to suspend.)
+\fB\-S | \-\-supend\f1
+Suspend a running daemon. The daemon will no longer check the link status until it is resumed (\-R) again. (Specify \-i to select the daemon instance to suspend.)
.TP
-\fB-R | --resume\f1
-Resume a suspended daemon. (Specify -i to select the daemon instance to resume.)
+\fB\-R | \-\-resume\f1
+Resume a suspended daemon. (Specify \-i to select the daemon instance to resume.)
.TP
-\fB-z | --info\f1
-Request that a running daemon shall write its status information to syslog. (Specify -i to select the daemon instance to send the request to.)
+\fB\-z | \-\-info\f1
+Request that a running daemon shall write its status information to syslog. (Specify \-i to select the daemon instance to send the request to.)
.SH FILES
-\fI/etc/ifplugd/ifplugd.conf\f1: this file is sourced by the init script \fI/etc/init.d/ifplugd\f1 and contains the interface to be monitored and the options to be used.
+\fI/etc/default/ifplugd\f1: this file is sourced by the init script \fI/etc/init.d/ifplugd\f1 and contains the interface to be monitored and the options to be used.
\fI/etc/ifplugd/ifplugd.action\f1: this is the script which will be called by the daemon whenever the state of the interface changes. It takes two areguments: the first is the interface name (eg. eth0), the second either "up" or "down".
@@ -102,15 +111,15 @@ The action script will be called with two environment variables set:
\fIIFPLUGD_CURRENT\f1 The current link status. See above for possible values.
.SH SIGNALS
-\fISIGINT, SIGTERM\f1 ifplugd will quit, possibly running the shutdown script. This is issued by passing -k to ifplugd.
+\fISIGINT, SIGTERM\f1 ifplugd will quit, possibly running the shutdown script. This is issued by passing \-k to ifplugd.
\fISIGQUIT\f1 ifplugd will quit, the shutdown script is never run.
-\fISIGHUP\f1 ifplugd will write its status information to syslog. This is issued by -z.
+\fISIGHUP\f1 ifplugd will write its status information to syslog. This is issued by \-z.
-\fISIGUSR1\f1 ifplugd will go to suspend mode. (-S)
+\fISIGUSR1\f1 ifplugd will go to suspend mode. (\-S)
-\fISIGUSR2\f1 ifplugd will resume from suspend mode. (-R)
+\fISIGUSR2\f1 ifplugd will resume from suspend mode. (\-R)
.SH AUTHOR
ifplugd was written by Lennart Poettering <mzvscyhtq (at) 0pointer (dot) de>. ifplugd is available at \fBhttp://0pointer.de/lennart/projects/ifplugd/\f1
.SH SEE ALSO
diff --git a/man/ifplugd.8.xml.in b/man/ifplugd.8.xml.in
index 9240891..ad658c3 100644
--- a/man/ifplugd.8.xml.in
+++ b/man/ifplugd.8.xml.in
@@ -73,7 +73,21 @@
<option>
<p><opt>-b | --no-beep</opt></p>
<optdesc><p>
- Do not beep (off)
+ Do not beep (off), overrides <opt>--no-beep-up</opt> and <opt>--no-beep-down</opt>.
+ </p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>-U | --no-beep-up</opt></p>
+ <optdesc><p>
+ Do not beep on interface up (off)
+ </p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>-D | --no-beep-down</opt></p>
+ <optdesc><p>
+ Do not beep on interface down (off)
</p></optdesc>
</option>
@@ -118,6 +132,13 @@
Specify poll time in seconds (default: 1)
</p></optdesc>
</option>
+
+ <option>
+ <p><opt>-T | --poll-utime=</opt> <arg>USECS</arg></p>
+ <optdesc><p>
+ Specify poll time in useconds, summing with -t (default: 1)
+ </p></optdesc>
+ </option>
<option>
<p><opt>-u | --delay-up=</opt> <arg>SECS</arg></p>
@@ -162,7 +183,7 @@
<optdesc><p> When daemonizing, wait until the background
process finished with the initial link beat detection. When
this is enabled, the parent process will return the link
- status on exit. 1 means link beat detected, 2 stands for link
+ status on exit. 2 means link beat detected, 3 stands for link
beat not detected, everything else is an error.
</p></optdesc>
</option>
@@ -185,7 +206,7 @@
<option>
<p><opt>-M | --monitor</opt></p>
<optdesc><p>
- Don't fail when the network interface is not available, instead use NETLINK to monitor device avaibility. The is useful for PCMCIA devices and similar.
+ Don't fail when the network interface is not available, instead use NETLINK to monitor device availability. The is useful for PCMCIA devices and similar.
</p></optdesc>
</option>
@@ -218,7 +239,7 @@
</option>
<option>
- <p><opt>-S | --supend</opt></p> <optdesc><p> Suspend a running
+ <p><opt>-S | --suspend</opt></p> <optdesc><p> Suspend a running
daemon. The daemon will no longer check the link status until
it is resumed (-R) again. (Specify -i to select the daemon instance
to suspend.) </p></optdesc>
@@ -241,14 +262,14 @@
<section name="Files">
- <p><file>@sysconfdir@/ifplugd/ifplugd.conf</file>: this file is sourced
+ <p><file>@sysconfdir@/default/ifplugd</file>: this file is sourced
by the init script <file>@sysconfdir@/init.d/ifplugd</file> and
contains the interface to be monitored and the options to be
used.</p>
<p><file>@sysconfdir@/ifplugd/ifplugd.action</file>: this is the script
which will be called by the daemon whenever the state of the
- interface changes. It takes two areguments: the first is the interface
+ interface changes. It takes two arguments: the first is the interface
name (eg. eth0), the second either "up" or "down". </p>
<p><file>/var/run/ifplugd.&lt;iface&gt;.pid</file>: the pid file
diff --git a/man/ifplugd.conf.5 b/man/ifplugd.conf.5
index 6e96378..c7721db 100644
--- a/man/ifplugd.conf.5
+++ b/man/ifplugd.conf.5
@@ -2,7 +2,7 @@
.SH NAME
ifplugd.conf \- ifplugd configuration file
.SH SYNOPSIS
-\fB/etc/ifplugd/ifplugd.conf
+\fB/etc/default/ifplugd
\f1
.SH DESCRIPTION
ifplugd.conf is the configuration file for ifplugd. It is a shell script that is sourced by the init script starting the daemon. It shall be used to set environment variables which are interpreted by the init script:
@@ -11,6 +11,9 @@ ifplugd.conf is the configuration file for ifplugd. It is a shell script that is
\fBINTERFACES\f1
Specifies the ethernet interfaces to monitor. It has to contain a space seperated list of network interfaces names. Most users will probably use "eth0" here, however you may add additional interfaces for monitoring more than one device. A special value is supported as well: "auto" will enable a more or less working auto detection of available network devices. This won't make you happy when using network module auto loading, since it cannot detect currently unloaded network devices.
.TP
+\fBHOTPLUG_INTERFACES\f1
+Specifies the interfaces that can be hotplugged (like interfaces on PCMCIA, USB or WLAN adapters). "all" can be used to make the udev script start an ifplugd process for any hotplugged interfaces (except those already listed in INTERFACES).
+.TP
\fBARGS\f1
Additional command line arguments for ifplugd invocation. See \fBifplugd(8)\f1 for further information.
.TP
diff --git a/man/ifplugd.conf.5.xml.in b/man/ifplugd.conf.5.xml.in
index 7da7da0..7fbb2bb 100644
--- a/man/ifplugd.conf.5.xml.in
+++ b/man/ifplugd.conf.5.xml.in
@@ -25,7 +25,7 @@
<manpage name="ifplugd.conf" section="5" desc="ifplugd configuration file">
<synopsis>
- <cmd>@sysconfdir@/ifplugd/ifplugd.conf</cmd>
+ <cmd>@sysconfdir@/default/ifplugd</cmd>
</synopsis>
<description>
@@ -40,7 +40,7 @@
<option>
<p><opt>INTERFACES</opt></p> <optdesc><p>Specifies the
ethernet interfaces to monitor. It has to contain a space
- seperated list of network interfaces names. Most users will
+ separated list of network interfaces names. Most users will
probably use "eth0" here, however you may add additional
interfaces for monitoring more than one device. A special
value is supported as well: "auto" will enable a more or less
@@ -51,12 +51,20 @@
</option>
<option>
+ <p><opt>HOTPLUG_INTERFACES</opt></p> <optdesc><p>Specifies the
+ interfaces that can be hotplugged (like interfaces on PCMCIA,
+ USB or WLAN adapters). "all" can be used to make the udev
+ script start an ifplugd process for any hotplugged interfaces
+ (except those already listed in INTERFACES).
+ </p></optdesc>
+ </option>
+
+ <option>
<p><opt>ARGS</opt></p> <optdesc><p>Additional command line
arguments for ifplugd invocation. See <manref name="ifplugd"
section="8"/> for further information.</p></optdesc>
</option>
-
<option>
<p><opt>ARGS_</opt><arg>iface</arg></p>
diff --git a/man/ifplugstatus.8 b/man/ifplugstatus.8
index 5dde013..e0f71c6 100644
--- a/man/ifplugstatus.8
+++ b/man/ifplugstatus.8
@@ -23,19 +23,19 @@ ifplugstatus may be used in shell script since it returns the current status as
.SH OPTIONS
You may specify an ethernet device on the command line. Otherwise ifplugstatus will check all available network interfaces.
.TP
-\fB-a | --auto\f1
+\fB\-a | \-\-auto\f1
Enable interface automatically before querying (default: off)
.TP
-\fB-h | --help\f1
+\fB\-h | \-\-help\f1
Show help
.TP
-\fB-q | --quiet\f1
+\fB\-q | \-\-quiet\f1
Decrease verbosity by one. If the verbosity is < 0, no text will be shown, only the return value is relevant; if the verbosity is = 0, a terse status will be shown; If the verbosity is > 0, detailed information about the used API is returned. (By default the verbosity is 0)
.TP
-\fB-v | --verbose\f1
+\fB\-v | \-\-verbose\f1
Increase verbosity by one. See option \fB-q\f1.
.TP
-\fB-V | --version\f1
+\fB\-V | \-\-version\f1
Show version
.SH RETURN VALUES
\fI0\f1 Success
diff --git a/src/ifplugd.c b/src/ifplugd.c
index 76d4d1a..f04afaf 100644
--- a/src/ifplugd.c
+++ b/src/ifplugd.c
@@ -68,11 +68,14 @@ char *run = SYSCONFDIR"/ifplugd/ifplugd.action";
char *extra_arg = NULL;
int polltime = 1,
+ pollutime = 0,
delay_up = 0,
delay_down = 5;
int daemonize = 1,
use_beep = 1,
+ beep_on_up = 1,
+ beep_on_down = 1,
no_startup_script = 0,
no_shutdown_script = 0,
wait_on_fork = 0,
@@ -126,6 +129,18 @@ finish:
return;
}
+static void beep_up(int b) {
+ if(!beep_on_up)
+ return;
+ beep(b);
+}
+
+static void beep_down(int b) {
+ if(!beep_on_down)
+ return;
+ beep(b);
+}
+
const char *pid_file_proc() {
static char fn[PATH_MAX];
snprintf(fn, sizeof(fn), "%s/ifplugd.%s.pid", VARRUN, interface);
@@ -237,13 +252,13 @@ int action(interface_status_t status) {
if (!WIFEXITED(r) || WEXITSTATUS(r) != 0) {
if (status == IFSTATUS_UP)
- beep(2);
+ beep_up(2);
daemon_log(LOG_ERR, "Program execution failed, return value is %i.", WEXITSTATUS(r));
return ignore_retval ? 0 : -1;
} else {
if (status == IFSTATUS_UP)
- beep(0);
+ beep_up(0);
daemon_log(LOG_INFO, "Program executed successfully.");
return 0;
@@ -409,7 +424,7 @@ void work(void) {
break;
}
- if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ if ((fd = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) {
daemon_log(LOG_ERR, "socket(): %s", strerror(errno));
goto finish;
}
@@ -440,7 +455,10 @@ void work(void) {
goto finish;
daemon_log(LOG_INFO, "Initialization complete, link beat %sdetected%s.", status == IFSTATUS_UP ? "" : "not ", use_ifmonitor ? (disabled ? ", interface disabled" : ", interface enabled") : "");
- beep(status == IFSTATUS_UP ? 0 : 1);
+ if(status == IFSTATUS_UP)
+ beep_up(0);
+ else
+ beep_down(1);
if ((!no_startup_script && status == IFSTATUS_UP) || initial_down)
if (action(status) < 0)
@@ -466,8 +484,16 @@ void work(void) {
struct timeval tv;
tv.tv_sec = polltime;
- tv.tv_usec = 0;
+ tv.tv_usec = pollutime;
+ if (t) {
+ int delay = t - time(NULL);
+ if (delay < 0)
+ tv.tv_sec = 0;
+ else if (delay < tv.tv_sec)
+ tv.tv_sec = delay;
+ }
+
if (select(FD_SETSIZE, &qfds, NULL, NULL, &tv) < 0) {
if (errno == EINTR)
continue;
@@ -513,7 +539,10 @@ void work(void) {
if (status != s) {
daemon_log(LOG_INFO, "Link beat %s.", status == IFSTATUS_DOWN ? "lost" : "detected");
- beep(status == IFSTATUS_UP ? 0 : 1);
+ if(status == IFSTATUS_UP)
+ beep_up(0);
+ else
+ beep_down(1);
if (t)
t = 0;
@@ -573,7 +602,7 @@ void work(void) {
}
}
- if (t && t < time(NULL)) {
+ if (t && t <= time(NULL)) {
t = 0;
if (action(status) < 0)
@@ -586,7 +615,7 @@ cleanup:
setenv(IFPLUGD_ENV_PREVIOUS, strstatus(status), 1);
setenv(IFPLUGD_ENV_CURRENT, strstatus(-1), 1);
action(IFSTATUS_DOWN);
- beep(1);
+ beep_down(1);
}
finish:
@@ -628,12 +657,15 @@ void usage(char *p) {
" -n --no-daemon Do not daemonize (for debugging) (%s)\n"
" -s --no-syslog Do not use syslog, use stderr instead (for debugging) (%s)\n"
" -b --no-beep Do not beep (%s)\n"
+ " -U --no-beep-up Do not beep on interface up (%s)\n"
+ " -D --no-beep-down Do not beep on interface down (%s)\n"
" -f --ignore-fail Ignore detection failure, retry instead (failure is treated as DOWN) (%s)\n"
" -F --ignore-fail-positive Ignore detection failure, retry instead (failure is treated as UP) (%s)\n"
" -i --iface=IFACE Specify ethernet interface (%s)\n"
" -r --run=EXEC Specify program to execute (%s)\n"
" -I --ignore-retval Don't exit on nonzero return value of program executed (%s)\n"
" -t --poll-time=SECS Specify poll time in seconds (%i)\n"
+ " -T --poll-utime=USECS Specify poll time in microseconds, add to -t (%i)\n"
" -u --delay-up=SECS Specify delay for configuring interface (%i)\n"
" -d --delay-down=SECS Specify delay for deconfiguring interface (%i)\n"
" -m --api-mode=MODE Force API mode (mii, priv, ethtool, wlan, auto) (%s)\n"
@@ -656,12 +688,15 @@ void usage(char *p) {
!daemonize ? "on" : "off",
!use_syslog ? "on" : "off",
!use_beep ? "on" : "off",
+ !beep_on_up ? "on" : "off",
+ !beep_on_down ? "on" : "off",
failure_status == IFSTATUS_DOWN ? "on" : "off",
failure_status == IFSTATUS_UP ? "on" : "off",
interface,
run,
ignore_retval ? "on" : "off",
polltime,
+ pollutime,
delay_up,
delay_down,
m,
@@ -679,12 +714,15 @@ void parse_args(int argc, char *argv[]) {
{"no-daemon", no_argument, 0, 'n'},
{"no-syslog", no_argument, 0, 's'},
{"no-beep", no_argument, 0, 'b'},
+ {"no-beep-up", no_argument, 0, 'U'},
+ {"no-beep-down", no_argument, 0, 'D'},
{"ignore-fail", no_argument, 0, 'f'},
{"ignore-fail-positive", no_argument, 0, 'F'},
{"ignore-retval", no_argument, 0, 'I'},
{"iface", required_argument, 0, 'i'},
{"run", required_argument, 0, 'r'},
{"poll-time", required_argument, 0, 't'},
+ {"poll-utime", required_argument, 0, 'T'},
{"delay-up", required_argument, 0, 'u'},
{"delay-down", required_argument, 0, 'd'},
{"api-mode", required_argument, 0, 'm'},
@@ -710,7 +748,7 @@ void parse_args(int argc, char *argv[]) {
for (;;) {
int c;
- if ((c = getopt_long(argc, argv, "asni:r:t:u:d:hkbfFvm:pqwx:cISRzlMW", long_options, &option_index)) < 0)
+ if ((c = getopt_long(argc, argv, "asni:r:t:T:u:d:hkbUDfFvm:pqwx:cISRzlMW", long_options, &option_index)) < 0)
break;
switch (c) {
@@ -738,6 +776,10 @@ void parse_args(int argc, char *argv[]) {
polltime = atoi(optarg);
if (polltime < 0) polltime = 0;
break;
+ case 'T':
+ pollutime = atoi(optarg);
+ if (pollutime < 0) pollutime = 0;
+ break;
case 'u':
delay_up = atoi(optarg);
break;
@@ -759,6 +801,12 @@ void parse_args(int argc, char *argv[]) {
case 'b':
use_beep = !use_beep;
break;
+ case 'U':
+ beep_on_up = !beep_on_up;
+ break;
+ case 'D':
+ beep_on_down = !beep_on_down;
+ break;
case 'f':
failure_status = IFSTATUS_DOWN;
break;
diff --git a/src/interface.c b/src/interface.c
index e5038f4..98bcf0e 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -23,7 +23,6 @@
#endif
#include <linux/sockios.h>
-#include <linux/if_ether.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
diff --git a/src/interface.h b/src/interface.h
index d223b1f..8d6ea78 100644
--- a/src/interface.h
+++ b/src/interface.h
@@ -21,6 +21,9 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+/* From <linux/if_ether.h> */
+#define ETH_ALEN 6
+
int interface_auto_up;
int interface_do_message;