Mirror of git://git.busybox.net/busybox with our patches on top
Source
/* vi: set sw=4 ts=4: */
/*
* ifplugd for busybox
*
* Copyright (C) 2009 Maksym Kryzhanovskyy <xmaks@email.cz>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/*
TODO: describe compat status here.
One questionable point of the design is netlink usage:
We have 1 second timeout by default to poll the link status,
it is short enough so that there are no real benefits in
using netlink to get "instantaneous" interface creation/deletion
notifications. We can check for interface existence by just
doing some fast ioctl using its name.
Netlink code then can be just dropped (1k or more?)
*/
enum {
FLAG_NO_AUTO = 1 << 0, // -a, Do not enable interface automatically
FLAG_NO_DAEMON = 1 << 1, // -n, Do not daemonize
FLAG_NO_SYSLOG = 1 << 2, // -s, Do not use syslog, use stderr instead
FLAG_IGNORE_FAIL = 1 << 3, // -f, Ignore detection failure, retry instead (failure is treated as DOWN)
FLAG_IGNORE_FAIL_POSITIVE = 1 << 4, // -F, Ignore detection failure, retry instead (failure is treated as UP)
FLAG_IFACE = 1 << 5, // -i, Specify ethernet interface
FLAG_RUN = 1 << 6, // -r, Specify program to execute
FLAG_IGNORE_RETVAL = 1 << 7, // -I, Don't exit on nonzero return value of program executed
FLAG_POLL_TIME = 1 << 8, // -t, Specify poll time in seconds
FLAG_DELAY_UP = 1 << 9, // -u, Specify delay for configuring interface
FLAG_DELAY_DOWN = 1 << 10, // -d, Specify delay for deconfiguring interface
FLAG_API_MODE = 1 << 11, // -m, Force API mode (mii, priv, ethtool, wlan, auto)
FLAG_NO_STARTUP = 1 << 12, // -p, Don't run script on daemon startup
FLAG_NO_SHUTDOWN = 1 << 13, // -q, Don't run script on daemon quit
FLAG_INITIAL_DOWN = 1 << 14, // -l, Run "down" script on startup if no cable is detected
FLAG_EXTRA_ARG = 1 << 15, // -x, Specify an extra argument for action script
FLAG_MONITOR = 1 << 16, // -M, Use interface monitoring
FLAG_KILL = 1 << 17, // -k, Kill a running daemon
};