diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-07-03 11:46:38 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-07-03 11:46:38 +0000 |
commit | 51b8bd68bb22b1cc5d95e418813c2f08a194ec2b (patch) | |
tree | 905d4f1b1e557950272ac98e1540fa06f732f42f /include | |
parent | 599e3ce163c43c3dfb24d06f8f707c783bc9ab9c (diff) | |
download | busybox-w32-51b8bd68bb22b1cc5d95e418813c2f08a194ec2b.tar.gz busybox-w32-51b8bd68bb22b1cc5d95e418813c2f08a194ec2b.tar.bz2 busybox-w32-51b8bd68bb22b1cc5d95e418813c2f08a194ec2b.zip |
This patch from Bart Visscher <magick@linux-fan.com> adds
IPV6 support to busybox. This patch does the following:
* Add IPv6 support to libbb
* Enable IPv6 interface address display
* Add IPv6 config option
* Adds ping6, an adaptation of the ping applet for IPv6
* Adds support routines for ping6:
- xgethostbyname2
- create_icmp6_socket
* Adds ifconfig support for IPv6
* Add support IPv6 to netstat
* Add IPv6 support to route
Thanks Bart!
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.h | 3 | ||||
-rw-r--r-- | include/inet_common.h | 5 | ||||
-rw-r--r-- | include/libbb.h | 3 | ||||
-rw-r--r-- | include/usage.h | 30 |
4 files changed, 40 insertions, 1 deletions
diff --git a/include/applets.h b/include/applets.h index c2d7acf4b..b6397a656 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -344,6 +344,9 @@ | |||
344 | #ifdef CONFIG_PING | 344 | #ifdef CONFIG_PING |
345 | APPLET(ping, ping_main, _BB_DIR_BIN, _BB_SUID_NEVER) | 345 | APPLET(ping, ping_main, _BB_DIR_BIN, _BB_SUID_NEVER) |
346 | #endif | 346 | #endif |
347 | #ifdef CONFIG_PING6 | ||
348 | APPLET(ping6, ping6_main, _BB_DIR_BIN, _BB_SUID_NEVER) | ||
349 | #endif | ||
347 | #ifdef CONFIG_PIVOT_ROOT | 350 | #ifdef CONFIG_PIVOT_ROOT |
348 | APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN, _BB_SUID_NEVER) | 351 | APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN, _BB_SUID_NEVER) |
349 | #endif | 352 | #endif |
diff --git a/include/inet_common.h b/include/inet_common.h index 2c5e8f673..8050afc67 100644 --- a/include/inet_common.h +++ b/include/inet_common.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Heavily modified by Manuel Novoa III Mar 12, 2001 | 5 | * Heavily modified by Manuel Novoa III Mar 12, 2001 |
6 | * | 6 | * |
7 | * Version: $Id: inet_common.h,v 1.1 2001/11/10 12:18:42 andersen Exp $ | 7 | * Version: $Id: inet_common.h,v 1.2 2002/07/03 11:46:38 andersen Exp $ |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
@@ -28,3 +28,6 @@ extern int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirs | |||
28 | */ | 28 | */ |
29 | extern int INET_rresolve(char *name, size_t len, struct sockaddr_in *s_in, | 29 | extern int INET_rresolve(char *name, size_t len, struct sockaddr_in *s_in, |
30 | int numeric, unsigned int netmask); | 30 | int numeric, unsigned int netmask); |
31 | |||
32 | extern int INET6_resolve(char *name, struct sockaddr_in6 *sin6); | ||
33 | extern int INET6_rresolve(char *name, size_t len, struct sockaddr_in6 *sin6, int numeric); | ||
diff --git a/include/libbb.h b/include/libbb.h index 2b9fd5fd6..f83cc7623 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -233,7 +233,10 @@ extern void gz_close(int gunzip_pid); | |||
233 | extern FILE *gz_open(FILE *compressed_file, int *pid); | 233 | extern FILE *gz_open(FILE *compressed_file, int *pid); |
234 | 234 | ||
235 | extern struct hostent *xgethostbyname(const char *name); | 235 | extern struct hostent *xgethostbyname(const char *name); |
236 | extern struct hostent *xgethostbyname2(const char *name, int af); | ||
236 | extern int create_icmp_socket(void); | 237 | extern int create_icmp_socket(void); |
238 | extern int create_icmp6_socket(void); | ||
239 | extern int xconnect(const char *host, const char *port); | ||
237 | 240 | ||
238 | char *dirname (char *path); | 241 | char *dirname (char *path); |
239 | 242 | ||
diff --git a/include/usage.h b/include/usage.h index 5feb3ac10..87678f5e9 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -733,12 +733,19 @@ | |||
733 | #else | 733 | #else |
734 | #define USAGE_IFCONFIG_OPT_A(a) | 734 | #define USAGE_IFCONFIG_OPT_A(a) |
735 | #endif | 735 | #endif |
736 | #ifdef CONFIG_FEATURE_IPV6 | ||
737 | #define USAGE_IPV6(a) a | ||
738 | #else | ||
739 | #define USAGE_IPV6(a) | ||
740 | #endif | ||
736 | 741 | ||
737 | #define ifconfig_trivial_usage \ | 742 | #define ifconfig_trivial_usage \ |
738 | USAGE_IFCONFIG_OPT_A("[-a]") " <interface> [<address>]" | 743 | USAGE_IFCONFIG_OPT_A("[-a]") " <interface> [<address>]" |
739 | #define ifconfig_full_usage \ | 744 | #define ifconfig_full_usage \ |
740 | "configure a network interface\n\n" \ | 745 | "configure a network interface\n\n" \ |
741 | "Options:\n" \ | 746 | "Options:\n" \ |
747 | USAGE_IPV6("[add <address>[/<prefixlen>]]\n") \ | ||
748 | USAGE_IPV6("[del <address>[/<prefixlen>]]\n") \ | ||
742 | "\t[[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n" \ | 749 | "\t[[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n" \ |
743 | "\t[netmask <address>] [dstaddr <address>]\n" \ | 750 | "\t[netmask <address>] [dstaddr <address>]\n" \ |
744 | USAGE_SIOCSKEEPALIVE("\t[outfill <NN>] [keepalive <NN>]\n") \ | 751 | USAGE_SIOCSKEEPALIVE("\t[outfill <NN>] [keepalive <NN>]\n") \ |
@@ -1370,6 +1377,29 @@ | |||
1370 | "1 packets transmitted, 1 packets received, 0% packet loss\n" \ | 1377 | "1 packets transmitted, 1 packets received, 0% packet loss\n" \ |
1371 | "round-trip min/avg/max = 20.1/20.1/20.1 ms\n" | 1378 | "round-trip min/avg/max = 20.1/20.1/20.1 ms\n" |
1372 | 1379 | ||
1380 | #ifndef CONFIG_FEATURE_FANCY_PING6 | ||
1381 | #define ping6_trivial_usage "host" | ||
1382 | #define ping6_full_usage "Send ICMP ECHO_REQUEST packets to network hosts" | ||
1383 | #else | ||
1384 | #define ping6_trivial_usage \ | ||
1385 | "[OPTION]... host" | ||
1386 | #define ping6_full_usage \ | ||
1387 | "Send ICMP ECHO_REQUEST packets to network hosts.\n\n" \ | ||
1388 | "Options:\n" \ | ||
1389 | "\t-c COUNT\tSend only COUNT pings.\n" \ | ||
1390 | "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n" \ | ||
1391 | "\t-q\t\tQuiet mode, only displays output at start\n" \ | ||
1392 | "\t\t\tand when finished." | ||
1393 | #endif | ||
1394 | #define ping6_example_usage \ | ||
1395 | "$ ping6 ip6-localhost\n" \ | ||
1396 | "PING ip6-localhost (::1): 56 data bytes\n" \ | ||
1397 | "64 bytes from ::1: icmp6_seq=0 ttl=64 time=20.1 ms\n" \ | ||
1398 | "\n" \ | ||
1399 | "--- ip6-localhost ping statistics ---\n" \ | ||
1400 | "1 packets transmitted, 1 packets received, 0% packet loss\n" \ | ||
1401 | "round-trip min/avg/max = 20.1/20.1/20.1 ms\n" | ||
1402 | |||
1373 | #define pivot_root_trivial_usage \ | 1403 | #define pivot_root_trivial_usage \ |
1374 | "NEW_ROOT PUT_OLD" | 1404 | "NEW_ROOT PUT_OLD" |
1375 | #define pivot_root_full_usage \ | 1405 | #define pivot_root_full_usage \ |