PATCH: Add -i IFACE option to wget

Denis Vlasenko vda.linux at googlemail.com
Fri Oct 20 22:14:20 UTC 2006


On Friday 20 October 2006 22:06, Raphaël HUCK wrote:
> I modified wget included in BusyBox v1.1.3 to support the -i option, in 
> order to listen on a specific interface (which can be really useful in 
> embedded systems).

Non-busyboxed wget unfortunately already has -i:

-i file
--input-file=file
    Read URLs from file, in which case no URLs need to be on the com-
    mand line.  If there are URLs both on the command line and in an
    input file, those on the command lines will be the first ones to be
    retrieved.  The file need not be an HTML document (but no harm if
    it is)---it is enough if the URLs are just listed sequentially.

How about implementing this?

--bind-address=ADDRESS
    When making client TCP/IP connections, "bind()" to ADDRESS on the
    local machine.  ADDRESS may be specified as a hostname or IP
    address.  This option can be useful if your machine is bound to
    multiple IPs.

If you desperately need to bind to _interface_, not _address_,
implement --bind-interface

> Please find the patch (diff -urpN wget_old.c wget.c) attached.

+#define WGET_OPT_INTERFACE     128

While at it, it will be a nice thing to convert these to hex.

-       opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:",
+       opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:i:",

BTW, I don't know what these funny high ASCII chars are doing here...
do you? Maybe they can be killed?

+                       bb_error_msg_and_die("Unable to bind to specified interface (-i)");

We're (supposed to be) size maniacs. "can't bind to %s" will be
as informative.
--
vda



More information about the busybox mailing list