summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Andersen2002-07-03 11:46:38 +0000
committerEric Andersen2002-07-03 11:46:38 +0000
commit51b8bd68bb22b1cc5d95e418813c2f08a194ec2b (patch)
tree905d4f1b1e557950272ac98e1540fa06f732f42f /include
parent599e3ce163c43c3dfb24d06f8f707c783bc9ab9c (diff)
downloadbusybox-51b8bd68bb22b1cc5d95e418813c2f08a194ec2b.zip
busybox-51b8bd68bb22b1cc5d95e418813c2f08a194ec2b.tar.gz
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.h3
-rw-r--r--include/inet_common.h5
-rw-r--r--include/libbb.h3
-rw-r--r--include/usage.h30
4 files changed, 40 insertions, 1 deletions
diff --git a/include/applets.h b/include/applets.h
index c2d7acf..b6397a6 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -344,6 +344,9 @@
#ifdef CONFIG_PING
APPLET(ping, ping_main, _BB_DIR_BIN, _BB_SUID_NEVER)
#endif
+#ifdef CONFIG_PING6
+ APPLET(ping6, ping6_main, _BB_DIR_BIN, _BB_SUID_NEVER)
+#endif
#ifdef CONFIG_PIVOT_ROOT
APPLET(pivot_root, pivot_root_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
#endif
diff --git a/include/inet_common.h b/include/inet_common.h
index 2c5e8f6..8050afc 100644
--- a/include/inet_common.h
+++ b/include/inet_common.h
@@ -4,7 +4,7 @@
*
* Heavily modified by Manuel Novoa III Mar 12, 2001
*
- * Version: $Id: inet_common.h,v 1.1 2001/11/10 12:18:42 andersen Exp $
+ * Version: $Id: inet_common.h,v 1.2 2002/07/03 11:46:38 andersen Exp $
*
*/
@@ -28,3 +28,6 @@ extern int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirs
*/
extern int INET_rresolve(char *name, size_t len, struct sockaddr_in *s_in,
int numeric, unsigned int netmask);
+
+extern int INET6_resolve(char *name, struct sockaddr_in6 *sin6);
+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 2b9fd5f..f83cc76 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -233,7 +233,10 @@ extern void gz_close(int gunzip_pid);
extern FILE *gz_open(FILE *compressed_file, int *pid);
extern struct hostent *xgethostbyname(const char *name);
+extern struct hostent *xgethostbyname2(const char *name, int af);
extern int create_icmp_socket(void);
+extern int create_icmp6_socket(void);
+extern int xconnect(const char *host, const char *port);
char *dirname (char *path);
diff --git a/include/usage.h b/include/usage.h
index 5feb3ac..87678f5 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -733,12 +733,19 @@
#else
#define USAGE_IFCONFIG_OPT_A(a)
#endif
+#ifdef CONFIG_FEATURE_IPV6
+ #define USAGE_IPV6(a) a
+#else
+ #define USAGE_IPV6(a)
+#endif
#define ifconfig_trivial_usage \
USAGE_IFCONFIG_OPT_A("[-a]") " <interface> [<address>]"
#define ifconfig_full_usage \
"configure a network interface\n\n" \
"Options:\n" \
+ USAGE_IPV6("[add <address>[/<prefixlen>]]\n") \
+ USAGE_IPV6("[del <address>[/<prefixlen>]]\n") \
"\t[[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n" \
"\t[netmask <address>] [dstaddr <address>]\n" \
USAGE_SIOCSKEEPALIVE("\t[outfill <NN>] [keepalive <NN>]\n") \
@@ -1370,6 +1377,29 @@
"1 packets transmitted, 1 packets received, 0% packet loss\n" \
"round-trip min/avg/max = 20.1/20.1/20.1 ms\n"
+#ifndef CONFIG_FEATURE_FANCY_PING6
+#define ping6_trivial_usage "host"
+#define ping6_full_usage "Send ICMP ECHO_REQUEST packets to network hosts"
+#else
+#define ping6_trivial_usage \
+ "[OPTION]... host"
+#define ping6_full_usage \
+ "Send ICMP ECHO_REQUEST packets to network hosts.\n\n" \
+ "Options:\n" \
+ "\t-c COUNT\tSend only COUNT pings.\n" \
+ "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n" \
+ "\t-q\t\tQuiet mode, only displays output at start\n" \
+ "\t\t\tand when finished."
+#endif
+#define ping6_example_usage \
+ "$ ping6 ip6-localhost\n" \
+ "PING ip6-localhost (::1): 56 data bytes\n" \
+ "64 bytes from ::1: icmp6_seq=0 ttl=64 time=20.1 ms\n" \
+ "\n" \
+ "--- ip6-localhost ping statistics ---\n" \
+ "1 packets transmitted, 1 packets received, 0% packet loss\n" \
+ "round-trip min/avg/max = 20.1/20.1/20.1 ms\n"
+
#define pivot_root_trivial_usage \
"NEW_ROOT PUT_OLD"
#define pivot_root_full_usage \