aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-07-22 08:56:55 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-07-22 08:56:55 +0000
commitfa8cf20631cf02ae3e6b0db95a494261df1aee27 (patch)
tree9971c6951256dd0bba5ff2a7db08ed6f65ef218d /networking
parent5658fe5f7869ce987e25dfb6554db5e062045319 (diff)
downloadbusybox-w32-fa8cf20631cf02ae3e6b0db95a494261df1aee27.tar.gz
busybox-w32-fa8cf20631cf02ae3e6b0db95a494261df1aee27.tar.bz2
busybox-w32-fa8cf20631cf02ae3e6b0db95a494261df1aee27.zip
Remove remaining libc5 support code
git-svn-id: svn://busybox.net/trunk/busybox@7090 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r--networking/ping.c81
-rw-r--r--networking/traceroute.c91
-rw-r--r--networking/wget.c15
3 files changed, 2 insertions, 185 deletions
diff --git a/networking/ping.c b/networking/ping.c
index 28b38db14..a38f356d6 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.54 2003/03/19 09:12:38 mjn3 Exp $ 3 * $Id: ping.c,v 1.55 2003/07/22 08:56:51 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -52,85 +52,6 @@
52#include "busybox.h" 52#include "busybox.h"
53 53
54 54
55/* It turns out that libc5 doesn't have proper icmp support
56 * built into it header files, so we have to supplement it */
57#if __GNU_LIBRARY__ < 5
58static const int ICMP_MINLEN = 8; /* abs minimum */
59
60struct icmp_ra_addr
61{
62 u_int32_t ira_addr;
63 u_int32_t ira_preference;
64};
65
66
67struct icmp
68{
69 u_int8_t icmp_type; /* type of message, see below */
70 u_int8_t icmp_code; /* type sub code */
71 u_int16_t icmp_cksum; /* ones complement checksum of struct */
72 union
73 {
74 u_char ih_pptr; /* ICMP_PARAMPROB */
75 struct in_addr ih_gwaddr; /* gateway address */
76 struct ih_idseq /* echo datagram */
77 {
78 u_int16_t icd_id;
79 u_int16_t icd_seq;
80 } ih_idseq;
81 u_int32_t ih_void;
82
83 /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
84 struct ih_pmtu
85 {
86 u_int16_t ipm_void;
87 u_int16_t ipm_nextmtu;
88 } ih_pmtu;
89
90 struct ih_rtradv
91 {
92 u_int8_t irt_num_addrs;
93 u_int8_t irt_wpa;
94 u_int16_t irt_lifetime;
95 } ih_rtradv;
96 } icmp_hun;
97#define icmp_pptr icmp_hun.ih_pptr
98#define icmp_gwaddr icmp_hun.ih_gwaddr
99#define icmp_id icmp_hun.ih_idseq.icd_id
100#define icmp_seq icmp_hun.ih_idseq.icd_seq
101#define icmp_void icmp_hun.ih_void
102#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
103#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
104#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
105#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
106#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
107 union
108 {
109 struct
110 {
111 u_int32_t its_otime;
112 u_int32_t its_rtime;
113 u_int32_t its_ttime;
114 } id_ts;
115 struct
116 {
117 struct ip idi_ip;
118 /* options and then 64 bits of data */
119 } id_ip;
120 struct icmp_ra_addr id_radv;
121 u_int32_t id_mask;
122 u_int8_t id_data[1];
123 } icmp_dun;
124#define icmp_otime icmp_dun.id_ts.its_otime
125#define icmp_rtime icmp_dun.id_ts.its_rtime
126#define icmp_ttime icmp_dun.id_ts.its_ttime
127#define icmp_ip icmp_dun.id_ip.idi_ip
128#define icmp_radv icmp_dun.id_radv
129#define icmp_mask icmp_dun.id_mask
130#define icmp_data icmp_dun.id_data
131};
132#endif
133
134static const int DEFDATALEN = 56; 55static const int DEFDATALEN = 56;
135static const int MAXIPLEN = 60; 56static const int MAXIPLEN = 60;
136static const int MAXICMPLEN = 76; 57static const int MAXICMPLEN = 76;
diff --git a/networking/traceroute.c b/networking/traceroute.c
index be9ea1d95..5f8989fd1 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -76,97 +76,6 @@
76#include <netinet/ip_icmp.h> 76#include <netinet/ip_icmp.h>
77 77
78 78
79 /* It turns out that libc5 doesn't have proper icmp support
80 * built into it header files, so we have to supplement it */
81#if __GNU_LIBRARY__ < 5
82static const int ICMP_MINLEN = 8; /* abs minimum */
83
84struct icmp_ra_addr
85{
86 u_int32_t ira_addr;
87 u_int32_t ira_preference;
88};
89
90
91struct icmp
92{
93 u_int8_t icmp_type; /* type of message, see below */
94 u_int8_t icmp_code; /* type sub code */
95 u_int16_t icmp_cksum; /* ones complement checksum of struct */
96 union
97 {
98 u_char ih_pptr; /* ICMP_PARAMPROB */
99 struct in_addr ih_gwaddr; /* gateway address */
100 struct ih_idseq /* echo datagram */
101 {
102 u_int16_t icd_id;
103 u_int16_t icd_seq;
104 } ih_idseq;
105 u_int32_t ih_void;
106
107 /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
108 struct ih_pmtu
109 {
110 u_int16_t ipm_void;
111 u_int16_t ipm_nextmtu;
112 } ih_pmtu;
113
114 struct ih_rtradv
115 {
116 u_int8_t irt_num_addrs;
117 u_int8_t irt_wpa;
118 u_int16_t irt_lifetime;
119 } ih_rtradv;
120 } icmp_hun;
121#define icmp_pptr icmp_hun.ih_pptr
122#define icmp_gwaddr icmp_hun.ih_gwaddr
123#define icmp_id icmp_hun.ih_idseq.icd_id
124#define icmp_seq icmp_hun.ih_idseq.icd_seq
125#define icmp_void icmp_hun.ih_void
126#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
127#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
128#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
129#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
130#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
131 union
132 {
133 struct
134 {
135 u_int32_t its_otime;
136 u_int32_t its_rtime;
137 u_int32_t its_ttime;
138 } id_ts;
139 struct
140 {
141 struct ip idi_ip;
142 /* options and then 64 bits of data */
143 } id_ip;
144 struct icmp_ra_addr id_radv;
145 u_int32_t id_mask;
146 u_int8_t id_data[1];
147 } icmp_dun;
148#define icmp_otime icmp_dun.id_ts.its_otime
149#define icmp_rtime icmp_dun.id_ts.its_rtime
150#define icmp_ttime icmp_dun.id_ts.its_ttime
151#define icmp_ip icmp_dun.id_ip.idi_ip
152#define icmp_radv icmp_dun.id_radv
153#define icmp_mask icmp_dun.id_mask
154#define icmp_data icmp_dun.id_data
155};
156
157#define ICMP_MINLEN 8 /* abs minimum */
158#define ICMP_UNREACH 3 /* dest unreachable, codes: */
159#define ICMP_TIMXCEED 11 /* time exceeded, code: */
160#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
161#define ICMP_UNREACH_NET 0 /* bad net */
162#define ICMP_UNREACH_HOST 1 /* bad host */
163#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
164#define ICMP_UNREACH_PORT 3 /* bad port */
165#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
166#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
167#endif
168
169
170#define MAXPACKET 65535 /* max ip packet size */ 79#define MAXPACKET 65535 /* max ip packet size */
171#ifndef MAXHOSTNAMELEN 80#ifndef MAXHOSTNAMELEN
172#define MAXHOSTNAMELEN 64 81#define MAXHOSTNAMELEN 64
diff --git a/networking/wget.c b/networking/wget.c
index d68b16524..a9ead7fc2 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -31,19 +31,6 @@
31 31
32#include "busybox.h" 32#include "busybox.h"
33 33
34/* Stupid libc5 doesn't define this... */
35#ifndef timersub
36#define timersub(a, b, result) \
37 do { \
38 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
39 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
40 if ((result)->tv_usec < 0) { \
41 --(result)->tv_sec; \
42 (result)->tv_usec += 1000000; \
43 } \
44 } while (0)
45#endif
46
47struct host_info { 34struct host_info {
48 char *host; 35 char *host;
49 int port; 36 int port;
@@ -824,7 +811,7 @@ progressmeter(int flag)
824 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 811 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
825 * SUCH DAMAGE. 812 * SUCH DAMAGE.
826 * 813 *
827 * $Id: wget.c,v 1.53 2003/03/19 09:12:39 mjn3 Exp $ 814 * $Id: wget.c,v 1.54 2003/07/22 08:56:51 andersen Exp $
828 */ 815 */
829 816
830 817