summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRob Landley2006-03-10 19:22:06 +0000
committerRob Landley2006-03-10 19:22:06 +0000
commitbc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch)
treebeb32cedafc6232bf8a49fe90f0769d471ea6791 /networking
parentdae6aa28598cb2353291f18ca52e768c3259165a (diff)
downloadbusybox-bc68cd14ccaebc17e7e03a08e51fddfb91007624.zip
busybox-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
Diffstat (limited to 'networking')
-rw-r--r--networking/dnsd.c16
-rw-r--r--networking/fakeidentd.c2
-rw-r--r--networking/ping.c16
-rw-r--r--networking/ping6.c16
-rw-r--r--networking/telnet.c14
-rw-r--r--networking/zcip.c24
6 files changed, 48 insertions, 40 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 433b124..9ca4105 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -27,11 +27,12 @@ static char *fileconf = "/etc/dnsd.conf";
#define LOCK_FILE "/var/run/dnsd.lock"
#define LOG_FILE "/var/log/dnsd.log"
-#define MAX_HOST_LEN 16 // longest host name allowed is 15
-#define IP_STRING_LEN 18 // .xxx.xxx.xxx.xxx\0
+enum {
+ MAX_HOST_LEN = 16, // longest host name allowed is 15
+ IP_STRING_LEN = 18, // .xxx.xxx.xxx.xxx\0
//must be strlen('.in-addr.arpa') larger than IP_STRING_LEN
-static const int MAX_NAME_LEN = (IP_STRING_LEN + 13);
+ MAX_NAME_LEN = (IP_STRING_LEN + 13),
/* Cannot get bigger packets than 512 per RFC1035
In practice this can be set considerably smaller:
@@ -39,12 +40,13 @@ static const int MAX_NAME_LEN = (IP_STRING_LEN + 13);
ttl(4B) + rlen(2B) + r (MAX_NAME_LEN =21B) +
2*querystring (2 MAX_NAME_LEN= 42B), all together 90 Byte
*/
-static const int MAX_PACK_LEN = 512 + 1;
+ MAX_PACK_LEN = 512 + 1,
-#define DEFAULT_TTL 30; // increase this when not testing?
+ DEFAULT_TTL = 30, // increase this when not testing?
-static const int REQ_A = 1;
-static const int REQ_PTR = 12;
+ REQ_A = 1,
+ REQ_PTR = 12
+};
struct dns_repl { // resource record, add 0 or 1 to accepted dns_msg in resp
uint16_t rlen;
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c
index c7fb42f..5442c22 100644
--- a/networking/fakeidentd.c
+++ b/networking/fakeidentd.c
@@ -51,7 +51,7 @@
#define MAXIDLETIME 45
static const char ident_substr[] = " : USERID : UNIX : ";
-static const int ident_substr_len = sizeof(ident_substr) - 1;
+enum { ident_substr_len = sizeof(ident_substr) - 1 };
#define PIDFILE "/var/run/identd.pid"
/*
diff --git a/networking/ping.c b/networking/ping.c
index 47b9f8f..ecfd125 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -33,13 +33,15 @@
#include "busybox.h"
-static const int DEFDATALEN = 56;
-static const int MAXIPLEN = 60;
-static const int MAXICMPLEN = 76;
-static const int MAXPACKET = 65468;
-#define MAX_DUP_CHK (8 * 128)
-static const int MAXWAIT = 10;
-static const int PINGINTERVAL = 1; /* second */
+enum {
+ DEFDATALEN = 56,
+ MAXIPLEN = 60,
+ MAXICMPLEN = 76,
+ MAXPACKET = 65468,
+ MAX_DUP_CHK = (8 * 128),
+ MAXWAIT = 10,
+ PINGINTERVAL = 1 /* second */
+};
#define O_QUIET (1 << 0)
diff --git a/networking/ping6.c b/networking/ping6.c
index 42cf278..72d1d66 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -56,13 +56,15 @@
#include <stddef.h> /* offsetof */
#include "busybox.h"
-static const int DEFDATALEN = 56;
-static const int MAXIPLEN = 60;
-static const int MAXICMPLEN = 76;
-static const int MAXPACKET = 65468;
-#define MAX_DUP_CHK (8 * 128)
-static const int MAXWAIT = 10;
-static const int PINGINTERVAL = 1; /* second */
+enum {
+ DEFDATALEN = 56,
+ MAXIPLEN = 60,
+ MAXICMPLEN = 76,
+ MAXPACKET = 65468,
+ MAX_DUP_CHK = (8 * 128),
+ MAXWAIT = 10,
+ PINGINTERVAL = 1 /* second */
+};
#define O_QUIET (1 << 0)
#define O_VERBOSE (1 << 1)
diff --git a/networking/telnet.c b/networking/telnet.c
index ca4896b..2ad44d4 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -35,7 +35,7 @@
#include "busybox.h"
#if 0
-static const int DOTRACE = 1;
+enum { DOTRACE = 1 };
#endif
#ifdef DOTRACE
@@ -55,14 +55,14 @@ static const int DOTRACE = 1;
#define DATABUFSIZE 128
#define IACBUFSIZE 128
-static const int CHM_TRY = 0;
-static const int CHM_ON = 1;
-static const int CHM_OFF = 2;
+enum {
+ CHM_TRY = 0,
+ CHM_ON = 1,
+ CHM_OFF = 2,
-static const int UF_ECHO = 0x01;
-static const int UF_SGA = 0x02;
+ UF_ECHO = 0x01,
+ UF_SGA = 0x02,
-enum {
TS_0 = 1,
TS_IAC = 2,
TS_OPT = 3,
diff --git a/networking/zcip.c b/networking/zcip.c
index 11b2db5..716c4a5 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -62,20 +62,22 @@ struct arp_packet {
struct in_addr target_ip;
} ATTRIBUTE_PACKED;
+enum {
/* 169.254.0.0 */
-static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000;
+ LINKLOCAL_ADDR = 0xa9fe0000,
/* protocol timeout parameters, specified in seconds */
-static const unsigned PROBE_WAIT = 1;
-static const unsigned PROBE_MIN = 1;
-static const unsigned PROBE_MAX = 2;
-static const unsigned PROBE_NUM = 3;
-static const unsigned MAX_CONFLICTS = 10;
-static const unsigned RATE_LIMIT_INTERVAL = 60;
-static const unsigned ANNOUNCE_WAIT = 2;
-static const unsigned ANNOUNCE_NUM = 2;
-static const unsigned ANNOUNCE_INTERVAL = 2;
-static const time_t DEFEND_INTERVAL = 10;
+ PROBE_WAIT = 1,
+ PROBE_MIN = 1,
+ PROBE_MAX = 2,
+ PROBE_NUM = 3,
+ MAX_CONFLICTS = 10,
+ RATE_LIMIT_INTERVAL = 60,
+ ANNOUNCE_WAIT = 2,
+ ANNOUNCE_NUM = 2,
+ ANNOUNCE_INTERVAL = 2,
+ DEFEND_INTERVAL = 10
+};
static const unsigned char ZCIP_VERSION[] = "0.75 (18 April 2005)";
static char *prog;