diff options
Diffstat (limited to 'networking')
33 files changed, 711 insertions, 0 deletions
diff --git a/networking/arp.c b/networking/arp.c index 0ef267a35..3f68f5cf7 100644 --- a/networking/arp.c +++ b/networking/arp.c | |||
@@ -13,6 +13,25 @@ | |||
13 | * modified for getopt32 by Arne Bernin <arne [at] alamut.de> | 13 | * modified for getopt32 by Arne Bernin <arne [at] alamut.de> |
14 | */ | 14 | */ |
15 | 15 | ||
16 | //usage:#define arp_trivial_usage | ||
17 | //usage: "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]" | ||
18 | //usage: "\n[-v] [-i IF] -d HOSTNAME [pub]" | ||
19 | //usage: "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]" | ||
20 | //usage: "\n[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub" | ||
21 | //usage: "\n[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub" | ||
22 | //usage:#define arp_full_usage "\n\n" | ||
23 | //usage: "Manipulate ARP cache\n" | ||
24 | //usage: "\nOptions:" | ||
25 | //usage: "\n -a Display (all) hosts" | ||
26 | //usage: "\n -s Set new ARP entry" | ||
27 | //usage: "\n -d Delete a specified entry" | ||
28 | //usage: "\n -v Verbose" | ||
29 | //usage: "\n -n Don't resolve names" | ||
30 | //usage: "\n -i IF Network interface" | ||
31 | //usage: "\n -D Read <hwaddr> from given device" | ||
32 | //usage: "\n -A,-p AF Protocol family" | ||
33 | //usage: "\n -H HWTYPE Hardware address type" | ||
34 | |||
16 | #include "libbb.h" | 35 | #include "libbb.h" |
17 | #include "inet_common.h" | 36 | #include "inet_common.h" |
18 | 37 | ||
diff --git a/networking/arping.c b/networking/arping.c index 6f6b59cfb..357dcaaf0 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -6,6 +6,23 @@ | |||
6 | * Busybox port: Nick Fedchik <nick@fedchik.org.ua> | 6 | * Busybox port: Nick Fedchik <nick@fedchik.org.ua> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | //usage:#define arping_trivial_usage | ||
10 | //usage: "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP" | ||
11 | //usage:#define arping_full_usage "\n\n" | ||
12 | //usage: "Send ARP requests/replies\n" | ||
13 | //usage: "\nOptions:" | ||
14 | //usage: "\n -f Quit on first ARP reply" | ||
15 | //usage: "\n -q Quiet" | ||
16 | //usage: "\n -b Keep broadcasting, don't go unicast" | ||
17 | //usage: "\n -D Duplicated address detection mode" | ||
18 | //usage: "\n -U Unsolicited ARP mode, update your neighbors" | ||
19 | //usage: "\n -A ARP answer mode, update your neighbors" | ||
20 | //usage: "\n -c N Stop after sending N ARP requests" | ||
21 | //usage: "\n -w TIMEOUT Time to wait for ARP reply, seconds" | ||
22 | //usage: "\n -I IFACE Interface to use (default eth0)" | ||
23 | //usage: "\n -s SRC_IP Sender IP address" | ||
24 | //usage: "\n DST_IP Target IP address" | ||
25 | |||
9 | #include <arpa/inet.h> | 26 | #include <arpa/inet.h> |
10 | #include <net/if.h> | 27 | #include <net/if.h> |
11 | #include <netinet/ether.h> | 28 | #include <netinet/ether.h> |
diff --git a/networking/brctl.c b/networking/brctl.c index c0b094eba..19f474fce 100644 --- a/networking/brctl.c +++ b/networking/brctl.c | |||
@@ -12,6 +12,30 @@ | |||
12 | /* This applet currently uses only the ioctl interface and no sysfs at all. | 12 | /* This applet currently uses only the ioctl interface and no sysfs at all. |
13 | * At the time of this writing this was considered a feature. | 13 | * At the time of this writing this was considered a feature. |
14 | */ | 14 | */ |
15 | |||
16 | //usage:#define brctl_trivial_usage | ||
17 | //usage: "COMMAND [BRIDGE [INTERFACE]]" | ||
18 | //usage:#define brctl_full_usage "\n\n" | ||
19 | //usage: "Manage ethernet bridges\n" | ||
20 | //usage: "\nCommands:" | ||
21 | //usage: IF_FEATURE_BRCTL_SHOW( | ||
22 | //usage: "\n show Show a list of bridges" | ||
23 | //usage: ) | ||
24 | //usage: "\n addbr BRIDGE Create BRIDGE" | ||
25 | //usage: "\n delbr BRIDGE Delete BRIDGE" | ||
26 | //usage: "\n addif BRIDGE IFACE Add IFACE to BRIDGE" | ||
27 | //usage: "\n delif BRIDGE IFACE Delete IFACE from BRIDGE" | ||
28 | //usage: IF_FEATURE_BRCTL_FANCY( | ||
29 | //usage: "\n setageing BRIDGE TIME Set ageing time" | ||
30 | //usage: "\n setfd BRIDGE TIME Set bridge forward delay" | ||
31 | //usage: "\n sethello BRIDGE TIME Set hello time" | ||
32 | //usage: "\n setmaxage BRIDGE TIME Set max message age" | ||
33 | //usage: "\n setpathcost BRIDGE COST Set path cost" | ||
34 | //usage: "\n setportprio BRIDGE PRIO Set port priority" | ||
35 | //usage: "\n setbridgeprio BRIDGE PRIO Set bridge priority" | ||
36 | //usage: "\n stp BRIDGE [1/yes/on|0/no/off] STP on/off" | ||
37 | //usage: ) | ||
38 | |||
15 | #include "libbb.h" | 39 | #include "libbb.h" |
16 | #include <linux/sockios.h> | 40 | #include <linux/sockios.h> |
17 | #include <net/if.h> | 41 | #include <net/if.h> |
diff --git a/networking/dnsd.c b/networking/dnsd.c index 8ed31cea2..65eae9670 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c | |||
@@ -17,6 +17,22 @@ | |||
17 | * the first porting of oao' scdns to busybox also. | 17 | * the first porting of oao' scdns to busybox also. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | //usage:#define dnsd_trivial_usage | ||
21 | //usage: "[-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR]" | ||
22 | //usage:#define dnsd_full_usage "\n\n" | ||
23 | //usage: "Small static DNS server daemon\n" | ||
24 | //usage: "\nOptions:" | ||
25 | //usage: "\n -c FILE Config file" | ||
26 | //usage: "\n -t SEC TTL" | ||
27 | //usage: "\n -p PORT Listen on PORT" | ||
28 | //usage: "\n -i ADDR Listen on ADDR" | ||
29 | //usage: "\n -d Daemonize" | ||
30 | //usage: "\n -v Verbose" | ||
31 | //usage: "\n -s Send successful replies only. Use this if you want" | ||
32 | //usage: "\n to use /etc/resolv.conf with two nameserver lines:" | ||
33 | //usage: "\n nameserver DNSD_SERVER" | ||
34 | //usage: "\n nameserver NORNAL_DNS_SERVER" | ||
35 | |||
20 | #include "libbb.h" | 36 | #include "libbb.h" |
21 | #include <syslog.h> | 37 | #include <syslog.h> |
22 | 38 | ||
diff --git a/networking/ether-wake.c b/networking/ether-wake.c index 8f1479c02..7bb9aa5a7 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c | |||
@@ -64,6 +64,16 @@ | |||
64 | * filter. That configuration consumes more power. | 64 | * filter. That configuration consumes more power. |
65 | */ | 65 | */ |
66 | 66 | ||
67 | //usage:#define ether_wake_trivial_usage | ||
68 | //usage: "[-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC" | ||
69 | //usage:#define ether_wake_full_usage "\n\n" | ||
70 | //usage: "Send a magic packet to wake up sleeping machines.\n" | ||
71 | //usage: "MAC must be a station address (00:11:22:33:44:55) or\n" | ||
72 | //usage: "a hostname with a known 'ethers' entry.\n" | ||
73 | //usage: "\nOptions:" | ||
74 | //usage: "\n -b Send wake-up packet to the broadcast address" | ||
75 | //usage: "\n -i iface Interface to use (default eth0)" | ||
76 | //usage: "\n -p pass Append four or six byte password PW to the packet" | ||
67 | 77 | ||
68 | #include <netpacket/packet.h> | 78 | #include <netpacket/packet.h> |
69 | #include <net/ethernet.h> | 79 | #include <net/ethernet.h> |
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 09c5ff30f..66316e21f 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c | |||
@@ -13,6 +13,44 @@ | |||
13 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 13 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | //usage:#define ftpget_trivial_usage | ||
17 | //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" | ||
18 | //usage:#define ftpget_full_usage "\n\n" | ||
19 | //usage: "Retrieve a remote file via FTP\n" | ||
20 | //usage: "\nOptions:" | ||
21 | //usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
22 | //usage: "\n -c,--continue Continue previous transfer" | ||
23 | //usage: "\n -v,--verbose Verbose" | ||
24 | //usage: "\n -u,--username Username" | ||
25 | //usage: "\n -p,--password Password" | ||
26 | //usage: "\n -P,--port Port number" | ||
27 | //usage: ) | ||
28 | //usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
29 | //usage: "\n -c Continue previous transfer" | ||
30 | //usage: "\n -v Verbose" | ||
31 | //usage: "\n -u Username" | ||
32 | //usage: "\n -p Password" | ||
33 | //usage: "\n -P Port number" | ||
34 | //usage: ) | ||
35 | //usage: | ||
36 | //usage:#define ftpput_trivial_usage | ||
37 | //usage: "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE" | ||
38 | //usage:#define ftpput_full_usage "\n\n" | ||
39 | //usage: "Store a local file on a remote machine via FTP\n" | ||
40 | //usage: "\nOptions:" | ||
41 | //usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
42 | //usage: "\n -v,--verbose Verbose" | ||
43 | //usage: "\n -u,--username Username" | ||
44 | //usage: "\n -p,--password Password" | ||
45 | //usage: "\n -P,--port Port number" | ||
46 | //usage: ) | ||
47 | //usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( | ||
48 | //usage: "\n -v Verbose" | ||
49 | //usage: "\n -u Username" | ||
50 | //usage: "\n -p Password" | ||
51 | //usage: "\n -P Port number" | ||
52 | //usage: ) | ||
53 | |||
16 | #include "libbb.h" | 54 | #include "libbb.h" |
17 | 55 | ||
18 | struct globals { | 56 | struct globals { |
diff --git a/networking/hostname.c b/networking/hostname.c index 66b52dd90..49a3e89bb 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -9,6 +9,25 @@ | |||
9 | * | 9 | * |
10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 10 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
11 | */ | 11 | */ |
12 | |||
13 | //usage:#define hostname_trivial_usage | ||
14 | //usage: "[OPTIONS] [HOSTNAME | -F FILE]" | ||
15 | //usage:#define hostname_full_usage "\n\n" | ||
16 | //usage: "Get or set hostname or DNS domain name\n" | ||
17 | //usage: "\nOptions:" | ||
18 | //usage: "\n -s Short" | ||
19 | //usage: "\n -i Addresses for the hostname" | ||
20 | //usage: "\n -d DNS domain name" | ||
21 | //usage: "\n -f Fully qualified domain name" | ||
22 | //usage: "\n -F FILE Use FILE's content as hostname" | ||
23 | //usage: | ||
24 | //usage:#define hostname_example_usage | ||
25 | //usage: "$ hostname\n" | ||
26 | //usage: "sage\n" | ||
27 | //usage: | ||
28 | //usage:#define dnsdomainname_trivial_usage NOUSAGE_STR | ||
29 | //usage:#define dnsdomainname_full_usage "" | ||
30 | |||
12 | #include "libbb.h" | 31 | #include "libbb.h" |
13 | 32 | ||
14 | static void do_sethostname(char *s, int isfile) | 33 | static void do_sethostname(char *s, int isfile) |
diff --git a/networking/httpd.c b/networking/httpd.c index eded7b63f..d6157aca2 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -97,6 +97,32 @@ | |||
97 | */ | 97 | */ |
98 | /* TODO: use TCP_CORK, parse_config() */ | 98 | /* TODO: use TCP_CORK, parse_config() */ |
99 | 99 | ||
100 | //usage:#define httpd_trivial_usage | ||
101 | //usage: "[-ifv[v]]" | ||
102 | //usage: " [-c CONFFILE]" | ||
103 | //usage: " [-p [IP:]PORT]" | ||
104 | //usage: IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]") | ||
105 | //usage: IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]") | ||
106 | //usage: " [-h HOME]\n" | ||
107 | //usage: "or httpd -d/-e" IF_FEATURE_HTTPD_AUTH_MD5("/-m") " STRING" | ||
108 | //usage:#define httpd_full_usage "\n\n" | ||
109 | //usage: "Listen for incoming HTTP requests\n" | ||
110 | //usage: "\nOptions:" | ||
111 | //usage: "\n -i Inetd mode" | ||
112 | //usage: "\n -f Don't daemonize" | ||
113 | //usage: "\n -v[v] Verbose" | ||
114 | //usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)" | ||
115 | //usage: IF_FEATURE_HTTPD_SETUID( | ||
116 | //usage: "\n -u USER[:GRP] Set uid/gid after binding to port") | ||
117 | //usage: IF_FEATURE_HTTPD_BASIC_AUTH( | ||
118 | //usage: "\n -r REALM Authentication Realm for Basic Authentication") | ||
119 | //usage: "\n -h HOME Home directory (default .)" | ||
120 | //usage: "\n -c FILE Configuration file (default {/etc,HOME}/httpd.conf)" | ||
121 | //usage: IF_FEATURE_HTTPD_AUTH_MD5( | ||
122 | //usage: "\n -m STRING MD5 crypt STRING") | ||
123 | //usage: "\n -e STRING HTML encode STRING" | ||
124 | //usage: "\n -d STRING URL decode STRING" | ||
125 | |||
100 | #include "libbb.h" | 126 | #include "libbb.h" |
101 | #if ENABLE_FEATURE_HTTPD_USE_SENDFILE | 127 | #if ENABLE_FEATURE_HTTPD_USE_SENDFILE |
102 | # include <sys/sendfile.h> | 128 | # include <sys/sendfile.h> |
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index da2635ce0..220b02126 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
@@ -26,6 +26,27 @@ | |||
26 | * IPV6 support added by Bart Visscher <magick@linux-fan.com> | 26 | * IPV6 support added by Bart Visscher <magick@linux-fan.com> |
27 | */ | 27 | */ |
28 | 28 | ||
29 | //usage:#define ifconfig_trivial_usage | ||
30 | //usage: IF_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]" | ||
31 | //usage:#define ifconfig_full_usage "\n\n" | ||
32 | //usage: "Configure a network interface\n" | ||
33 | //usage: "\nOptions:" | ||
34 | //usage: "\n" | ||
35 | //usage: IF_FEATURE_IPV6( | ||
36 | //usage: " [add ADDRESS[/PREFIXLEN]]\n") | ||
37 | //usage: IF_FEATURE_IPV6( | ||
38 | //usage: " [del ADDRESS[/PREFIXLEN]]\n") | ||
39 | //usage: " [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]]\n" | ||
40 | //usage: " [netmask ADDRESS] [dstaddr ADDRESS]\n" | ||
41 | //usage: IF_FEATURE_IFCONFIG_SLIP( | ||
42 | //usage: " [outfill NN] [keepalive NN]\n") | ||
43 | //usage: " " IF_FEATURE_IFCONFIG_HW("[hw ether" IF_FEATURE_HWIB("|infiniband")" ADDRESS] ") "[metric NN] [mtu NN]\n" | ||
44 | //usage: " [[-]trailers] [[-]arp] [[-]allmulti]\n" | ||
45 | //usage: " [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic]\n" | ||
46 | //usage: IF_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ( | ||
47 | //usage: " [mem_start NN] [io_addr NN] [irq NN]\n") | ||
48 | //usage: " [up|down] ..." | ||
49 | |||
29 | #include <net/if.h> | 50 | #include <net/if.h> |
30 | #include <net/if_arp.h> | 51 | #include <net/if_arp.h> |
31 | #include <netinet/in.h> | 52 | #include <netinet/in.h> |
diff --git a/networking/ifenslave.c b/networking/ifenslave.c index 0b3ebf72a..208623e7d 100644 --- a/networking/ifenslave.c +++ b/networking/ifenslave.c | |||
@@ -98,6 +98,33 @@ | |||
98 | * set version to 1.1.0 | 98 | * set version to 1.1.0 |
99 | */ | 99 | */ |
100 | 100 | ||
101 | //usage:#define ifenslave_trivial_usage | ||
102 | //usage: "[-cdf] MASTER_IFACE SLAVE_IFACE..." | ||
103 | //usage:#define ifenslave_full_usage "\n\n" | ||
104 | //usage: "Configure network interfaces for parallel routing\n" | ||
105 | //usage: "\nOptions:" | ||
106 | //usage: "\n -c,--change-active Change active slave" | ||
107 | //usage: "\n -d,--detach Remove slave interface from bonding device" | ||
108 | //usage: "\n -f,--force Force, even if interface is not Ethernet" | ||
109 | /* //usage: "\n -r,--receive-slave Create a receive-only slave" */ | ||
110 | //usage: | ||
111 | //usage:#define ifenslave_example_usage | ||
112 | //usage: "To create a bond device, simply follow these three steps:\n" | ||
113 | //usage: "- ensure that the required drivers are properly loaded:\n" | ||
114 | //usage: " # modprobe bonding ; modprobe <3c59x|eepro100|pcnet32|tulip|...>\n" | ||
115 | //usage: "- assign an IP address to the bond device:\n" | ||
116 | //usage: " # ifconfig bond0 <addr> netmask <mask> broadcast <bcast>\n" | ||
117 | //usage: "- attach all the interfaces you need to the bond device:\n" | ||
118 | //usage: " # ifenslave bond0 eth0 eth1 eth2\n" | ||
119 | //usage: " If bond0 didn't have a MAC address, it will take eth0's. Then, all\n" | ||
120 | //usage: " interfaces attached AFTER this assignment will get the same MAC addr.\n\n" | ||
121 | //usage: " To detach a dead interface without setting the bond device down:\n" | ||
122 | //usage: " # ifenslave -d bond0 eth1\n\n" | ||
123 | //usage: " To set the bond device down and automatically release all the slaves:\n" | ||
124 | //usage: " # ifconfig bond0 down\n\n" | ||
125 | //usage: " To change active slave:\n" | ||
126 | //usage: " # ifenslave -c bond0 eth0\n" | ||
127 | |||
101 | #include "libbb.h" | 128 | #include "libbb.h" |
102 | 129 | ||
103 | /* #include <net/if.h> - no. linux/if_bonding.h pulls in linux/if.h */ | 130 | /* #include <net/if.h> - no. linux/if_bonding.h pulls in linux/if.h */ |
diff --git a/networking/ifplugd.c b/networking/ifplugd.c index 8dd0a5bd8..421611aae 100644 --- a/networking/ifplugd.c +++ b/networking/ifplugd.c | |||
@@ -6,6 +6,32 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | |||
10 | //usage:#define ifplugd_trivial_usage | ||
11 | //usage: "[OPTIONS]" | ||
12 | //usage:#define ifplugd_full_usage "\n\n" | ||
13 | //usage: "Network interface plug detection daemon\n" | ||
14 | //usage: "\nOptions:" | ||
15 | //usage: "\n -n Don't daemonize" | ||
16 | //usage: "\n -s Don't log to syslog" | ||
17 | //usage: "\n -i IFACE Interface" | ||
18 | //usage: "\n -f/-F Treat link detection error as link down/link up" | ||
19 | //usage: "\n (otherwise exit on error)" | ||
20 | //usage: "\n -a Don't up interface at each link probe" | ||
21 | //usage: "\n -M Monitor creation/destruction of interface" | ||
22 | //usage: "\n (otherwise it must exist)" | ||
23 | //usage: "\n -r PROG Script to run" | ||
24 | //usage: "\n -x ARG Extra argument for script" | ||
25 | //usage: "\n -I Don't exit on nonzero exit code from script" | ||
26 | //usage: "\n -p Don't run script on daemon startup" | ||
27 | //usage: "\n -q Don't run script on daemon quit" | ||
28 | //usage: "\n -l Run script on startup even if no cable is detected" | ||
29 | //usage: "\n -t SECS Poll time in seconds" | ||
30 | //usage: "\n -u SECS Delay before running script after link up" | ||
31 | //usage: "\n -d SECS Delay after link down" | ||
32 | //usage: "\n -m MODE API mode (mii, priv, ethtool, wlan, iff, auto)" | ||
33 | //usage: "\n -k Kill running daemon" | ||
34 | |||
9 | #include "libbb.h" | 35 | #include "libbb.h" |
10 | 36 | ||
11 | #include "fix_u32.h" | 37 | #include "fix_u32.h" |
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 7706a84b7..b48abb7dc 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -17,6 +17,34 @@ | |||
17 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 17 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | //usage:#define ifup_trivial_usage | ||
21 | //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." | ||
22 | //usage:#define ifup_full_usage "\n\n" | ||
23 | //usage: "Options:" | ||
24 | //usage: "\n -a De/configure all interfaces automatically" | ||
25 | //usage: "\n -i FILE Use FILE for interface definitions" | ||
26 | //usage: "\n -n Print out what would happen, but don't do it" | ||
27 | //usage: IF_FEATURE_IFUPDOWN_MAPPING( | ||
28 | //usage: "\n (note: doesn't disable mappings)" | ||
29 | //usage: "\n -m Don't run any mappings" | ||
30 | //usage: ) | ||
31 | //usage: "\n -v Print out what would happen before doing it" | ||
32 | //usage: "\n -f Force de/configuration" | ||
33 | //usage: | ||
34 | //usage:#define ifdown_trivial_usage | ||
35 | //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." | ||
36 | //usage:#define ifdown_full_usage "\n\n" | ||
37 | //usage: "Options:" | ||
38 | //usage: "\n -a De/configure all interfaces automatically" | ||
39 | //usage: "\n -i FILE Use FILE for interface definitions" | ||
40 | //usage: "\n -n Print out what would happen, but don't do it" | ||
41 | //usage: IF_FEATURE_IFUPDOWN_MAPPING( | ||
42 | //usage: "\n (note: doesn't disable mappings)" | ||
43 | //usage: "\n -m Don't run any mappings" | ||
44 | //usage: ) | ||
45 | //usage: "\n -v Print out what would happen before doing it" | ||
46 | //usage: "\n -f Force de/configuration" | ||
47 | |||
20 | #include "libbb.h" | 48 | #include "libbb.h" |
21 | /* After libbb.h, since it needs sys/types.h on some systems */ | 49 | /* After libbb.h, since it needs sys/types.h on some systems */ |
22 | #include <sys/utsname.h> | 50 | #include <sys/utsname.h> |
diff --git a/networking/inetd.c b/networking/inetd.c index 6018665ef..226a6491c 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -154,6 +154,17 @@ | |||
154 | * setuid() | 154 | * setuid() |
155 | */ | 155 | */ |
156 | 156 | ||
157 | //usage:#define inetd_trivial_usage | ||
158 | //usage: "[-fe] [-q N] [-R N] [CONFFILE]" | ||
159 | //usage:#define inetd_full_usage "\n\n" | ||
160 | //usage: "Listen for network connections and launch programs\n" | ||
161 | //usage: "\nOptions:" | ||
162 | //usage: "\n -f Run in foreground" | ||
163 | //usage: "\n -e Log to stderr" | ||
164 | //usage: "\n -q N Socket listen queue (default: 128)" | ||
165 | //usage: "\n -R N Pause services after N connects/min" | ||
166 | //usage: "\n (default: 0 - disabled)" | ||
167 | |||
157 | #include <syslog.h> | 168 | #include <syslog.h> |
158 | #include <sys/un.h> | 169 | #include <sys/un.h> |
159 | 170 | ||
diff --git a/networking/ip.c b/networking/ip.c index 350656cef..98d583325 100644 --- a/networking/ip.c +++ b/networking/ip.c | |||
@@ -9,6 +9,79 @@ | |||
9 | * Bernhard Reutner-Fischer rewrote to use index_in_substr_array | 9 | * Bernhard Reutner-Fischer rewrote to use index_in_substr_array |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* would need to make the " | " optional depending on more than one selected: */ | ||
13 | //usage:#define ip_trivial_usage | ||
14 | //usage: "[OPTIONS] {" | ||
15 | //usage: IF_FEATURE_IP_ADDRESS("address | ") | ||
16 | //usage: IF_FEATURE_IP_ROUTE("route | ") | ||
17 | //usage: IF_FEATURE_IP_LINK("link | ") | ||
18 | //usage: IF_FEATURE_IP_TUNNEL("tunnel | ") | ||
19 | //usage: IF_FEATURE_IP_RULE("rule") | ||
20 | //usage: "} {COMMAND}" | ||
21 | //usage:#define ip_full_usage "\n\n" | ||
22 | //usage: "ip [OPTIONS] OBJECT {COMMAND}\n" | ||
23 | //usage: "where OBJECT := {" | ||
24 | //usage: IF_FEATURE_IP_ADDRESS("address | ") | ||
25 | //usage: IF_FEATURE_IP_ROUTE("route | ") | ||
26 | //usage: IF_FEATURE_IP_LINK("link | ") | ||
27 | //usage: IF_FEATURE_IP_TUNNEL("tunnel | ") | ||
28 | //usage: IF_FEATURE_IP_RULE("rule") | ||
29 | //usage: "}\n" | ||
30 | //usage: "OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }" | ||
31 | //usage: | ||
32 | //usage:#define ipaddr_trivial_usage | ||
33 | //usage: "{ {add|del} IFADDR dev STRING | {show|flush}\n" | ||
34 | //usage: " [dev STRING] [to PREFIX] }" | ||
35 | //usage:#define ipaddr_full_usage "\n\n" | ||
36 | //usage: "ipaddr {add|delete} IFADDR dev STRING\n" | ||
37 | //usage: "ipaddr {show|flush} [dev STRING] [scope SCOPE-ID]\n" | ||
38 | //usage: " [to PREFIX] [label PATTERN]\n" | ||
39 | //usage: " IFADDR := PREFIX | ADDR peer PREFIX\n" | ||
40 | //usage: " [broadcast ADDR] [anycast ADDR]\n" | ||
41 | //usage: " [label STRING] [scope SCOPE-ID]\n" | ||
42 | //usage: " SCOPE-ID := [host | link | global | NUMBER]" | ||
43 | //usage: | ||
44 | //usage:#define iplink_trivial_usage | ||
45 | //usage: "{ set DEVICE { up | down | arp { on | off } | show [DEVICE] }" | ||
46 | //usage:#define iplink_full_usage "\n\n" | ||
47 | //usage: "iplink set DEVICE { up | down | arp | multicast { on | off } |\n" | ||
48 | //usage: " dynamic { on | off } |\n" | ||
49 | //usage: " mtu MTU }\n" | ||
50 | //usage: "iplink show [DEVICE]" | ||
51 | //usage: | ||
52 | //usage:#define iproute_trivial_usage | ||
53 | //usage: "{ list | flush | { add | del | change | append |\n" | ||
54 | //usage: " replace | monitor } ROUTE }" | ||
55 | //usage:#define iproute_full_usage "\n\n" | ||
56 | //usage: "iproute { list | flush } SELECTOR\n" | ||
57 | //usage: "iproute get ADDRESS [from ADDRESS iif STRING]\n" | ||
58 | //usage: " [oif STRING] [tos TOS]\n" | ||
59 | //usage: "iproute { add | del | change | append | replace | monitor } ROUTE\n" | ||
60 | //usage: " SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" | ||
61 | //usage: " ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n" | ||
62 | //usage: " [metric METRIC]" | ||
63 | //usage: | ||
64 | //usage:#define iprule_trivial_usage | ||
65 | //usage: "{[list | add | del] RULE}" | ||
66 | //usage:#define iprule_full_usage "\n\n" | ||
67 | //usage: "iprule [list | add | del] SELECTOR ACTION\n" | ||
68 | //usage: " SELECTOR := [from PREFIX] [to PREFIX] [tos TOS] [fwmark FWMARK]\n" | ||
69 | //usage: " [dev STRING] [pref NUMBER]\n" | ||
70 | //usage: " ACTION := [table TABLE_ID] [nat ADDRESS]\n" | ||
71 | //usage: " [prohibit | reject | unreachable]\n" | ||
72 | //usage: " [realms [SRCREALM/]DSTREALM]\n" | ||
73 | //usage: " TABLE_ID := [local | main | default | NUMBER]" | ||
74 | //usage: | ||
75 | //usage:#define iptunnel_trivial_usage | ||
76 | //usage: "{ add | change | del | show } [NAME]\n" | ||
77 | //usage: " [mode { ipip | gre | sit }]\n" | ||
78 | //usage: " [remote ADDR] [local ADDR] [ttl TTL]" | ||
79 | //usage:#define iptunnel_full_usage "\n\n" | ||
80 | //usage: "iptunnel { add | change | del | show } [NAME]\n" | ||
81 | //usage: " [mode { ipip | gre | sit }] [remote ADDR] [local ADDR]\n" | ||
82 | //usage: " [[i|o]seq] [[i|o]key KEY] [[i|o]csum]\n" | ||
83 | //usage: " [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]" | ||
84 | |||
12 | #include "libbb.h" | 85 | #include "libbb.h" |
13 | 86 | ||
14 | #include "libiproute/utils.h" | 87 | #include "libiproute/utils.h" |
diff --git a/networking/ipcalc.c b/networking/ipcalc.c index acbaa4ac5..f96c73912 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c | |||
@@ -11,6 +11,33 @@ | |||
11 | * | 11 | * |
12 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 12 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
13 | */ | 13 | */ |
14 | |||
15 | //usage:#define ipcalc_trivial_usage | ||
16 | //usage: "[OPTIONS] ADDRESS[[/]NETMASK] [NETMASK]" | ||
17 | //usage:#define ipcalc_full_usage "\n\n" | ||
18 | //usage: "Calculate IP network settings from a IP address\n" | ||
19 | //usage: "\nOptions:" | ||
20 | //usage: IF_FEATURE_IPCALC_LONG_OPTIONS( | ||
21 | //usage: "\n -b,--broadcast Display calculated broadcast address" | ||
22 | //usage: "\n -n,--network Display calculated network address" | ||
23 | //usage: "\n -m,--netmask Display default netmask for IP" | ||
24 | //usage: IF_FEATURE_IPCALC_FANCY( | ||
25 | //usage: "\n -p,--prefix Display the prefix for IP/NETMASK" | ||
26 | //usage: "\n -h,--hostname Display first resolved host name" | ||
27 | //usage: "\n -s,--silent Don't ever display error messages" | ||
28 | //usage: ) | ||
29 | //usage: ) | ||
30 | //usage: IF_NOT_FEATURE_IPCALC_LONG_OPTIONS( | ||
31 | //usage: "\n -b Display calculated broadcast address" | ||
32 | //usage: "\n -n Display calculated network address" | ||
33 | //usage: "\n -m Display default netmask for IP" | ||
34 | //usage: IF_FEATURE_IPCALC_FANCY( | ||
35 | //usage: "\n -p Display the prefix for IP/NETMASK" | ||
36 | //usage: "\n -h Display first resolved host name" | ||
37 | //usage: "\n -s Don't ever display error messages" | ||
38 | //usage: ) | ||
39 | //usage: ) | ||
40 | |||
14 | #include "libbb.h" | 41 | #include "libbb.h" |
15 | /* After libbb.h, because on some systems it needs other includes */ | 42 | /* After libbb.h, because on some systems it needs other includes */ |
16 | #include <arpa/inet.h> | 43 | #include <arpa/inet.h> |
diff --git a/networking/isrv_identd.c b/networking/isrv_identd.c index 18ce59aaf..199e11225 100644 --- a/networking/isrv_identd.c +++ b/networking/isrv_identd.c | |||
@@ -7,6 +7,17 @@ | |||
7 | * Licensed under GPLv2, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | //usage:#define fakeidentd_trivial_usage | ||
11 | //usage: "[-fiw] [-b ADDR] [STRING]" | ||
12 | //usage:#define fakeidentd_full_usage "\n\n" | ||
13 | //usage: "Provide fake ident (auth) service\n" | ||
14 | //usage: "\nOptions:" | ||
15 | //usage: "\n -f Run in foreground" | ||
16 | //usage: "\n -i Inetd mode" | ||
17 | //usage: "\n -w Inetd 'wait' mode" | ||
18 | //usage: "\n -b ADDR Bind to specified address" | ||
19 | //usage: "\n STRING Ident answer string (default: nobody)" | ||
20 | |||
10 | #include "libbb.h" | 21 | #include "libbb.h" |
11 | #include <syslog.h> | 22 | #include <syslog.h> |
12 | #include "isrv.h" | 23 | #include "isrv.h" |
diff --git a/networking/nslookup.c b/networking/nslookup.c index 67fc01547..f4fd407dd 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -11,6 +11,20 @@ | |||
11 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 11 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | //usage:#define nslookup_trivial_usage | ||
15 | //usage: "[HOST] [SERVER]" | ||
16 | //usage:#define nslookup_full_usage "\n\n" | ||
17 | //usage: "Query the nameserver for the IP address of the given HOST\n" | ||
18 | //usage: "optionally using a specified DNS server" | ||
19 | //usage: | ||
20 | //usage:#define nslookup_example_usage | ||
21 | //usage: "$ nslookup localhost\n" | ||
22 | //usage: "Server: default\n" | ||
23 | //usage: "Address: default\n" | ||
24 | //usage: "\n" | ||
25 | //usage: "Name: debian\n" | ||
26 | //usage: "Address: 127.0.0.1\n" | ||
27 | |||
14 | #include <resolv.h> | 28 | #include <resolv.h> |
15 | #include "libbb.h" | 29 | #include "libbb.h" |
16 | 30 | ||
diff --git a/networking/ntpd.c b/networking/ntpd.c index ba2950d8f..e27dbaa6b 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
@@ -27,6 +27,23 @@ | |||
27 | * * | 27 | * * |
28 | *********************************************************************** | 28 | *********************************************************************** |
29 | */ | 29 | */ |
30 | |||
31 | //usage:#define ntpd_trivial_usage | ||
32 | //usage: "[-dnqNw"IF_FEATURE_NTPD_SERVER("l")"] [-S PROG] [-p PEER]..." | ||
33 | //usage:#define ntpd_full_usage "\n\n" | ||
34 | //usage: "NTP client/server\n" | ||
35 | //usage: "\nOptions:" | ||
36 | //usage: "\n -d Verbose" | ||
37 | //usage: "\n -n Do not daemonize" | ||
38 | //usage: "\n -q Quit after clock is set" | ||
39 | //usage: "\n -N Run at high priority" | ||
40 | //usage: "\n -w Do not set time (only query peers), implies -n" | ||
41 | //usage: IF_FEATURE_NTPD_SERVER( | ||
42 | //usage: "\n -l Run as server on port 123" | ||
43 | //usage: ) | ||
44 | //usage: "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins" | ||
45 | //usage: "\n -p PEER Obtain time from PEER (may be repeated)" | ||
46 | |||
30 | #include "libbb.h" | 47 | #include "libbb.h" |
31 | #include <math.h> | 48 | #include <math.h> |
32 | #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */ | 49 | #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */ |
diff --git a/networking/pscan.c b/networking/pscan.c index a9e5d5c29..5595148fc 100644 --- a/networking/pscan.c +++ b/networking/pscan.c | |||
@@ -6,6 +6,18 @@ | |||
6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | //usage:#define pscan_trivial_usage | ||
10 | //usage: "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST" | ||
11 | //usage:#define pscan_full_usage "\n\n" | ||
12 | //usage: "Scan a host, print all open ports\n" | ||
13 | //usage: "\nOptions:" | ||
14 | //usage: "\n -c Show closed ports too" | ||
15 | //usage: "\n -b Show blocked ports too" | ||
16 | //usage: "\n -p Scan from this port (default 1)" | ||
17 | //usage: "\n -P Scan up to this port (default 1024)" | ||
18 | //usage: "\n -t Timeout (default 5000 ms)" | ||
19 | //usage: "\n -T Minimum rtt (default 5 ms, increase for congested hosts)" | ||
20 | |||
9 | #include "libbb.h" | 21 | #include "libbb.h" |
10 | 22 | ||
11 | /* debugging */ | 23 | /* debugging */ |
diff --git a/networking/route.c b/networking/route.c index 98a03ded7..6699a1c32 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -25,6 +25,15 @@ | |||
25 | * remove ridiculous amounts of bloat. | 25 | * remove ridiculous amounts of bloat. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | //usage:#define route_trivial_usage | ||
29 | //usage: "[{add|del|delete}]" | ||
30 | //usage:#define route_full_usage "\n\n" | ||
31 | //usage: "Edit kernel routing tables\n" | ||
32 | //usage: "\nOptions:" | ||
33 | //usage: "\n -n Don't resolve names" | ||
34 | //usage: "\n -e Display other/more information" | ||
35 | //usage: "\n -A inet" IF_FEATURE_IPV6("{6}") " Select address family" | ||
36 | |||
28 | #include <net/route.h> | 37 | #include <net/route.h> |
29 | #include <net/if.h> | 38 | #include <net/if.h> |
30 | 39 | ||
diff --git a/networking/slattach.c b/networking/slattach.c index 71edd2f27..d1221b11a 100644 --- a/networking/slattach.c +++ b/networking/slattach.c | |||
@@ -13,6 +13,20 @@ | |||
13 | * - The -F options allows disabling of RTS/CTS flow control. | 13 | * - The -F options allows disabling of RTS/CTS flow control. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | //usage:#define slattach_trivial_usage | ||
17 | //usage: "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE" | ||
18 | //usage:#define slattach_full_usage "\n\n" | ||
19 | //usage: "Attach network interface(s) to serial line(s)\n" | ||
20 | //usage: "\nOptions:" | ||
21 | //usage: "\n -p PROT Set protocol (slip, cslip, slip6, clisp6 or adaptive)" | ||
22 | //usage: "\n -s SPD Set line speed" | ||
23 | //usage: "\n -e Exit after initializing device" | ||
24 | //usage: "\n -h Exit when the carrier is lost" | ||
25 | //usage: "\n -c PROG Run PROG when the line is hung up" | ||
26 | //usage: "\n -m Do NOT initialize the line in raw 8 bits mode" | ||
27 | //usage: "\n -L Enable 3-wire operation" | ||
28 | //usage: "\n -F Disable RTS/CTS flow control" | ||
29 | |||
16 | #include "libbb.h" | 30 | #include "libbb.h" |
17 | #include "libiproute/utils.h" /* invarg() */ | 31 | #include "libiproute/utils.h" /* invarg() */ |
18 | 32 | ||
diff --git a/networking/tc.c b/networking/tc.c index 9b3245546..e9848a86b 100644 --- a/networking/tc.c +++ b/networking/tc.c | |||
@@ -7,6 +7,27 @@ | |||
7 | * Bernhard Reutner-Fischer adjusted for busybox | 7 | * Bernhard Reutner-Fischer adjusted for busybox |
8 | */ | 8 | */ |
9 | 9 | ||
10 | //usage:#define tc_trivial_usage | ||
11 | /* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */ | ||
12 | //usage: "OBJECT CMD [dev STRING]" | ||
13 | //usage:#define tc_full_usage "\n\n" | ||
14 | //usage: "OBJECT: {qdisc|class|filter}\n" | ||
15 | //usage: "CMD: {add|del|change|replace|show}\n" | ||
16 | //usage: "\n" | ||
17 | //usage: "qdisc [ handle QHANDLE ] [ root |"IF_FEATURE_TC_INGRESS(" ingress |")" parent CLASSID ]\n" | ||
18 | /* //usage: "[ estimator INTERVAL TIME_CONSTANT ]\n" */ | ||
19 | //usage: " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" | ||
20 | //usage: " QDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" | ||
21 | //usage: "qdisc show [ dev STRING ]"IF_FEATURE_TC_INGRESS(" [ingress]")"\n" | ||
22 | //usage: "class [ classid CLASSID ] [ root | parent CLASSID ]\n" | ||
23 | //usage: " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" | ||
24 | //usage: "class show [ dev STRING ] [ root | parent CLASSID ]\n" | ||
25 | //usage: "filter [ pref PRIO ] [ protocol PROTO ]\n" | ||
26 | /* //usage: "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ | ||
27 | //usage: " [ root | classid CLASSID ] [ handle FILTERID ]\n" | ||
28 | //usage: " [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n" | ||
29 | //usage: "filter show [ dev STRING ] [ root | parent CLASSID ]" | ||
30 | |||
10 | #include "libbb.h" | 31 | #include "libbb.h" |
11 | 32 | ||
12 | #include "libiproute/utils.h" | 33 | #include "libiproute/utils.h" |
diff --git a/networking/tcpudp.c b/networking/tcpudp.c index 3ff2acbf8..a2b8c958c 100644 --- a/networking/tcpudp.c +++ b/networking/tcpudp.c | |||
@@ -29,6 +29,43 @@ | |||
29 | * - don't know how to retrieve ORIGDST for udp. | 29 | * - don't know how to retrieve ORIGDST for udp. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | //usage:#define tcpsvd_trivial_usage | ||
33 | //usage: "[-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG" | ||
34 | /* with not-implemented options: */ | ||
35 | /* //usage: "[-hpEvv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] [-i DIR|-x CDB] [-t SEC] IP PORT PROG" */ | ||
36 | //usage:#define tcpsvd_full_usage "\n\n" | ||
37 | //usage: "Create TCP socket, bind to IP:PORT and listen\n" | ||
38 | //usage: "for incoming connection. Run PROG for each connection.\n" | ||
39 | //usage: "\n IP IP to listen on. '0' = all" | ||
40 | //usage: "\n PORT Port to listen on" | ||
41 | //usage: "\n PROG ARGS Program to run" | ||
42 | //usage: "\n -l NAME Local hostname (else looks up local hostname in DNS)" | ||
43 | //usage: "\n -u USER[:GRP] Change to user/group after bind" | ||
44 | //usage: "\n -c N Handle up to N connections simultaneously" | ||
45 | //usage: "\n -b N Allow a backlog of approximately N TCP SYNs" | ||
46 | //usage: "\n -C N[:MSG] Allow only up to N connections from the same IP." | ||
47 | //usage: "\n New connections from this IP address are closed" | ||
48 | //usage: "\n immediately. MSG is written to the peer before close" | ||
49 | //usage: "\n -h Look up peer's hostname" | ||
50 | //usage: "\n -E Don't set up environment variables" | ||
51 | //usage: "\n -v Verbose" | ||
52 | //usage: | ||
53 | //usage:#define udpsvd_trivial_usage | ||
54 | //usage: "[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG" | ||
55 | //usage:#define udpsvd_full_usage "\n\n" | ||
56 | //usage: "Create UDP socket, bind to IP:PORT and wait\n" | ||
57 | //usage: "for incoming packets. Run PROG for each packet,\n" | ||
58 | //usage: "redirecting all further packets with same peer ip:port to it.\n" | ||
59 | //usage: "\n IP IP to listen on. '0' = all" | ||
60 | //usage: "\n PORT Port to listen on" | ||
61 | //usage: "\n PROG ARGS Program to run" | ||
62 | //usage: "\n -l NAME Local hostname (else looks up local hostname in DNS)" | ||
63 | //usage: "\n -u USER[:GRP] Change to user/group after bind" | ||
64 | //usage: "\n -c N Handle up to N connections simultaneously" | ||
65 | //usage: "\n -h Look up peer's hostname" | ||
66 | //usage: "\n -E Don't set up environment variables" | ||
67 | //usage: "\n -v Verbose" | ||
68 | |||
32 | #include "libbb.h" | 69 | #include "libbb.h" |
33 | 70 | ||
34 | /* Wants <limits.h> etc, thus included after libbb.h: */ | 71 | /* Wants <limits.h> etc, thus included after libbb.h: */ |
diff --git a/networking/telnet.c b/networking/telnet.c index f6fad684c..1f0d85107 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -21,6 +21,22 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | //usage:#if ENABLE_FEATURE_TELNET_AUTOLOGIN | ||
25 | //usage:#define telnet_trivial_usage | ||
26 | //usage: "[-a] [-l USER] HOST [PORT]" | ||
27 | //usage:#define telnet_full_usage "\n\n" | ||
28 | //usage: "Connect to telnet server\n" | ||
29 | //usage: "\nOptions:" | ||
30 | //usage: "\n -a Automatic login with $USER variable" | ||
31 | //usage: "\n -l USER Automatic login as USER" | ||
32 | //usage: | ||
33 | //usage:#else | ||
34 | //usage:#define telnet_trivial_usage | ||
35 | //usage: "HOST [PORT]" | ||
36 | //usage:#define telnet_full_usage "\n\n" | ||
37 | //usage: "Connect to telnet server" | ||
38 | //usage:#endif | ||
39 | |||
24 | #include <arpa/telnet.h> | 40 | #include <arpa/telnet.h> |
25 | #include <netinet/in.h> | 41 | #include <netinet/in.h> |
26 | #include "libbb.h" | 42 | #include "libbb.h" |
diff --git a/networking/telnetd.c b/networking/telnetd.c index eec4417ca..4404064fc 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -20,6 +20,28 @@ | |||
20 | * Vladimir Oleynik <dzo@simtreas.ru> 2001 | 20 | * Vladimir Oleynik <dzo@simtreas.ru> 2001 |
21 | * Set process group corrections, initial busybox port | 21 | * Set process group corrections, initial busybox port |
22 | */ | 22 | */ |
23 | |||
24 | //usage:#define telnetd_trivial_usage | ||
25 | //usage: "[OPTIONS]" | ||
26 | //usage:#define telnetd_full_usage "\n\n" | ||
27 | //usage: "Handle incoming telnet connections" | ||
28 | //usage: IF_NOT_FEATURE_TELNETD_STANDALONE(" via inetd") "\n" | ||
29 | //usage: "\nOptions:" | ||
30 | //usage: "\n -l LOGIN Exec LOGIN on connect" | ||
31 | //usage: "\n -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue" | ||
32 | //usage: "\n -K Close connection as soon as login exits" | ||
33 | //usage: "\n (normally wait until all programs close slave pty)" | ||
34 | //usage: IF_FEATURE_TELNETD_STANDALONE( | ||
35 | //usage: "\n -p PORT Port to listen on" | ||
36 | //usage: "\n -b ADDR[:PORT] Address to bind to" | ||
37 | //usage: "\n -F Run in foreground" | ||
38 | //usage: "\n -i Inetd mode" | ||
39 | //usage: IF_FEATURE_TELNETD_INETD_WAIT( | ||
40 | //usage: "\n -w SEC Inetd 'wait' mode, linger time SEC" | ||
41 | //usage: "\n -S Log to syslog (implied by -i or without -F and -w)" | ||
42 | //usage: ) | ||
43 | //usage: ) | ||
44 | |||
23 | #define DEBUG 0 | 45 | #define DEBUG 0 |
24 | 46 | ||
25 | #include "libbb.h" | 47 | #include "libbb.h" |
diff --git a/networking/tftp.c b/networking/tftp.c index 35cf0dbd9..f52e49d51 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -18,6 +18,39 @@ | |||
18 | * | 18 | * |
19 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 19 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
20 | */ | 20 | */ |
21 | |||
22 | //usage:#define tftp_trivial_usage | ||
23 | //usage: "[OPTIONS] HOST [PORT]" | ||
24 | //usage:#define tftp_full_usage "\n\n" | ||
25 | //usage: "Transfer a file from/to tftp server\n" | ||
26 | //usage: "\nOptions:" | ||
27 | //usage: "\n -l FILE Local FILE" | ||
28 | //usage: "\n -r FILE Remote FILE" | ||
29 | //usage: IF_FEATURE_TFTP_GET( | ||
30 | //usage: "\n -g Get file" | ||
31 | //usage: ) | ||
32 | //usage: IF_FEATURE_TFTP_PUT( | ||
33 | //usage: "\n -p Put file" | ||
34 | //usage: ) | ||
35 | //usage: IF_FEATURE_TFTP_BLOCKSIZE( | ||
36 | //usage: "\n -b SIZE Transfer blocks of SIZE octets" | ||
37 | //usage: ) | ||
38 | //usage: | ||
39 | //usage:#define tftpd_trivial_usage | ||
40 | //usage: "[-cr] [-u USER] [DIR]" | ||
41 | //usage:#define tftpd_full_usage "\n\n" | ||
42 | //usage: "Transfer a file on tftp client's request\n" | ||
43 | //usage: "\n" | ||
44 | //usage: "tftpd should be used as an inetd service.\n" | ||
45 | //usage: "tftpd's line for inetd.conf:\n" | ||
46 | //usage: " 69 dgram udp nowait root tftpd tftpd /files/to/serve\n" | ||
47 | //usage: "It also can be ran from udpsvd:\n" | ||
48 | //usage: " udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve\n" | ||
49 | //usage: "\nOptions:" | ||
50 | //usage: "\n -r Prohibit upload" | ||
51 | //usage: "\n -c Allow file creation via upload" | ||
52 | //usage: "\n -u Access files as USER" | ||
53 | |||
21 | #include "libbb.h" | 54 | #include "libbb.h" |
22 | 55 | ||
23 | #if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT | 56 | #if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT |
diff --git a/networking/traceroute.c b/networking/traceroute.c index 55dc15b66..96f9d3472 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -210,6 +210,51 @@ | |||
210 | * Tue Dec 20 03:50:13 PST 1988 | 210 | * Tue Dec 20 03:50:13 PST 1988 |
211 | */ | 211 | */ |
212 | 212 | ||
213 | //usage:#define traceroute_trivial_usage | ||
214 | //usage: "[-"IF_TRACEROUTE6("46")"FIldnrv] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]\n" | ||
215 | //usage: " [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE]\n" | ||
216 | //usage: " [-z PAUSE_MSEC] HOST [BYTES]" | ||
217 | //usage:#define traceroute_full_usage "\n\n" | ||
218 | //usage: "Trace the route to HOST\n" | ||
219 | //usage: "\nOptions:" | ||
220 | //usage: IF_TRACEROUTE6( | ||
221 | //usage: "\n -4,-6 Force IP or IPv6 name resolution" | ||
222 | //usage: ) | ||
223 | //usage: "\n -F Set the don't fragment bit" | ||
224 | //usage: "\n -I Use ICMP ECHO instead of UDP datagrams" | ||
225 | //usage: "\n -l Display the TTL value of the returned packet" | ||
226 | //usage: "\n -d Set SO_DEBUG options to socket" | ||
227 | //usage: "\n -n Print numeric addresses" | ||
228 | //usage: "\n -r Bypass routing tables, send directly to HOST" | ||
229 | //usage: "\n -v Verbose" | ||
230 | //usage: "\n -m Max time-to-live (max number of hops)" | ||
231 | //usage: "\n -p Base UDP port number used in probes" | ||
232 | //usage: "\n (default 33434)" | ||
233 | //usage: "\n -q Number of probes per TTL (default 3)" | ||
234 | //usage: "\n -s IP address to use as the source address" | ||
235 | //usage: "\n -t Type-of-service in probe packets (default 0)" | ||
236 | //usage: "\n -w Time in seconds to wait for a response (default 3)" | ||
237 | //usage: "\n -g Loose source route gateway (8 max)" | ||
238 | //usage: | ||
239 | //usage:#define traceroute6_trivial_usage | ||
240 | //usage: "[-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES]\n" | ||
241 | //usage: " [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-i IFACE]\n" | ||
242 | //usage: " HOST [BYTES]" | ||
243 | //usage:#define traceroute6_full_usage "\n\n" | ||
244 | //usage: "Trace the route to HOST\n" | ||
245 | //usage: "\nOptions:" | ||
246 | //usage: "\n -d Set SO_DEBUG options to socket" | ||
247 | //usage: "\n -n Print numeric addresses" | ||
248 | //usage: "\n -r Bypass routing tables, send directly to HOST" | ||
249 | //usage: "\n -v Verbose" | ||
250 | //usage: "\n -m Max time-to-live (max number of hops)" | ||
251 | //usage: "\n -p Base UDP port number used in probes" | ||
252 | //usage: "\n (default is 33434)" | ||
253 | //usage: "\n -q Number of probes per TTL (default 3)" | ||
254 | //usage: "\n -s IP address to use as the source address" | ||
255 | //usage: "\n -t Type-of-service in probe packets (default 0)" | ||
256 | //usage: "\n -w Time in seconds to wait for a response (default 3)" | ||
257 | |||
213 | #define TRACEROUTE_SO_DEBUG 0 | 258 | #define TRACEROUTE_SO_DEBUG 0 |
214 | 259 | ||
215 | /* TODO: undefs were uncommented - ??! we have config system for that! */ | 260 | /* TODO: undefs were uncommented - ??! we have config system for that! */ |
diff --git a/networking/tunctl.c b/networking/tunctl.c index e17a9db64..8cb733b68 100644 --- a/networking/tunctl.c +++ b/networking/tunctl.c | |||
@@ -9,6 +9,25 @@ | |||
9 | * | 9 | * |
10 | * Licensed under GPLv2, see file LICENSE in this source tree. | 10 | * Licensed under GPLv2, see file LICENSE in this source tree. |
11 | */ | 11 | */ |
12 | |||
13 | //usage:#define tunctl_trivial_usage | ||
14 | //usage: "[-f device] ([-t name] | -d name)" IF_FEATURE_TUNCTL_UG(" [-u owner] [-g group] [-b]") | ||
15 | //usage:#define tunctl_full_usage "\n\n" | ||
16 | //usage: "Create or delete tun interfaces\n" | ||
17 | //usage: "\nOptions:" | ||
18 | //usage: "\n -f name tun device (/dev/net/tun)" | ||
19 | //usage: "\n -t name Create iface 'name'" | ||
20 | //usage: "\n -d name Delete iface 'name'" | ||
21 | //usage: IF_FEATURE_TUNCTL_UG( | ||
22 | //usage: "\n -u owner Set iface owner" | ||
23 | //usage: "\n -g group Set iface group" | ||
24 | //usage: "\n -b Brief output" | ||
25 | //usage: ) | ||
26 | //usage: | ||
27 | //usage:#define tunctl_example_usage | ||
28 | //usage: "# tunctl\n" | ||
29 | //usage: "# tunctl -d tun0\n" | ||
30 | |||
12 | #include <netinet/in.h> | 31 | #include <netinet/in.h> |
13 | #include <net/if.h> | 32 | #include <net/if.h> |
14 | #include <linux/if_tun.h> | 33 | #include <linux/if_tun.h> |
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 6fb48a19a..747472d0c 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -20,6 +20,17 @@ | |||
20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | */ | 22 | */ |
23 | |||
24 | //usage:#define udhcpd_trivial_usage | ||
25 | //usage: "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" | ||
26 | //usage:#define udhcpd_full_usage "\n\n" | ||
27 | //usage: "DHCP server\n" | ||
28 | //usage: "\n -f Run in foreground" | ||
29 | //usage: "\n -S Log to syslog too" | ||
30 | //usage: IF_FEATURE_UDHCP_PORT( | ||
31 | //usage: "\n -P N Use port N (default 67)" | ||
32 | //usage: ) | ||
33 | |||
23 | #include <syslog.h> | 34 | #include <syslog.h> |
24 | #include "common.h" | 35 | #include "common.h" |
25 | #include "dhcpc.h" | 36 | #include "dhcpc.h" |
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c index 86ef04a62..f82ac05b4 100644 --- a/networking/udhcp/dhcprelay.c +++ b/networking/udhcp/dhcprelay.c | |||
@@ -9,6 +9,12 @@ | |||
9 | * Netbeat AG | 9 | * Netbeat AG |
10 | * Upstream has GPL v2 or later | 10 | * Upstream has GPL v2 or later |
11 | */ | 11 | */ |
12 | |||
13 | //usage:#define dhcprelay_trivial_usage | ||
14 | //usage: "CLIENT_IFACE[,CLIENT_IFACE2]... SERVER_IFACE [SERVER_IP]" | ||
15 | //usage:#define dhcprelay_full_usage "\n\n" | ||
16 | //usage: "Relay DHCP requests between clients and server" | ||
17 | |||
12 | #include "common.h" | 18 | #include "common.h" |
13 | 19 | ||
14 | #define SERVER_PORT 67 | 20 | #define SERVER_PORT 67 |
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index 21d62a2d2..ec07192c1 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c | |||
@@ -2,6 +2,23 @@ | |||
2 | /* | 2 | /* |
3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 3 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
4 | */ | 4 | */ |
5 | |||
6 | //usage:#define dumpleases_trivial_usage | ||
7 | //usage: "[-r|-a] [-f LEASEFILE]" | ||
8 | //usage:#define dumpleases_full_usage "\n\n" | ||
9 | //usage: "Display DHCP leases granted by udhcpd\n" | ||
10 | //usage: "\nOptions:" | ||
11 | //usage: IF_LONG_OPTS( | ||
12 | //usage: "\n -f,--file=FILE Lease file" | ||
13 | //usage: "\n -r,--remaining Show remaining time" | ||
14 | //usage: "\n -a,--absolute Show expiration time" | ||
15 | //usage: ) | ||
16 | //usage: IF_NOT_LONG_OPTS( | ||
17 | //usage: "\n -f FILE Lease file" | ||
18 | //usage: "\n -r Show remaining time" | ||
19 | //usage: "\n -a Show expiration time" | ||
20 | //usage: ) | ||
21 | |||
5 | #include "common.h" | 22 | #include "common.h" |
6 | #include "dhcpd.h" | 23 | #include "dhcpd.h" |
7 | #include "unicode.h" | 24 | #include "unicode.h" |
diff --git a/networking/vconfig.c b/networking/vconfig.c index 13c65ad78..4fa341ac3 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c | |||
@@ -9,6 +9,18 @@ | |||
9 | 9 | ||
10 | /* BB_AUDIT SUSv3 N/A */ | 10 | /* BB_AUDIT SUSv3 N/A */ |
11 | 11 | ||
12 | //usage:#define vconfig_trivial_usage | ||
13 | //usage: "COMMAND [OPTIONS]" | ||
14 | //usage:#define vconfig_full_usage "\n\n" | ||
15 | //usage: "Create and remove virtual ethernet devices\n" | ||
16 | //usage: "\nOptions:" | ||
17 | //usage: "\n add [interface-name] [vlan_id]" | ||
18 | //usage: "\n rem [vlan-name]" | ||
19 | //usage: "\n set_flag [interface-name] [flag-num] [0 | 1]" | ||
20 | //usage: "\n set_egress_map [vlan-name] [skb_priority] [vlan_qos]" | ||
21 | //usage: "\n set_ingress_map [vlan-name] [skb_priority] [vlan_qos]" | ||
22 | //usage: "\n set_name_type [name-type]" | ||
23 | |||
12 | #include "libbb.h" | 24 | #include "libbb.h" |
13 | #include <net/if.h> | 25 | #include <net/if.h> |
14 | 26 | ||
diff --git a/networking/zcip.c b/networking/zcip.c index 6fa265ad4..7250fb2fd 100644 --- a/networking/zcip.c +++ b/networking/zcip.c | |||
@@ -23,6 +23,19 @@ | |||
23 | // - avoid silent script failures, especially under load... | 23 | // - avoid silent script failures, especially under load... |
24 | // - link status monitoring (restart on link-up; stop on link-down) | 24 | // - link status monitoring (restart on link-up; stop on link-down) |
25 | 25 | ||
26 | //usage:#define zcip_trivial_usage | ||
27 | //usage: "[OPTIONS] IFACE SCRIPT" | ||
28 | //usage:#define zcip_full_usage "\n\n" | ||
29 | //usage: "Manage a ZeroConf IPv4 link-local address\n" | ||
30 | //usage: "\nOptions:" | ||
31 | //usage: "\n -f Run in foreground" | ||
32 | //usage: "\n -q Quit after obtaining address" | ||
33 | //usage: "\n -r 169.254.x.x Request this address first" | ||
34 | //usage: "\n -v Verbose" | ||
35 | //usage: "\n" | ||
36 | //usage: "\nWith no -q, runs continuously monitoring for ARP conflicts," | ||
37 | //usage: "\nexits only on I/O errors (link down etc)" | ||
38 | |||
26 | #include <netinet/ether.h> | 39 | #include <netinet/ether.h> |
27 | #include <net/ethernet.h> | 40 | #include <net/ethernet.h> |
28 | #include <net/if.h> | 41 | #include <net/if.h> |