diff options
author | Tim Riker | 2006-01-25 00:08:53 +0000 |
---|---|---|
committer | Tim Riker | 2006-01-25 00:08:53 +0000 |
commit | c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4 (patch) | |
tree | 5f329b7d0c7f20ecced0dc7581a9ba6dc720d965 /networking | |
parent | f64ff682a3d58dbb627e760e6fe1ec21d9ccdf61 (diff) | |
download | busybox-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.zip busybox-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.tar.gz |
just whitespace
Diffstat (limited to 'networking')
37 files changed, 204 insertions, 204 deletions
diff --git a/networking/ether-wake.c b/networking/ether-wake.c index 9ea5c03..7d5f79b 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c @@ -14,53 +14,53 @@ /* full usage according Donald Becker * usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n" * - * This program generates and transmits a Wake-On-LAN (WOL)\n" - * \"Magic Packet\", used for restarting machines that have been\n" - * soft-powered-down (ACPI D3-warm state).\n" - * It currently generates the standard AMD Magic Packet format, with\n" - * an optional password appended.\n" + * This program generates and transmits a Wake-On-LAN (WOL)\n" + * \"Magic Packet\", used for restarting machines that have been\n" + * soft-powered-down (ACPI D3-warm state).\n" + * It currently generates the standard AMD Magic Packet format, with\n" + * an optional password appended.\n" * - * The single required parameter is the Ethernet MAC (station) address\n" - * of the machine to wake or a host ID with known NSS 'ethers' entry.\n" - * The MAC address may be found with the 'arp' program while the target\n" - * machine is awake.\n" + * The single required parameter is the Ethernet MAC (station) address\n" + * of the machine to wake or a host ID with known NSS 'ethers' entry.\n" + * The MAC address may be found with the 'arp' program while the target\n" + * machine is awake.\n" * - * Options:\n" - * -b Send wake-up packet to the broadcast address.\n" - * -D Increase the debug level.\n" - * -i ifname Use interface IFNAME instead of the default 'eth0'.\n" - * -p <pw> Append the four or six byte password PW to the packet.\n" - * A password is only required for a few adapter types.\n" - * The password may be specified in ethernet hex format\n" - * or dotted decimal (Internet address)\n" - * -p 00:22:44:66:88:aa\n" - * -p 192.168.1.1\n"; - * + * Options:\n" + * -b Send wake-up packet to the broadcast address.\n" + * -D Increase the debug level.\n" + * -i ifname Use interface IFNAME instead of the default 'eth0'.\n" + * -p <pw> Append the four or six byte password PW to the packet.\n" + * A password is only required for a few adapter types.\n" + * The password may be specified in ethernet hex format\n" + * or dotted decimal (Internet address)\n" + * -p 00:22:44:66:88:aa\n" + * -p 192.168.1.1\n"; + * + * + * This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet", + * used for restarting machines that have been soft-powered-down + * (ACPI D3-warm state). It currently generates the standard AMD Magic Packet + * format, with an optional password appended. + * + * This software may be used and distributed according to the terms + * of the GNU Public License, incorporated herein by reference. + * Contact the author for use under other terms. + * + * This source file was originally part of the network tricks package, and + * is now distributed to support the Scyld Beowulf system. + * Copyright 1999-2003 Donald Becker and Scyld Computing Corporation. + * + * The author may be reached as becker@scyld, or C/O + * Scyld Computing Corporation + * 914 Bay Ridge Road, Suite 220 + * Annapolis MD 21403 * - * This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet", - * used for restarting machines that have been soft-powered-down - * (ACPI D3-warm state). It currently generates the standard AMD Magic Packet - * format, with an optional password appended. - * - * This software may be used and distributed according to the terms - * of the GNU Public License, incorporated herein by reference. - * Contact the author for use under other terms. - * - * This source file was originally part of the network tricks package, and - * is now distributed to support the Scyld Beowulf system. - * Copyright 1999-2003 Donald Becker and Scyld Computing Corporation. - * - * The author may be reached as becker@scyld, or C/O - * Scyld Computing Corporation - * 914 Bay Ridge Road, Suite 220 - * Annapolis MD 21403 - * * Notes: * On some systems dropping root capability allows the process to be * dumped, traced or debugged. * If someone traces this program, they get control of a raw socket. * Linux handles this safely, but beware when porting this program. - * + * * An alternative to needing 'root' is using a UDP broadcast socket, however * doing so only works with adapters configured for unicast+broadcast Rx * filter. That configuration consumes more power. diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c index 40d5cf1..c7fb42f 100644 --- a/networking/fakeidentd.c +++ b/networking/fakeidentd.c @@ -55,7 +55,7 @@ static const int ident_substr_len = sizeof(ident_substr) - 1; #define PIDFILE "/var/run/identd.pid" /* - * We have to track the 'first connection socket' so that we + * We have to track the 'first connection socket' so that we * don't go around closing file descriptors for non-clients. * * descriptor setup normally diff --git a/networking/hostname.c b/networking/hostname.c index a00263d..8b9314c 100644 --- a/networking/hostname.c +++ b/networking/hostname.c @@ -77,8 +77,8 @@ int hostname_main(int argc, char **argv) if (argc < 1) bb_show_usage(); - while ((opt = getopt(argc, argv, "dfisF:")) > 0) { - switch (opt) { + while ((opt = getopt(argc, argv, "dfisF:")) > 0) { + switch (opt) { case 'd': case 'f': case 'i': diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 9dce445..34a43e6 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -471,8 +471,8 @@ static int static_up(struct interface_defn_t *ifd, execfn *exec) return ((result == 3) ? 3 : 0); #else result = execute("ifconfig %iface% %address% netmask %netmask% " - "[[broadcast %broadcast%]] [[pointopoint %pointopoint%]] " - "[[media %media%]] [[mtu %mtu%]] [[hw %hwaddress%]] up", + "[[broadcast %broadcast%]] [[pointopoint %pointopoint%]] " + "[[media %media%]] [[mtu %mtu%]] [[hw %hwaddress%]] up", ifd, exec); result += execute("[[ route add default gw %gateway% %iface% ]]", ifd, exec); return ((result == 2) ? 2 : 0); diff --git a/networking/inetd.c b/networking/inetd.c index 7a6ffae..9f6acdb 100644 --- a/networking/inetd.c +++ b/networking/inetd.c @@ -1364,7 +1364,7 @@ inetd_main (int argc, char *argv[]) sigaction (SIGINT, &sa, NULL); sa.sa_handler = SIG_IGN; sigaction (SIGPIPE, &sa, &sapipe); - memset(&wait_mask, 0, sizeof(wait_mask)); + memset(&wait_mask, 0, sizeof(wait_mask)); { /* space for daemons to overwrite environment for ps */ #define DUMMYSIZE 100 diff --git a/networking/interface.c b/networking/interface.c index 554dc16..ad6c40f 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -1039,9 +1039,9 @@ static char *get_name(char *name, char *p) * args. */ /* static const char * const ss_fmt[] = { */ -/* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */ -/* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */ -/* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */ +/* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */ +/* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */ +/* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */ /* }; */ /* Lie about the size of the int pointed to for %n. */ diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index c6115b3..c5e6e4e 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c @@ -54,8 +54,8 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown) fprintf(fp, "<"); flags &= ~IFF_RUNNING; #define _PF(f) if (flags&IFF_##f) { \ - flags &= ~IFF_##f ; \ - fprintf(fp, #f "%s", flags ? "," : ""); } + flags &= ~IFF_##f ; \ + fprintf(fp, #f "%s", flags ? "," : ""); } _PF(LOOPBACK); _PF(BROADCAST); _PF(POINTOPOINT); @@ -74,7 +74,7 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown) #endif _PF(UP); #undef _PF - if (flags) + if (flags) fprintf(fp, "%x", flags); if (mdown) fprintf(fp, ",M-DOWN"); @@ -636,9 +636,9 @@ static int ipaddr_modify(int cmd, int argc, char **argv) "anycast", "scope", "dev", "label", "local", 0 }; struct rtnl_handle rth; struct { - struct nlmsghdr n; - struct ifaddrmsg ifa; - char buf[256]; + struct nlmsghdr n; + struct ifaddrmsg ifa; + char buf[256]; } req; char *d = NULL; char *l = NULL; diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index b4493d6..91c8582 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c @@ -289,7 +289,7 @@ static int do_set(int argc, char **argv) NEXT_ARG(); newaddr = *argv; } else { - if (strcmp(*argv, "dev") == 0) { + if (strcmp(*argv, "dev") == 0) { NEXT_ARG(); } if (dev) diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index b622afd..1c4f755 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c @@ -286,9 +286,9 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv) { struct rtnl_handle rth; struct { - struct nlmsghdr n; - struct rtmsg r; - char buf[1024]; + struct nlmsghdr n; + struct rtmsg r; + char buf[1024]; } req; char mxbuf[256]; struct rtattr * mxrta = (void*)mxbuf; @@ -648,15 +648,15 @@ static int iproute_get(int argc, char **argv) { struct rtnl_handle rth; struct { - struct nlmsghdr n; - struct rtmsg r; - char buf[1024]; + struct nlmsghdr n; + struct rtmsg r; + char buf[1024]; } req; char *idev = NULL; char *odev = NULL; int connected = 0; int from_ok = 0; - static const char * const options[] = + static const char * const options[] = { "from", "iif", "oif", "dev", "notify", "connected", "to", 0 }; memset(&req, 0, sizeof(req)); @@ -816,8 +816,8 @@ static int iproute_get(int argc, char **argv) int do_iproute(int argc, char **argv) { - static const char * const ip_route_commands[] = - { "add", "append", "change", "chg", "delete", "del", "get", + static const char * const ip_route_commands[] = + { "add", "append", "change", "chg", "delete", "del", "get", "list", "show", "prepend", "replace", "test", "flush", 0 }; int command_num = 7; unsigned int flags = 0; diff --git a/networking/libiproute/linux/pkt_sched.h b/networking/libiproute/linux/pkt_sched.h index 70cbabc..ec5b3fd 100644 --- a/networking/libiproute/linux/pkt_sched.h +++ b/networking/libiproute/linux/pkt_sched.h @@ -256,8 +256,8 @@ struct tc_gred_sopt struct tc_htb_opt { - struct tc_ratespec rate; - struct tc_ratespec ceil; + struct tc_ratespec rate; + struct tc_ratespec ceil; __u32 buffer; __u32 cbuffer; __u32 quantum; /* out only */ @@ -268,9 +268,9 @@ struct tc_htb_opt }; struct tc_htb_glob { - __u32 rate2quantum; /* bps->quantum divisor */ - __u32 defcls; /* default class number */ - __u32 use_dcache; /* use dequeue cache ? */ + __u32 rate2quantum; /* bps->quantum divisor */ + __u32 defcls; /* default class number */ + __u32 use_dcache; /* use dequeue cache ? */ __u32 debug; /* debug flags */ @@ -311,8 +311,8 @@ struct tc_cbq_lssopt unsigned char flags; #define TCF_CBQ_LSS_BOUNDED 1 #define TCF_CBQ_LSS_ISOLATED 2 - unsigned char ewma_log; - unsigned char level; + unsigned char ewma_log; + unsigned char level; #define TCF_CBQ_LSS_FLAGS 1 #define TCF_CBQ_LSS_EWMA 2 #define TCF_CBQ_LSS_MAXIDLE 4 diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c index 104fbca..8732530 100644 --- a/networking/libiproute/ll_proto.c +++ b/networking/libiproute/ll_proto.c @@ -92,23 +92,23 @@ __PF(ECONET,econet) const char * ll_proto_n2a(unsigned short id, char *buf, int len) { - int i; + int i; id = ntohs(id); - for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { - if (llproto_names[i].id == id) + for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { + if (llproto_names[i].id == id) return llproto_names[i].name; } - snprintf(buf, len, "[%d]", id); - return buf; + snprintf(buf, len, "[%d]", id); + return buf; } int ll_proto_a2n(unsigned short *id, char *buf) { - int i; - for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { - if (strcasecmp(llproto_names[i].name, buf) == 0) { + int i; + for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { + if (strcasecmp(llproto_names[i].name, buf) == 0) { *id = htons(llproto_names[i].id); return 0; } diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c index 6b42426..fc5a015 100644 --- a/networking/libiproute/ll_types.c +++ b/networking/libiproute/ll_types.c @@ -105,11 +105,11 @@ __PF(VOID,void) }; #undef __PF - int i; - for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { - if (arphrd_names[i].type == type) + int i; + for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { + if (arphrd_names[i].type == type) return arphrd_names[i].name; } - snprintf(buf, len, "[%d]", type); - return buf; + snprintf(buf, len, "[%d]", type); + return buf; } diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h index 3d223ed..0a3a06c 100644 --- a/networking/libiproute/utils.h +++ b/networking/libiproute/utils.h @@ -46,8 +46,8 @@ typedef struct struct dn_naddr { - unsigned short a_len; - unsigned char a_addr[DN_MAXADDL]; + unsigned short a_len; + unsigned char a_addr[DN_MAXADDL]; }; #define IPX_NODE_LEN 6 diff --git a/networking/nc.c b/networking/nc.c index fda1fb8..85148c4 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -48,9 +48,9 @@ static void timeout(int signum) int nc_main(int argc, char **argv) { int do_listen = 0, lport = 0, delay = 0, wsecs = 0, tmpfd, opt, sfd, x; - + #define buf bb_common_bufsiz1 - + #ifdef CONFIG_NC_GAPING_SECURITY_HOLE char *pr00gie = NULL; #endif diff --git a/networking/netstat.c b/networking/netstat.c index bc1ed05..ea37232 100644 --- a/networking/netstat.c +++ b/networking/netstat.c @@ -247,7 +247,7 @@ static void udp_do_one(int lnr, const char *line) if (strlen(local_addr) > 8) { #ifdef CONFIG_FEATURE_IPV6 - /* Demangle what the kernel gives us */ + /* Demangle what the kernel gives us */ sscanf(local_addr, "%08X%08X%08X%08X", &in6.s6_addr32[0], &in6.s6_addr32[1], &in6.s6_addr32[2], &in6.s6_addr32[3]); diff --git a/networking/ping.c b/networking/ping.c index ed52abf..14373c8 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -236,20 +236,20 @@ static void sendping(int junk) static char *icmp_type_name (int id) { switch (id) { - case ICMP_ECHOREPLY: return "Echo Reply"; - case ICMP_DEST_UNREACH: return "Destination Unreachable"; - case ICMP_SOURCE_QUENCH: return "Source Quench"; - case ICMP_REDIRECT: return "Redirect (change route)"; - case ICMP_ECHO: return "Echo Request"; - case ICMP_TIME_EXCEEDED: return "Time Exceeded"; - case ICMP_PARAMETERPROB: return "Parameter Problem"; - case ICMP_TIMESTAMP: return "Timestamp Request"; - case ICMP_TIMESTAMPREPLY: return "Timestamp Reply"; - case ICMP_INFO_REQUEST: return "Information Request"; - case ICMP_INFO_REPLY: return "Information Reply"; - case ICMP_ADDRESS: return "Address Mask Request"; - case ICMP_ADDRESSREPLY: return "Address Mask Reply"; - default: return "unknown ICMP type"; + case ICMP_ECHOREPLY: return "Echo Reply"; + case ICMP_DEST_UNREACH: return "Destination Unreachable"; + case ICMP_SOURCE_QUENCH: return "Source Quench"; + case ICMP_REDIRECT: return "Redirect (change route)"; + case ICMP_ECHO: return "Echo Request"; + case ICMP_TIME_EXCEEDED: return "Time Exceeded"; + case ICMP_PARAMETERPROB: return "Parameter Problem"; + case ICMP_TIMESTAMP: return "Timestamp Request"; + case ICMP_TIMESTAMPREPLY: return "Timestamp Reply"; + case ICMP_INFO_REQUEST: return "Information Request"; + case ICMP_INFO_REPLY: return "Information Reply"; + case ICMP_ADDRESS: return "Address Mask Request"; + case ICMP_ADDRESSREPLY: return "Address Mask Reply"; + default: return "unknown ICMP type"; } } diff --git a/networking/ping6.c b/networking/ping6.c index 72867f3..1d7271d 100644 --- a/networking/ping6.c +++ b/networking/ping6.c @@ -246,7 +246,7 @@ static char *icmp6_type_name (int id) case ICMP6_MEMBERSHIP_QUERY: return "Membership Query"; case ICMP6_MEMBERSHIP_REPORT: return "Membership Report"; case ICMP6_MEMBERSHIP_REDUCTION: return "Membership Reduction"; - default: return "unknown ICMP type"; + default: return "unknown ICMP type"; } } diff --git a/networking/route.c b/networking/route.c index bb5f940..49d219a 100644 --- a/networking/route.c +++ b/networking/route.c @@ -86,7 +86,7 @@ /* We remap '-' to '#' to avoid problems with getopt. */ static const char tbl_hash_net_host[] = "\007\001#net\0" -/* "\010\002#host\0" */ +/* "\010\002#host\0" */ "\007\002#host" /* Since last, we can save a byte. */ ; @@ -128,7 +128,7 @@ static const char tbl_ipvx[] = #endif "\006\041mod\0" "\006\042dyn\0" -/* "\014\043reinstate\0" */ +/* "\014\043reinstate\0" */ "\013\043reinstate" /* Since last, we can save a byte. */ ; @@ -186,7 +186,7 @@ static void INET_setroute(int action, char **args) const char *target = *args++; /* Prefer hostname lookup is -host flag (xflag==1) was given. */ - isnet = INET_resolve(target, (struct sockaddr_in *) &rt.rt_dst, + isnet = INET_resolve(target, (struct sockaddr_in *) &rt.rt_dst, (xflag & HOST_FLAG)); if (isnet < 0) { bb_error_msg_and_die("resolving %s", target); @@ -459,7 +459,7 @@ static const unsigned int flagvals[] = { /* Must agree with flagchars[]. */ #define IPV4_MASK (RTF_GATEWAY|RTF_HOST|RTF_REINSTATE|RTF_DYNAMIC|RTF_MODIFIED) #define IPV6_MASK (RTF_GATEWAY|RTF_HOST|RTF_DEFAULT|RTF_ADDRCONF|RTF_CACHE) -static const char flagchars[] = /* Must agree with flagvals[]. */ +static const char flagchars[] = /* Must agree with flagvals[]. */ "GHRDM" #ifdef CONFIG_FEATURE_IPV6 "DAC" @@ -645,10 +645,10 @@ static void INET6_displayroutes(int noresolve) #define ROUTE_OPT_INET6 0x08 /* Not an actual option. See below. */ /* 1st byte is offset to next entry offset. 2nd byte is return value. */ -static const char tbl_verb[] = /* 2nd byte matches RTACTION_* code */ +static const char tbl_verb[] = /* 2nd byte matches RTACTION_* code */ "\006\001add\0" "\006\002del\0" -/* "\011\002delete\0" */ +/* "\011\002delete\0" */ "\010\002delete" /* Since last, we can save a byte. */ ; diff --git a/networking/telnet.c b/networking/telnet.c index 3143631..d9e66e5 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -647,7 +647,7 @@ extern int telnet_main(int argc, char** argv) #ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN if (1 & bb_getopt_ulflags(argc, argv, "al:", &autologin)) autologin = getenv("USER"); - + if (optind < argc) { bb_lookup_host(&s_in, argv[optind++]); s_in.sin_port = bb_lookup_port((optind < argc) ? argv[optind++] : diff --git a/networking/telnetd.c b/networking/telnetd.c index d5de890..73303a2 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -94,7 +94,7 @@ struct tsession { +-------+ wridx1++ +------+ rdidx1++ +----------+ | | <-------------- | buf1 | <-------------- | | | | size1-- +------+ size1++ | | - | pty | | socket | + | pty | | socket | | | rdidx2++ +------+ wridx2++ | | | | --------------> | buf2 | --------------> | | +-------+ size2++ +------+ size2-- +----------+ @@ -166,7 +166,7 @@ remove_iacs(struct tsession *ts, int *pnum_totty) { else if (ptr[1] == SB && ptr[2] == TELOPT_NAWS) { struct winsize ws; if ((ptr+8) >= end) - break; /* incomplete, can't process */ + break; /* incomplete, can't process */ ws.ws_col = (ptr[3] << 8) | ptr[4]; ws.ws_row = (ptr[5] << 8) | ptr[6]; (void) ioctl(ts->ptyfd, TIOCSWINSZ, (char *)&ws); @@ -383,7 +383,7 @@ int telnetd_main(int argc, char **argv) { #ifndef CONFIG_FEATURE_TELNETD_INETD - sockaddr_type sa; + sockaddr_type sa; int master_fd; #endif /* CONFIG_FEATURE_TELNETD_INETD */ fd_set rdfdset, wrfdset; @@ -446,7 +446,7 @@ telnetd_main(int argc, char **argv) /* Grab a TCP socket. */ - master_fd = socket(SOCKET_TYPE, SOCK_STREAM, 0); + master_fd = socket(SOCKET_TYPE, SOCK_STREAM, 0); if (master_fd < 0) { bb_perror_msg_and_die("socket"); } diff --git a/networking/tftp.c b/networking/tftp.c index cad0dcc..402d5d0 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -1,34 +1,34 @@ /* ------------------------------------------------------------------------- */ -/* tftp.c */ -/* */ -/* A simple tftp client for busybox. */ -/* Tries to follow RFC1350. */ -/* Only "octet" mode supported. */ +/* tftp.c */ +/* */ +/* A simple tftp client for busybox. */ +/* Tries to follow RFC1350. */ +/* Only "octet" mode supported. */ /* Optional blocksize negotiation (RFC2347 + RFC2348) */ -/* */ +/* */ /* Copyright (C) 2001 Magnus Damm <damm@opensource.se> */ -/* */ -/* Parts of the code based on: */ -/* */ +/* */ +/* Parts of the code based on: */ +/* */ /* atftp: Copyright (C) 2000 Jean-Pierre Lefebvre <helix@step.polymtl.ca> */ /* and Remi Lefebvre <remi@debian.org> */ -/* */ +/* */ /* utftp: Copyright (C) 1999 Uwe Ohse <uwe@ohse.de> */ -/* */ +/* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ -/* */ +/* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ /* General Public License for more details. */ -/* */ +/* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* */ +/* */ /* ------------------------------------------------------------------------- */ #include <stdio.h> @@ -87,13 +87,13 @@ static const char * const tftp_bb_error_msg[] = { static int tftp_blocksize_check(int blocksize, int bufsize) { - /* Check if the blocksize is valid: + /* Check if the blocksize is valid: * RFC2348 says between 8 and 65464, * but our implementation makes it impossible * to use blocksizes smaller than 22 octets. */ - if ((bufsize && (blocksize > bufsize)) || + if ((bufsize && (blocksize > bufsize)) || (blocksize < 8) || (blocksize > 65464)) { bb_error_msg("bad blocksize"); return 0; @@ -104,7 +104,7 @@ static int tftp_blocksize_check(int blocksize, int bufsize) static char *tftp_option_get(char *buf, int len, char *option) { - int opt_val = 0; + int opt_val = 0; int opt_found = 0; int k; @@ -216,7 +216,7 @@ static inline int tftp(const int cmd, const struct hostent *host, if ((cmd_get && (opcode == TFTP_RRQ)) || (cmd_put && (opcode == TFTP_WRQ))) { - int too_long = 0; + int too_long = 0; /* see if the filename fits into buf */ /* and fill in packet */ @@ -418,7 +418,7 @@ static inline int tftp(const int cmd, const struct hostent *host, if (res) { int blksize = atoi(res); - + if (tftp_blocksize_check(blksize, tftp_bufsize - 4)) { @@ -452,7 +452,7 @@ static inline int tftp(const int cmd, const struct hostent *host, if (cmd_get && (opcode == TFTP_DATA)) { if (tmp == block_nr) { - + len = bb_full_write(localfd, &buf[4], len - 4); if (len < 0) { @@ -496,7 +496,7 @@ static inline int tftp(const int cmd, const struct hostent *host, #ifdef CONFIG_FEATURE_CLEAN_UP close(socketfd); - free(buf); + free(buf); #endif return finished ? EXIT_SUCCESS : EXIT_FAILURE; @@ -549,8 +549,8 @@ int tftp_main(int argc, char **argv) /* XXX: may be should #error ? */ #endif - - cmd = bb_getopt_ulflags(argc, argv, GET PUT "l:r:" BS, + + cmd = bb_getopt_ulflags(argc, argv, GET PUT "l:r:" BS, &localfile, &remotefile BS_ARG); #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE if(sblocksize) { diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c index 7cc2be4..4831d43 100644 --- a/networking/udhcp/arpping.c +++ b/networking/udhcp/arpping.c @@ -23,7 +23,7 @@ * ip - our ip * mac - our arp address * interface - interface to use - * retn: 1 addr free + * retn: 1 addr free * 0 addr used * -1 error */ @@ -33,7 +33,7 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface) { int timeout = 2; - int optval = 1; + int optval = 1; int s; /* socket */ int rv = 1; /* return value */ struct sockaddr addr; /* for interface name */ @@ -101,6 +101,6 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface) prevTime = uptime(); } close(s); - DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V"); + DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V"); return rv; } diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c index 528befd..e377bd2 100644 --- a/networking/udhcp/clientpacket.c +++ b/networking/udhcp/clientpacket.c @@ -205,8 +205,8 @@ int get_raw_packet(struct dhcpMessage *payload, int fd) packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) || bytes > (int) sizeof(struct udp_dhcp_packet) || ntohs(packet.udp.len) != (uint16_t) (bytes - sizeof(packet.ip))) { - DEBUG(LOG_INFO, "unrelated/bogus packet"); - return -2; + DEBUG(LOG_INFO, "unrelated/bogus packet"); + return -2; } /* check IP checksum */ diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index efa8fd4..071a5c4 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -43,7 +43,7 @@ long uptime(void); void background(const char *pidfile); void start_log_and_pid(const char *client_server, const char *pidfile); void udhcp_logging(int level, const char *fmt, ...); - + #define LOG(level, str, args...) udhcp_logging(level, str, ## args) #ifdef UDHCP_DEBUG diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index c4277e3..a4afb0c 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) {"hostname", required_argument, 0, 'h'}, {"fqdn", required_argument, 0, 'F'}, {"interface", required_argument, 0, 'i'}, - {"now", no_argument, 0, 'n'}, + {"now", no_argument, 0, 'n'}, {"pidfile", required_argument, 0, 'p'}, {"quit", no_argument, 0, 'q'}, {"request", required_argument, 0, 'r'}, @@ -314,7 +314,7 @@ int main(int argc, char *argv[]) client_config.vendorclass[OPT_CODE] = DHCP_VENDOR; client_config.vendorclass[OPT_LEN] = sizeof("udhcp "VERSION) - 1; client_config.vendorclass[OPT_DATA] = 1; - memcpy(&client_config.vendorclass[OPT_DATA], + memcpy(&client_config.vendorclass[OPT_DATA], "udhcp "VERSION, sizeof("udhcp "VERSION) - 1); } @@ -370,7 +370,7 @@ int main(int argc, char *argv[]) } else if (client_config.abort_if_no_lease) { LOG(LOG_INFO, "No lease, failing."); return 1; - } + } /* wait to try again */ packet_num = 0; timeout = now + 60; diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 2812e6e..0dfc0b5 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -193,7 +193,7 @@ int main(int argc, char *argv[]) LOG(LOG_ERR, "send OFFER failed"); } break; - case DHCPREQUEST: + case DHCPREQUEST: DEBUG(LOG_INFO, "received REQUEST"); requested = get_option(&packet, DHCP_REQUESTED_IP); diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h index 65c8348..a060002 100644 --- a/networking/udhcp/dhcpd.h +++ b/networking/udhcp/dhcpd.h @@ -108,23 +108,23 @@ struct static_lease { struct server_config_t { uint32_t server; /* Our IP, in network order */ - uint32_t start; /* Start address of leases, network order */ + uint32_t start; /* Start address of leases, network order */ uint32_t end; /* End of leases, network order */ struct option_set *options; /* List of DHCP options loaded from the config file */ char *interface; /* The name of the interface to use */ int ifindex; /* Index number of the interface to use */ - uint8_t arp[6]; /* Our arp address */ + uint8_t arp[6]; /* Our arp address */ unsigned long lease; /* lease time in seconds (host order) */ - unsigned long max_leases; /* maximum number of leases (including reserved address) */ - char remaining; /* should the lease file be interpreted as lease time remaining, or - * as the time the lease expires */ - unsigned long auto_time; /* how long should udhcpd wait before writing a config file. + unsigned long max_leases; /* maximum number of leases (including reserved address) */ + char remaining; /* should the lease file be interpreted as lease time remaining, or + * as the time the lease expires */ + unsigned long auto_time; /* how long should udhcpd wait before writing a config file. * if this is zero, it will only write one on SIGUSR1 */ - unsigned long decline_time; /* how long an address is reserved if a client returns a - * decline message */ - unsigned long conflict_time; /* how long an arp conflict offender is leased for */ - unsigned long offer_time; /* how long an offered address is reserved */ - unsigned long min_lease; /* minimum lease a client can request*/ + unsigned long decline_time; /* how long an address is reserved if a client returns a + * decline message */ + unsigned long conflict_time; /* how long an arp conflict offender is leased for */ + unsigned long offer_time; /* how long an offered address is reserved */ + unsigned long min_lease; /* minimum lease a client can request*/ char *lease_file; char *pidfile; char *notify_file; /* What to run whenever leases are written */ diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index 40e68a0..01534f2 100644 --- a/networking/udhcp/files.c +++ b/networking/udhcp/files.c @@ -271,7 +271,7 @@ static const struct config_keyword keywords[] = { {"boot_file", read_str, &(server_config.boot_file), ""}, {"static_lease",read_staticlease, &(server_config.static_leases), ""}, /*ADDME: static lease */ - {"", NULL, NULL, ""} + {"", NULL, NULL, ""} }; diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c index 4da21a2..bb08c3a 100644 --- a/networking/udhcp/leases.c +++ b/networking/udhcp/leases.c @@ -148,7 +148,7 @@ uint32_t find_address(int check_expired) (check_expired && lease_expired(lease))) && /* and it isn't on the network */ - !check_ip(ret)) { + !check_ip(ret)) { return ret; break; } diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h index 0dae401..30e167f 100644 --- a/networking/udhcp/libbb_udhcp.h +++ b/networking/udhcp/libbb_udhcp.h @@ -29,19 +29,19 @@ /* make safe the exported namespace */ /* from common.h */ -#define background udhcp_background -#define start_log_and_pid udhcp_start_log_and_pid +#define background udhcp_background +#define start_log_and_pid udhcp_start_log_and_pid /* from script.h */ -#define run_script udhcp_run_script +#define run_script udhcp_run_script /* from packet.h */ -#define init_header udhcp_init_header -#define get_packet udhcp_get_packet -#define checksum udhcp_checksum -#define raw_packet udhcp_raw_packet -#define kernel_packet udhcp_kernel_packet +#define init_header udhcp_init_header +#define get_packet udhcp_get_packet +#define checksum udhcp_checksum +#define raw_packet udhcp_raw_packet +#define kernel_packet udhcp_kernel_packet /* from pidfile.h */ -#define pidfile_acquire udhcp_pidfile_acquire -#define pidfile_write_release udhcp_pidfile_write_release +#define pidfile_acquire udhcp_pidfile_acquire +#define pidfile_write_release udhcp_pidfile_write_release /* from options.h */ #define get_option udhcp_get_option #define end_option udhcp_end_option diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c index 1443451..eebcaaa 100644 --- a/networking/udhcp/options.c +++ b/networking/udhcp/options.c @@ -154,11 +154,11 @@ int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data) for (dh=dhcp_options; dh->code; dh++) { if (dh->code == code) { uint8_t option[6], len; - + option[OPT_CODE] = code; len = option_lengths[dh->flags & TYPE_MASK]; option[OPT_LEN] = len; - if (__BYTE_ORDER == __BIG_ENDIAN) + if (__BYTE_ORDER == __BIG_ENDIAN) data <<= 8 * (4 - len); /* This memcpy is for broken processors which can't * handle a simple unaligned 32-bit assignment */ diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c index 1c6bb0c..64a9100 100644 --- a/networking/udhcp/packet.c +++ b/networking/udhcp/packet.c @@ -71,13 +71,13 @@ int get_packet(struct dhcpMessage *packet, int fd) for (i = 0; broken_vendors[i][0]; i++) { if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) && !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) { - DEBUG(LOG_INFO, "broken client (%s), forcing broadcast", - broken_vendors[i]); - packet->flags |= htons(BROADCAST_FLAG); + DEBUG(LOG_INFO, "broken client (%s), forcing broadcast", + broken_vendors[i]); + packet->flags |= htons(BROADCAST_FLAG); } } } - + return bytes; } diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index c04c69f..b6b0e0d 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c @@ -97,7 +97,7 @@ static void fill_options(char *dest, uint8_t *option, struct dhcp_option *type_p optlen = 4; case OPTION_IP: /* Works regardless of host byte order. */ dest += sprintip(dest, "", option); - break; + break; case OPTION_BOOLEAN: dest += sprintf(dest, *option ? "yes" : "no"); break; diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c index c6a8209..1b89862 100644 --- a/networking/udhcp/serverpacket.c +++ b/networking/udhcp/serverpacket.c @@ -138,11 +138,11 @@ int sendOffer(struct dhcpMessage *oldpacket) /* and the ip is in the lease range */ ntohl(req_align) >= ntohl(server_config.start) && ntohl(req_align) <= ntohl(server_config.end) && - + !static_lease_ip && /* Check that its not a static lease */ /* and is not already taken/offered */ ((!(lease = find_lease_by_yiaddr(req_align)) || - + /* or its taken, but expired */ /* ADDME: or maybe in here */ lease_expired(lease)))) { packet.yiaddr = req_align; /* FIXME: oh my, is there a host using this IP? */ diff --git a/networking/vconfig.c b/networking/vconfig.c index bbd2987..36458f7 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c @@ -54,20 +54,20 @@ struct vlan_ioctl_args { int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */ char device1[24]; - union { + union { char device2[24]; int VID; unsigned int skb_priority; unsigned int name_type; unsigned int bind_type; unsigned int flag; /* Matches vlan_dev_info flags */ - } u; + } u; short vlan_qos; }; #define VLAN_GROUP_ARRAY_LEN 4096 -#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ +#define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ /* On entry, table points to the length of the current string plus * nul terminator plus data length for the subsequent entry. The diff --git a/networking/wget.c b/networking/wget.c index 29f5d45..9c7ed9f 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -118,22 +118,22 @@ static char *safe_fgets(char *s, int size, FILE *stream) */ static char *base64enc(unsigned char *p, char *buf, int len) { - char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - "0123456789+/"; + char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + "0123456789+/"; char *s = buf; - while(*p) { + while(*p) { if (s >= buf+len-4) bb_error_msg_and_die("buffer overflow"); - *(s++) = al[(*p >> 2) & 0x3F]; - *(s++) = al[((*p << 4) & 0x30) | ((*(p+1) >> 4) & 0x0F)]; - *s = *(s+1) = '='; - *(s+2) = 0; - if (! *(++p)) break; - *(s++) = al[((*p << 2) & 0x3C) | ((*(p+1) >> 6) & 0x03)]; - if (! *(++p)) break; - *(s++) = al[*(p++) & 0x3F]; - } + *(s++) = al[(*p >> 2) & 0x3F]; + *(s++) = al[((*p << 4) & 0x30) | ((*(p+1) >> 4) & 0x0F)]; + *s = *(s+1) = '='; + *(s+2) = 0; + if (! *(++p)) break; + *(s++) = al[((*p << 2) & 0x3C) | ((*(p+1) >> 6) & 0x03)]; + if (! *(++p)) break; + *(s++) = al[*(p++) & 0x3F]; + } return buf; } @@ -190,8 +190,8 @@ int wget_main(int argc, char **argv) */ bb_opt_complementally = "-1:\203::"; bb_applet_long_options = wget_long_options; - opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:", - &fname_out, &headers_llist, + opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:", + &fname_out, &headers_llist, &dir_prefix, &proxy_flag); if (opt & WGET_OPT_CONTINUE) { ++do_continue; @@ -217,7 +217,7 @@ int wget_main(int argc, char **argv) headers_llist = headers_llist->link; } } - + parse_url(argv[optind], &target); server.host = target.host; server.port = target.port; @@ -347,8 +347,8 @@ int wget_main(int argc, char **argv) fprintf(sfp,"Connection: close\r\n\r\n"); /* - * Retrieve HTTP response line and check for "200" status code. - */ + * Retrieve HTTP response line and check for "200" status code. + */ read_response: if (fgets(buf, sizeof(buf), sfp) == NULL) close_delete_and_die("no response from server"); diff --git a/networking/zcip.c b/networking/zcip.c index 294ffd0..b64e37c 100644 --- a/networking/zcip.c +++ b/networking/zcip.c @@ -174,7 +174,7 @@ run(char *script, char *arg, char *intf, struct in_addr *ip) execl(script, script, arg, NULL); perror("execl"); _exit(EXIT_FAILURE); - } + } if (waitpid(pid, &status, 0) <= 0) { why = "waitpid"; @@ -365,7 +365,7 @@ fail: fds[0].events = POLLIN; fds[0].revents = 0; - // poll, being ready to adjust current timeout + // poll, being ready to adjust current timeout if (timeout > 0) { gettimeofday(&tv1, NULL); tv1.tv_usec += (timeout % 1000) * 1000; @@ -477,7 +477,7 @@ fail: && p.arp.ar_op != htons(ARPOP_REPLY)) continue; - // some cases are always conflicts + // some cases are always conflicts if ((p.source_ip.s_addr == ip.s_addr) && (memcmp(&addr, &p.source_addr, ETH_ALEN) != 0)) { @@ -533,7 +533,7 @@ collision: bad: if (foreground) perror(why); - else + else syslog(LOG_ERR, "%s %s, %s error: %s", prog, intf, why, strerror(errno)); return EXIT_FAILURE; |