diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-01-22 22:55:11 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-01-22 22:55:11 +0000 |
commit | 86f5c9906beac527f3d7966f24811b571a589e08 (patch) | |
tree | 1c9eba853c728b5d734506e1c66c269d96fe46ea /networking | |
parent | 2edf52643d3eb3d13f26d31f9678cf122f2063bc (diff) | |
download | busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.tar.gz busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.tar.bz2 busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.zip |
- add platform.h.
- use shorter boilerplate while at it.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/inetd.c | 22 | ||||
-rw-r--r-- | networking/libiproute/ip_common.h | 5 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 2 | ||||
-rw-r--r-- | networking/libiproute/utils.h | 9 | ||||
-rw-r--r-- | networking/nameif.c | 4 | ||||
-rw-r--r-- | networking/traceroute.c | 2 | ||||
-rw-r--r-- | networking/udhcp/arpping.h | 2 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 18 | ||||
-rw-r--r-- | networking/udhcp/dumpleases.c | 6 | ||||
-rw-r--r-- | networking/zcip.c | 19 |
10 files changed, 36 insertions, 53 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 5388bf789..7a6ffae0c 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -928,7 +928,7 @@ static int matchconf (servtab_t *old, servtab_t *new) | |||
928 | return (1); | 928 | return (1); |
929 | } | 929 | } |
930 | 930 | ||
931 | static void config (int sig __attribute__((unused))) | 931 | static void config (int sig ATTRIBUTE_UNUSED) |
932 | { | 932 | { |
933 | servtab_t *sep, *cp, **sepp; | 933 | servtab_t *sep, *cp, **sepp; |
934 | sigset_t omask; | 934 | sigset_t omask; |
@@ -1149,7 +1149,7 @@ static void config (int sig __attribute__((unused))) | |||
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | 1151 | ||
1152 | static void reapchild (int sig __attribute__((unused))) | 1152 | static void reapchild (int sig ATTRIBUTE_UNUSED) |
1153 | { | 1153 | { |
1154 | pid_t pid; | 1154 | pid_t pid; |
1155 | int save_errno = errno, status; | 1155 | int save_errno = errno, status; |
@@ -1176,7 +1176,7 @@ static void reapchild (int sig __attribute__((unused))) | |||
1176 | errno = save_errno; | 1176 | errno = save_errno; |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | static void retry (int sig __attribute__((unused))) | 1179 | static void retry (int sig ATTRIBUTE_UNUSED) |
1180 | { | 1180 | { |
1181 | servtab_t *sep; | 1181 | servtab_t *sep; |
1182 | 1182 | ||
@@ -1200,7 +1200,7 @@ static void retry (int sig __attribute__((unused))) | |||
1200 | } | 1200 | } |
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | static void goaway (int sig __attribute__((unused))) | 1203 | static void goaway (int sig ATTRIBUTE_UNUSED) |
1204 | { | 1204 | { |
1205 | servtab_t *sep; | 1205 | servtab_t *sep; |
1206 | 1206 | ||
@@ -1582,7 +1582,7 @@ echo_stream (int s, servtab_t *sep) | |||
1582 | /* Echo service -- echo data back */ | 1582 | /* Echo service -- echo data back */ |
1583 | /* ARGSUSED */ | 1583 | /* ARGSUSED */ |
1584 | static void | 1584 | static void |
1585 | echo_dg (int s, servtab_t *sep __attribute__((unused))) | 1585 | echo_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1586 | { | 1586 | { |
1587 | char buffer[BUFSIZE]; | 1587 | char buffer[BUFSIZE]; |
1588 | int i; | 1588 | int i; |
@@ -1616,7 +1616,7 @@ discard_stream (int s, servtab_t *sep) | |||
1616 | /* Discard service -- ignore data */ | 1616 | /* Discard service -- ignore data */ |
1617 | /* ARGSUSED */ | 1617 | /* ARGSUSED */ |
1618 | static void | 1618 | static void |
1619 | discard_dg (int s, servtab_t *sep __attribute__((unused))) | 1619 | discard_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1620 | { | 1620 | { |
1621 | char buffer[BUFSIZE]; | 1621 | char buffer[BUFSIZE]; |
1622 | 1622 | ||
@@ -1678,7 +1678,7 @@ chargen_stream (int s, servtab_t *sep) | |||
1678 | /* Character generator */ | 1678 | /* Character generator */ |
1679 | /* ARGSUSED */ | 1679 | /* ARGSUSED */ |
1680 | static void | 1680 | static void |
1681 | chargen_dg (int s, servtab_t *sep __attribute__((unused))) | 1681 | chargen_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1682 | { | 1682 | { |
1683 | /* struct sockaddr_storage ss; */ | 1683 | /* struct sockaddr_storage ss; */ |
1684 | struct sockaddr sa; | 1684 | struct sockaddr sa; |
@@ -1735,7 +1735,7 @@ static u_int machtime (void) | |||
1735 | 1735 | ||
1736 | /* ARGSUSED */ | 1736 | /* ARGSUSED */ |
1737 | static void | 1737 | static void |
1738 | machtime_stream (int s, servtab_t *sep __attribute__((unused))) | 1738 | machtime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1739 | { | 1739 | { |
1740 | u_int result; | 1740 | u_int result; |
1741 | 1741 | ||
@@ -1745,7 +1745,7 @@ machtime_stream (int s, servtab_t *sep __attribute__((unused))) | |||
1745 | 1745 | ||
1746 | /* ARGSUSED */ | 1746 | /* ARGSUSED */ |
1747 | static void | 1747 | static void |
1748 | machtime_dg (int s, servtab_t *sep __attribute__((unused))) | 1748 | machtime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1749 | { | 1749 | { |
1750 | u_int result; | 1750 | u_int result; |
1751 | /* struct sockaddr_storage ss; */ | 1751 | /* struct sockaddr_storage ss; */ |
@@ -1770,7 +1770,7 @@ machtime_dg (int s, servtab_t *sep __attribute__((unused))) | |||
1770 | #ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME | 1770 | #ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME |
1771 | /* Return human-readable time of day */ | 1771 | /* Return human-readable time of day */ |
1772 | /* ARGSUSED */ | 1772 | /* ARGSUSED */ |
1773 | static void daytime_stream (int s, servtab_t *sep __attribute__((unused))) | 1773 | static void daytime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1774 | { | 1774 | { |
1775 | char buffer[256]; | 1775 | char buffer[256]; |
1776 | time_t t; | 1776 | time_t t; |
@@ -1784,7 +1784,7 @@ static void daytime_stream (int s, servtab_t *sep __attribute__((unused))) | |||
1784 | /* Return human-readable time of day */ | 1784 | /* Return human-readable time of day */ |
1785 | /* ARGSUSED */ | 1785 | /* ARGSUSED */ |
1786 | void | 1786 | void |
1787 | daytime_dg (int s, servtab_t *sep __attribute__((unused))) | 1787 | daytime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED) |
1788 | { | 1788 | { |
1789 | char buffer[256]; | 1789 | char buffer[256]; |
1790 | time_t t; | 1790 | time_t t; |
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h index 25e9c6c81..71be8269e 100644 --- a/networking/libiproute/ip_common.h +++ b/networking/libiproute/ip_common.h | |||
@@ -1,3 +1,5 @@ | |||
1 | #ifndef _IP_COMMON_H | ||
2 | #define _IP_COMMON_H 1 | ||
1 | extern int preferred_family; | 3 | extern int preferred_family; |
2 | extern char * _SL_; | 4 | extern char * _SL_; |
3 | 5 | ||
@@ -5,7 +7,7 @@ extern void ip_parse_common_args(int *argcp, char ***argvp); | |||
5 | extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); | 7 | extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); |
6 | extern int ipaddr_list_or_flush(int argc, char **argv, int flush); | 8 | extern int ipaddr_list_or_flush(int argc, char **argv, int flush); |
7 | extern int iproute_monitor(int argc, char **argv); | 9 | extern int iproute_monitor(int argc, char **argv); |
8 | extern void iplink_usage(void) __attribute__((noreturn)); | 10 | extern void iplink_usage(void) ATTRIBUTE_NORETURN; |
9 | extern void ipneigh_reset_filter(void); | 11 | extern void ipneigh_reset_filter(void); |
10 | extern int do_ipaddr(int argc, char **argv); | 12 | extern int do_ipaddr(int argc, char **argv); |
11 | extern int do_iproute(int argc, char **argv); | 13 | extern int do_iproute(int argc, char **argv); |
@@ -16,3 +18,4 @@ extern int do_iplink(int argc, char **argv); | |||
16 | extern int do_ipmonitor(int argc, char **argv); | 18 | extern int do_ipmonitor(int argc, char **argv); |
17 | extern int do_multiaddr(int argc, char **argv); | 19 | extern int do_multiaddr(int argc, char **argv); |
18 | extern int do_multiroute(int argc, char **argv); | 20 | extern int do_multiroute(int argc, char **argv); |
21 | #endif /* ip_common.h */ | ||
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index a15fc81dc..b622afd47 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -63,7 +63,7 @@ static int flush_update(void) | |||
63 | return 0; | 63 | return 0; |
64 | } | 64 | } |
65 | 65 | ||
66 | static int print_route(struct sockaddr_nl *who __attribute__((unused)), | 66 | static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED, |
67 | struct nlmsghdr *n, void *arg) | 67 | struct nlmsghdr *n, void *arg) |
68 | { | 68 | { |
69 | FILE *fp = (FILE*)arg; | 69 | FILE *fp = (FILE*)arg; |
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h index e79e177b9..3d223edf6 100644 --- a/networking/libiproute/utils.h +++ b/networking/libiproute/utils.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "libnetlink.h" | 7 | #include "libnetlink.h" |
8 | #include "ll_map.h" | 8 | #include "ll_map.h" |
9 | #include "rtm_map.h" | 9 | #include "rtm_map.h" |
10 | #include "libbb.h" | ||
10 | 11 | ||
11 | extern int preferred_family; | 12 | extern int preferred_family; |
12 | extern int show_stats; | 13 | extern int show_stats; |
@@ -26,7 +27,7 @@ extern char * _SL_; | |||
26 | #define SPRINT_BSIZE 64 | 27 | #define SPRINT_BSIZE 64 |
27 | #define SPRINT_BUF(x) char x[SPRINT_BSIZE] | 28 | #define SPRINT_BUF(x) char x[SPRINT_BSIZE] |
28 | 29 | ||
29 | extern void incomplete_command(void) __attribute__((noreturn)); | 30 | extern void incomplete_command(void) ATTRIBUTE_NORETURN; |
30 | 31 | ||
31 | #define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0) | 32 | #define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0) |
32 | 33 | ||
@@ -76,9 +77,9 @@ extern int get_s8(__s8 *val, char *arg, int base); | |||
76 | extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); | 77 | extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); |
77 | extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); | 78 | extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); |
78 | 79 | ||
79 | void invarg(char *, char *) __attribute__((noreturn)); | 80 | void invarg(char *, char *) ATTRIBUTE_NORETURN; |
80 | void duparg(char *, char *) __attribute__((noreturn)); | 81 | void duparg(char *, char *) ATTRIBUTE_NORETURN; |
81 | void duparg2(char *, char *) __attribute__((noreturn)); | 82 | void duparg2(char *, char *) ATTRIBUTE_NORETURN; |
82 | int matches(char *arg, char *pattern); | 83 | int matches(char *arg, char *pattern); |
83 | extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); | 84 | extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); |
84 | 85 | ||
diff --git a/networking/nameif.c b/networking/nameif.c index a2c8b4915..f28e5ebe3 100644 --- a/networking/nameif.c +++ b/networking/nameif.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua> | 5 | * Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua> |
6 | * Glenn McGrath <bug1@iinet.net.au> | 6 | * Glenn McGrath <bug1@iinet.net.au> |
7 | * | 7 | * |
8 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. | 8 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <sys/syslog.h> | 11 | #include <sys/syslog.h> |
@@ -48,7 +48,7 @@ typedef struct mactable_s { | |||
48 | 48 | ||
49 | static unsigned long flags; | 49 | static unsigned long flags; |
50 | 50 | ||
51 | static void serror(const char *s, ...) __attribute__ ((noreturn)); | 51 | static void serror(const char *s, ...) ATTRIBUTE_NORETURN; |
52 | 52 | ||
53 | static void serror(const char *s, ...) | 53 | static void serror(const char *s, ...) |
54 | { | 54 | { |
diff --git a/networking/traceroute.c b/networking/traceroute.c index 690e21f82..b6252ad3e 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -281,7 +281,7 @@ struct hostinfo { | |||
281 | struct outdata { | 281 | struct outdata { |
282 | u_char seq; /* sequence number of this packet */ | 282 | u_char seq; /* sequence number of this packet */ |
283 | u_char ttl; /* ttl packet left with */ | 283 | u_char ttl; /* ttl packet left with */ |
284 | struct timeval tv __attribute__((packed)); /* time packet left */ | 284 | struct timeval tv ATTRIBUTE_PACKED; /* time packet left */ |
285 | }; | 285 | }; |
286 | 286 | ||
287 | struct IFADDRLIST { | 287 | struct IFADDRLIST { |
diff --git a/networking/udhcp/arpping.h b/networking/udhcp/arpping.h index 6f27d9f75..30959ca99 100644 --- a/networking/udhcp/arpping.h +++ b/networking/udhcp/arpping.h | |||
@@ -27,7 +27,7 @@ struct arpMsg { | |||
27 | uint8_t tHaddr[6]; /* target's hardware address */ | 27 | uint8_t tHaddr[6]; /* target's hardware address */ |
28 | uint8_t tInaddr[4]; /* target's IP address */ | 28 | uint8_t tInaddr[4]; /* target's IP address */ |
29 | uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */ | 29 | uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */ |
30 | } __attribute__ ((packed)); | 30 | } ATTRIBUTE_PACKED; |
31 | 31 | ||
32 | /* function prototypes */ | 32 | /* function prototypes */ |
33 | int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *arp, char *interface); | 33 | int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *arp, char *interface); |
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index d5c69db42..c4277e3f1 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -4,19 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Russ Dill <Russ.Dill@asu.edu> July 2001 | 5 | * Russ Dill <Russ.Dill@asu.edu> July 2001 |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | 8 | */ |
21 | 9 | ||
22 | #include <sys/time.h> | 10 | #include <sys/time.h> |
@@ -74,7 +62,7 @@ struct client_config_t client_config = { | |||
74 | }; | 62 | }; |
75 | 63 | ||
76 | #ifndef IN_BUSYBOX | 64 | #ifndef IN_BUSYBOX |
77 | static void __attribute__ ((noreturn)) show_usage(void) | 65 | static void ATTRIBUTE_NORETURN show_usage(void) |
78 | { | 66 | { |
79 | printf( | 67 | printf( |
80 | "Usage: udhcpc [OPTIONS]\n\n" | 68 | "Usage: udhcpc [OPTIONS]\n\n" |
@@ -101,7 +89,7 @@ static void __attribute__ ((noreturn)) show_usage(void) | |||
101 | } | 89 | } |
102 | #else | 90 | #else |
103 | #define show_usage bb_show_usage | 91 | #define show_usage bb_show_usage |
104 | extern void show_usage(void) __attribute__ ((noreturn)); | 92 | extern void show_usage(void) ATTRIBUTE_NORETURN; |
105 | #endif | 93 | #endif |
106 | 94 | ||
107 | 95 | ||
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index a9036dfbd..ca5c6059e 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c | |||
@@ -1,3 +1,7 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | Licensed under the GPL v2 or later, see the file LICENSE in this tarball. | ||
4 | */ | ||
1 | #include <fcntl.h> | 5 | #include <fcntl.h> |
2 | #include <string.h> | 6 | #include <string.h> |
3 | #include <stdlib.h> | 7 | #include <stdlib.h> |
@@ -21,7 +25,7 @@ | |||
21 | 25 | ||
22 | 26 | ||
23 | #ifndef IN_BUSYBOX | 27 | #ifndef IN_BUSYBOX |
24 | static void __attribute__ ((noreturn)) show_usage(void) | 28 | static void ATTRIBUTE_NORETURN show_usage(void) |
25 | { | 29 | { |
26 | printf( | 30 | printf( |
27 | "Usage: dumpleases -f <file> -[r|a]\n\n" | 31 | "Usage: dumpleases -f <file> -[r|a]\n\n" |
diff --git a/networking/zcip.c b/networking/zcip.c index ad1131f3b..294ffd066 100644 --- a/networking/zcip.c +++ b/networking/zcip.c | |||
@@ -5,20 +5,7 @@ | |||
5 | * Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com) | 5 | * Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com) |
6 | * Copyright (C) 2004 by David Brownell | 6 | * Copyright (C) 2004 by David Brownell |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
21 | * 02111-1307 USA | ||
22 | */ | 9 | */ |
23 | 10 | ||
24 | /* | 11 | /* |
@@ -73,7 +60,7 @@ struct arp_packet { | |||
73 | struct in_addr source_ip; | 60 | struct in_addr source_ip; |
74 | struct ether_addr target_addr; | 61 | struct ether_addr target_addr; |
75 | struct in_addr target_ip; | 62 | struct in_addr target_ip; |
76 | } __attribute__ ((__packed__)); | 63 | } ATTRIBUTE_PACKED; |
77 | 64 | ||
78 | /* 169.254.0.0 */ | 65 | /* 169.254.0.0 */ |
79 | static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000; | 66 | static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000; |
@@ -214,7 +201,7 @@ bad: | |||
214 | /** | 201 | /** |
215 | * Print usage information. | 202 | * Print usage information. |
216 | */ | 203 | */ |
217 | static void __attribute__((noreturn)) | 204 | static void ATTRIBUTE_NORETURN |
218 | zcip_usage(const char *msg) | 205 | zcip_usage(const char *msg) |
219 | { | 206 | { |
220 | fprintf(stderr, "%s: %s\n", prog, msg); | 207 | fprintf(stderr, "%s: %s\n", prog, msg); |