aboutsummaryrefslogtreecommitdiff
path: root/toys/toylist.h
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-12-03 18:53:00 -0600
committerRob Landley <rob@landley.net>2007-12-03 18:53:00 -0600
commit29266f4987fe104c245d4d4b2afd44430ee15d56 (patch)
treea6f7473317f56a5bea482a5e11b5a4b1ed319847 /toys/toylist.h
parent7abb976bac52e95820a629b2569e2c30aa8dd8d4 (diff)
downloadtoybox-29266f4987fe104c245d4d4b2afd44430ee15d56.tar.gz
Add first pass at netcat. Base applet, -f, and -w implemented.
Diffstat (limited to 'toys/toylist.h')
-rw-r--r--toys/toylist.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/toys/toylist.h b/toys/toylist.h
index e3fb4d7c..360efa8a 100644
--- a/toys/toylist.h
+++ b/toys/toylist.h
@@ -53,6 +53,16 @@ struct mke2fs_data {
struct ext2_superblock sb;
};
+struct netcat_data {
+ char *filename; // -f read from filename instead of network
+ long quit_delay; // -q Exit after EOF from stdin after # seconds.
+ char *source_address; // -s Bind to a specific source address.
+ long port; // -p Bind to a specific source port.
+ long listen; // -l Listen for connection instead of dialing out.
+ long wait; // -w Wait # seconds for a connection.
+ long delay; // -i delay between lines sent
+};
+
struct sleep_data {
long seconds;
};
@@ -76,6 +86,7 @@ extern union toy_union {
struct df_data df;
struct mke2fs_data mke2fs;
struct mkfifo_data mkfifo;
+ struct netcat_data netcat;
struct sleep_data sleep;
struct touch_data touch;
struct toysh_data toysh;
@@ -120,6 +131,8 @@ USE_HELLO(NEWTOY(hello, NULL, TOYFLAG_USR|TOYFLAG_BIN))
USE_HELP(NEWTOY(help, "<1", TOYFLAG_BIN))
USE_MKE2FS(NEWTOY(mke2fs, MKE2FS_OPTSTRING, TOYFLAG_SBIN))
USE_MKFIFO(NEWTOY(mkfifo, "<1m:", TOYFLAG_BIN))
+USE_NETCAT(OLDTOY(nc, netcat, "i#w#l@p#s:q#f:e", TOYFLAG_BIN))
+USE_NETCAT(NEWTOY(netcat, "i#w#l@p#s:q#f:e", TOYFLAG_BIN))
USE_ONEIT(NEWTOY(oneit, "+<1p", TOYFLAG_SBIN))
USE_PWD(NEWTOY(pwd, NULL, TOYFLAG_BIN))
USE_READLINK(NEWTOY(readlink, "<1f", TOYFLAG_BIN))