summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-01-22 22:55:11 +0000
committerBernhard Reutner-Fischer2006-01-22 22:55:11 +0000
commit86f5c9906beac527f3d7966f24811b571a589e08 (patch)
tree1c9eba853c728b5d734506e1c66c269d96fe46ea /networking
parent2edf52643d3eb3d13f26d31f9678cf122f2063bc (diff)
downloadbusybox-86f5c9906beac527f3d7966f24811b571a589e08.zip
busybox-86f5c9906beac527f3d7966f24811b571a589e08.tar.gz
- add platform.h.
- use shorter boilerplate while at it.
Diffstat (limited to 'networking')
-rw-r--r--networking/inetd.c22
-rw-r--r--networking/libiproute/ip_common.h5
-rw-r--r--networking/libiproute/iproute.c2
-rw-r--r--networking/libiproute/utils.h9
-rw-r--r--networking/nameif.c4
-rw-r--r--networking/traceroute.c2
-rw-r--r--networking/udhcp/arpping.h2
-rw-r--r--networking/udhcp/dhcpc.c18
-rw-r--r--networking/udhcp/dumpleases.c6
-rw-r--r--networking/zcip.c19
10 files changed, 36 insertions, 53 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 5388bf7..7a6ffae 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -928,7 +928,7 @@ static int matchconf (servtab_t *old, servtab_t *new)
return (1);
}
-static void config (int sig __attribute__((unused)))
+static void config (int sig ATTRIBUTE_UNUSED)
{
servtab_t *sep, *cp, **sepp;
sigset_t omask;
@@ -1149,7 +1149,7 @@ static void config (int sig __attribute__((unused)))
}
-static void reapchild (int sig __attribute__((unused)))
+static void reapchild (int sig ATTRIBUTE_UNUSED)
{
pid_t pid;
int save_errno = errno, status;
@@ -1176,7 +1176,7 @@ static void reapchild (int sig __attribute__((unused)))
errno = save_errno;
}
-static void retry (int sig __attribute__((unused)))
+static void retry (int sig ATTRIBUTE_UNUSED)
{
servtab_t *sep;
@@ -1200,7 +1200,7 @@ static void retry (int sig __attribute__((unused)))
}
}
-static void goaway (int sig __attribute__((unused)))
+static void goaway (int sig ATTRIBUTE_UNUSED)
{
servtab_t *sep;
@@ -1582,7 +1582,7 @@ echo_stream (int s, servtab_t *sep)
/* Echo service -- echo data back */
/* ARGSUSED */
static void
-echo_dg (int s, servtab_t *sep __attribute__((unused)))
+echo_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[BUFSIZE];
int i;
@@ -1616,7 +1616,7 @@ discard_stream (int s, servtab_t *sep)
/* Discard service -- ignore data */
/* ARGSUSED */
static void
-discard_dg (int s, servtab_t *sep __attribute__((unused)))
+discard_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[BUFSIZE];
@@ -1678,7 +1678,7 @@ chargen_stream (int s, servtab_t *sep)
/* Character generator */
/* ARGSUSED */
static void
-chargen_dg (int s, servtab_t *sep __attribute__((unused)))
+chargen_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
/* struct sockaddr_storage ss; */
struct sockaddr sa;
@@ -1735,7 +1735,7 @@ static u_int machtime (void)
/* ARGSUSED */
static void
-machtime_stream (int s, servtab_t *sep __attribute__((unused)))
+machtime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
u_int result;
@@ -1745,7 +1745,7 @@ machtime_stream (int s, servtab_t *sep __attribute__((unused)))
/* ARGSUSED */
static void
-machtime_dg (int s, servtab_t *sep __attribute__((unused)))
+machtime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
u_int result;
/* struct sockaddr_storage ss; */
@@ -1770,7 +1770,7 @@ machtime_dg (int s, servtab_t *sep __attribute__((unused)))
#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME
/* Return human-readable time of day */
/* ARGSUSED */
-static void daytime_stream (int s, servtab_t *sep __attribute__((unused)))
+static void daytime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[256];
time_t t;
@@ -1784,7 +1784,7 @@ static void daytime_stream (int s, servtab_t *sep __attribute__((unused)))
/* Return human-readable time of day */
/* ARGSUSED */
void
-daytime_dg (int s, servtab_t *sep __attribute__((unused)))
+daytime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[256];
time_t t;
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h
index 25e9c6c8..71be826 100644
--- a/networking/libiproute/ip_common.h
+++ b/networking/libiproute/ip_common.h
@@ -1,3 +1,5 @@
+#ifndef _IP_COMMON_H
+#define _IP_COMMON_H 1
extern int preferred_family;
extern char * _SL_;
@@ -5,7 +7,7 @@ extern void ip_parse_common_args(int *argcp, char ***argvp);
extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
extern int ipaddr_list_or_flush(int argc, char **argv, int flush);
extern int iproute_monitor(int argc, char **argv);
-extern void iplink_usage(void) __attribute__((noreturn));
+extern void iplink_usage(void) ATTRIBUTE_NORETURN;
extern void ipneigh_reset_filter(void);
extern int do_ipaddr(int argc, char **argv);
extern int do_iproute(int argc, char **argv);
@@ -16,3 +18,4 @@ extern int do_iplink(int argc, char **argv);
extern int do_ipmonitor(int argc, char **argv);
extern int do_multiaddr(int argc, char **argv);
extern int do_multiroute(int argc, char **argv);
+#endif /* ip_common.h */
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index a15fc81..b622afd 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -63,7 +63,7 @@ static int flush_update(void)
return 0;
}
-static int print_route(struct sockaddr_nl *who __attribute__((unused)),
+static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE*)arg;
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index e79e177..3d223ed 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -7,6 +7,7 @@
#include "libnetlink.h"
#include "ll_map.h"
#include "rtm_map.h"
+#include "libbb.h"
extern int preferred_family;
extern int show_stats;
@@ -26,7 +27,7 @@ extern char * _SL_;
#define SPRINT_BSIZE 64
#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
-extern void incomplete_command(void) __attribute__((noreturn));
+extern void incomplete_command(void) ATTRIBUTE_NORETURN;
#define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0)
@@ -76,9 +77,9 @@ extern int get_s8(__s8 *val, char *arg, int base);
extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen);
-void invarg(char *, char *) __attribute__((noreturn));
-void duparg(char *, char *) __attribute__((noreturn));
-void duparg2(char *, char *) __attribute__((noreturn));
+void invarg(char *, char *) ATTRIBUTE_NORETURN;
+void duparg(char *, char *) ATTRIBUTE_NORETURN;
+void duparg2(char *, char *) ATTRIBUTE_NORETURN;
int matches(char *arg, char *pattern);
extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
diff --git a/networking/nameif.c b/networking/nameif.c
index a2c8b49..f28e5eb 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -5,7 +5,7 @@
* Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua>
* Glenn McGrath <bug1@iinet.net.au>
*
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <sys/syslog.h>
@@ -48,7 +48,7 @@ typedef struct mactable_s {
static unsigned long flags;
-static void serror(const char *s, ...) __attribute__ ((noreturn));
+static void serror(const char *s, ...) ATTRIBUTE_NORETURN;
static void serror(const char *s, ...)
{
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 690e21f..b6252ad 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -281,7 +281,7 @@ struct hostinfo {
struct outdata {
u_char seq; /* sequence number of this packet */
u_char ttl; /* ttl packet left with */
- struct timeval tv __attribute__((packed)); /* time packet left */
+ struct timeval tv ATTRIBUTE_PACKED; /* time packet left */
};
struct IFADDRLIST {
diff --git a/networking/udhcp/arpping.h b/networking/udhcp/arpping.h
index 6f27d9f..30959ca 100644
--- a/networking/udhcp/arpping.h
+++ b/networking/udhcp/arpping.h
@@ -27,7 +27,7 @@ struct arpMsg {
uint8_t tHaddr[6]; /* target's hardware address */
uint8_t tInaddr[4]; /* target's IP address */
uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */
-} __attribute__ ((packed));
+} ATTRIBUTE_PACKED;
/* function prototypes */
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 d5c69db..c4277e3 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -4,19 +4,7 @@
*
* Russ Dill <Russ.Dill@asu.edu> July 2001
*
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <sys/time.h>
@@ -74,7 +62,7 @@ struct client_config_t client_config = {
};
#ifndef IN_BUSYBOX
-static void __attribute__ ((noreturn)) show_usage(void)
+static void ATTRIBUTE_NORETURN show_usage(void)
{
printf(
"Usage: udhcpc [OPTIONS]\n\n"
@@ -101,7 +89,7 @@ static void __attribute__ ((noreturn)) show_usage(void)
}
#else
#define show_usage bb_show_usage
-extern void show_usage(void) __attribute__ ((noreturn));
+extern void show_usage(void) ATTRIBUTE_NORETURN;
#endif
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index a9036df..ca5c605 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -1,3 +1,7 @@
+/* vi: set sw=4 ts=4: */
+/*
+ Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ */
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
@@ -21,7 +25,7 @@
#ifndef IN_BUSYBOX
-static void __attribute__ ((noreturn)) show_usage(void)
+static void ATTRIBUTE_NORETURN show_usage(void)
{
printf(
"Usage: dumpleases -f <file> -[r|a]\n\n"
diff --git a/networking/zcip.c b/networking/zcip.c
index ad1131f..294ffd0 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -5,20 +5,7 @@
* Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com)
* Copyright (C) 2004 by David Brownell
*
- * 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
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
/*
@@ -73,7 +60,7 @@ struct arp_packet {
struct in_addr source_ip;
struct ether_addr target_addr;
struct in_addr target_ip;
-} __attribute__ ((__packed__));
+} ATTRIBUTE_PACKED;
/* 169.254.0.0 */
static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000;
@@ -214,7 +201,7 @@ bad:
/**
* Print usage information.
*/
-static void __attribute__((noreturn))
+static void ATTRIBUTE_NORETURN
zcip_usage(const char *msg)
{
fprintf(stderr, "%s: %s\n", prog, msg);