- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+int nc_main(int argc, char **argv)
+{
+ int do_listen = 0, lport = 0, delay = 0, wsecs = 0, execflag = 0, opt,
+ sfd = 0, cfd;
+ struct sockaddr_in address;
+ struct hostent *hostinfo;
+ fd_set readfds, testfds;
+ char *infile = NULL;
+
+ memset(&address, 0, sizeof(address));
+
+ if (ENABLE_NC_SERVER || ENABLE_NC_EXTRA) {
+ while ((opt = getopt(argc, argv, "lp:" USE_NC_EXTRA("i:ew:f:"))) > 0) {
+ if (ENABLE_NC_SERVER && opt=='l') do_listen++;
+ else if (ENABLE_NC_SERVER && opt=='p')
+ lport = bb_lookup_port(optarg, "tcp", 0);
+ else if (ENABLE_NC_EXTRA && opt=='w') wsecs = atoi(optarg);
+ else if (ENABLE_NC_EXTRA && opt=='i') delay = atoi(optarg);
+ else if (ENABLE_NC_EXTRA && opt=='f') infile = optarg;
+ else if (ENABLE_NC_EXTRA && opt=='e' && optind!=argc) {
+ execflag++;
+ break;
+ } else bb_show_usage();
+ }
+ }