summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
committerRob Landley <rob@landley.net>2006-03-10 19:22:06 +0000
commitbc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch)
treebeb32cedafc6232bf8a49fe90f0769d471ea6791 /networking
parentdae6aa28598cb2353291f18ca52e768c3259165a (diff)
downloadbusybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz
busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.bz2
busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.zip
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 433b12443..9ca4105d3 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -27,11 +27,12 @@ static char *fileconf = "/etc/dnsd.conf";
27#define LOCK_FILE "/var/run/dnsd.lock" 27#define LOCK_FILE "/var/run/dnsd.lock"
28#define LOG_FILE "/var/log/dnsd.log" 28#define LOG_FILE "/var/log/dnsd.log"
29 29
30#define MAX_HOST_LEN 16 // longest host name allowed is 15 30enum {
31#define IP_STRING_LEN 18 // .xxx.xxx.xxx.xxx\0 31 MAX_HOST_LEN = 16, // longest host name allowed is 15
32 IP_STRING_LEN = 18, // .xxx.xxx.xxx.xxx\0
32 33
33//must be strlen('.in-addr.arpa') larger than IP_STRING_LEN 34//must be strlen('.in-addr.arpa') larger than IP_STRING_LEN
34static const int MAX_NAME_LEN = (IP_STRING_LEN + 13); 35 MAX_NAME_LEN = (IP_STRING_LEN + 13),
35 36
36/* Cannot get bigger packets than 512 per RFC1035 37/* Cannot get bigger packets than 512 per RFC1035
37 In practice this can be set considerably smaller: 38 In practice this can be set considerably smaller:
@@ -39,12 +40,13 @@ static const int MAX_NAME_LEN = (IP_STRING_LEN + 13);
39 ttl(4B) + rlen(2B) + r (MAX_NAME_LEN =21B) + 40 ttl(4B) + rlen(2B) + r (MAX_NAME_LEN =21B) +
40 2*querystring (2 MAX_NAME_LEN= 42B), all together 90 Byte 41 2*querystring (2 MAX_NAME_LEN= 42B), all together 90 Byte
41*/ 42*/
42static const int MAX_PACK_LEN = 512 + 1; 43 MAX_PACK_LEN = 512 + 1,
43 44
44#define DEFAULT_TTL 30; // increase this when not testing? 45 DEFAULT_TTL = 30, // increase this when not testing?
45 46
46static const int REQ_A = 1; 47 REQ_A = 1,
47static const int REQ_PTR = 12; 48 REQ_PTR = 12
49};
48 50
49struct dns_repl { // resource record, add 0 or 1 to accepted dns_msg in resp 51struct dns_repl { // resource record, add 0 or 1 to accepted dns_msg in resp
50 uint16_t rlen; 52 uint16_t rlen;
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c
index c7fb42fc4..5442c22c2 100644
--- a/networking/fakeidentd.c
+++ b/networking/fakeidentd.c
@@ -51,7 +51,7 @@
51#define MAXIDLETIME 45 51#define MAXIDLETIME 45
52 52
53static const char ident_substr[] = " : USERID : UNIX : "; 53static const char ident_substr[] = " : USERID : UNIX : ";
54static const int ident_substr_len = sizeof(ident_substr) - 1; 54enum { ident_substr_len = sizeof(ident_substr) - 1 };
55#define PIDFILE "/var/run/identd.pid" 55#define PIDFILE "/var/run/identd.pid"
56 56
57/* 57/*
diff --git a/networking/ping.c b/networking/ping.c
index 47b9f8f52..ecfd125ae 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -33,13 +33,15 @@
33#include "busybox.h" 33#include "busybox.h"
34 34
35 35
36static const int DEFDATALEN = 56; 36enum {
37static const int MAXIPLEN = 60; 37 DEFDATALEN = 56,
38static const int MAXICMPLEN = 76; 38 MAXIPLEN = 60,
39static const int MAXPACKET = 65468; 39 MAXICMPLEN = 76,
40#define MAX_DUP_CHK (8 * 128) 40 MAXPACKET = 65468,
41static const int MAXWAIT = 10; 41 MAX_DUP_CHK = (8 * 128),
42static const int PINGINTERVAL = 1; /* second */ 42 MAXWAIT = 10,
43 PINGINTERVAL = 1 /* second */
44};
43 45
44#define O_QUIET (1 << 0) 46#define O_QUIET (1 << 0)
45 47
diff --git a/networking/ping6.c b/networking/ping6.c
index 42cf2785c..72d1d667a 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -56,13 +56,15 @@
56#include <stddef.h> /* offsetof */ 56#include <stddef.h> /* offsetof */
57#include "busybox.h" 57#include "busybox.h"
58 58
59static const int DEFDATALEN = 56; 59enum {
60static const int MAXIPLEN = 60; 60 DEFDATALEN = 56,
61static const int MAXICMPLEN = 76; 61 MAXIPLEN = 60,
62static const int MAXPACKET = 65468; 62 MAXICMPLEN = 76,
63#define MAX_DUP_CHK (8 * 128) 63 MAXPACKET = 65468,
64static const int MAXWAIT = 10; 64 MAX_DUP_CHK = (8 * 128),
65static const int PINGINTERVAL = 1; /* second */ 65 MAXWAIT = 10,
66 PINGINTERVAL = 1 /* second */
67};
66 68
67#define O_QUIET (1 << 0) 69#define O_QUIET (1 << 0)
68#define O_VERBOSE (1 << 1) 70#define O_VERBOSE (1 << 1)
diff --git a/networking/telnet.c b/networking/telnet.c
index ca4896bf0..2ad44d429 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -35,7 +35,7 @@
35#include "busybox.h" 35#include "busybox.h"
36 36
37#if 0 37#if 0
38static const int DOTRACE = 1; 38enum { DOTRACE = 1 };
39#endif 39#endif
40 40
41#ifdef DOTRACE 41#ifdef DOTRACE
@@ -55,14 +55,14 @@ static const int DOTRACE = 1;
55#define DATABUFSIZE 128 55#define DATABUFSIZE 128
56#define IACBUFSIZE 128 56#define IACBUFSIZE 128
57 57
58static const int CHM_TRY = 0; 58enum {
59static const int CHM_ON = 1; 59 CHM_TRY = 0,
60static const int CHM_OFF = 2; 60 CHM_ON = 1,
61 CHM_OFF = 2,
61 62
62static const int UF_ECHO = 0x01; 63 UF_ECHO = 0x01,
63static const int UF_SGA = 0x02; 64 UF_SGA = 0x02,
64 65
65enum {
66 TS_0 = 1, 66 TS_0 = 1,
67 TS_IAC = 2, 67 TS_IAC = 2,
68 TS_OPT = 3, 68 TS_OPT = 3,
diff --git a/networking/zcip.c b/networking/zcip.c
index 11b2db526..716c4a5e1 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -62,20 +62,22 @@ struct arp_packet {
62 struct in_addr target_ip; 62 struct in_addr target_ip;
63} ATTRIBUTE_PACKED; 63} ATTRIBUTE_PACKED;
64 64
65enum {
65/* 169.254.0.0 */ 66/* 169.254.0.0 */
66static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000; 67 LINKLOCAL_ADDR = 0xa9fe0000,
67 68
68/* protocol timeout parameters, specified in seconds */ 69/* protocol timeout parameters, specified in seconds */
69static const unsigned PROBE_WAIT = 1; 70 PROBE_WAIT = 1,
70static const unsigned PROBE_MIN = 1; 71 PROBE_MIN = 1,
71static const unsigned PROBE_MAX = 2; 72 PROBE_MAX = 2,
72static const unsigned PROBE_NUM = 3; 73 PROBE_NUM = 3,
73static const unsigned MAX_CONFLICTS = 10; 74 MAX_CONFLICTS = 10,
74static const unsigned RATE_LIMIT_INTERVAL = 60; 75 RATE_LIMIT_INTERVAL = 60,
75static const unsigned ANNOUNCE_WAIT = 2; 76 ANNOUNCE_WAIT = 2,
76static const unsigned ANNOUNCE_NUM = 2; 77 ANNOUNCE_NUM = 2,
77static const unsigned ANNOUNCE_INTERVAL = 2; 78 ANNOUNCE_INTERVAL = 2,
78static const time_t DEFEND_INTERVAL = 10; 79 DEFEND_INTERVAL = 10
80};
79 81
80static const unsigned char ZCIP_VERSION[] = "0.75 (18 April 2005)"; 82static const unsigned char ZCIP_VERSION[] = "0.75 (18 April 2005)";
81static char *prog; 83static char *prog;