aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h10
-rw-r--r--include/usage.h31
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)) */
337int xsocket_type(len_and_sockaddr **lsap, int sock_type);
337int xsocket_stream(len_and_sockaddr **lsap); 338int 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
392void socket_want_pktinfo(int fd);
393ssize_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);
396ssize_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
391extern char *xstrdup(const char *s); 401extern char *xstrdup(const char *s);
392extern char *xstrndup(const char *s, int n); 402extern char *xstrndup(const char *s, int n);
393extern char *safe_strncpy(char *dst, const char *src, size_t size); 403extern 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 \