diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-05 20:26:28 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-05 20:26:28 +0000 |
commit | 29fe7265b8c1917ebc03283f22a3eb61e9195979 (patch) | |
tree | 231771f61046cc95c765fc91f65cff26081d8fab /include | |
parent | 00c2c4868a5bd90fe36beaf9236f23f60cd5e8e1 (diff) | |
download | busybox-w32-29fe7265b8c1917ebc03283f22a3eb61e9195979.tar.gz busybox-w32-29fe7265b8c1917ebc03283f22a3eb61e9195979.tar.bz2 busybox-w32-29fe7265b8c1917ebc03283f22a3eb61e9195979.zip |
nc: port nc 1.10 to busybox
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 10 | ||||
-rw-r--r-- | include/usage.h | 31 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index e5413b1a4..91715c16a 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -334,6 +334,7 @@ enum { | |||
334 | }; | 334 | }; |
335 | /* Create stream socket, and allocated suitable lsa | 335 | /* Create stream socket, and allocated suitable lsa |
336 | * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */ | 336 | * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */ |
337 | int xsocket_type(len_and_sockaddr **lsap, int sock_type); | ||
337 | int xsocket_stream(len_and_sockaddr **lsap); | 338 | int xsocket_stream(len_and_sockaddr **lsap); |
338 | /* Create server socket bound to bindaddr:port. bindaddr can be NULL, | 339 | /* Create server socket bound to bindaddr:port. bindaddr can be NULL, |
339 | * numeric IP ("N.N.N.N") or numeric IPv6 address, | 340 | * numeric IP ("N.N.N.N") or numeric IPv6 address, |
@@ -388,6 +389,15 @@ struct hostent *xgethostbyname(const char *name); | |||
388 | // + inet_common.c has additional IPv4-only stuff | 389 | // + inet_common.c has additional IPv4-only stuff |
389 | 390 | ||
390 | 391 | ||
392 | void socket_want_pktinfo(int fd); | ||
393 | ssize_t send_to_from(int fd, void *buf, size_t len, int flags, | ||
394 | const struct sockaddr *from, const struct sockaddr *to, | ||
395 | socklen_t tolen); | ||
396 | ssize_t recv_from_to(int fd, void *buf, size_t len, int flags, | ||
397 | struct sockaddr *from, struct sockaddr *to, | ||
398 | socklen_t sa_size); | ||
399 | |||
400 | |||
391 | extern char *xstrdup(const char *s); | 401 | extern char *xstrdup(const char *s); |
392 | extern char *xstrndup(const char *s, int n); | 402 | extern char *xstrndup(const char *s, int n); |
393 | extern char *safe_strncpy(char *dst, const char *src, size_t size); | 403 | extern char *safe_strncpy(char *dst, const char *src, size_t size); |
diff --git a/include/usage.h b/include/usage.h index c729532e5..fe4cd903c 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -2314,6 +2314,8 @@ | |||
2314 | " or\n" \ | 2314 | " or\n" \ |
2315 | "$ nameif -c /etc/my_mactab_file\n" \ | 2315 | "$ nameif -c /etc/my_mactab_file\n" \ |
2316 | 2316 | ||
2317 | #if !ENABLE_DESKTOP | ||
2318 | |||
2317 | #if ENABLE_NC_SERVER || ENABLE_NC_EXTRA | 2319 | #if ENABLE_NC_SERVER || ENABLE_NC_EXTRA |
2318 | #define NC_OPTIONS_STR "\n\nOptions:" | 2320 | #define NC_OPTIONS_STR "\n\nOptions:" |
2319 | #else | 2321 | #else |
@@ -2356,6 +2358,35 @@ | |||
2356 | "quit\n" \ | 2358 | "quit\n" \ |
2357 | "221 foobar closing connection\n" | 2359 | "221 foobar closing connection\n" |
2358 | 2360 | ||
2361 | #else /* DESKTOP nc - much more compatible with nc 1.10 */ | ||
2362 | |||
2363 | #define nc_trivial_usage \ | ||
2364 | "[-options] hostname port - connect" \ | ||
2365 | USE_NC_SERVER("\nnc [-options] -l -p port [hostname] [port] - listen") | ||
2366 | #define nc_full_usage \ | ||
2367 | USE_NC_SERVER( \ | ||
2368 | "-l Listen mode, for inbound connects\n" \ | ||
2369 | ) \ | ||
2370 | "-n Do not do DNS resolution" \ | ||
2371 | "\n-s addr Local address" \ | ||
2372 | "\n-p port Local port" \ | ||
2373 | "\n-u UDP mode" \ | ||
2374 | "\n-v Verbose (cumulative: -vv)" \ | ||
2375 | "\n-w secs Timeout for connects and final net reads" \ | ||
2376 | USE_NC_EXTRA( \ | ||
2377 | "\n-i sec Delay interval for lines sent" /* ", ports scanned" */ \ | ||
2378 | "\n-o file Hex dump of traffic" \ | ||
2379 | "\n-z Zero-I/O mode (scanning)" \ | ||
2380 | ) \ | ||
2381 | "\n-e prog [args] Program to exec after connect (must be last)" \ | ||
2382 | /* "\n-r Randomize local and remote ports" */ | ||
2383 | /* "\n-g gateway Source-routing hop point[s], up to 8" */ | ||
2384 | /* "\n-G num Source-routing pointer: 4, 8, 12, ..." */ | ||
2385 | /* "\nport numbers can be individual or ranges: lo-hi [inclusive]" */ | ||
2386 | |||
2387 | #endif | ||
2388 | |||
2389 | |||
2359 | #define netstat_trivial_usage \ | 2390 | #define netstat_trivial_usage \ |
2360 | "[-laenrtuwx]" | 2391 | "[-laenrtuwx]" |
2361 | #define netstat_full_usage \ | 2392 | #define netstat_full_usage \ |