diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-06-01 21:47:15 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-06-01 21:47:15 +0000 |
commit | 8b113f93b9b9157ea1e013667eaaf00aed97a251 (patch) | |
tree | c833c8f3a72637660af61b061b90d69d987fed25 /libbb/interface.c | |
parent | 4f6753e586dba5e6c240e670d41fc8fd011034e1 (diff) | |
download | busybox-w32-8b113f93b9b9157ea1e013667eaaf00aed97a251.tar.gz busybox-w32-8b113f93b9b9157ea1e013667eaaf00aed97a251.tar.bz2 busybox-w32-8b113f93b9b9157ea1e013667eaaf00aed97a251.zip |
Vladimir's last_patch13, containing several bugfixes.
Diffstat (limited to 'libbb/interface.c')
-rw-r--r-- | libbb/interface.c | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/libbb/interface.c b/libbb/interface.c index 1d36c13bb..8eb03a61c 100644 --- a/libbb/interface.c +++ b/libbb/interface.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * that either displays or sets the characteristics of | 3 | * that either displays or sets the characteristics of |
4 | * one or more of the system's networking interfaces. | 4 | * one or more of the system's networking interfaces. |
5 | * | 5 | * |
6 | * Version: $Id: interface.c,v 1.2 2001/05/05 03:19:12 bug1 Exp $ | 6 | * Version: $Id: interface.c,v 1.3 2001/06/01 21:47:15 andersen Exp $ |
7 | * | 7 | * |
8 | * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> | 8 | * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> |
9 | * and others. Copyright 1993 MicroWalt Corporation | 9 | * and others. Copyright 1993 MicroWalt Corporation |
@@ -49,6 +49,7 @@ | |||
49 | #undef HAVE_AFNETROM | 49 | #undef HAVE_AFNETROM |
50 | #undef HAVE_AFX25 | 50 | #undef HAVE_AFX25 |
51 | #undef HAVE_AFECONET | 51 | #undef HAVE_AFECONET |
52 | #undef HAVE_AFASH | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * | 55 | * |
@@ -83,7 +84,7 @@ | |||
83 | #define _(x) x | 84 | #define _(x) x |
84 | #define _PATH_PROCNET_DEV "/proc/net/dev" | 85 | #define _PATH_PROCNET_DEV "/proc/net/dev" |
85 | #define new(p) ((p) = xcalloc(1,sizeof(*(p)))) | 86 | #define new(p) ((p) = xcalloc(1,sizeof(*(p)))) |
86 | #define KRELEASE(maj,min,patch) ((maj) * 10000 + (min)*1000 + (patch)) | 87 | #define KRELEASE(maj,min,patch) ((maj) * 65536 + (min)*256 + (patch)) |
87 | 88 | ||
88 | static int procnetdev_vsn = 1; | 89 | static int procnetdev_vsn = 1; |
89 | 90 | ||
@@ -174,15 +175,31 @@ static struct aftype *aftypes[]; | |||
174 | #ifdef KEEP_UNUSED | 175 | #ifdef KEEP_UNUSED |
175 | 176 | ||
176 | static int flag_unx; | 177 | static int flag_unx; |
178 | #ifdef HAVE_AFIPX | ||
177 | static int flag_ipx; | 179 | static int flag_ipx; |
180 | #endif | ||
181 | #ifdef HAVE_AFX25 | ||
178 | static int flag_ax25; | 182 | static int flag_ax25; |
183 | #endif | ||
184 | #ifdef HAVE_AFATALK | ||
179 | static int flag_ddp; | 185 | static int flag_ddp; |
186 | #endif | ||
187 | #ifdef HAVE_AFNETROM | ||
180 | static int flag_netrom; | 188 | static int flag_netrom; |
189 | #endif | ||
181 | static int flag_inet; | 190 | static int flag_inet; |
191 | #ifdef HAVE_AFINET6 | ||
182 | static int flag_inet6; | 192 | static int flag_inet6; |
193 | #endif | ||
194 | #ifdef HAVE_AFECONET | ||
183 | static int flag_econet; | 195 | static int flag_econet; |
196 | #endif | ||
197 | #ifdef HAVE_AFX25 | ||
184 | static int flag_x25 = 0; | 198 | static int flag_x25 = 0; |
199 | #endif | ||
200 | #ifdef HAVE_AFASH | ||
185 | static int flag_ash; | 201 | static int flag_ash; |
202 | #endif | ||
186 | 203 | ||
187 | 204 | ||
188 | static struct aftrans_t { | 205 | static struct aftrans_t { |
@@ -191,48 +208,68 @@ static struct aftrans_t { | |||
191 | int *flag; | 208 | int *flag; |
192 | } aftrans[] = { | 209 | } aftrans[] = { |
193 | 210 | ||
211 | #ifdef HAVE_AFX25 | ||
194 | { | 212 | { |
195 | "ax25", "ax25", &flag_ax25 | 213 | "ax25", "ax25", &flag_ax25 |
196 | }, | 214 | }, |
215 | #endif | ||
197 | { | 216 | { |
198 | "ip", "inet", &flag_inet | 217 | "ip", "inet", &flag_inet |
199 | }, | 218 | }, |
219 | #ifdef HAVE_AFINET6 | ||
200 | { | 220 | { |
201 | "ip6", "inet6", &flag_inet6 | 221 | "ip6", "inet6", &flag_inet6 |
202 | }, | 222 | }, |
223 | #endif | ||
224 | #ifdef HAVE_AFIPX | ||
203 | { | 225 | { |
204 | "ipx", "ipx", &flag_ipx | 226 | "ipx", "ipx", &flag_ipx |
205 | }, | 227 | }, |
228 | #endif | ||
229 | #ifdef HAVE_AFATALK | ||
206 | { | 230 | { |
207 | "appletalk", "ddp", &flag_ddp | 231 | "appletalk", "ddp", &flag_ddp |
208 | }, | 232 | }, |
233 | #endif | ||
234 | #ifdef HAVE_AFNETROM | ||
209 | { | 235 | { |
210 | "netrom", "netrom", &flag_netrom | 236 | "netrom", "netrom", &flag_netrom |
211 | }, | 237 | }, |
238 | #endif | ||
212 | { | 239 | { |
213 | "inet", "inet", &flag_inet | 240 | "inet", "inet", &flag_inet |
214 | }, | 241 | }, |
242 | #ifdef HAVE_AFINET6 | ||
215 | { | 243 | { |
216 | "inet6", "inet6", &flag_inet6 | 244 | "inet6", "inet6", &flag_inet6 |
217 | }, | 245 | }, |
246 | #endif | ||
247 | #ifdef HAVE_AFATALK | ||
218 | { | 248 | { |
219 | "ddp", "ddp", &flag_ddp | 249 | "ddp", "ddp", &flag_ddp |
220 | }, | 250 | }, |
251 | #endif | ||
221 | { | 252 | { |
222 | "unix", "unix", &flag_unx | 253 | "unix", "unix", &flag_unx |
223 | }, | 254 | }, |
224 | { | 255 | { |
225 | "tcpip", "inet", &flag_inet | 256 | "tcpip", "inet", &flag_inet |
226 | }, | 257 | }, |
258 | #ifdef HAVE_AFECONET | ||
227 | { | 259 | { |
228 | "econet", "ec", &flag_econet | 260 | "econet", "ec", &flag_econet |
229 | }, | 261 | }, |
262 | #endif | ||
263 | #ifdef HAVE_AFX25 | ||
230 | { | 264 | { |
231 | "x25", "x25", &flag_x25 | 265 | "x25", "x25", &flag_x25 |
232 | }, | 266 | }, |
267 | #endif | ||
268 | #ifdef HAVE_AFASH | ||
233 | { | 269 | { |
234 | "ash", "ash", &flag_ash | 270 | "ash", "ash", &flag_ash |
235 | }, | 271 | }, |
272 | #endif | ||
236 | { | 273 | { |
237 | 0, 0, 0 | 274 | 0, 0, 0 |
238 | } | 275 | } |
@@ -694,7 +731,7 @@ static int aftrans_opt(const char *arg) | |||
694 | 731 | ||
695 | while (tmp1) { | 732 | while (tmp1) { |
696 | 733 | ||
697 | tmp2 = index(tmp1, ','); | 734 | tmp2 = strchr(tmp1, ','); |
698 | 735 | ||
699 | if (tmp2) | 736 | if (tmp2) |
700 | *(tmp2++) = '\0'; | 737 | *(tmp2++) = '\0'; |
@@ -777,7 +814,7 @@ static struct aftype *get_aftype(const char *name) | |||
777 | return (*afp); | 814 | return (*afp); |
778 | afp++; | 815 | afp++; |
779 | } | 816 | } |
780 | if (index(name, ',')) | 817 | if (strchr(name, ',')) |
781 | fprintf(stderr, _("Please don't supply more than one address family.\n")); | 818 | fprintf(stderr, _("Please don't supply more than one address family.\n")); |
782 | return (NULL); | 819 | return (NULL); |
783 | } | 820 | } |