diff options
author | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2016-11-29 11:26:45 +0000 |
commit | bb8d79eadbba1942dbdb9f9cee5c47833afe269f (patch) | |
tree | b8c517e9ca895d60d7227aef7177b6291df5e2cd /networking | |
parent | 9fa1e4990e655a85025c9d270a1606983e375e47 (diff) | |
parent | 7d877fc9312a742b06125927bb1d34bd35398c6c (diff) | |
download | busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.gz busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.tar.bz2 busybox-w32-bb8d79eadbba1942dbdb9f9cee5c47833afe269f.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'networking')
42 files changed, 1158 insertions, 1009 deletions
diff --git a/networking/Config.src b/networking/Config.src index eb0536a7c..527bdd15d 100644 --- a/networking/Config.src +++ b/networking/Config.src | |||
@@ -5,8 +5,6 @@ | |||
5 | 5 | ||
6 | menu "Networking Utilities" | 6 | menu "Networking Utilities" |
7 | 7 | ||
8 | INSERT | ||
9 | |||
10 | config FEATURE_IPV6 | 8 | config FEATURE_IPV6 |
11 | bool "Enable IPv6 support" | 9 | bool "Enable IPv6 support" |
12 | default y | 10 | default y |
@@ -48,891 +46,7 @@ config VERBOSE_RESOLUTION_ERRORS | |||
48 | "can't resolve 'hostname.com'" and want to know more. | 46 | "can't resolve 'hostname.com'" and want to know more. |
49 | This may increase size of your executable a bit. | 47 | This may increase size of your executable a bit. |
50 | 48 | ||
51 | config ARP | 49 | INSERT |
52 | bool "arp" | ||
53 | default y | ||
54 | select PLATFORM_LINUX | ||
55 | help | ||
56 | Manipulate the system ARP cache. | ||
57 | |||
58 | config ARPING | ||
59 | bool "arping" | ||
60 | default y | ||
61 | select PLATFORM_LINUX | ||
62 | help | ||
63 | Ping hosts by ARP packets. | ||
64 | |||
65 | config BRCTL | ||
66 | bool "brctl" | ||
67 | default y | ||
68 | select PLATFORM_LINUX | ||
69 | help | ||
70 | Manage ethernet bridges. | ||
71 | Supports addbr/delbr and addif/delif. | ||
72 | |||
73 | config FEATURE_BRCTL_FANCY | ||
74 | bool "Fancy options" | ||
75 | default y | ||
76 | depends on BRCTL | ||
77 | help | ||
78 | Add support for extended option like: | ||
79 | setageing, setfd, sethello, setmaxage, | ||
80 | setpathcost, setportprio, setbridgeprio, | ||
81 | stp | ||
82 | This adds about 600 bytes. | ||
83 | |||
84 | config FEATURE_BRCTL_SHOW | ||
85 | bool "Support show" | ||
86 | default y | ||
87 | depends on BRCTL && FEATURE_BRCTL_FANCY | ||
88 | help | ||
89 | Add support for option which prints the current config: | ||
90 | show | ||
91 | |||
92 | config DNSD | ||
93 | bool "dnsd" | ||
94 | default y | ||
95 | help | ||
96 | Small and static DNS server daemon. | ||
97 | |||
98 | config ETHER_WAKE | ||
99 | bool "ether-wake" | ||
100 | default y | ||
101 | select PLATFORM_LINUX | ||
102 | help | ||
103 | Send a magic packet to wake up sleeping machines. | ||
104 | |||
105 | config FAKEIDENTD | ||
106 | bool "fakeidentd" | ||
107 | default y | ||
108 | select FEATURE_SYSLOG | ||
109 | help | ||
110 | fakeidentd listens on the ident port and returns a predefined | ||
111 | fake value on any query. | ||
112 | |||
113 | config FTPD | ||
114 | bool "ftpd" | ||
115 | default y | ||
116 | help | ||
117 | simple FTP daemon. You have to run it via inetd. | ||
118 | |||
119 | config FEATURE_FTP_WRITE | ||
120 | bool "Enable upload commands" | ||
121 | default y | ||
122 | depends on FTPD | ||
123 | help | ||
124 | Enable all kinds of FTP upload commands (-w option) | ||
125 | |||
126 | config FEATURE_FTPD_ACCEPT_BROKEN_LIST | ||
127 | bool "Enable workaround for RFC-violating clients" | ||
128 | default y | ||
129 | depends on FTPD | ||
130 | help | ||
131 | Some ftp clients (among them KDE's Konqueror) issue illegal | ||
132 | "LIST -l" requests. This option works around such problems. | ||
133 | It might prevent you from listing files starting with "-" and | ||
134 | it increases the code size by ~40 bytes. | ||
135 | Most other ftp servers seem to behave similar to this. | ||
136 | |||
137 | config FEATURE_FTP_AUTHENTICATION | ||
138 | bool "Enable authentication" | ||
139 | default y | ||
140 | depends on FTPD | ||
141 | help | ||
142 | Enable basic system login as seen in telnet etc. | ||
143 | |||
144 | config FTPGET | ||
145 | bool "ftpget" | ||
146 | default y | ||
147 | help | ||
148 | Retrieve a remote file via FTP. | ||
149 | |||
150 | config FTPPUT | ||
151 | bool "ftpput" | ||
152 | default y | ||
153 | help | ||
154 | Store a remote file via FTP. | ||
155 | |||
156 | config FEATURE_FTPGETPUT_LONG_OPTIONS | ||
157 | bool "Enable long options in ftpget/ftpput" | ||
158 | default y | ||
159 | depends on LONG_OPTS && (FTPGET || FTPPUT) | ||
160 | help | ||
161 | Support long options for the ftpget/ftpput applet. | ||
162 | |||
163 | config HOSTNAME | ||
164 | bool "hostname" | ||
165 | default y | ||
166 | help | ||
167 | Show or set the system's host name. | ||
168 | |||
169 | config HTTPD | ||
170 | bool "httpd" | ||
171 | default y | ||
172 | help | ||
173 | Serve web pages via an HTTP server. | ||
174 | |||
175 | config FEATURE_HTTPD_RANGES | ||
176 | bool "Support 'Ranges:' header" | ||
177 | default y | ||
178 | depends on HTTPD | ||
179 | help | ||
180 | Makes httpd emit "Accept-Ranges: bytes" header and understand | ||
181 | "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted | ||
182 | downloads, seeking in multimedia players etc. | ||
183 | |||
184 | config FEATURE_HTTPD_SETUID | ||
185 | bool "Enable -u <user> option" | ||
186 | default y | ||
187 | depends on HTTPD | ||
188 | help | ||
189 | This option allows the server to run as a specific user | ||
190 | rather than defaulting to the user that starts the server. | ||
191 | Use of this option requires special privileges to change to a | ||
192 | different user. | ||
193 | |||
194 | config FEATURE_HTTPD_BASIC_AUTH | ||
195 | bool "Enable Basic http Authentication" | ||
196 | default y | ||
197 | depends on HTTPD | ||
198 | help | ||
199 | Utilizes password settings from /etc/httpd.conf for basic | ||
200 | authentication on a per url basis. | ||
201 | Example for httpd.conf file: | ||
202 | /adm:toor:PaSsWd | ||
203 | |||
204 | config FEATURE_HTTPD_AUTH_MD5 | ||
205 | bool "Support MD5 crypted passwords for http Authentication" | ||
206 | default y | ||
207 | depends on FEATURE_HTTPD_BASIC_AUTH | ||
208 | help | ||
209 | Enables encrypted passwords, and wildcard user/passwords | ||
210 | in httpd.conf file. | ||
211 | User '*' means 'any system user name is ok', | ||
212 | password of '*' means 'use system password for this user' | ||
213 | Examples: | ||
214 | /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 | ||
215 | /adm:root:* | ||
216 | /wiki:*:* | ||
217 | |||
218 | config FEATURE_HTTPD_CGI | ||
219 | bool "Support Common Gateway Interface (CGI)" | ||
220 | default y | ||
221 | depends on HTTPD | ||
222 | help | ||
223 | This option allows scripts and executables to be invoked | ||
224 | when specific URLs are requested. | ||
225 | |||
226 | config FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR | ||
227 | bool "Support for running scripts through an interpreter" | ||
228 | default y | ||
229 | depends on FEATURE_HTTPD_CGI | ||
230 | help | ||
231 | This option enables support for running scripts through an | ||
232 | interpreter. Turn this on if you want PHP scripts to work | ||
233 | properly. You need to supply an additional line in your | ||
234 | httpd.conf file: | ||
235 | *.php:/path/to/your/php | ||
236 | |||
237 | config FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV | ||
238 | bool "Set REMOTE_PORT environment variable for CGI" | ||
239 | default y | ||
240 | depends on FEATURE_HTTPD_CGI | ||
241 | help | ||
242 | Use of this option can assist scripts in generating | ||
243 | references that contain a unique port number. | ||
244 | |||
245 | config FEATURE_HTTPD_ENCODE_URL_STR | ||
246 | bool "Enable -e option (useful for CGIs written as shell scripts)" | ||
247 | default y | ||
248 | depends on HTTPD | ||
249 | help | ||
250 | This option allows html encoding of arbitrary strings for display | ||
251 | by the browser. Output goes to stdout. | ||
252 | For example, httpd -e "<Hello World>" produces | ||
253 | "<Hello World>". | ||
254 | |||
255 | config FEATURE_HTTPD_ERROR_PAGES | ||
256 | bool "Support for custom error pages" | ||
257 | default y | ||
258 | depends on HTTPD | ||
259 | help | ||
260 | This option allows you to define custom error pages in | ||
261 | the configuration file instead of the default HTTP status | ||
262 | error pages. For instance, if you add the line: | ||
263 | E404:/path/e404.html | ||
264 | in the config file, the server will respond the specified | ||
265 | '/path/e404.html' file instead of the terse '404 NOT FOUND' | ||
266 | message. | ||
267 | |||
268 | config FEATURE_HTTPD_PROXY | ||
269 | bool "Support for reverse proxy" | ||
270 | default y | ||
271 | depends on HTTPD | ||
272 | help | ||
273 | This option allows you to define URLs that will be forwarded | ||
274 | to another HTTP server. To setup add the following line to the | ||
275 | configuration file | ||
276 | P:/url/:http://hostname[:port]/new/path/ | ||
277 | Then a request to /url/myfile will be forwarded to | ||
278 | http://hostname[:port]/new/path/myfile. | ||
279 | |||
280 | config FEATURE_HTTPD_GZIP | ||
281 | bool "Support for GZIP content encoding" | ||
282 | default y | ||
283 | depends on HTTPD | ||
284 | help | ||
285 | Makes httpd send files using GZIP content encoding if the | ||
286 | client supports it and a pre-compressed <file>.gz exists. | ||
287 | |||
288 | config IFCONFIG | ||
289 | bool "ifconfig" | ||
290 | default y | ||
291 | select PLATFORM_LINUX | ||
292 | help | ||
293 | Ifconfig is used to configure the kernel-resident network interfaces. | ||
294 | |||
295 | config FEATURE_IFCONFIG_STATUS | ||
296 | bool "Enable status reporting output (+7k)" | ||
297 | default y | ||
298 | depends on IFCONFIG | ||
299 | help | ||
300 | If ifconfig is called with no arguments it will display the status | ||
301 | of the currently active interfaces. | ||
302 | |||
303 | config FEATURE_IFCONFIG_SLIP | ||
304 | bool "Enable slip-specific options \"keepalive\" and \"outfill\"" | ||
305 | default y | ||
306 | depends on IFCONFIG | ||
307 | help | ||
308 | Allow "keepalive" and "outfill" support for SLIP. If you're not | ||
309 | planning on using serial lines, leave this unchecked. | ||
310 | |||
311 | config FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ | ||
312 | bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" | ||
313 | default y | ||
314 | depends on IFCONFIG | ||
315 | help | ||
316 | Allow the start address for shared memory, start address for I/O, | ||
317 | and/or the interrupt line used by the specified device. | ||
318 | |||
319 | config FEATURE_IFCONFIG_HW | ||
320 | bool "Enable option \"hw\" (ether only)" | ||
321 | default y | ||
322 | depends on IFCONFIG | ||
323 | help | ||
324 | Set the hardware address of this interface, if the device driver | ||
325 | supports this operation. Currently, we only support the 'ether' | ||
326 | class. | ||
327 | |||
328 | config FEATURE_IFCONFIG_BROADCAST_PLUS | ||
329 | bool "Set the broadcast automatically" | ||
330 | default y | ||
331 | depends on IFCONFIG | ||
332 | help | ||
333 | Setting this will make ifconfig attempt to find the broadcast | ||
334 | automatically if the value '+' is used. | ||
335 | |||
336 | config IFENSLAVE | ||
337 | bool "ifenslave" | ||
338 | default y | ||
339 | select PLATFORM_LINUX | ||
340 | help | ||
341 | Userspace application to bind several interfaces | ||
342 | to a logical interface (use with kernel bonding driver). | ||
343 | |||
344 | config IFPLUGD | ||
345 | bool "ifplugd" | ||
346 | default y | ||
347 | select PLATFORM_LINUX | ||
348 | help | ||
349 | Network interface plug detection daemon. | ||
350 | |||
351 | config IFUPDOWN | ||
352 | bool "ifupdown" | ||
353 | default y | ||
354 | help | ||
355 | Activate or deactivate the specified interfaces. This applet makes | ||
356 | use of either "ifconfig" and "route" or the "ip" command to actually | ||
357 | configure network interfaces. Therefore, you will probably also want | ||
358 | to enable either IFCONFIG and ROUTE, or enable | ||
359 | FEATURE_IFUPDOWN_IP and the various IP options. Of | ||
360 | course you could use non-busybox versions of these programs, so | ||
361 | against my better judgement (since this will surely result in plenty | ||
362 | of support questions on the mailing list), I do not force you to | ||
363 | enable these additional options. It is up to you to supply either | ||
364 | "ifconfig", "route" and "run-parts" or the "ip" command, either | ||
365 | via busybox or via standalone utilities. | ||
366 | |||
367 | config IFUPDOWN_IFSTATE_PATH | ||
368 | string "Absolute path to ifstate file" | ||
369 | default "/var/run/ifstate" | ||
370 | depends on IFUPDOWN | ||
371 | help | ||
372 | ifupdown keeps state information in a file called ifstate. | ||
373 | Typically it is located in /var/run/ifstate, however | ||
374 | some distributions tend to put it in other places | ||
375 | (debian, for example, uses /etc/network/run/ifstate). | ||
376 | This config option defines location of ifstate. | ||
377 | |||
378 | config FEATURE_IFUPDOWN_IP | ||
379 | bool "Use ip applet" | ||
380 | default y | ||
381 | depends on IFUPDOWN | ||
382 | help | ||
383 | Use the iproute "ip" command to implement "ifup" and "ifdown", rather | ||
384 | than the default of using the older 'ifconfig' and 'route' utilities. | ||
385 | |||
386 | config FEATURE_IFUPDOWN_IP_BUILTIN | ||
387 | bool "Use busybox ip applet" | ||
388 | default y | ||
389 | depends on FEATURE_IFUPDOWN_IP | ||
390 | select PLATFORM_LINUX | ||
391 | select IP | ||
392 | select FEATURE_IP_ADDRESS | ||
393 | select FEATURE_IP_LINK | ||
394 | select FEATURE_IP_ROUTE | ||
395 | help | ||
396 | Use the busybox iproute "ip" applet to implement "ifupdown". | ||
397 | |||
398 | If left disabled, you must install the full-blown iproute2 | ||
399 | utility or the "ifup" and "ifdown" applets will not work. | ||
400 | |||
401 | config FEATURE_IFUPDOWN_IFCONFIG_BUILTIN | ||
402 | bool "Use busybox ifconfig and route applets" | ||
403 | default n | ||
404 | depends on IFUPDOWN && !FEATURE_IFUPDOWN_IP | ||
405 | select IFCONFIG | ||
406 | select ROUTE | ||
407 | help | ||
408 | Use the busybox iproute "ifconfig" and "route" applets to | ||
409 | implement the "ifup" and "ifdown" utilities. | ||
410 | |||
411 | If left disabled, you must install the full-blown ifconfig | ||
412 | and route utilities, or the "ifup" and "ifdown" applets will not | ||
413 | work. | ||
414 | |||
415 | config FEATURE_IFUPDOWN_IPV4 | ||
416 | bool "Support for IPv4" | ||
417 | default y | ||
418 | depends on IFUPDOWN | ||
419 | help | ||
420 | If you want ifup/ifdown to talk IPv4, leave this on. | ||
421 | |||
422 | config FEATURE_IFUPDOWN_IPV6 | ||
423 | bool "Support for IPv6" | ||
424 | default y | ||
425 | depends on IFUPDOWN && FEATURE_IPV6 | ||
426 | help | ||
427 | If you need support for IPv6, turn this option on. | ||
428 | |||
429 | ### UNUSED | ||
430 | ###config FEATURE_IFUPDOWN_IPX | ||
431 | ### bool "Support for IPX" | ||
432 | ### default y | ||
433 | ### depends on IFUPDOWN | ||
434 | ### help | ||
435 | ### If this option is selected you can use busybox to work with IPX | ||
436 | ### networks. | ||
437 | |||
438 | config FEATURE_IFUPDOWN_MAPPING | ||
439 | bool "Enable mapping support" | ||
440 | default y | ||
441 | depends on IFUPDOWN | ||
442 | help | ||
443 | This enables support for the "mapping" stanza, unless you have | ||
444 | a weird network setup you don't need it. | ||
445 | |||
446 | config FEATURE_IFUPDOWN_EXTERNAL_DHCP | ||
447 | bool "Support for external dhcp clients" | ||
448 | default n | ||
449 | depends on IFUPDOWN | ||
450 | help | ||
451 | This enables support for the external dhcp clients. Clients are | ||
452 | tried in the following order: dhcpcd, dhclient, pump and udhcpc. | ||
453 | Otherwise, if udhcpc applet is enabled, it is used. | ||
454 | Otherwise, ifup/ifdown will have no support for DHCP. | ||
455 | |||
456 | config INETD | ||
457 | bool "inetd" | ||
458 | default y | ||
459 | select FEATURE_SYSLOG | ||
460 | help | ||
461 | Internet superserver daemon | ||
462 | |||
463 | config FEATURE_INETD_SUPPORT_BUILTIN_ECHO | ||
464 | bool "Support echo service" | ||
465 | default y | ||
466 | depends on INETD | ||
467 | help | ||
468 | Echo received data internal inetd service | ||
469 | |||
470 | config FEATURE_INETD_SUPPORT_BUILTIN_DISCARD | ||
471 | bool "Support discard service" | ||
472 | default y | ||
473 | depends on INETD | ||
474 | help | ||
475 | Internet /dev/null internal inetd service | ||
476 | |||
477 | config FEATURE_INETD_SUPPORT_BUILTIN_TIME | ||
478 | bool "Support time service" | ||
479 | default y | ||
480 | depends on INETD | ||
481 | help | ||
482 | Return 32 bit time since 1900 internal inetd service | ||
483 | |||
484 | config FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME | ||
485 | bool "Support daytime service" | ||
486 | default y | ||
487 | depends on INETD | ||
488 | help | ||
489 | Return human-readable time internal inetd service | ||
490 | |||
491 | config FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN | ||
492 | bool "Support chargen service" | ||
493 | default y | ||
494 | depends on INETD | ||
495 | help | ||
496 | Familiar character generator internal inetd service | ||
497 | |||
498 | config FEATURE_INETD_RPC | ||
499 | bool "Support RPC services" | ||
500 | default n # very rarely used, and needs Sun RPC support in libc | ||
501 | depends on INETD | ||
502 | select FEATURE_HAVE_RPC | ||
503 | help | ||
504 | Support Sun-RPC based services | ||
505 | |||
506 | config IP | ||
507 | bool "ip" | ||
508 | default y | ||
509 | select PLATFORM_LINUX | ||
510 | help | ||
511 | The "ip" applet is a TCP/IP interface configuration and routing | ||
512 | utility. You generally don't need "ip" to use busybox with | ||
513 | TCP/IP. | ||
514 | |||
515 | config FEATURE_IP_ADDRESS | ||
516 | bool "ip address" | ||
517 | default y | ||
518 | depends on IP | ||
519 | help | ||
520 | Address manipulation support for the "ip" applet. | ||
521 | |||
522 | config FEATURE_IP_LINK | ||
523 | bool "ip link" | ||
524 | default y | ||
525 | depends on IP | ||
526 | help | ||
527 | Configure network devices with "ip". | ||
528 | |||
529 | config FEATURE_IP_ROUTE | ||
530 | bool "ip route" | ||
531 | default y | ||
532 | depends on IP | ||
533 | help | ||
534 | Add support for routing table management to "ip". | ||
535 | |||
536 | config FEATURE_IP_ROUTE_DIR | ||
537 | string "ip route configuration directory" | ||
538 | default "/etc/iproute2" | ||
539 | depends on FEATURE_IP_ROUTE | ||
540 | help | ||
541 | Location of the "ip" applet routing configuration. | ||
542 | |||
543 | config FEATURE_IP_TUNNEL | ||
544 | bool "ip tunnel" | ||
545 | default y | ||
546 | depends on IP | ||
547 | help | ||
548 | Add support for tunneling commands to "ip". | ||
549 | |||
550 | config FEATURE_IP_RULE | ||
551 | bool "ip rule" | ||
552 | default y | ||
553 | depends on IP | ||
554 | help | ||
555 | Add support for rule commands to "ip". | ||
556 | |||
557 | config FEATURE_IP_NEIGH | ||
558 | bool "ip neighbor" | ||
559 | default y | ||
560 | depends on IP | ||
561 | help | ||
562 | Add support for neighbor commands to "ip". | ||
563 | |||
564 | config FEATURE_IP_SHORT_FORMS | ||
565 | bool "Support short forms of ip commands" | ||
566 | default y | ||
567 | depends on IP | ||
568 | help | ||
569 | Also support short-form of ip <OBJECT> commands: | ||
570 | ip addr -> ipaddr | ||
571 | ip link -> iplink | ||
572 | ip route -> iproute | ||
573 | ip tunnel -> iptunnel | ||
574 | ip rule -> iprule | ||
575 | ip neigh -> ipneigh | ||
576 | |||
577 | Say N unless you desparately need the short form of the ip | ||
578 | object commands. | ||
579 | |||
580 | config FEATURE_IP_RARE_PROTOCOLS | ||
581 | bool "Support displaying rarely used link types" | ||
582 | default n | ||
583 | depends on IP | ||
584 | help | ||
585 | If you are not going to use links of type "frad", "econet", | ||
586 | "bif" etc, you probably don't need to enable this. | ||
587 | Ethernet, wireless, infrared, ppp/slip, ip tunnelling | ||
588 | link types are supported without this option selected. | ||
589 | |||
590 | config IPADDR | ||
591 | bool | ||
592 | default y | ||
593 | depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ADDRESS | ||
594 | |||
595 | config IPLINK | ||
596 | bool | ||
597 | default y | ||
598 | depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_LINK | ||
599 | |||
600 | config IPROUTE | ||
601 | bool | ||
602 | default y | ||
603 | depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ROUTE | ||
604 | |||
605 | config IPTUNNEL | ||
606 | bool | ||
607 | default y | ||
608 | depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_TUNNEL | ||
609 | |||
610 | config IPRULE | ||
611 | bool | ||
612 | default y | ||
613 | depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_RULE | ||
614 | |||
615 | config IPNEIGH | ||
616 | bool | ||
617 | default y | ||
618 | depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_NEIGH | ||
619 | |||
620 | config IPCALC | ||
621 | bool "ipcalc" | ||
622 | default y | ||
623 | help | ||
624 | ipcalc takes an IP address and netmask and calculates the | ||
625 | resulting broadcast, network, and host range. | ||
626 | |||
627 | config FEATURE_IPCALC_FANCY | ||
628 | bool "Fancy IPCALC, more options, adds 1 kbyte" | ||
629 | default y | ||
630 | depends on IPCALC | ||
631 | help | ||
632 | Adds the options hostname, prefix and silent to the output of | ||
633 | "ipcalc". | ||
634 | |||
635 | config FEATURE_IPCALC_LONG_OPTIONS | ||
636 | bool "Enable long options" | ||
637 | default y | ||
638 | depends on IPCALC && LONG_OPTS | ||
639 | help | ||
640 | Support long options for the ipcalc applet. | ||
641 | |||
642 | config NETSTAT | ||
643 | bool "netstat" | ||
644 | default y | ||
645 | select PLATFORM_LINUX | ||
646 | help | ||
647 | netstat prints information about the Linux networking subsystem. | ||
648 | |||
649 | config FEATURE_NETSTAT_WIDE | ||
650 | bool "Enable wide netstat output" | ||
651 | default y | ||
652 | depends on NETSTAT | ||
653 | help | ||
654 | Add support for wide columns. Useful when displaying IPv6 addresses | ||
655 | (-W option). | ||
656 | |||
657 | config FEATURE_NETSTAT_PRG | ||
658 | bool "Enable PID/Program name output" | ||
659 | default y | ||
660 | depends on NETSTAT | ||
661 | help | ||
662 | Add support for -p flag to print out PID and program name. | ||
663 | +700 bytes of code. | ||
664 | |||
665 | config NSLOOKUP | ||
666 | bool "nslookup" | ||
667 | default y | ||
668 | help | ||
669 | nslookup is a tool to query Internet name servers. | ||
670 | |||
671 | config NTPD | ||
672 | bool "ntpd" | ||
673 | default y | ||
674 | select PLATFORM_LINUX | ||
675 | help | ||
676 | The NTP client/server daemon. | ||
677 | |||
678 | config FEATURE_NTPD_SERVER | ||
679 | bool "Make ntpd usable as a NTP server" | ||
680 | default y | ||
681 | depends on NTPD | ||
682 | help | ||
683 | Make ntpd usable as a NTP server. If you disable this option | ||
684 | ntpd will be usable only as a NTP client. | ||
685 | |||
686 | config FEATURE_NTPD_CONF | ||
687 | bool "Make ntpd understand /etc/ntp.conf" | ||
688 | default y | ||
689 | depends on NTPD | ||
690 | help | ||
691 | Make ntpd look in /etc/ntp.conf for peers. Only "server address" | ||
692 | is supported. | ||
693 | |||
694 | config PSCAN | ||
695 | bool "pscan" | ||
696 | default y | ||
697 | help | ||
698 | Simple network port scanner. | ||
699 | |||
700 | config ROUTE | ||
701 | bool "route" | ||
702 | default y | ||
703 | select PLATFORM_LINUX | ||
704 | help | ||
705 | Route displays or manipulates the kernel's IP routing tables. | ||
706 | |||
707 | config SLATTACH | ||
708 | bool "slattach" | ||
709 | default y | ||
710 | select PLATFORM_LINUX | ||
711 | help | ||
712 | slattach is a small utility to attach network interfaces to serial | ||
713 | lines. | ||
714 | |||
715 | #config TC | ||
716 | # bool "tc" | ||
717 | # default y | ||
718 | # help | ||
719 | # show / manipulate traffic control settings | ||
720 | # | ||
721 | #config FEATURE_TC_INGRESS | ||
722 | # def_bool n | ||
723 | # depends on TC | ||
724 | |||
725 | config TCPSVD | ||
726 | bool "tcpsvd" | ||
727 | default y | ||
728 | help | ||
729 | tcpsvd listens on a TCP port and runs a program for each new | ||
730 | connection. | ||
731 | |||
732 | config TELNET | ||
733 | bool "telnet" | ||
734 | default y | ||
735 | help | ||
736 | Telnet is an interface to the TELNET protocol, but is also commonly | ||
737 | used to test other simple protocols. | ||
738 | |||
739 | config FEATURE_TELNET_TTYPE | ||
740 | bool "Pass TERM type to remote host" | ||
741 | default y | ||
742 | depends on TELNET | ||
743 | help | ||
744 | Setting this option will forward the TERM environment variable to the | ||
745 | remote host you are connecting to. This is useful to make sure that | ||
746 | things like ANSI colors and other control sequences behave. | ||
747 | |||
748 | config FEATURE_TELNET_AUTOLOGIN | ||
749 | bool "Pass USER type to remote host" | ||
750 | default y | ||
751 | depends on TELNET | ||
752 | help | ||
753 | Setting this option will forward the USER environment variable to the | ||
754 | remote host you are connecting to. This is useful when you need to | ||
755 | log into a machine without telling the username (autologin). This | ||
756 | option enables `-a' and `-l USER' arguments. | ||
757 | |||
758 | config TELNETD | ||
759 | bool "telnetd" | ||
760 | default y | ||
761 | select FEATURE_SYSLOG | ||
762 | help | ||
763 | A daemon for the TELNET protocol, allowing you to log onto the host | ||
764 | running the daemon. Please keep in mind that the TELNET protocol | ||
765 | sends passwords in plain text. If you can't afford the space for an | ||
766 | SSH daemon and you trust your network, you may say 'y' here. As a | ||
767 | more secure alternative, you should seriously consider installing the | ||
768 | very small Dropbear SSH daemon instead: | ||
769 | http://matt.ucc.asn.au/dropbear/dropbear.html | ||
770 | |||
771 | Note that for busybox telnetd to work you need several things: | ||
772 | First of all, your kernel needs: | ||
773 | CONFIG_UNIX98_PTYS=y | ||
774 | |||
775 | Next, you need a /dev/pts directory on your root filesystem: | ||
776 | |||
777 | $ ls -ld /dev/pts | ||
778 | drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/ | ||
779 | |||
780 | Next you need the pseudo terminal master multiplexer /dev/ptmx: | ||
781 | |||
782 | $ ls -la /dev/ptmx | ||
783 | crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx | ||
784 | |||
785 | Any /dev/ttyp[0-9]* files you may have can be removed. | ||
786 | Next, you need to mount the devpts filesystem on /dev/pts using: | ||
787 | |||
788 | mount -t devpts devpts /dev/pts | ||
789 | |||
790 | You need to be sure that busybox has LOGIN and | ||
791 | FEATURE_SUID enabled. And finally, you should make | ||
792 | certain that Busybox has been installed setuid root: | ||
793 | |||
794 | chown root.root /bin/busybox | ||
795 | chmod 4755 /bin/busybox | ||
796 | |||
797 | with all that done, telnetd _should_ work.... | ||
798 | |||
799 | |||
800 | config FEATURE_TELNETD_STANDALONE | ||
801 | bool "Support standalone telnetd (not inetd only)" | ||
802 | default y | ||
803 | depends on TELNETD | ||
804 | help | ||
805 | Selecting this will make telnetd able to run standalone. | ||
806 | |||
807 | config FEATURE_TELNETD_INETD_WAIT | ||
808 | bool "Support -w SEC option (inetd wait mode)" | ||
809 | default y | ||
810 | depends on FEATURE_TELNETD_STANDALONE | ||
811 | help | ||
812 | This option allows you to run telnetd in "inet wait" mode. | ||
813 | Example inetd.conf line (note "wait", not usual "nowait"): | ||
814 | |||
815 | telnet stream tcp wait root /bin/telnetd telnetd -w10 | ||
816 | |||
817 | In this example, inetd passes _listening_ socket_ as fd 0 | ||
818 | to telnetd when connection appears. | ||
819 | telnetd will wait for connections until all existing | ||
820 | connections are closed, and no new connections | ||
821 | appear during 10 seconds. Then it exits, and inetd continues | ||
822 | to listen for new connections. | ||
823 | |||
824 | This option is rarely used. "tcp nowait" is much more usual | ||
825 | way of running tcp services, including telnetd. | ||
826 | You most probably want to say N here. | ||
827 | |||
828 | config TFTP | ||
829 | bool "tftp" | ||
830 | default y | ||
831 | help | ||
832 | This enables the Trivial File Transfer Protocol client program. TFTP | ||
833 | is usually used for simple, small transfers such as a root image | ||
834 | for a network-enabled bootloader. | ||
835 | |||
836 | config TFTPD | ||
837 | bool "tftpd" | ||
838 | default y | ||
839 | help | ||
840 | This enables the Trivial File Transfer Protocol server program. | ||
841 | It expects that stdin is a datagram socket and a packet | ||
842 | is already pending on it. It will exit after one transfer. | ||
843 | In other words: it should be run from inetd in nowait mode, | ||
844 | or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR" | ||
845 | |||
846 | comment "Common options for tftp/tftpd" | ||
847 | depends on TFTP || TFTPD | ||
848 | |||
849 | config FEATURE_TFTP_GET | ||
850 | bool "Enable 'tftp get' and/or tftpd upload code" | ||
851 | default y | ||
852 | depends on TFTP || TFTPD | ||
853 | help | ||
854 | Add support for the GET command within the TFTP client. This allows | ||
855 | a client to retrieve a file from a TFTP server. | ||
856 | Also enable upload support in tftpd, if tftpd is selected. | ||
857 | |||
858 | Note: this option does _not_ make tftpd capable of download | ||
859 | (the usual operation people need from it)! | ||
860 | |||
861 | config FEATURE_TFTP_PUT | ||
862 | bool "Enable 'tftp put' and/or tftpd download code" | ||
863 | default y | ||
864 | depends on TFTP || TFTPD | ||
865 | help | ||
866 | Add support for the PUT command within the TFTP client. This allows | ||
867 | a client to transfer a file to a TFTP server. | ||
868 | Also enable download support in tftpd, if tftpd is selected. | ||
869 | |||
870 | config FEATURE_TFTP_BLOCKSIZE | ||
871 | bool "Enable 'blksize' and 'tsize' protocol options" | ||
872 | default y | ||
873 | depends on TFTP || TFTPD | ||
874 | help | ||
875 | Allow tftp to specify block size, and tftpd to understand | ||
876 | "blksize" and "tsize" options. | ||
877 | |||
878 | config FEATURE_TFTP_PROGRESS_BAR | ||
879 | bool "Enable tftp progress meter" | ||
880 | default y | ||
881 | depends on TFTP && FEATURE_TFTP_BLOCKSIZE | ||
882 | help | ||
883 | Show progress bar. | ||
884 | |||
885 | config TFTP_DEBUG | ||
886 | bool "Enable debug" | ||
887 | default n | ||
888 | depends on TFTP || TFTPD | ||
889 | help | ||
890 | Make tftp[d] print debugging messages on stderr. | ||
891 | This is useful if you are diagnosing a bug in tftp[d]. | ||
892 | |||
893 | config TRACEROUTE | ||
894 | bool "traceroute" | ||
895 | default y | ||
896 | select PLATFORM_LINUX | ||
897 | help | ||
898 | Utility to trace the route of IP packets. | ||
899 | |||
900 | config TRACEROUTE6 | ||
901 | bool "traceroute6" | ||
902 | default y | ||
903 | depends on FEATURE_IPV6 && TRACEROUTE | ||
904 | help | ||
905 | Utility to trace the route of IPv6 packets. | ||
906 | |||
907 | config FEATURE_TRACEROUTE_VERBOSE | ||
908 | bool "Enable verbose output" | ||
909 | default y | ||
910 | depends on TRACEROUTE | ||
911 | help | ||
912 | Add some verbosity to traceroute. This includes among other things | ||
913 | hostnames and ICMP response types. | ||
914 | |||
915 | config FEATURE_TRACEROUTE_USE_ICMP | ||
916 | bool "Enable -I option (use ICMP instead of UDP)" | ||
917 | default y | ||
918 | depends on TRACEROUTE | ||
919 | help | ||
920 | Add option -I to use ICMP ECHO instead of UDP datagrams. | ||
921 | |||
922 | config TUNCTL | ||
923 | bool "tunctl" | ||
924 | default y | ||
925 | select PLATFORM_LINUX | ||
926 | help | ||
927 | tunctl creates or deletes tun devices. | ||
928 | |||
929 | config FEATURE_TUNCTL_UG | ||
930 | bool "Support owner:group assignment" | ||
931 | default y | ||
932 | depends on TUNCTL | ||
933 | help | ||
934 | Allow to specify owner and group of newly created interface. | ||
935 | 340 bytes of pure bloat. Say no here. | ||
936 | 50 | ||
937 | source networking/udhcp/Config.in | 51 | source networking/udhcp/Config.in |
938 | 52 | ||
@@ -945,31 +59,4 @@ config IFUPDOWN_UDHCPC_CMD_OPTIONS | |||
945 | Intended to alter options not available in /etc/network/interfaces. | 59 | Intended to alter options not available in /etc/network/interfaces. |
946 | (IE: --syslog --background etc...) | 60 | (IE: --syslog --background etc...) |
947 | 61 | ||
948 | config UDPSVD | ||
949 | bool "udpsvd" | ||
950 | default y | ||
951 | help | ||
952 | udpsvd listens on an UDP port and runs a program for each new | ||
953 | connection. | ||
954 | |||
955 | config VCONFIG | ||
956 | bool "vconfig" | ||
957 | default y | ||
958 | select PLATFORM_LINUX | ||
959 | help | ||
960 | Creates, removes, and configures VLAN interfaces | ||
961 | |||
962 | config ZCIP | ||
963 | bool "zcip" | ||
964 | default y | ||
965 | select PLATFORM_LINUX | ||
966 | select FEATURE_SYSLOG | ||
967 | help | ||
968 | ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927. | ||
969 | It's a daemon that allocates and defends a dynamically assigned | ||
970 | address on the 169.254/16 network, requiring no system administrator. | ||
971 | |||
972 | See http://www.zeroconf.org for further details, and "zcip.script" | ||
973 | in the busybox examples. | ||
974 | |||
975 | endmenu | 62 | endmenu |
diff --git a/networking/Kbuild.src b/networking/Kbuild.src index 79f54824b..6b4fb7470 100644 --- a/networking/Kbuild.src +++ b/networking/Kbuild.src | |||
@@ -7,41 +7,3 @@ | |||
7 | lib-y:= | 7 | lib-y:= |
8 | 8 | ||
9 | INSERT | 9 | INSERT |
10 | lib-$(CONFIG_ARP) += arp.o interface.o | ||
11 | lib-$(CONFIG_ARPING) += arping.o | ||
12 | lib-$(CONFIG_BRCTL) += brctl.o | ||
13 | lib-$(CONFIG_DNSD) += dnsd.o | ||
14 | lib-$(CONFIG_ETHER_WAKE) += ether-wake.o | ||
15 | lib-$(CONFIG_FAKEIDENTD) += isrv_identd.o isrv.o | ||
16 | lib-$(CONFIG_FTPD) += ftpd.o | ||
17 | lib-$(CONFIG_FTPGET) += ftpgetput.o | ||
18 | lib-$(CONFIG_FTPPUT) += ftpgetput.o | ||
19 | lib-$(CONFIG_HOSTNAME) += hostname.o | ||
20 | lib-$(CONFIG_HTTPD) += httpd.o | ||
21 | lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o | ||
22 | lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o | ||
23 | lib-$(CONFIG_IFPLUGD) += ifplugd.o | ||
24 | lib-$(CONFIG_IFUPDOWN) += ifupdown.o | ||
25 | lib-$(CONFIG_INETD) += inetd.o | ||
26 | lib-$(CONFIG_IP) += ip.o | ||
27 | lib-$(CONFIG_IPCALC) += ipcalc.o | ||
28 | lib-$(CONFIG_NAMEIF) += nameif.o | ||
29 | lib-$(CONFIG_NC) += nc.o | ||
30 | lib-$(CONFIG_NETSTAT) += netstat.o | ||
31 | lib-$(CONFIG_NSLOOKUP) += nslookup.o | ||
32 | lib-$(CONFIG_NTPD) += ntpd.o | ||
33 | lib-$(CONFIG_PSCAN) += pscan.o | ||
34 | lib-$(CONFIG_ROUTE) += route.o | ||
35 | lib-$(CONFIG_SLATTACH) += slattach.o | ||
36 | lib-$(CONFIG_TC) += tc.o | ||
37 | lib-$(CONFIG_TELNET) += telnet.o | ||
38 | lib-$(CONFIG_TELNETD) += telnetd.o | ||
39 | lib-$(CONFIG_TFTP) += tftp.o | ||
40 | lib-$(CONFIG_TFTPD) += tftp.o | ||
41 | lib-$(CONFIG_TRACEROUTE) += traceroute.o | ||
42 | lib-$(CONFIG_TUNCTL) += tunctl.o | ||
43 | lib-$(CONFIG_VCONFIG) += vconfig.o | ||
44 | lib-$(CONFIG_ZCIP) += zcip.o | ||
45 | |||
46 | lib-$(CONFIG_TCPSVD) += tcpudp.o tcpudp_perhost.o | ||
47 | lib-$(CONFIG_UDPSVD) += tcpudp.o tcpudp_perhost.o | ||
diff --git a/networking/arp.c b/networking/arp.c index 69a5816eb..a62a3761c 100644 --- a/networking/arp.c +++ b/networking/arp.c | |||
@@ -12,6 +12,16 @@ | |||
12 | * | 12 | * |
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 | //config:config ARP | ||
16 | //config: bool "arp" | ||
17 | //config: default y | ||
18 | //config: select PLATFORM_LINUX | ||
19 | //config: help | ||
20 | //config: Manipulate the system ARP cache. | ||
21 | |||
22 | //applet:IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) | ||
23 | |||
24 | //kbuild:lib-$(CONFIG_ARP) += arp.o interface.o | ||
15 | 25 | ||
16 | //usage:#define arp_trivial_usage | 26 | //usage:#define arp_trivial_usage |
17 | //usage: "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]" | 27 | //usage: "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]" |
diff --git a/networking/arping.c b/networking/arping.c index 46bd65e36..5bfeb1b45 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -5,6 +5,17 @@ | |||
5 | * Author: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> | 5 | * Author: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> |
6 | * Busybox port: Nick Fedchik <nick@fedchik.org.ua> | 6 | * Busybox port: Nick Fedchik <nick@fedchik.org.ua> |
7 | */ | 7 | */ |
8 | //config:config ARPING | ||
9 | //config: bool "arping" | ||
10 | //config: default y | ||
11 | //config: select PLATFORM_LINUX | ||
12 | //config: help | ||
13 | //config: Ping hosts by ARP packets. | ||
14 | //config: | ||
15 | |||
16 | //applet:IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
17 | |||
18 | //kbuild:lib-$(CONFIG_ARPING) += arping.o | ||
8 | 19 | ||
9 | //usage:#define arping_trivial_usage | 20 | //usage:#define arping_trivial_usage |
10 | //usage: "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP" | 21 | //usage: "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP" |
diff --git a/networking/brctl.c b/networking/brctl.c index b7320966a..35876896e 100644 --- a/networking/brctl.c +++ b/networking/brctl.c | |||
@@ -12,6 +12,36 @@ | |||
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 | //config:config BRCTL | ||
16 | //config: bool "brctl" | ||
17 | //config: default y | ||
18 | //config: select PLATFORM_LINUX | ||
19 | //config: help | ||
20 | //config: Manage ethernet bridges. | ||
21 | //config: Supports addbr/delbr and addif/delif. | ||
22 | //config: | ||
23 | //config:config FEATURE_BRCTL_FANCY | ||
24 | //config: bool "Fancy options" | ||
25 | //config: default y | ||
26 | //config: depends on BRCTL | ||
27 | //config: help | ||
28 | //config: Add support for extended option like: | ||
29 | //config: setageing, setfd, sethello, setmaxage, | ||
30 | //config: setpathcost, setportprio, setbridgeprio, | ||
31 | //config: stp | ||
32 | //config: This adds about 600 bytes. | ||
33 | //config: | ||
34 | //config:config FEATURE_BRCTL_SHOW | ||
35 | //config: bool "Support show" | ||
36 | //config: default y | ||
37 | //config: depends on BRCTL && FEATURE_BRCTL_FANCY | ||
38 | //config: help | ||
39 | //config: Add support for option which prints the current config: | ||
40 | //config: show | ||
41 | |||
42 | //applet:IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
43 | |||
44 | //kbuild:lib-$(CONFIG_BRCTL) += brctl.o | ||
15 | 45 | ||
16 | //usage:#define brctl_trivial_usage | 46 | //usage:#define brctl_trivial_usage |
17 | //usage: "COMMAND [BRIDGE [INTERFACE]]" | 47 | //usage: "COMMAND [BRIDGE [INTERFACE]]" |
diff --git a/networking/dnsd.c b/networking/dnsd.c index 923ad6bc6..7be90018d 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c | |||
@@ -16,6 +16,15 @@ | |||
16 | * Some bugfix and minor changes was applied by Roberto A. Foglietta who made | 16 | * Some bugfix and minor changes was applied by Roberto A. Foglietta who made |
17 | * the first porting of oao' scdns to busybox also. | 17 | * the first porting of oao' scdns to busybox also. |
18 | */ | 18 | */ |
19 | //config:config DNSD | ||
20 | //config: bool "dnsd" | ||
21 | //config: default y | ||
22 | //config: help | ||
23 | //config: Small and static DNS server daemon. | ||
24 | |||
25 | //applet:IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
26 | |||
27 | //kbuild:lib-$(CONFIG_DNSD) += dnsd.o | ||
19 | 28 | ||
20 | //usage:#define dnsd_trivial_usage | 29 | //usage:#define dnsd_trivial_usage |
21 | //usage: "[-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR]" | 30 | //usage: "[-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR]" |
diff --git a/networking/ether-wake.c b/networking/ether-wake.c index c38547dda..d7d691772 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c | |||
@@ -63,6 +63,16 @@ | |||
63 | * doing so only works with adapters configured for unicast+broadcast Rx | 63 | * doing so only works with adapters configured for unicast+broadcast Rx |
64 | * filter. That configuration consumes more power. | 64 | * filter. That configuration consumes more power. |
65 | */ | 65 | */ |
66 | //config:config ETHER_WAKE | ||
67 | //config: bool "ether-wake" | ||
68 | //config: default y | ||
69 | //config: select PLATFORM_LINUX | ||
70 | //config: help | ||
71 | //config: Send a magic packet to wake up sleeping machines. | ||
72 | |||
73 | //applet:IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_SBIN, BB_SUID_DROP, ether_wake)) | ||
74 | |||
75 | //kbuild:lib-$(CONFIG_ETHER_WAKE) += ether-wake.o | ||
66 | 76 | ||
67 | //usage:#define ether_wake_trivial_usage | 77 | //usage:#define ether_wake_trivial_usage |
68 | //usage: "[-b] [-i IFACE] [-p aa:bb:cc:dd[:ee:ff]/a.b.c.d] MAC" | 78 | //usage: "[-b] [-i IFACE] [-p aa:bb:cc:dd[:ee:ff]/a.b.c.d] MAC" |
diff --git a/networking/ftpd.c b/networking/ftpd.c index 4cbb9b6fe..bcd60a2ad 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -11,6 +11,40 @@ | |||
11 | * | 11 | * |
12 | * You have to run this daemon via inetd. | 12 | * You have to run this daemon via inetd. |
13 | */ | 13 | */ |
14 | //config:config FTPD | ||
15 | //config: bool "ftpd" | ||
16 | //config: default y | ||
17 | //config: help | ||
18 | //config: simple FTP daemon. You have to run it via inetd. | ||
19 | //config: | ||
20 | //config:config FEATURE_FTPD_WRITE | ||
21 | //config: bool "Enable upload commands" | ||
22 | //config: default y | ||
23 | //config: depends on FTPD | ||
24 | //config: help | ||
25 | //config: Enable all kinds of FTP upload commands (-w option) | ||
26 | //config: | ||
27 | //config:config FEATURE_FTPD_ACCEPT_BROKEN_LIST | ||
28 | //config: bool "Enable workaround for RFC-violating clients" | ||
29 | //config: default y | ||
30 | //config: depends on FTPD | ||
31 | //config: help | ||
32 | //config: Some ftp clients (among them KDE's Konqueror) issue illegal | ||
33 | //config: "LIST -l" requests. This option works around such problems. | ||
34 | //config: It might prevent you from listing files starting with "-" and | ||
35 | //config: it increases the code size by ~40 bytes. | ||
36 | //config: Most other ftp servers seem to behave similar to this. | ||
37 | //config: | ||
38 | //config:config FEATURE_FTPD_AUTHENTICATION | ||
39 | //config: bool "Enable authentication" | ||
40 | //config: default y | ||
41 | //config: depends on FTPD | ||
42 | //config: help | ||
43 | //config: Enable basic system login as seen in telnet etc. | ||
44 | |||
45 | //applet:IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
46 | |||
47 | //kbuild:lib-$(CONFIG_FTPD) += ftpd.o | ||
14 | 48 | ||
15 | //usage:#define ftpd_trivial_usage | 49 | //usage:#define ftpd_trivial_usage |
16 | //usage: "[-wvS] [-t N] [-T N] [DIR]" | 50 | //usage: "[-wvS] [-t N] [-T N] [DIR]" |
@@ -117,7 +151,7 @@ struct globals { | |||
117 | len_and_sockaddr *port_addr; | 151 | len_and_sockaddr *port_addr; |
118 | char *ftp_cmd; | 152 | char *ftp_cmd; |
119 | char *ftp_arg; | 153 | char *ftp_arg; |
120 | #if ENABLE_FEATURE_FTP_WRITE | 154 | #if ENABLE_FEATURE_FTPD_WRITE |
121 | char *rnfr_filename; | 155 | char *rnfr_filename; |
122 | #endif | 156 | #endif |
123 | /* We need these aligned to uint32_t */ | 157 | /* We need these aligned to uint32_t */ |
@@ -831,7 +865,7 @@ handle_size_or_mdtm(int need_size) | |||
831 | 865 | ||
832 | /* Upload commands */ | 866 | /* Upload commands */ |
833 | 867 | ||
834 | #if ENABLE_FEATURE_FTP_WRITE | 868 | #if ENABLE_FEATURE_FTPD_WRITE |
835 | static void | 869 | static void |
836 | handle_mkd(void) | 870 | handle_mkd(void) |
837 | { | 871 | { |
@@ -974,7 +1008,7 @@ handle_stou(void) | |||
974 | G.restart_pos = 0; | 1008 | G.restart_pos = 0; |
975 | handle_upload_common(0, 1); | 1009 | handle_upload_common(0, 1); |
976 | } | 1010 | } |
977 | #endif /* ENABLE_FEATURE_FTP_WRITE */ | 1011 | #endif /* ENABLE_FEATURE_FTPD_WRITE */ |
978 | 1012 | ||
979 | static uint32_t | 1013 | static uint32_t |
980 | cmdio_get_cmd_and_arg(void) | 1014 | cmdio_get_cmd_and_arg(void) |
@@ -1108,7 +1142,7 @@ enum { | |||
1108 | #endif | 1142 | #endif |
1109 | OPT_v = (1 << ((!BB_MMU) * 3 + 0)), | 1143 | OPT_v = (1 << ((!BB_MMU) * 3 + 0)), |
1110 | OPT_S = (1 << ((!BB_MMU) * 3 + 1)), | 1144 | OPT_S = (1 << ((!BB_MMU) * 3 + 1)), |
1111 | OPT_w = (1 << ((!BB_MMU) * 3 + 2)) * ENABLE_FEATURE_FTP_WRITE, | 1145 | OPT_w = (1 << ((!BB_MMU) * 3 + 2)) * ENABLE_FEATURE_FTPD_WRITE, |
1112 | }; | 1146 | }; |
1113 | 1147 | ||
1114 | int ftpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1148 | int ftpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
@@ -1118,7 +1152,7 @@ int ftpd_main(int argc, char **argv) | |||
1118 | int ftpd_main(int argc UNUSED_PARAM, char **argv) | 1152 | int ftpd_main(int argc UNUSED_PARAM, char **argv) |
1119 | #endif | 1153 | #endif |
1120 | { | 1154 | { |
1121 | #if ENABLE_FEATURE_FTP_AUTHENTICATION | 1155 | #if ENABLE_FEATURE_FTPD_AUTHENTICATION |
1122 | struct passwd *pw = NULL; | 1156 | struct passwd *pw = NULL; |
1123 | #endif | 1157 | #endif |
1124 | unsigned abs_timeout; | 1158 | unsigned abs_timeout; |
@@ -1132,9 +1166,9 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1132 | G.timeout = 2 * 60; | 1166 | G.timeout = 2 * 60; |
1133 | opt_complementary = "vv:SS"; | 1167 | opt_complementary = "vv:SS"; |
1134 | #if BB_MMU | 1168 | #if BB_MMU |
1135 | opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S); | 1169 | opts = getopt32(argv, "vS" IF_FEATURE_FTPD_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S); |
1136 | #else | 1170 | #else |
1137 | opts = getopt32(argv, "l1AvS" IF_FEATURE_FTP_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S); | 1171 | opts = getopt32(argv, "l1AvS" IF_FEATURE_FTPD_WRITE("w") "t:+T:+", &G.timeout, &abs_timeout, &G.verbose, &verbose_S); |
1138 | if (opts & (OPT_l|OPT_1)) { | 1172 | if (opts & (OPT_l|OPT_1)) { |
1139 | /* Our secret backdoor to ls */ | 1173 | /* Our secret backdoor to ls */ |
1140 | /* TODO: pass --group-directories-first? would be nice, but ls doesn't do that yet */ | 1174 | /* TODO: pass --group-directories-first? would be nice, but ls doesn't do that yet */ |
@@ -1197,7 +1231,7 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1197 | WRITE_OK(FTP_GREET); | 1231 | WRITE_OK(FTP_GREET); |
1198 | signal(SIGALRM, timeout_handler); | 1232 | signal(SIGALRM, timeout_handler); |
1199 | 1233 | ||
1200 | #if ENABLE_FEATURE_FTP_AUTHENTICATION | 1234 | #if ENABLE_FEATURE_FTPD_AUTHENTICATION |
1201 | while (1) { | 1235 | while (1) { |
1202 | uint32_t cmdval = cmdio_get_cmd_and_arg(); | 1236 | uint32_t cmdval = cmdio_get_cmd_and_arg(); |
1203 | if (cmdval == const_USER) { | 1237 | if (cmdval == const_USER) { |
@@ -1247,7 +1281,7 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1247 | xchdir(basedir); | 1281 | xchdir(basedir); |
1248 | } | 1282 | } |
1249 | 1283 | ||
1250 | #if ENABLE_FEATURE_FTP_AUTHENTICATION | 1284 | #if ENABLE_FEATURE_FTPD_AUTHENTICATION |
1251 | change_identity(pw); | 1285 | change_identity(pw); |
1252 | #endif | 1286 | #endif |
1253 | 1287 | ||
@@ -1354,7 +1388,7 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1354 | handle_port(); | 1388 | handle_port(); |
1355 | else if (cmdval == const_REST) | 1389 | else if (cmdval == const_REST) |
1356 | handle_rest(); | 1390 | handle_rest(); |
1357 | #if ENABLE_FEATURE_FTP_WRITE | 1391 | #if ENABLE_FEATURE_FTPD_WRITE |
1358 | else if (opts & OPT_w) { | 1392 | else if (opts & OPT_w) { |
1359 | if (cmdval == const_STOR) | 1393 | if (cmdval == const_STOR) |
1360 | handle_stor(); | 1394 | handle_stor(); |
@@ -1394,7 +1428,7 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1394 | * (doesn't necessarily mean "we must support them") | 1428 | * (doesn't necessarily mean "we must support them") |
1395 | * foo 1.2.3: XXXX - comment | 1429 | * foo 1.2.3: XXXX - comment |
1396 | */ | 1430 | */ |
1397 | #if ENABLE_FEATURE_FTP_WRITE | 1431 | #if ENABLE_FEATURE_FTPD_WRITE |
1398 | bad_cmd: | 1432 | bad_cmd: |
1399 | #endif | 1433 | #endif |
1400 | cmdio_write_raw(STR(FTP_BADCMD)" Unknown command\r\n"); | 1434 | cmdio_write_raw(STR(FTP_BADCMD)" Unknown command\r\n"); |
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 0bfe388a8..0b06f85b4 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c | |||
@@ -12,6 +12,30 @@ | |||
12 | * | 12 | * |
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 | //config:config FTPGET | ||
16 | //config: bool "ftpget" | ||
17 | //config: default y | ||
18 | //config: help | ||
19 | //config: Retrieve a remote file via FTP. | ||
20 | //config: | ||
21 | //config:config FTPPUT | ||
22 | //config: bool "ftpput" | ||
23 | //config: default y | ||
24 | //config: help | ||
25 | //config: Store a remote file via FTP. | ||
26 | //config: | ||
27 | //config:config FEATURE_FTPGETPUT_LONG_OPTIONS | ||
28 | //config: bool "Enable long options in ftpget/ftpput" | ||
29 | //config: default y | ||
30 | //config: depends on LONG_OPTS && (FTPGET || FTPPUT) | ||
31 | //config: help | ||
32 | //config: Support long options for the ftpget/ftpput applet. | ||
33 | |||
34 | //applet:IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) | ||
35 | //applet:IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) | ||
36 | |||
37 | //kbuild:lib-$(CONFIG_FTPGET) += ftpgetput.o | ||
38 | //kbuild:lib-$(CONFIG_FTPPUT) += ftpgetput.o | ||
15 | 39 | ||
16 | //usage:#define ftpget_trivial_usage | 40 | //usage:#define ftpget_trivial_usage |
17 | //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" | 41 | //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" |
diff --git a/networking/hostname.c b/networking/hostname.c index b3e352242..04a051ede 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -10,6 +10,24 @@ | |||
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 | 12 | ||
13 | //config:config HOSTNAME | ||
14 | //config: bool "hostname" | ||
15 | //config: default y | ||
16 | //config: help | ||
17 | //config: Show or set the system's host name. | ||
18 | //config: | ||
19 | //config:config DNSDOMAINNAME | ||
20 | //config: bool "dnsdomainname" | ||
21 | //config: default y | ||
22 | //config: help | ||
23 | //config: Alias to "hostname -d". | ||
24 | |||
25 | //applet:IF_DNSDOMAINNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) | ||
26 | //applet:IF_HOSTNAME(APPLET(hostname, BB_DIR_BIN, BB_SUID_DROP)) | ||
27 | |||
28 | //kbuild: lib-$(CONFIG_HOSTNAME) += hostname.o | ||
29 | //kbuild: lib-$(CONFIG_DNSDOMAINNAME) += hostname.o | ||
30 | |||
13 | //usage:#define hostname_trivial_usage | 31 | //usage:#define hostname_trivial_usage |
14 | //usage: "[OPTIONS] [HOSTNAME | -F FILE]" | 32 | //usage: "[OPTIONS] [HOSTNAME | -F FILE]" |
15 | //usage:#define hostname_full_usage "\n\n" | 33 | //usage:#define hostname_full_usage "\n\n" |
@@ -131,8 +149,12 @@ int hostname_main(int argc UNUSED_PARAM, char **argv) | |||
131 | opts = getopt32(argv, "dfisF:v", &hostname_str); | 149 | opts = getopt32(argv, "dfisF:v", &hostname_str); |
132 | argv += optind; | 150 | argv += optind; |
133 | buf = safe_gethostname(); | 151 | buf = safe_gethostname(); |
134 | if (applet_name[0] == 'd') /* dnsdomainname? */ | 152 | if (ENABLE_DNSDOMAINNAME) { |
135 | opts = OPT_d; | 153 | if (!ENABLE_HOSTNAME || applet_name[0] == 'd') { |
154 | /* dnsdomainname */ | ||
155 | opts = OPT_d; | ||
156 | } | ||
157 | } | ||
136 | 158 | ||
137 | if (opts & OPT_dfi) { | 159 | if (opts & OPT_dfi) { |
138 | /* Cases when we need full hostname (or its part) */ | 160 | /* Cases when we need full hostname (or its part) */ |
diff --git a/networking/httpd.c b/networking/httpd.c index abe83a458..d301d598d 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -98,6 +98,128 @@ | |||
98 | * | 98 | * |
99 | */ | 99 | */ |
100 | /* TODO: use TCP_CORK, parse_config() */ | 100 | /* TODO: use TCP_CORK, parse_config() */ |
101 | //config:config HTTPD | ||
102 | //config: bool "httpd" | ||
103 | //config: default y | ||
104 | //config: help | ||
105 | //config: Serve web pages via an HTTP server. | ||
106 | //config: | ||
107 | //config:config FEATURE_HTTPD_RANGES | ||
108 | //config: bool "Support 'Ranges:' header" | ||
109 | //config: default y | ||
110 | //config: depends on HTTPD | ||
111 | //config: help | ||
112 | //config: Makes httpd emit "Accept-Ranges: bytes" header and understand | ||
113 | //config: "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted | ||
114 | //config: downloads, seeking in multimedia players etc. | ||
115 | //config: | ||
116 | //config:config FEATURE_HTTPD_SETUID | ||
117 | //config: bool "Enable -u <user> option" | ||
118 | //config: default y | ||
119 | //config: depends on HTTPD | ||
120 | //config: help | ||
121 | //config: This option allows the server to run as a specific user | ||
122 | //config: rather than defaulting to the user that starts the server. | ||
123 | //config: Use of this option requires special privileges to change to a | ||
124 | //config: different user. | ||
125 | //config: | ||
126 | //config:config FEATURE_HTTPD_BASIC_AUTH | ||
127 | //config: bool "Enable Basic http Authentication" | ||
128 | //config: default y | ||
129 | //config: depends on HTTPD | ||
130 | //config: help | ||
131 | //config: Utilizes password settings from /etc/httpd.conf for basic | ||
132 | //config: authentication on a per url basis. | ||
133 | //config: Example for httpd.conf file: | ||
134 | //config: /adm:toor:PaSsWd | ||
135 | //config: | ||
136 | //config:config FEATURE_HTTPD_AUTH_MD5 | ||
137 | //config: bool "Support MD5 crypted passwords for http Authentication" | ||
138 | //config: default y | ||
139 | //config: depends on FEATURE_HTTPD_BASIC_AUTH | ||
140 | //config: help | ||
141 | //config: Enables encrypted passwords, and wildcard user/passwords | ||
142 | //config: in httpd.conf file. | ||
143 | //config: User '*' means 'any system user name is ok', | ||
144 | //config: password of '*' means 'use system password for this user' | ||
145 | //config: Examples: | ||
146 | //config: /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 | ||
147 | //config: /adm:root:* | ||
148 | //config: /wiki:*:* | ||
149 | //config: | ||
150 | //config:config FEATURE_HTTPD_CGI | ||
151 | //config: bool "Support Common Gateway Interface (CGI)" | ||
152 | //config: default y | ||
153 | //config: depends on HTTPD | ||
154 | //config: help | ||
155 | //config: This option allows scripts and executables to be invoked | ||
156 | //config: when specific URLs are requested. | ||
157 | //config: | ||
158 | //config:config FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR | ||
159 | //config: bool "Support for running scripts through an interpreter" | ||
160 | //config: default y | ||
161 | //config: depends on FEATURE_HTTPD_CGI | ||
162 | //config: help | ||
163 | //config: This option enables support for running scripts through an | ||
164 | //config: interpreter. Turn this on if you want PHP scripts to work | ||
165 | //config: properly. You need to supply an additional line in your | ||
166 | //config: httpd.conf file: | ||
167 | //config: *.php:/path/to/your/php | ||
168 | //config: | ||
169 | //config:config FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV | ||
170 | //config: bool "Set REMOTE_PORT environment variable for CGI" | ||
171 | //config: default y | ||
172 | //config: depends on FEATURE_HTTPD_CGI | ||
173 | //config: help | ||
174 | //config: Use of this option can assist scripts in generating | ||
175 | //config: references that contain a unique port number. | ||
176 | //config: | ||
177 | //config:config FEATURE_HTTPD_ENCODE_URL_STR | ||
178 | //config: bool "Enable -e option (useful for CGIs written as shell scripts)" | ||
179 | //config: default y | ||
180 | //config: depends on HTTPD | ||
181 | //config: help | ||
182 | //config: This option allows html encoding of arbitrary strings for display | ||
183 | //config: by the browser. Output goes to stdout. | ||
184 | //config: For example, httpd -e "<Hello World>" produces | ||
185 | //config: "<Hello World>". | ||
186 | //config: | ||
187 | //config:config FEATURE_HTTPD_ERROR_PAGES | ||
188 | //config: bool "Support for custom error pages" | ||
189 | //config: default y | ||
190 | //config: depends on HTTPD | ||
191 | //config: help | ||
192 | //config: This option allows you to define custom error pages in | ||
193 | //config: the configuration file instead of the default HTTP status | ||
194 | //config: error pages. For instance, if you add the line: | ||
195 | //config: E404:/path/e404.html | ||
196 | //config: in the config file, the server will respond the specified | ||
197 | //config: '/path/e404.html' file instead of the terse '404 NOT FOUND' | ||
198 | //config: message. | ||
199 | //config: | ||
200 | //config:config FEATURE_HTTPD_PROXY | ||
201 | //config: bool "Support for reverse proxy" | ||
202 | //config: default y | ||
203 | //config: depends on HTTPD | ||
204 | //config: help | ||
205 | //config: This option allows you to define URLs that will be forwarded | ||
206 | //config: to another HTTP server. To setup add the following line to the | ||
207 | //config: configuration file | ||
208 | //config: P:/url/:http://hostname[:port]/new/path/ | ||
209 | //config: Then a request to /url/myfile will be forwarded to | ||
210 | //config: http://hostname[:port]/new/path/myfile. | ||
211 | //config: | ||
212 | //config:config FEATURE_HTTPD_GZIP | ||
213 | //config: bool "Support for GZIP content encoding" | ||
214 | //config: default y | ||
215 | //config: depends on HTTPD | ||
216 | //config: help | ||
217 | //config: Makes httpd send files using GZIP content encoding if the | ||
218 | //config: client supports it and a pre-compressed <file>.gz exists. | ||
219 | |||
220 | //applet:IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
221 | |||
222 | //kbuild:lib-$(CONFIG_HTTPD) += httpd.o | ||
101 | 223 | ||
102 | //usage:#define httpd_trivial_usage | 224 | //usage:#define httpd_trivial_usage |
103 | //usage: "[-ifv[v]]" | 225 | //usage: "[-ifv[v]]" |
@@ -926,16 +1048,16 @@ static void log_and_exit(void) | |||
926 | static void send_headers(int responseNum) | 1048 | static void send_headers(int responseNum) |
927 | { | 1049 | { |
928 | static const char RFC1123FMT[] ALIGN1 = "%a, %d %b %Y %H:%M:%S GMT"; | 1050 | static const char RFC1123FMT[] ALIGN1 = "%a, %d %b %Y %H:%M:%S GMT"; |
1051 | /* Fixed size 29-byte string. Example: Sun, 06 Nov 1994 08:49:37 GMT */ | ||
1052 | char date_str[40]; /* using a bit larger buffer to paranoia reasons */ | ||
929 | 1053 | ||
930 | const char *responseString = ""; | 1054 | const char *responseString = ""; |
931 | const char *infoString = NULL; | 1055 | const char *infoString = NULL; |
932 | const char *mime_type; | ||
933 | #if ENABLE_FEATURE_HTTPD_ERROR_PAGES | 1056 | #if ENABLE_FEATURE_HTTPD_ERROR_PAGES |
934 | const char *error_page = NULL; | 1057 | const char *error_page = NULL; |
935 | #endif | 1058 | #endif |
936 | unsigned i; | 1059 | unsigned i; |
937 | time_t timer = time(NULL); | 1060 | time_t timer = time(NULL); |
938 | char tmp_str[80]; | ||
939 | int len; | 1061 | int len; |
940 | 1062 | ||
941 | for (i = 0; i < ARRAY_SIZE(http_response_type); i++) { | 1063 | for (i = 0; i < ARRAY_SIZE(http_response_type); i++) { |
@@ -948,25 +1070,33 @@ static void send_headers(int responseNum) | |||
948 | break; | 1070 | break; |
949 | } | 1071 | } |
950 | } | 1072 | } |
951 | /* error message is HTML */ | ||
952 | mime_type = responseNum == HTTP_OK ? | ||
953 | found_mime_type : "text/html"; | ||
954 | 1073 | ||
955 | if (verbose) | 1074 | if (verbose) |
956 | bb_error_msg("response:%u", responseNum); | 1075 | bb_error_msg("response:%u", responseNum); |
957 | 1076 | ||
958 | /* emit the current date */ | 1077 | /* We use sprintf, not snprintf (it's less code). |
959 | strftime(tmp_str, sizeof(tmp_str), RFC1123FMT, gmtime(&timer)); | 1078 | * iobuf[] is several kbytes long and all headers we generate |
1079 | * always fit into those kbytes. | ||
1080 | */ | ||
1081 | |||
1082 | strftime(date_str, sizeof(date_str), RFC1123FMT, gmtime(&timer)); | ||
960 | len = sprintf(iobuf, | 1083 | len = sprintf(iobuf, |
961 | "HTTP/1.0 %d %s\r\nContent-type: %s\r\n" | 1084 | "HTTP/1.0 %d %s\r\n" |
962 | "Date: %s\r\nConnection: close\r\n", | 1085 | "Content-type: %s\r\n" |
963 | responseNum, responseString, mime_type, tmp_str); | 1086 | "Date: %s\r\n" |
1087 | "Connection: close\r\n", | ||
1088 | responseNum, responseString, | ||
1089 | /* if it's error message, then it's HTML */ | ||
1090 | (responseNum == HTTP_OK ? found_mime_type : "text/html"), | ||
1091 | date_str | ||
1092 | ); | ||
964 | 1093 | ||
965 | #if ENABLE_FEATURE_HTTPD_BASIC_AUTH | 1094 | #if ENABLE_FEATURE_HTTPD_BASIC_AUTH |
966 | if (responseNum == HTTP_UNAUTHORIZED) { | 1095 | if (responseNum == HTTP_UNAUTHORIZED) { |
967 | len += sprintf(iobuf + len, | 1096 | len += sprintf(iobuf + len, |
968 | "WWW-Authenticate: Basic realm=\"%s\"\r\n", | 1097 | "WWW-Authenticate: Basic realm=\"%.999s\"\r\n", |
969 | g_realm); | 1098 | g_realm /* %.999s protects from overflowing iobuf[] */ |
1099 | ); | ||
970 | } | 1100 | } |
971 | #endif | 1101 | #endif |
972 | if (responseNum == HTTP_MOVED_TEMPORARILY) { | 1102 | if (responseNum == HTTP_MOVED_TEMPORARILY) { |
@@ -981,7 +1111,8 @@ static void send_headers(int responseNum) | |||
981 | "Location: %s/%s%s\r\n", | 1111 | "Location: %s/%s%s\r\n", |
982 | found_moved_temporarily, | 1112 | found_moved_temporarily, |
983 | (g_query ? "?" : ""), | 1113 | (g_query ? "?" : ""), |
984 | (g_query ? g_query : "")); | 1114 | (g_query ? g_query : "") |
1115 | ); | ||
985 | if (len > IOBUF_SIZE-3) | 1116 | if (len > IOBUF_SIZE-3) |
986 | len = IOBUF_SIZE-3; | 1117 | len = IOBUF_SIZE-3; |
987 | } | 1118 | } |
@@ -1002,13 +1133,15 @@ static void send_headers(int responseNum) | |||
1002 | #endif | 1133 | #endif |
1003 | 1134 | ||
1004 | if (file_size != -1) { /* file */ | 1135 | if (file_size != -1) { /* file */ |
1005 | strftime(tmp_str, sizeof(tmp_str), RFC1123FMT, gmtime(&last_mod)); | 1136 | strftime(date_str, sizeof(date_str), RFC1123FMT, gmtime(&last_mod)); |
1006 | #if ENABLE_FEATURE_HTTPD_RANGES | 1137 | #if ENABLE_FEATURE_HTTPD_RANGES |
1007 | if (responseNum == HTTP_PARTIAL_CONTENT) { | 1138 | if (responseNum == HTTP_PARTIAL_CONTENT) { |
1008 | len += sprintf(iobuf + len, "Content-Range: bytes %"OFF_FMT"u-%"OFF_FMT"u/%"OFF_FMT"u\r\n", | 1139 | len += sprintf(iobuf + len, |
1140 | "Content-Range: bytes %"OFF_FMT"u-%"OFF_FMT"u/%"OFF_FMT"u\r\n", | ||
1009 | range_start, | 1141 | range_start, |
1010 | range_end, | 1142 | range_end, |
1011 | file_size); | 1143 | file_size |
1144 | ); | ||
1012 | file_size = range_end - range_start + 1; | 1145 | file_size = range_end - range_start + 1; |
1013 | } | 1146 | } |
1014 | #endif | 1147 | #endif |
@@ -1016,8 +1149,9 @@ static void send_headers(int responseNum) | |||
1016 | #if ENABLE_FEATURE_HTTPD_RANGES | 1149 | #if ENABLE_FEATURE_HTTPD_RANGES |
1017 | "Accept-Ranges: bytes\r\n" | 1150 | "Accept-Ranges: bytes\r\n" |
1018 | #endif | 1151 | #endif |
1019 | "Last-Modified: %s\r\n%s %"OFF_FMT"u\r\n", | 1152 | "Last-Modified: %s\r\n" |
1020 | tmp_str, | 1153 | "%s %"OFF_FMT"u\r\n", |
1154 | date_str, | ||
1021 | content_gzip ? "Transfer-length:" : "Content-length:", | 1155 | content_gzip ? "Transfer-length:" : "Content-length:", |
1022 | file_size | 1156 | file_size |
1023 | ); | 1157 | ); |
@@ -1031,9 +1165,13 @@ static void send_headers(int responseNum) | |||
1031 | if (infoString) { | 1165 | if (infoString) { |
1032 | len += sprintf(iobuf + len, | 1166 | len += sprintf(iobuf + len, |
1033 | "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\n" | 1167 | "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\n" |
1034 | "<BODY><H1>%d %s</H1>\n%s\n</BODY></HTML>\n", | 1168 | "<BODY><H1>%d %s</H1>\n" |
1169 | "%s\n" | ||
1170 | "</BODY></HTML>\n", | ||
1035 | responseNum, responseString, | 1171 | responseNum, responseString, |
1036 | responseNum, responseString, infoString); | 1172 | responseNum, responseString, |
1173 | infoString | ||
1174 | ); | ||
1037 | } | 1175 | } |
1038 | if (DEBUG) { | 1176 | if (DEBUG) { |
1039 | iobuf[len] = '\0'; | 1177 | iobuf[len] = '\0'; |
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index 8984b0207..9e16936d8 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
@@ -25,6 +25,57 @@ | |||
25 | * 2002-04-20 | 25 | * 2002-04-20 |
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 | //config:config IFCONFIG | ||
29 | //config: bool "ifconfig" | ||
30 | //config: default y | ||
31 | //config: select PLATFORM_LINUX | ||
32 | //config: help | ||
33 | //config: Ifconfig is used to configure the kernel-resident network interfaces. | ||
34 | //config: | ||
35 | //config:config FEATURE_IFCONFIG_STATUS | ||
36 | //config: bool "Enable status reporting output (+7k)" | ||
37 | //config: default y | ||
38 | //config: depends on IFCONFIG | ||
39 | //config: help | ||
40 | //config: If ifconfig is called with no arguments it will display the status | ||
41 | //config: of the currently active interfaces. | ||
42 | //config: | ||
43 | //config:config FEATURE_IFCONFIG_SLIP | ||
44 | //config: bool "Enable slip-specific options \"keepalive\" and \"outfill\"" | ||
45 | //config: default y | ||
46 | //config: depends on IFCONFIG | ||
47 | //config: help | ||
48 | //config: Allow "keepalive" and "outfill" support for SLIP. If you're not | ||
49 | //config: planning on using serial lines, leave this unchecked. | ||
50 | //config: | ||
51 | //config:config FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ | ||
52 | //config: bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" | ||
53 | //config: default y | ||
54 | //config: depends on IFCONFIG | ||
55 | //config: help | ||
56 | //config: Allow the start address for shared memory, start address for I/O, | ||
57 | //config: and/or the interrupt line used by the specified device. | ||
58 | //config: | ||
59 | //config:config FEATURE_IFCONFIG_HW | ||
60 | //config: bool "Enable option \"hw\" (ether only)" | ||
61 | //config: default y | ||
62 | //config: depends on IFCONFIG | ||
63 | //config: help | ||
64 | //config: Set the hardware address of this interface, if the device driver | ||
65 | //config: supports this operation. Currently, we only support the 'ether' | ||
66 | //config: class. | ||
67 | //config: | ||
68 | //config:config FEATURE_IFCONFIG_BROADCAST_PLUS | ||
69 | //config: bool "Set the broadcast automatically" | ||
70 | //config: default y | ||
71 | //config: depends on IFCONFIG | ||
72 | //config: help | ||
73 | //config: Setting this will make ifconfig attempt to find the broadcast | ||
74 | //config: automatically if the value '+' is used. | ||
75 | |||
76 | //applet:IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) | ||
77 | |||
78 | //kbuild:lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o | ||
28 | 79 | ||
29 | //usage:#define ifconfig_trivial_usage | 80 | //usage:#define ifconfig_trivial_usage |
30 | //usage: IF_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]" | 81 | //usage: IF_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]" |
diff --git a/networking/ifenslave.c b/networking/ifenslave.c index 6b234adee..1cb765e23 100644 --- a/networking/ifenslave.c +++ b/networking/ifenslave.c | |||
@@ -97,6 +97,17 @@ | |||
97 | * - Code cleanup and style changes | 97 | * - Code cleanup and style changes |
98 | * set version to 1.1.0 | 98 | * set version to 1.1.0 |
99 | */ | 99 | */ |
100 | //config:config IFENSLAVE | ||
101 | //config: bool "ifenslave" | ||
102 | //config: default y | ||
103 | //config: select PLATFORM_LINUX | ||
104 | //config: help | ||
105 | //config: Userspace application to bind several interfaces | ||
106 | //config: to a logical interface (use with kernel bonding driver). | ||
107 | |||
108 | //applet:IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) | ||
109 | |||
110 | //kbuild:lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o | ||
100 | 111 | ||
101 | //usage:#define ifenslave_trivial_usage | 112 | //usage:#define ifenslave_trivial_usage |
102 | //usage: "[-cdf] MASTER_IFACE SLAVE_IFACE..." | 113 | //usage: "[-cdf] MASTER_IFACE SLAVE_IFACE..." |
diff --git a/networking/ifplugd.c b/networking/ifplugd.c index 029cba147..4f8a274b0 100644 --- a/networking/ifplugd.c +++ b/networking/ifplugd.c | |||
@@ -6,6 +6,16 @@ | |||
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 | //config:config IFPLUGD | ||
10 | //config: bool "ifplugd" | ||
11 | //config: default y | ||
12 | //config: select PLATFORM_LINUX | ||
13 | //config: help | ||
14 | //config: Network interface plug detection daemon. | ||
15 | |||
16 | //applet:IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
17 | |||
18 | //kbuild:lib-$(CONFIG_IFPLUGD) += ifplugd.o | ||
9 | 19 | ||
10 | //usage:#define ifplugd_trivial_usage | 20 | //usage:#define ifplugd_trivial_usage |
11 | //usage: "[OPTIONS]" | 21 | //usage: "[OPTIONS]" |
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 1d0fc53cf..7ac517afd 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * ifupdown for busybox | 3 | * ifup/ifdown for busybox |
4 | * Copyright (c) 2002 Glenn McGrath | 4 | * Copyright (c) 2002 Glenn McGrath |
5 | * Copyright (c) 2003-2004 Erik Andersen <andersen@codepoet.org> | 5 | * Copyright (c) 2003-2004 Erik Andersen <andersen@codepoet.org> |
6 | * | 6 | * |
@@ -17,10 +17,127 @@ | |||
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 | //config:config IFUP | ||
21 | //config: bool "ifup" | ||
22 | //config: default y | ||
23 | //config: help | ||
24 | //config: Activate the specified interfaces. This applet makes use | ||
25 | //config: of either "ifconfig" and "route" or the "ip" command to actually | ||
26 | //config: configure network interfaces. Therefore, you will probably also want | ||
27 | //config: to enable either IFCONFIG and ROUTE, or enable | ||
28 | //config: FEATURE_IFUPDOWN_IP and the various IP options. Of | ||
29 | //config: course you could use non-busybox versions of these programs, so | ||
30 | //config: against my better judgement (since this will surely result in plenty | ||
31 | //config: of support questions on the mailing list), I do not force you to | ||
32 | //config: enable these additional options. It is up to you to supply either | ||
33 | //config: "ifconfig", "route" and "run-parts" or the "ip" command, either | ||
34 | //config: via busybox or via standalone utilities. | ||
35 | //config: | ||
36 | //config:config IFDOWN | ||
37 | //config: bool "ifdown" | ||
38 | //config: default y | ||
39 | //config: help | ||
40 | //config: Deactivate the specified interfaces. | ||
41 | //config: | ||
42 | //config:config IFUPDOWN_IFSTATE_PATH | ||
43 | //config: string "Absolute path to ifstate file" | ||
44 | //config: default "/var/run/ifstate" | ||
45 | //config: depends on IFUP || IFDOWN | ||
46 | //config: help | ||
47 | //config: ifupdown keeps state information in a file called ifstate. | ||
48 | //config: Typically it is located in /var/run/ifstate, however | ||
49 | //config: some distributions tend to put it in other places | ||
50 | //config: (debian, for example, uses /etc/network/run/ifstate). | ||
51 | //config: This config option defines location of ifstate. | ||
52 | //config: | ||
53 | //config:config FEATURE_IFUPDOWN_IP | ||
54 | //config: bool "Use ip applet" | ||
55 | //config: default y | ||
56 | //config: depends on IFUP || IFDOWN | ||
57 | //config: help | ||
58 | //config: Use the iproute "ip" command to implement "ifup" and "ifdown", rather | ||
59 | //config: than the default of using the older 'ifconfig' and 'route' utilities. | ||
60 | //config: | ||
61 | //config:config FEATURE_IFUPDOWN_IP_BUILTIN | ||
62 | //config: bool "Use busybox ip applet" | ||
63 | //config: default y | ||
64 | //config: depends on FEATURE_IFUPDOWN_IP | ||
65 | //config: select PLATFORM_LINUX | ||
66 | //config: select IP | ||
67 | //config: select FEATURE_IP_ADDRESS | ||
68 | //config: select FEATURE_IP_LINK | ||
69 | //config: select FEATURE_IP_ROUTE | ||
70 | //config: help | ||
71 | //config: Use the busybox iproute "ip" applet to implement "ifupdown". | ||
72 | //config: | ||
73 | //config: If left disabled, you must install the full-blown iproute2 | ||
74 | //config: utility or the "ifup" and "ifdown" applets will not work. | ||
75 | //config: | ||
76 | //config:config FEATURE_IFUPDOWN_IFCONFIG_BUILTIN | ||
77 | //config: bool "Use busybox ifconfig and route applets" | ||
78 | //config: default n | ||
79 | //config: depends on (IFUP || IFDOWN) && !FEATURE_IFUPDOWN_IP | ||
80 | //config: select IFCONFIG | ||
81 | //config: select ROUTE | ||
82 | //config: help | ||
83 | //config: Use the busybox iproute "ifconfig" and "route" applets to | ||
84 | //config: implement the "ifup" and "ifdown" utilities. | ||
85 | //config: | ||
86 | //config: If left disabled, you must install the full-blown ifconfig | ||
87 | //config: and route utilities, or the "ifup" and "ifdown" applets will not | ||
88 | //config: work. | ||
89 | //config: | ||
90 | //config:config FEATURE_IFUPDOWN_IPV4 | ||
91 | //config: bool "Support for IPv4" | ||
92 | //config: default y | ||
93 | //config: depends on IFUP || IFDOWN | ||
94 | //config: help | ||
95 | //config: If you want ifup/ifdown to talk IPv4, leave this on. | ||
96 | //config: | ||
97 | //config:config FEATURE_IFUPDOWN_IPV6 | ||
98 | //config: bool "Support for IPv6" | ||
99 | //config: default y | ||
100 | //config: depends on (IFUP || IFDOWN) && FEATURE_IPV6 | ||
101 | //config: help | ||
102 | //config: If you need support for IPv6, turn this option on. | ||
103 | //config: | ||
104 | //UNUSED: | ||
105 | ////////:config FEATURE_IFUPDOWN_IPX | ||
106 | ////////: bool "Support for IPX" | ||
107 | ////////: default y | ||
108 | ////////: depends on IFUP || IFDOWN | ||
109 | ////////: help | ||
110 | ////////: If this option is selected you can use busybox to work with IPX | ||
111 | ////////: networks. | ||
112 | //config: | ||
113 | //config:config FEATURE_IFUPDOWN_MAPPING | ||
114 | //config: bool "Enable mapping support" | ||
115 | //config: default y | ||
116 | //config: depends on IFUP || IFDOWN | ||
117 | //config: help | ||
118 | //config: This enables support for the "mapping" stanza, unless you have | ||
119 | //config: a weird network setup you don't need it. | ||
120 | //config: | ||
121 | //config:config FEATURE_IFUPDOWN_EXTERNAL_DHCP | ||
122 | //config: bool "Support for external dhcp clients" | ||
123 | //config: default n | ||
124 | //config: depends on IFUP || IFDOWN | ||
125 | //config: help | ||
126 | //config: This enables support for the external dhcp clients. Clients are | ||
127 | //config: tried in the following order: dhcpcd, dhclient, pump and udhcpc. | ||
128 | //config: Otherwise, if udhcpc applet is enabled, it is used. | ||
129 | //config: Otherwise, ifup/ifdown will have no support for DHCP. | ||
130 | |||
131 | //applet:IF_IFUP(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup)) | ||
132 | //applet:IF_IFDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown)) | ||
133 | |||
134 | //kbuild:lib-$(CONFIG_IFUP) += ifupdown.o | ||
135 | //kbuild:lib-$(CONFIG_IFDOWN) += ifupdown.o | ||
136 | |||
20 | //usage:#define ifup_trivial_usage | 137 | //usage:#define ifup_trivial_usage |
21 | //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." | 138 | //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." |
22 | //usage:#define ifup_full_usage "\n\n" | 139 | //usage:#define ifup_full_usage "\n\n" |
23 | //usage: " -a De/configure all interfaces automatically" | 140 | //usage: " -a Configure all interfaces" |
24 | //usage: "\n -i FILE Use FILE instead of /etc/network/interfaces" | 141 | //usage: "\n -i FILE Use FILE instead of /etc/network/interfaces" |
25 | //usage: "\n -n Print out what would happen, but don't do it" | 142 | //usage: "\n -n Print out what would happen, but don't do it" |
26 | //usage: IF_FEATURE_IFUPDOWN_MAPPING( | 143 | //usage: IF_FEATURE_IFUPDOWN_MAPPING( |
@@ -28,12 +145,12 @@ | |||
28 | //usage: "\n -m Don't run any mappings" | 145 | //usage: "\n -m Don't run any mappings" |
29 | //usage: ) | 146 | //usage: ) |
30 | //usage: "\n -v Print out what would happen before doing it" | 147 | //usage: "\n -v Print out what would happen before doing it" |
31 | //usage: "\n -f Force de/configuration" | 148 | //usage: "\n -f Force configuration" |
32 | //usage: | 149 | //usage: |
33 | //usage:#define ifdown_trivial_usage | 150 | //usage:#define ifdown_trivial_usage |
34 | //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." | 151 | //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." |
35 | //usage:#define ifdown_full_usage "\n\n" | 152 | //usage:#define ifdown_full_usage "\n\n" |
36 | //usage: " -a De/configure all interfaces automatically" | 153 | //usage: " -a Deconfigure all interfaces" |
37 | //usage: "\n -i FILE Use FILE for interface definitions" | 154 | //usage: "\n -i FILE Use FILE for interface definitions" |
38 | //usage: "\n -n Print out what would happen, but don't do it" | 155 | //usage: "\n -n Print out what would happen, but don't do it" |
39 | //usage: IF_FEATURE_IFUPDOWN_MAPPING( | 156 | //usage: IF_FEATURE_IFUPDOWN_MAPPING( |
@@ -41,7 +158,7 @@ | |||
41 | //usage: "\n -m Don't run any mappings" | 158 | //usage: "\n -m Don't run any mappings" |
42 | //usage: ) | 159 | //usage: ) |
43 | //usage: "\n -v Print out what would happen before doing it" | 160 | //usage: "\n -v Print out what would happen before doing it" |
44 | //usage: "\n -f Force de/configuration" | 161 | //usage: "\n -f Force deconfiguration" |
45 | 162 | ||
46 | #include "libbb.h" | 163 | #include "libbb.h" |
47 | #include "common_bufsiz.h" | 164 | #include "common_bufsiz.h" |
@@ -1248,7 +1365,6 @@ static FILE *open_new_state_file(void) | |||
1248 | return xfdopen_for_write(fd); | 1365 | return xfdopen_for_write(fd); |
1249 | } | 1366 | } |
1250 | 1367 | ||
1251 | |||
1252 | int ifupdown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1368 | int ifupdown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
1253 | int ifupdown_main(int argc UNUSED_PARAM, char **argv) | 1369 | int ifupdown_main(int argc UNUSED_PARAM, char **argv) |
1254 | { | 1370 | { |
@@ -1263,10 +1379,13 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv) | |||
1263 | G.startup_PATH = getenv("PATH"); | 1379 | G.startup_PATH = getenv("PATH"); |
1264 | G.shell = xstrdup(get_shell_name()); | 1380 | G.shell = xstrdup(get_shell_name()); |
1265 | 1381 | ||
1266 | cmds = iface_down; | 1382 | if (ENABLE_IFUP |
1267 | if (applet_name[2] == 'u') { | 1383 | && (!ENABLE_IFDOWN || applet_name[2] == 'u') |
1384 | ) { | ||
1268 | /* ifup command */ | 1385 | /* ifup command */ |
1269 | cmds = iface_up; | 1386 | cmds = iface_up; |
1387 | } else { | ||
1388 | cmds = iface_down; | ||
1270 | } | 1389 | } |
1271 | 1390 | ||
1272 | getopt32(argv, OPTION_STR, &interfaces); | 1391 | getopt32(argv, OPTION_STR, &interfaces); |
diff --git a/networking/inetd.c b/networking/inetd.c index f9295e38b..4d0ab2e0d 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -153,6 +153,59 @@ | |||
153 | * setgid(specified group) | 153 | * setgid(specified group) |
154 | * setuid() | 154 | * setuid() |
155 | */ | 155 | */ |
156 | //config:config INETD | ||
157 | //config: bool "inetd" | ||
158 | //config: default y | ||
159 | //config: select FEATURE_SYSLOG | ||
160 | //config: help | ||
161 | //config: Internet superserver daemon | ||
162 | //config: | ||
163 | //config:config FEATURE_INETD_SUPPORT_BUILTIN_ECHO | ||
164 | //config: bool "Support echo service" | ||
165 | //config: default y | ||
166 | //config: depends on INETD | ||
167 | //config: help | ||
168 | //config: Echo received data internal inetd service | ||
169 | //config: | ||
170 | //config:config FEATURE_INETD_SUPPORT_BUILTIN_DISCARD | ||
171 | //config: bool "Support discard service" | ||
172 | //config: default y | ||
173 | //config: depends on INETD | ||
174 | //config: help | ||
175 | //config: Internet /dev/null internal inetd service | ||
176 | //config: | ||
177 | //config:config FEATURE_INETD_SUPPORT_BUILTIN_TIME | ||
178 | //config: bool "Support time service" | ||
179 | //config: default y | ||
180 | //config: depends on INETD | ||
181 | //config: help | ||
182 | //config: Return 32 bit time since 1900 internal inetd service | ||
183 | //config: | ||
184 | //config:config FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME | ||
185 | //config: bool "Support daytime service" | ||
186 | //config: default y | ||
187 | //config: depends on INETD | ||
188 | //config: help | ||
189 | //config: Return human-readable time internal inetd service | ||
190 | //config: | ||
191 | //config:config FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN | ||
192 | //config: bool "Support chargen service" | ||
193 | //config: default y | ||
194 | //config: depends on INETD | ||
195 | //config: help | ||
196 | //config: Familiar character generator internal inetd service | ||
197 | //config: | ||
198 | //config:config FEATURE_INETD_RPC | ||
199 | //config: bool "Support RPC services" | ||
200 | //config: default n # very rarely used, and needs Sun RPC support in libc | ||
201 | //config: depends on INETD | ||
202 | //config: select FEATURE_HAVE_RPC | ||
203 | //config: help | ||
204 | //config: Support Sun-RPC based services | ||
205 | |||
206 | //applet:IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
207 | |||
208 | //kbuild:lib-$(CONFIG_INETD) += inetd.o | ||
156 | 209 | ||
157 | //usage:#define inetd_trivial_usage | 210 | //usage:#define inetd_trivial_usage |
158 | //usage: "[-fe] [-q N] [-R N] [CONFFILE]" | 211 | //usage: "[-fe] [-q N] [-R N] [CONFFILE]" |
diff --git a/networking/interface.c b/networking/interface.c index e5723b428..c5c8f2cdd 100644 --- a/networking/interface.c +++ b/networking/interface.c | |||
@@ -264,7 +264,7 @@ const struct aftype* FAST_FUNC get_aftype(const char *name) | |||
264 | 264 | ||
265 | afp = aftypes; | 265 | afp = aftypes; |
266 | while (*afp != NULL) { | 266 | while (*afp != NULL) { |
267 | if (!strcmp((*afp)->name, name)) | 267 | if (strcmp((*afp)->name, name) == 0) |
268 | return (*afp); | 268 | return (*afp); |
269 | afp++; | 269 | afp++; |
270 | } | 270 | } |
@@ -572,7 +572,7 @@ static int if_readlist_proc(char *target) | |||
572 | ife = add_interface(name); | 572 | ife = add_interface(name); |
573 | get_dev_fields(s, ife, procnetdev_vsn); | 573 | get_dev_fields(s, ife, procnetdev_vsn); |
574 | ife->statistics_valid = 1; | 574 | ife->statistics_valid = 1; |
575 | if (target && !strcmp(target, name)) | 575 | if (target && strcmp(target, name) == 0) |
576 | break; | 576 | break; |
577 | } | 577 | } |
578 | if (ferror(fh)) { | 578 | if (ferror(fh)) { |
@@ -781,7 +781,7 @@ const struct hwtype* FAST_FUNC get_hwtype(const char *name) | |||
781 | 781 | ||
782 | hwp = hwtypes; | 782 | hwp = hwtypes; |
783 | while (*hwp != NULL) { | 783 | while (*hwp != NULL) { |
784 | if (!strcmp((*hwp)->name, name)) | 784 | if (strcmp((*hwp)->name, name) == 0) |
785 | return (*hwp); | 785 | return (*hwp); |
786 | hwp++; | 786 | hwp++; |
787 | } | 787 | } |
@@ -877,7 +877,7 @@ static void ife_print6(struct interface *ptr) | |||
877 | addr6p[5], addr6p[6], addr6p[7], &if_idx, &plen, &scope, | 877 | addr6p[5], addr6p[6], addr6p[7], &if_idx, &plen, &scope, |
878 | &dad_status, devname) != EOF | 878 | &dad_status, devname) != EOF |
879 | ) { | 879 | ) { |
880 | if (!strcmp(devname, ptr->name)) { | 880 | if (strcmp(devname, ptr->name) == 0) { |
881 | sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", | 881 | sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", |
882 | addr6p[0], addr6p[1], addr6p[2], addr6p[3], | 882 | addr6p[0], addr6p[1], addr6p[2], addr6p[3], |
883 | addr6p[4], addr6p[5], addr6p[6], addr6p[7]); | 883 | addr6p[4], addr6p[5], addr6p[6], addr6p[7]); |
diff --git a/networking/ip.c b/networking/ip.c index ddfe74e9c..c3607b74f 100644 --- a/networking/ip.c +++ b/networking/ip.c | |||
@@ -8,6 +8,131 @@ | |||
8 | * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses | 8 | * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses |
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 | //config:config IP | ||
12 | //config: bool "ip" | ||
13 | //config: default y | ||
14 | //config: select PLATFORM_LINUX | ||
15 | //config: help | ||
16 | //config: The "ip" applet is a TCP/IP interface configuration and routing | ||
17 | //config: utility. You generally don't need "ip" to use busybox with | ||
18 | //config: TCP/IP. | ||
19 | //config: | ||
20 | //config:config FEATURE_IP_ADDRESS | ||
21 | //config: bool "ip address" | ||
22 | //config: default y | ||
23 | //config: depends on IP | ||
24 | //config: help | ||
25 | //config: Address manipulation support for the "ip" applet. | ||
26 | //config: | ||
27 | //config:config FEATURE_IP_LINK | ||
28 | //config: bool "ip link" | ||
29 | //config: default y | ||
30 | //config: depends on IP | ||
31 | //config: help | ||
32 | //config: Configure network devices with "ip". | ||
33 | //config: | ||
34 | //config:config FEATURE_IP_ROUTE | ||
35 | //config: bool "ip route" | ||
36 | //config: default y | ||
37 | //config: depends on IP | ||
38 | //config: help | ||
39 | //config: Add support for routing table management to "ip". | ||
40 | //config: | ||
41 | //config:config FEATURE_IP_ROUTE_DIR | ||
42 | //config: string "ip route configuration directory" | ||
43 | //config: default "/etc/iproute2" | ||
44 | //config: depends on FEATURE_IP_ROUTE | ||
45 | //config: help | ||
46 | //config: Location of the "ip" applet routing configuration. | ||
47 | //config: | ||
48 | //config:config FEATURE_IP_TUNNEL | ||
49 | //config: bool "ip tunnel" | ||
50 | //config: default y | ||
51 | //config: depends on IP | ||
52 | //config: help | ||
53 | //config: Add support for tunneling commands to "ip". | ||
54 | //config: | ||
55 | //config:config FEATURE_IP_RULE | ||
56 | //config: bool "ip rule" | ||
57 | //config: default y | ||
58 | //config: depends on IP | ||
59 | //config: help | ||
60 | //config: Add support for rule commands to "ip". | ||
61 | //config: | ||
62 | //config:config FEATURE_IP_NEIGH | ||
63 | //config: bool "ip neighbor" | ||
64 | //config: default y | ||
65 | //config: depends on IP | ||
66 | //config: help | ||
67 | //config: Add support for neighbor commands to "ip". | ||
68 | //config: | ||
69 | //config:config FEATURE_IP_SHORT_FORMS | ||
70 | //config: bool "Support short forms of ip commands" | ||
71 | //config: default y | ||
72 | //config: depends on IP | ||
73 | //config: help | ||
74 | //config: Also support short-form of ip <OBJECT> commands: | ||
75 | //config: ip addr -> ipaddr | ||
76 | //config: ip link -> iplink | ||
77 | //config: ip route -> iproute | ||
78 | //config: ip tunnel -> iptunnel | ||
79 | //config: ip rule -> iprule | ||
80 | //config: ip neigh -> ipneigh | ||
81 | //config: | ||
82 | //config: Say N unless you desparately need the short form of the ip | ||
83 | //config: object commands. | ||
84 | //config: | ||
85 | //config:config FEATURE_IP_RARE_PROTOCOLS | ||
86 | //config: bool "Support displaying rarely used link types" | ||
87 | //config: default n | ||
88 | //config: depends on IP | ||
89 | //config: help | ||
90 | //config: If you are not going to use links of type "frad", "econet", | ||
91 | //config: "bif" etc, you probably don't need to enable this. | ||
92 | //config: Ethernet, wireless, infrared, ppp/slip, ip tunnelling | ||
93 | //config: link types are supported without this option selected. | ||
94 | //config: | ||
95 | //config:config IPADDR | ||
96 | //config: bool | ||
97 | //config: default y | ||
98 | //config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ADDRESS | ||
99 | //config: | ||
100 | //config:config IPLINK | ||
101 | //config: bool | ||
102 | //config: default y | ||
103 | //config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_LINK | ||
104 | //config: | ||
105 | //config:config IPROUTE | ||
106 | //config: bool | ||
107 | //config: default y | ||
108 | //config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ROUTE | ||
109 | //config: | ||
110 | //config:config IPTUNNEL | ||
111 | //config: bool | ||
112 | //config: default y | ||
113 | //config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_TUNNEL | ||
114 | //config: | ||
115 | //config:config IPRULE | ||
116 | //config: bool | ||
117 | //config: default y | ||
118 | //config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_RULE | ||
119 | //config: | ||
120 | //config:config IPNEIGH | ||
121 | //config: bool | ||
122 | //config: default y | ||
123 | //config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_NEIGH | ||
124 | |||
125 | //applet:#if ENABLE_FEATURE_IP_ADDRESS || ENABLE_FEATURE_IP_ROUTE || ENABLE_FEATURE_IP_LINK || ENABLE_FEATURE_IP_TUNNEL || ENABLE_FEATURE_IP_RULE || ENABLE_FEATURE_IP_NEIGH | ||
126 | //applet:IF_IP(APPLET(ip, BB_DIR_SBIN, BB_SUID_DROP)) | ||
127 | //applet:#endif | ||
128 | //applet:IF_IPADDR(APPLET(ipaddr, BB_DIR_SBIN, BB_SUID_DROP)) | ||
129 | //applet:IF_IPLINK(APPLET(iplink, BB_DIR_SBIN, BB_SUID_DROP)) | ||
130 | //applet:IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP)) | ||
131 | //applet:IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) | ||
132 | //applet:IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) | ||
133 | //applet:IF_IPNEIGH(APPLET(ipneigh, BB_DIR_SBIN, BB_SUID_DROP)) | ||
134 | |||
135 | //kbuild:lib-$(CONFIG_IP) += ip.o | ||
11 | 136 | ||
12 | /* would need to make the " | " optional depending on more than one selected: */ | 137 | /* would need to make the " | " optional depending on more than one selected: */ |
13 | //usage:#define ip_trivial_usage | 138 | //usage:#define ip_trivial_usage |
diff --git a/networking/ipcalc.c b/networking/ipcalc.c index f4bacd7dc..21219424f 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c | |||
@@ -11,6 +11,31 @@ | |||
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 | //config:config IPCALC | ||
15 | //config: bool "ipcalc" | ||
16 | //config: default y | ||
17 | //config: help | ||
18 | //config: ipcalc takes an IP address and netmask and calculates the | ||
19 | //config: resulting broadcast, network, and host range. | ||
20 | //config: | ||
21 | //config:config FEATURE_IPCALC_FANCY | ||
22 | //config: bool "Fancy IPCALC, more options, adds 1 kbyte" | ||
23 | //config: default y | ||
24 | //config: depends on IPCALC | ||
25 | //config: help | ||
26 | //config: Adds the options hostname, prefix and silent to the output of | ||
27 | //config: "ipcalc". | ||
28 | //config: | ||
29 | //config:config FEATURE_IPCALC_LONG_OPTIONS | ||
30 | //config: bool "Enable long options" | ||
31 | //config: default y | ||
32 | //config: depends on IPCALC && LONG_OPTS | ||
33 | //config: help | ||
34 | //config: Support long options for the ipcalc applet. | ||
35 | |||
36 | //applet:IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) | ||
37 | |||
38 | //kbuild:lib-$(CONFIG_IPCALC) += ipcalc.o | ||
14 | 39 | ||
15 | //usage:#define ipcalc_trivial_usage | 40 | //usage:#define ipcalc_trivial_usage |
16 | //usage: "[OPTIONS] ADDRESS" | 41 | //usage: "[OPTIONS] ADDRESS" |
diff --git a/networking/isrv_identd.c b/networking/isrv_identd.c index 8a15926e5..219c64b66 100644 --- a/networking/isrv_identd.c +++ b/networking/isrv_identd.c | |||
@@ -6,6 +6,17 @@ | |||
6 | * | 6 | * |
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 | //config:config FAKEIDENTD | ||
10 | //config: bool "fakeidentd" | ||
11 | //config: default y | ||
12 | //config: select FEATURE_SYSLOG | ||
13 | //config: help | ||
14 | //config: fakeidentd listens on the ident port and returns a predefined | ||
15 | //config: fake value on any query. | ||
16 | |||
17 | //applet:IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
18 | |||
19 | //kbuild:lib-$(CONFIG_FAKEIDENTD) += isrv_identd.o isrv.o | ||
9 | 20 | ||
10 | //usage:#define fakeidentd_trivial_usage | 21 | //usage:#define fakeidentd_trivial_usage |
11 | //usage: "[-fiw] [-b ADDR] [STRING]" | 22 | //usage: "[-fiw] [-b ADDR] [STRING]" |
diff --git a/networking/nameif.c b/networking/nameif.c index 9b18a6d16..cffd5bfde 100644 --- a/networking/nameif.c +++ b/networking/nameif.c | |||
@@ -40,6 +40,10 @@ | |||
40 | //config: new_interface_name mac=00:80:C8:38:91:B5 | 40 | //config: new_interface_name mac=00:80:C8:38:91:B5 |
41 | //config: new_interface_name 00:80:C8:38:91:B5 | 41 | //config: new_interface_name 00:80:C8:38:91:B5 |
42 | 42 | ||
43 | //applet:IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) | ||
44 | |||
45 | //kbuild:lib-$(CONFIG_NAMEIF) += nameif.o | ||
46 | |||
43 | //usage:#define nameif_trivial_usage | 47 | //usage:#define nameif_trivial_usage |
44 | //usage: IF_NOT_FEATURE_NAMEIF_EXTENDED( | 48 | //usage: IF_NOT_FEATURE_NAMEIF_EXTENDED( |
45 | //usage: "[-s] [-c FILE] [IFNAME HWADDR]..." | 49 | //usage: "[-s] [-c FILE] [IFNAME HWADDR]..." |
diff --git a/networking/nc.c b/networking/nc.c index 13a9b48a8..1b70434ac 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -6,10 +6,6 @@ | |||
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 | #include "libbb.h" | ||
11 | #include "common_bufsiz.h" | ||
12 | |||
13 | //config:config NC | 9 | //config:config NC |
14 | //config: bool "nc" | 10 | //config: bool "nc" |
15 | //config: default y | 11 | //config: default y |
@@ -43,6 +39,12 @@ | |||
43 | //config: -s ADDR, -n, -u, -v, -o FILE, -z options, but loses | 39 | //config: -s ADDR, -n, -u, -v, -o FILE, -z options, but loses |
44 | //config: busybox-specific extensions: -f FILE. | 40 | //config: busybox-specific extensions: -f FILE. |
45 | 41 | ||
42 | //applet:IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
43 | |||
44 | //kbuild:lib-$(CONFIG_NC) += nc.o | ||
45 | |||
46 | #include "libbb.h" | ||
47 | #include "common_bufsiz.h" | ||
46 | #if ENABLE_NC_110_COMPAT | 48 | #if ENABLE_NC_110_COMPAT |
47 | # include "nc_bloaty.c" | 49 | # include "nc_bloaty.c" |
48 | #else | 50 | #else |
diff --git a/networking/netstat.c b/networking/netstat.c index 2196d42f7..90da6cdb8 100644 --- a/networking/netstat.c +++ b/networking/netstat.c | |||
@@ -13,6 +13,32 @@ | |||
13 | * | 13 | * |
14 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 14 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
15 | */ | 15 | */ |
16 | //config:config NETSTAT | ||
17 | //config: bool "netstat" | ||
18 | //config: default y | ||
19 | //config: select PLATFORM_LINUX | ||
20 | //config: help | ||
21 | //config: netstat prints information about the Linux networking subsystem. | ||
22 | //config: | ||
23 | //config:config FEATURE_NETSTAT_WIDE | ||
24 | //config: bool "Enable wide netstat output" | ||
25 | //config: default y | ||
26 | //config: depends on NETSTAT | ||
27 | //config: help | ||
28 | //config: Add support for wide columns. Useful when displaying IPv6 addresses | ||
29 | //config: (-W option). | ||
30 | //config: | ||
31 | //config:config FEATURE_NETSTAT_PRG | ||
32 | //config: bool "Enable PID/Program name output" | ||
33 | //config: default y | ||
34 | //config: depends on NETSTAT | ||
35 | //config: help | ||
36 | //config: Add support for -p flag to print out PID and program name. | ||
37 | //config: +700 bytes of code. | ||
38 | |||
39 | //applet:IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP)) | ||
40 | |||
41 | //kbuild:lib-$(CONFIG_NETSTAT) += netstat.o | ||
16 | 42 | ||
17 | #include "libbb.h" | 43 | #include "libbb.h" |
18 | #include "inet_common.h" | 44 | #include "inet_common.h" |
diff --git a/networking/nslookup.c b/networking/nslookup.c index dd4b1ffed..8e3c8fed9 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -10,6 +10,15 @@ | |||
10 | * | 10 | * |
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 | //config:config NSLOOKUP | ||
14 | //config: bool "nslookup" | ||
15 | //config: default y | ||
16 | //config: help | ||
17 | //config: nslookup is a tool to query Internet name servers. | ||
18 | |||
19 | //applet:IF_NSLOOKUP(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
20 | |||
21 | //kbuild:lib-$(CONFIG_NSLOOKUP) += nslookup.o | ||
13 | 22 | ||
14 | //usage:#define nslookup_trivial_usage | 23 | //usage:#define nslookup_trivial_usage |
15 | //usage: "[HOST] [SERVER]" | 24 | //usage: "[HOST] [SERVER]" |
diff --git a/networking/ntpd.c b/networking/ntpd.c index 8ca62cf1b..b7fa5dce9 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
@@ -40,6 +40,32 @@ | |||
40 | * purpose. It is provided "as is" without express or implied warranty. | 40 | * purpose. It is provided "as is" without express or implied warranty. |
41 | *********************************************************************** | 41 | *********************************************************************** |
42 | */ | 42 | */ |
43 | //config:config NTPD | ||
44 | //config: bool "ntpd" | ||
45 | //config: default y | ||
46 | //config: select PLATFORM_LINUX | ||
47 | //config: help | ||
48 | //config: The NTP client/server daemon. | ||
49 | //config: | ||
50 | //config:config FEATURE_NTPD_SERVER | ||
51 | //config: bool "Make ntpd usable as a NTP server" | ||
52 | //config: default y | ||
53 | //config: depends on NTPD | ||
54 | //config: help | ||
55 | //config: Make ntpd usable as a NTP server. If you disable this option | ||
56 | //config: ntpd will be usable only as a NTP client. | ||
57 | //config: | ||
58 | //config:config FEATURE_NTPD_CONF | ||
59 | //config: bool "Make ntpd understand /etc/ntp.conf" | ||
60 | //config: default y | ||
61 | //config: depends on NTPD | ||
62 | //config: help | ||
63 | //config: Make ntpd look in /etc/ntp.conf for peers. Only "server address" | ||
64 | //config: is supported. | ||
65 | |||
66 | //applet:IF_NTPD(APPLET(ntpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
67 | |||
68 | //kbuild:lib-$(CONFIG_NTPD) += ntpd.o | ||
43 | 69 | ||
44 | //usage:#define ntpd_trivial_usage | 70 | //usage:#define ntpd_trivial_usage |
45 | //usage: "[-dnqNw"IF_FEATURE_NTPD_SERVER("l -I IFACE")"] [-S PROG] [-p PEER]..." | 71 | //usage: "[-dnqNw"IF_FEATURE_NTPD_SERVER("l -I IFACE")"] [-S PROG] [-p PEER]..." |
diff --git a/networking/ping.c b/networking/ping.c index 82d5b7a85..d0ef7ba62 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -57,14 +57,14 @@ | |||
57 | //config:config PING6 | 57 | //config:config PING6 |
58 | //config: bool "ping6" | 58 | //config: bool "ping6" |
59 | //config: default y | 59 | //config: default y |
60 | //config: depends on FEATURE_IPV6 && PING | 60 | //config: depends on FEATURE_IPV6 |
61 | //config: help | 61 | //config: help |
62 | //config: This will give you a ping that can talk IPv6. | 62 | //config: This will give you a ping that can talk IPv6. |
63 | //config: | 63 | //config: |
64 | //config:config FEATURE_FANCY_PING | 64 | //config:config FEATURE_FANCY_PING |
65 | //config: bool "Enable fancy ping output" | 65 | //config: bool "Enable fancy ping output" |
66 | //config: default y | 66 | //config: default y |
67 | //config: depends on PING | 67 | //config: depends on PING || PING6 |
68 | //config: help | 68 | //config: help |
69 | //config: Make the output from the ping applet include statistics, and at the | 69 | //config: Make the output from the ping applet include statistics, and at the |
70 | //config: same time provide full support for ICMP packets. | 70 | //config: same time provide full support for ICMP packets. |
@@ -907,15 +907,17 @@ static int common_ping_main(int opt, char **argv) | |||
907 | #endif /* FEATURE_FANCY_PING */ | 907 | #endif /* FEATURE_FANCY_PING */ |
908 | 908 | ||
909 | 909 | ||
910 | #if ENABLE_PING | ||
910 | int ping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 911 | int ping_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
911 | int ping_main(int argc UNUSED_PARAM, char **argv) | 912 | int ping_main(int argc UNUSED_PARAM, char **argv) |
912 | { | 913 | { |
913 | #if !ENABLE_FEATURE_FANCY_PING | 914 | # if !ENABLE_FEATURE_FANCY_PING |
914 | return common_ping_main(AF_UNSPEC, argv); | 915 | return common_ping_main(AF_UNSPEC, argv); |
915 | #else | 916 | # else |
916 | return common_ping_main(0, argv); | 917 | return common_ping_main(0, argv); |
917 | #endif | 918 | # endif |
918 | } | 919 | } |
920 | #endif | ||
919 | 921 | ||
920 | #if ENABLE_PING6 | 922 | #if ENABLE_PING6 |
921 | int ping6_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 923 | int ping6_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
diff --git a/networking/pscan.c b/networking/pscan.c index 72ed8cdb5..0893c3577 100644 --- a/networking/pscan.c +++ b/networking/pscan.c | |||
@@ -5,6 +5,15 @@ | |||
5 | * | 5 | * |
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 | //config:config PSCAN | ||
9 | //config: bool "pscan" | ||
10 | //config: default y | ||
11 | //config: help | ||
12 | //config: Simple network port scanner. | ||
13 | |||
14 | //applet:IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
15 | |||
16 | //kbuild:lib-$(CONFIG_PSCAN) += pscan.o | ||
8 | 17 | ||
9 | //usage:#define pscan_trivial_usage | 18 | //usage:#define pscan_trivial_usage |
10 | //usage: "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST" | 19 | //usage: "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST" |
diff --git a/networking/route.c b/networking/route.c index 102a6ec67..7dc2b5a3d 100644 --- a/networking/route.c +++ b/networking/route.c | |||
@@ -24,6 +24,16 @@ | |||
24 | * Rewritten to fix several bugs, add additional error checking, and | 24 | * Rewritten to fix several bugs, add additional error checking, and |
25 | * remove ridiculous amounts of bloat. | 25 | * remove ridiculous amounts of bloat. |
26 | */ | 26 | */ |
27 | //config:config ROUTE | ||
28 | //config: bool "route" | ||
29 | //config: default y | ||
30 | //config: select PLATFORM_LINUX | ||
31 | //config: help | ||
32 | //config: Route displays or manipulates the kernel's IP routing tables. | ||
33 | |||
34 | //applet:IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) | ||
35 | |||
36 | //kbuild:lib-$(CONFIG_ROUTE) += route.o | ||
27 | 37 | ||
28 | //usage:#define route_trivial_usage | 38 | //usage:#define route_trivial_usage |
29 | //usage: "[{add|del|delete}]" | 39 | //usage: "[{add|del|delete}]" |
diff --git a/networking/slattach.c b/networking/slattach.c index 2d1305e32..9267eb1d0 100644 --- a/networking/slattach.c +++ b/networking/slattach.c | |||
@@ -12,6 +12,17 @@ | |||
12 | * | 12 | * |
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 | //config:config SLATTACH | ||
16 | //config: bool "slattach" | ||
17 | //config: default y | ||
18 | //config: select PLATFORM_LINUX | ||
19 | //config: help | ||
20 | //config: slattach is a small utility to attach network interfaces to serial | ||
21 | //config: lines. | ||
22 | |||
23 | //applet:IF_SLATTACH(APPLET(slattach, BB_DIR_SBIN, BB_SUID_DROP)) | ||
24 | |||
25 | //kbuild:lib-$(CONFIG_SLATTACH) += slattach.o | ||
15 | 26 | ||
16 | //usage:#define slattach_trivial_usage | 27 | //usage:#define slattach_trivial_usage |
17 | //usage: "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE" | 28 | //usage: "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE" |
diff --git a/networking/tc.c b/networking/tc.c index d0bcbdeaa..25875aa3e 100644 --- a/networking/tc.c +++ b/networking/tc.c | |||
@@ -7,6 +7,22 @@ | |||
7 | * Bernhard Reutner-Fischer adjusted for busybox | 7 | * Bernhard Reutner-Fischer adjusted for busybox |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* Was disabled in 2008 by Bernhard, not known why. | ||
11 | --//config:#config TC | ||
12 | --//config:# bool "tc" | ||
13 | --//config:# default y | ||
14 | --//config:# help | ||
15 | --//config:# Show / manipulate traffic control settings | ||
16 | --//config:# | ||
17 | --//config:#config FEATURE_TC_INGRESS | ||
18 | --//config:# default y | ||
19 | --//config:# depends on TC | ||
20 | -- | ||
21 | --//applet:IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) | ||
22 | -- | ||
23 | --//kbuild:lib-$(CONFIG_TC) += tc.o | ||
24 | */ | ||
25 | |||
10 | //usage:#define tc_trivial_usage | 26 | //usage:#define tc_trivial_usage |
11 | /* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */ | 27 | /* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */ |
12 | //usage: "OBJECT CMD [dev STRING]" | 28 | //usage: "OBJECT CMD [dev STRING]" |
@@ -100,7 +116,7 @@ static int get_qdisc_handle(uint32_t *h, const char *str) { | |||
100 | char *p; | 116 | char *p; |
101 | 117 | ||
102 | maj = TC_H_UNSPEC; | 118 | maj = TC_H_UNSPEC; |
103 | if (!strcmp(str, "none")) | 119 | if (strcmp(str, "none") == 0) |
104 | goto ok; | 120 | goto ok; |
105 | maj = strtoul(str, &p, 16); | 121 | maj = strtoul(str, &p, 16); |
106 | if (p == str) | 122 | if (p == str) |
@@ -119,10 +135,10 @@ static int get_tc_classid(uint32_t *h, const char *str) { | |||
119 | char *p; | 135 | char *p; |
120 | 136 | ||
121 | maj = TC_H_ROOT; | 137 | maj = TC_H_ROOT; |
122 | if (!strcmp(str, "root")) | 138 | if (strcmp(str, "root") == 0) |
123 | goto ok; | 139 | goto ok; |
124 | maj = TC_H_UNSPEC; | 140 | maj = TC_H_UNSPEC; |
125 | if (!strcmp(str, "none")) | 141 | if (strcmp(str, "none") == 0) |
126 | goto ok; | 142 | goto ok; |
127 | maj = strtoul(str, &p, 16); | 143 | maj = strtoul(str, &p, 16); |
128 | if (p == str) { | 144 | if (p == str) { |
diff --git a/networking/tcpudp.c b/networking/tcpudp.c index b27cf3ea9..94c89b9ef 100644 --- a/networking/tcpudp.c +++ b/networking/tcpudp.c | |||
@@ -28,6 +28,25 @@ | |||
28 | * with wrong source IP... | 28 | * with wrong source IP... |
29 | * - don't know how to retrieve ORIGDST for udp. | 29 | * - don't know how to retrieve ORIGDST for udp. |
30 | */ | 30 | */ |
31 | //config:config TCPSVD | ||
32 | //config: bool "tcpsvd" | ||
33 | //config: default y | ||
34 | //config: help | ||
35 | //config: tcpsvd listens on a TCP port and runs a program for each new | ||
36 | //config: connection. | ||
37 | //config: | ||
38 | //config:config UDPSVD | ||
39 | //config: bool "udpsvd" | ||
40 | //config: default y | ||
41 | //config: help | ||
42 | //config: udpsvd listens on an UDP port and runs a program for each new | ||
43 | //config: connection. | ||
44 | |||
45 | //applet:IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd)) | ||
46 | //applet:IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) | ||
47 | |||
48 | //kbuild:lib-$(CONFIG_TCPSVD) += tcpudp.o tcpudp_perhost.o | ||
49 | //kbuild:lib-$(CONFIG_UDPSVD) += tcpudp.o tcpudp_perhost.o | ||
31 | 50 | ||
32 | //usage:#define tcpsvd_trivial_usage | 51 | //usage:#define tcpsvd_trivial_usage |
33 | //usage: "[-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG" | 52 | //usage: "[-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG" |
diff --git a/networking/telnet.c b/networking/telnet.c index 1a6986b94..f520fe1dd 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -20,6 +20,35 @@ | |||
20 | * by Fernando Silveira <swrh@gmx.net> | 20 | * by Fernando Silveira <swrh@gmx.net> |
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | //config:config TELNET | ||
24 | //config: bool "telnet" | ||
25 | //config: default y | ||
26 | //config: help | ||
27 | //config: Telnet is an interface to the TELNET protocol, but is also commonly | ||
28 | //config: used to test other simple protocols. | ||
29 | //config: | ||
30 | //config:config FEATURE_TELNET_TTYPE | ||
31 | //config: bool "Pass TERM type to remote host" | ||
32 | //config: default y | ||
33 | //config: depends on TELNET | ||
34 | //config: help | ||
35 | //config: Setting this option will forward the TERM environment variable to the | ||
36 | //config: remote host you are connecting to. This is useful to make sure that | ||
37 | //config: things like ANSI colors and other control sequences behave. | ||
38 | //config: | ||
39 | //config:config FEATURE_TELNET_AUTOLOGIN | ||
40 | //config: bool "Pass USER type to remote host" | ||
41 | //config: default y | ||
42 | //config: depends on TELNET | ||
43 | //config: help | ||
44 | //config: Setting this option will forward the USER environment variable to the | ||
45 | //config: remote host you are connecting to. This is useful when you need to | ||
46 | //config: log into a machine without telling the username (autologin). This | ||
47 | //config: option enables `-a' and `-l USER' arguments. | ||
48 | |||
49 | //applet:IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
50 | |||
51 | //kbuild:lib-$(CONFIG_TELNET) += telnet.o | ||
23 | 52 | ||
24 | //usage:#if ENABLE_FEATURE_TELNET_AUTOLOGIN | 53 | //usage:#if ENABLE_FEATURE_TELNET_AUTOLOGIN |
25 | //usage:#define telnet_trivial_usage | 54 | //usage:#define telnet_trivial_usage |
diff --git a/networking/telnetd.c b/networking/telnetd.c index 303ef1be7..f06e9583e 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -20,6 +20,78 @@ | |||
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 | //config:config TELNETD | ||
24 | //config: bool "telnetd" | ||
25 | //config: default y | ||
26 | //config: select FEATURE_SYSLOG | ||
27 | //config: help | ||
28 | //config: A daemon for the TELNET protocol, allowing you to log onto the host | ||
29 | //config: running the daemon. Please keep in mind that the TELNET protocol | ||
30 | //config: sends passwords in plain text. If you can't afford the space for an | ||
31 | //config: SSH daemon and you trust your network, you may say 'y' here. As a | ||
32 | //config: more secure alternative, you should seriously consider installing the | ||
33 | //config: very small Dropbear SSH daemon instead: | ||
34 | //config: http://matt.ucc.asn.au/dropbear/dropbear.html | ||
35 | //config: | ||
36 | //config: Note that for busybox telnetd to work you need several things: | ||
37 | //config: First of all, your kernel needs: | ||
38 | //config: CONFIG_UNIX98_PTYS=y | ||
39 | //config: | ||
40 | //config: Next, you need a /dev/pts directory on your root filesystem: | ||
41 | //config: | ||
42 | //config: $ ls -ld /dev/pts | ||
43 | //config: drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/ | ||
44 | //config: | ||
45 | //config: Next you need the pseudo terminal master multiplexer /dev/ptmx: | ||
46 | //config: | ||
47 | //config: $ ls -la /dev/ptmx | ||
48 | //config: crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx | ||
49 | //config: | ||
50 | //config: Any /dev/ttyp[0-9]* files you may have can be removed. | ||
51 | //config: Next, you need to mount the devpts filesystem on /dev/pts using: | ||
52 | //config: | ||
53 | //config: mount -t devpts devpts /dev/pts | ||
54 | //config: | ||
55 | //config: You need to be sure that busybox has LOGIN and | ||
56 | //config: FEATURE_SUID enabled. And finally, you should make | ||
57 | //config: certain that Busybox has been installed setuid root: | ||
58 | //config: | ||
59 | //config: chown root.root /bin/busybox | ||
60 | //config: chmod 4755 /bin/busybox | ||
61 | //config: | ||
62 | //config: with all that done, telnetd _should_ work.... | ||
63 | //config: | ||
64 | //config:config FEATURE_TELNETD_STANDALONE | ||
65 | //config: bool "Support standalone telnetd (not inetd only)" | ||
66 | //config: default y | ||
67 | //config: depends on TELNETD | ||
68 | //config: help | ||
69 | //config: Selecting this will make telnetd able to run standalone. | ||
70 | //config: | ||
71 | //config:config FEATURE_TELNETD_INETD_WAIT | ||
72 | //config: bool "Support -w SEC option (inetd wait mode)" | ||
73 | //config: default y | ||
74 | //config: depends on FEATURE_TELNETD_STANDALONE | ||
75 | //config: help | ||
76 | //config: This option allows you to run telnetd in "inet wait" mode. | ||
77 | //config: Example inetd.conf line (note "wait", not usual "nowait"): | ||
78 | //config: | ||
79 | //config: telnet stream tcp wait root /bin/telnetd telnetd -w10 | ||
80 | //config: | ||
81 | //config: In this example, inetd passes _listening_ socket_ as fd 0 | ||
82 | //config: to telnetd when connection appears. | ||
83 | //config: telnetd will wait for connections until all existing | ||
84 | //config: connections are closed, and no new connections | ||
85 | //config: appear during 10 seconds. Then it exits, and inetd continues | ||
86 | //config: to listen for new connections. | ||
87 | //config: | ||
88 | //config: This option is rarely used. "tcp nowait" is much more usual | ||
89 | //config: way of running tcp services, including telnetd. | ||
90 | //config: You most probably want to say N here. | ||
91 | |||
92 | //applet:IF_TELNETD(APPLET(telnetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
93 | |||
94 | //kbuild:lib-$(CONFIG_TELNETD) += telnetd.o | ||
23 | 95 | ||
24 | //usage:#define telnetd_trivial_usage | 96 | //usage:#define telnetd_trivial_usage |
25 | //usage: "[OPTIONS]" | 97 | //usage: "[OPTIONS]" |
diff --git a/networking/tftp.c b/networking/tftp.c index e879c4674..ed8672025 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -18,6 +18,78 @@ | |||
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 | //config:config TFTP | ||
22 | //config: bool "tftp" | ||
23 | //config: default y | ||
24 | //config: help | ||
25 | //config: This enables the Trivial File Transfer Protocol client program. TFTP | ||
26 | //config: is usually used for simple, small transfers such as a root image | ||
27 | //config: for a network-enabled bootloader. | ||
28 | //config: | ||
29 | //config:config TFTPD | ||
30 | //config: bool "tftpd" | ||
31 | //config: default y | ||
32 | //config: help | ||
33 | //config: This enables the Trivial File Transfer Protocol server program. | ||
34 | //config: It expects that stdin is a datagram socket and a packet | ||
35 | //config: is already pending on it. It will exit after one transfer. | ||
36 | //config: In other words: it should be run from inetd in nowait mode, | ||
37 | //config: or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR" | ||
38 | //config: | ||
39 | //config:comment "Common options for tftp/tftpd" | ||
40 | //config: depends on TFTP || TFTPD | ||
41 | //config: | ||
42 | //config:config FEATURE_TFTP_GET | ||
43 | //config: bool "Enable 'tftp get' and/or tftpd upload code" | ||
44 | //config: default y | ||
45 | //config: depends on TFTP || TFTPD | ||
46 | //config: help | ||
47 | //config: Add support for the GET command within the TFTP client. This allows | ||
48 | //config: a client to retrieve a file from a TFTP server. | ||
49 | //config: Also enable upload support in tftpd, if tftpd is selected. | ||
50 | //config: | ||
51 | //config: Note: this option does _not_ make tftpd capable of download | ||
52 | //config: (the usual operation people need from it)! | ||
53 | //config: | ||
54 | //config:config FEATURE_TFTP_PUT | ||
55 | //config: bool "Enable 'tftp put' and/or tftpd download code" | ||
56 | //config: default y | ||
57 | //config: depends on TFTP || TFTPD | ||
58 | //config: help | ||
59 | //config: Add support for the PUT command within the TFTP client. This allows | ||
60 | //config: a client to transfer a file to a TFTP server. | ||
61 | //config: Also enable download support in tftpd, if tftpd is selected. | ||
62 | //config: | ||
63 | //config:config FEATURE_TFTP_BLOCKSIZE | ||
64 | //config: bool "Enable 'blksize' and 'tsize' protocol options" | ||
65 | //config: default y | ||
66 | //config: depends on TFTP || TFTPD | ||
67 | //config: help | ||
68 | //config: Allow tftp to specify block size, and tftpd to understand | ||
69 | //config: "blksize" and "tsize" options. | ||
70 | //config: | ||
71 | //config:config FEATURE_TFTP_PROGRESS_BAR | ||
72 | //config: bool "Enable tftp progress meter" | ||
73 | //config: default y | ||
74 | //config: depends on TFTP && FEATURE_TFTP_BLOCKSIZE | ||
75 | //config: help | ||
76 | //config: Show progress bar. | ||
77 | //config: | ||
78 | //config:config TFTP_DEBUG | ||
79 | //config: bool "Enable debug" | ||
80 | //config: default n | ||
81 | //config: depends on TFTP || TFTPD | ||
82 | //config: help | ||
83 | //config: Make tftp[d] print debugging messages on stderr. | ||
84 | //config: This is useful if you are diagnosing a bug in tftp[d]. | ||
85 | |||
86 | //applet:#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT | ||
87 | //applet:IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
88 | //applet:IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
89 | //applet:#endif | ||
90 | |||
91 | //kbuild:lib-$(CONFIG_TFTP) += tftp.o | ||
92 | //kbuild:lib-$(CONFIG_TFTPD) += tftp.o | ||
21 | 93 | ||
22 | //usage:#define tftp_trivial_usage | 94 | //usage:#define tftp_trivial_usage |
23 | //usage: "[OPTIONS] HOST [PORT]" | 95 | //usage: "[OPTIONS] HOST [PORT]" |
diff --git a/networking/traceroute.c b/networking/traceroute.c index b9a9ca4bb..a463b0faa 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -209,6 +209,41 @@ | |||
209 | * -- Van Jacobson (van@ee.lbl.gov) | 209 | * -- Van Jacobson (van@ee.lbl.gov) |
210 | * Tue Dec 20 03:50:13 PST 1988 | 210 | * Tue Dec 20 03:50:13 PST 1988 |
211 | */ | 211 | */ |
212 | //config:config TRACEROUTE | ||
213 | //config: bool "traceroute" | ||
214 | //config: default y | ||
215 | //config: select PLATFORM_LINUX | ||
216 | //config: help | ||
217 | //config: Utility to trace the route of IP packets. | ||
218 | //config: | ||
219 | //config:config TRACEROUTE6 | ||
220 | //config: bool "traceroute6" | ||
221 | //config: default y | ||
222 | //config: depends on FEATURE_IPV6 | ||
223 | //config: help | ||
224 | //config: Utility to trace the route of IPv6 packets. | ||
225 | //config: | ||
226 | //config:config FEATURE_TRACEROUTE_VERBOSE | ||
227 | //config: bool "Enable verbose output" | ||
228 | //config: default y | ||
229 | //config: depends on TRACEROUTE || TRACEROUTE6 | ||
230 | //config: help | ||
231 | //config: Add some verbosity to traceroute. This includes among other things | ||
232 | //config: hostnames and ICMP response types. | ||
233 | //config: | ||
234 | //config:config FEATURE_TRACEROUTE_USE_ICMP | ||
235 | //config: bool "Enable -I option (use ICMP instead of UDP)" | ||
236 | //config: default y | ||
237 | //config: depends on TRACEROUTE || TRACEROUTE6 | ||
238 | //config: help | ||
239 | //config: Add option -I to use ICMP ECHO instead of UDP datagrams. | ||
240 | |||
241 | /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ | ||
242 | //applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) | ||
243 | //applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) | ||
244 | |||
245 | //kbuild:lib-$(CONFIG_TRACEROUTE) += traceroute.o | ||
246 | //kbuild:lib-$(CONFIG_TRACEROUTE6) += traceroute.o | ||
212 | 247 | ||
213 | //usage:#define traceroute_trivial_usage | 248 | //usage:#define traceroute_trivial_usage |
214 | //usage: "[-"IF_TRACEROUTE6("46")"FIlnrv] [-f 1ST_TTL] [-m MAXTTL] [-q PROBES] [-p PORT]\n" | 249 | //usage: "[-"IF_TRACEROUTE6("46")"FIlnrv] [-f 1ST_TTL] [-m MAXTTL] [-q PROBES] [-p PORT]\n" |
@@ -1170,11 +1205,13 @@ common_traceroute_main(int op, char **argv) | |||
1170 | return 0; | 1205 | return 0; |
1171 | } | 1206 | } |
1172 | 1207 | ||
1208 | #if ENABLE_TRACEROUTE | ||
1173 | int traceroute_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1209 | int traceroute_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
1174 | int traceroute_main(int argc UNUSED_PARAM, char **argv) | 1210 | int traceroute_main(int argc UNUSED_PARAM, char **argv) |
1175 | { | 1211 | { |
1176 | return common_traceroute_main(0, argv); | 1212 | return common_traceroute_main(0, argv); |
1177 | } | 1213 | } |
1214 | #endif | ||
1178 | 1215 | ||
1179 | #if ENABLE_TRACEROUTE6 | 1216 | #if ENABLE_TRACEROUTE6 |
1180 | int traceroute6_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1217 | int traceroute6_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
diff --git a/networking/tunctl.c b/networking/tunctl.c index 941e8bbd3..fa904c2a9 100644 --- a/networking/tunctl.c +++ b/networking/tunctl.c | |||
@@ -9,6 +9,24 @@ | |||
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 | //config:config TUNCTL | ||
13 | //config: bool "tunctl" | ||
14 | //config: default y | ||
15 | //config: select PLATFORM_LINUX | ||
16 | //config: help | ||
17 | //config: tunctl creates or deletes tun devices. | ||
18 | //config: | ||
19 | //config:config FEATURE_TUNCTL_UG | ||
20 | //config: bool "Support owner:group assignment" | ||
21 | //config: default y | ||
22 | //config: depends on TUNCTL | ||
23 | //config: help | ||
24 | //config: Allow to specify owner and group of newly created interface. | ||
25 | //config: 340 bytes of pure bloat. Say no here. | ||
26 | |||
27 | //applet:IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) | ||
28 | |||
29 | //kbuild:lib-$(CONFIG_TUNCTL) += tunctl.o | ||
12 | 30 | ||
13 | //usage:#define tunctl_trivial_usage | 31 | //usage:#define tunctl_trivial_usage |
14 | //usage: "[-f device] ([-t name] | -d name)" IF_FEATURE_TUNCTL_UG(" [-u owner] [-g group] [-b]") | 32 | //usage: "[-f device] ([-t name] | -d name)" IF_FEATURE_TUNCTL_UG(" [-u owner] [-g group] [-b]") |
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 1c1051107..0e236261b 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -18,6 +18,13 @@ | |||
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | //applet:IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) | ||
22 | |||
23 | //kbuild:lib-$(CONFIG_UDHCPC) += common.o packet.o signalpipe.o socket.o | ||
24 | //kbuild:lib-$(CONFIG_UDHCPC) += dhcpc.o | ||
25 | //kbuild:lib-$(CONFIG_FEATURE_UDHCPC_ARPING) += arpping.o | ||
26 | //kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o | ||
27 | |||
21 | #include <syslog.h> | 28 | #include <syslog.h> |
22 | /* Override ENABLE_FEATURE_PIDFILE - ifupdown needs our pidfile to always exist */ | 29 | /* Override ENABLE_FEATURE_PIDFILE - ifupdown needs our pidfile to always exist */ |
23 | #define WANT_PIDFILE 1 | 30 | #define WANT_PIDFILE 1 |
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 56116d01f..e116ba3af 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -20,6 +20,11 @@ | |||
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 | //applet:IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
24 | |||
25 | //kbuild:lib-$(CONFIG_UDHCPD) += common.o packet.o signalpipe.o socket.o | ||
26 | //kbuild:lib-$(CONFIG_UDHCPD) += dhcpd.o arpping.o | ||
27 | //kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o | ||
23 | 28 | ||
24 | //usage:#define udhcpd_trivial_usage | 29 | //usage:#define udhcpd_trivial_usage |
25 | //usage: "[-fS] [-I ADDR]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" | 30 | //usage: "[-fS] [-I ADDR]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" |
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c index f52a0cf88..7cb19b14e 100644 --- a/networking/udhcp/dhcprelay.c +++ b/networking/udhcp/dhcprelay.c | |||
@@ -9,6 +9,9 @@ | |||
9 | * Netbeat AG | 9 | * Netbeat AG |
10 | * Upstream has GPL v2 or later | 10 | * Upstream has GPL v2 or later |
11 | */ | 11 | */ |
12 | //applet:IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
13 | |||
14 | //kbuild:lib-$(CONFIG_DHCPRELAY) += dhcprelay.o | ||
12 | 15 | ||
13 | //usage:#define dhcprelay_trivial_usage | 16 | //usage:#define dhcprelay_trivial_usage |
14 | //usage: "CLIENT_IFACE[,CLIENT_IFACE2]... SERVER_IFACE [SERVER_IP]" | 17 | //usage: "CLIENT_IFACE[,CLIENT_IFACE2]... SERVER_IFACE [SERVER_IP]" |
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index 987cc9aff..d83344a8d 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c | |||
@@ -2,6 +2,9 @@ | |||
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 | //applet:IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
6 | |||
7 | //kbuild:lib-$(CONFIG_DUMPLEASES) += dumpleases.o | ||
5 | 8 | ||
6 | //usage:#define dumpleases_trivial_usage | 9 | //usage:#define dumpleases_trivial_usage |
7 | //usage: "[-r|-a] [-d] [-f LEASEFILE]" | 10 | //usage: "[-r|-a] [-d] [-f LEASEFILE]" |
diff --git a/networking/vconfig.c b/networking/vconfig.c index 924b2f009..f3020409a 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c | |||
@@ -9,6 +9,17 @@ | |||
9 | 9 | ||
10 | /* BB_AUDIT SUSv3 N/A */ | 10 | /* BB_AUDIT SUSv3 N/A */ |
11 | 11 | ||
12 | //config:config VCONFIG | ||
13 | //config: bool "vconfig" | ||
14 | //config: default y | ||
15 | //config: select PLATFORM_LINUX | ||
16 | //config: help | ||
17 | //config: Creates, removes, and configures VLAN interfaces | ||
18 | |||
19 | //applet:IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) | ||
20 | |||
21 | //kbuild:lib-$(CONFIG_VCONFIG) += vconfig.o | ||
22 | |||
12 | //usage:#define vconfig_trivial_usage | 23 | //usage:#define vconfig_trivial_usage |
13 | //usage: "COMMAND [OPTIONS]" | 24 | //usage: "COMMAND [OPTIONS]" |
14 | //usage:#define vconfig_full_usage "\n\n" | 25 | //usage:#define vconfig_full_usage "\n\n" |
diff --git a/networking/zcip.c b/networking/zcip.c index 47f3216a0..9122bd681 100644 --- a/networking/zcip.c +++ b/networking/zcip.c | |||
@@ -14,6 +14,22 @@ | |||
14 | * routed at the IP level, though various proxies or bridges can | 14 | * routed at the IP level, though various proxies or bridges can |
15 | * certainly be used. Its naming is built over multicast DNS. | 15 | * certainly be used. Its naming is built over multicast DNS. |
16 | */ | 16 | */ |
17 | //config:config ZCIP | ||
18 | //config: bool "zcip" | ||
19 | //config: default y | ||
20 | //config: select PLATFORM_LINUX | ||
21 | //config: select FEATURE_SYSLOG | ||
22 | //config: help | ||
23 | //config: ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927. | ||
24 | //config: It's a daemon that allocates and defends a dynamically assigned | ||
25 | //config: address on the 169.254/16 network, requiring no system administrator. | ||
26 | //config: | ||
27 | //config: See http://www.zeroconf.org for further details, and "zcip.script" | ||
28 | //config: in the busybox examples. | ||
29 | |||
30 | //applet:IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) | ||
31 | |||
32 | //kbuild:lib-$(CONFIG_ZCIP) += zcip.o | ||
17 | 33 | ||
18 | //#define DEBUG | 34 | //#define DEBUG |
19 | 35 | ||