diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-27 04:22:02 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-27 04:22:02 +0200 |
commit | 77cc2c5738d780b97b56af49510ed64d61ad2e2d (patch) | |
tree | cbb8bd5787da4cfb0fca2710e35bd649d77b1371 /networking/nc_bloaty.c | |
parent | a73b87e9343df2a6f14e328a977e7b70eb3ed707 (diff) | |
download | busybox-w32-77cc2c5738d780b97b56af49510ed64d61ad2e2d.tar.gz busybox-w32-77cc2c5738d780b97b56af49510ed64d61ad2e2d.tar.bz2 busybox-w32-77cc2c5738d780b97b56af49510ed64d61ad2e2d.zip |
nc: introduce CONFIG_NC_110_COMPAT option.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/nc_bloaty.c')
-rw-r--r-- | networking/nc_bloaty.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index 8d27e9682..c44133b5d 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c | |||
@@ -36,9 +36,9 @@ | |||
36 | * - source routing | 36 | * - source routing |
37 | * - multiple DNS checks | 37 | * - multiple DNS checks |
38 | * Functionalty which is different from nc 1.10: | 38 | * Functionalty which is different from nc 1.10: |
39 | * - Prog in '-e prog' can have prog's parameters and options. | 39 | * - Prog in '-e PROG' can have prog's parameters and options. |
40 | * Because of this -e option must be last. | 40 | * Because of this -e option must be last. |
41 | * - nc doesn't redirect stderr to the network socket for the -e prog. | 41 | * - nc doesn't redirect stderr to the network socket for the -e PROG. |
42 | * - numeric addresses are printed in (), not [] (IPv6 looks better), | 42 | * - numeric addresses are printed in (), not [] (IPv6 looks better), |
43 | * port numbers are inside (): (1.2.3.4:5678) | 43 | * port numbers are inside (): (1.2.3.4:5678) |
44 | * - network read errors are reported on verbose levels > 1 | 44 | * - network read errors are reported on verbose levels > 1 |
@@ -50,6 +50,42 @@ | |||
50 | 50 | ||
51 | /* done in nc.c: #include "libbb.h" */ | 51 | /* done in nc.c: #include "libbb.h" */ |
52 | 52 | ||
53 | //usage:#if ENABLE_NC_110_COMPAT | ||
54 | //usage: | ||
55 | //usage:#define nc_trivial_usage | ||
56 | //usage: "[OPTIONS] HOST PORT - connect" | ||
57 | //usage: IF_NC_SERVER("\n" | ||
58 | //usage: "nc [OPTIONS] -l -p PORT [HOST] [PORT] - listen") | ||
59 | //usage:#define nc_full_usage "\n\n" | ||
60 | //usage: "Options:" | ||
61 | //usage: "\n -e PROG Run PROG after connect (must be last)" | ||
62 | //usage: IF_NC_SERVER( | ||
63 | //usage: "\n -l Listen mode, for inbound connects" | ||
64 | //usage: ) | ||
65 | //usage: "\n -p PORT Local port" | ||
66 | //usage: "\n -s ADDR Local address" | ||
67 | //usage: "\n -w SEC Timeout for connects and final net reads" | ||
68 | //usage: IF_NC_EXTRA( | ||
69 | //usage: "\n -i SEC Delay interval for lines sent" /* ", ports scanned" */ | ||
70 | //usage: ) | ||
71 | //usage: "\n -n Don't do DNS resolution" | ||
72 | //usage: "\n -u UDP mode" | ||
73 | //usage: "\n -v Verbose" | ||
74 | //usage: IF_NC_EXTRA( | ||
75 | //usage: "\n -o FILE Hex dump traffic" | ||
76 | //usage: "\n -z Zero-I/O mode (scanning)" | ||
77 | //usage: ) | ||
78 | //usage:#endif | ||
79 | |||
80 | /* "\n -r Randomize local and remote ports" */ | ||
81 | /* "\n -g gateway Source-routing hop point[s], up to 8" */ | ||
82 | /* "\n -G num Source-routing pointer: 4, 8, 12, ..." */ | ||
83 | /* "\nport numbers can be individual or ranges: lo-hi [inclusive]" */ | ||
84 | |||
85 | /* -e PROG can take ARGS too: "nc ... -e ls -l", but we don't document it | ||
86 | * in help text: nc 1.10 does not allow that. We don't want to entice | ||
87 | * users to use this incompatibility */ | ||
88 | |||
53 | enum { | 89 | enum { |
54 | SLEAZE_PORT = 31337, /* for UDP-scan RTT trick, change if ya want */ | 90 | SLEAZE_PORT = 31337, /* for UDP-scan RTT trick, change if ya want */ |
55 | BIGSIZ = 8192, /* big buffers */ | 91 | BIGSIZ = 8192, /* big buffers */ |