#include <sys/socket.h>
#include <netinet/in.h>
+unsigned short port = 2007;
+
const static struct option longopts[] = {
{ "destination-file", required_argument, NULL, 'd' },
+ { "port", required_argument, NULL, 'p' },
{ NULL, 0, NULL, 0 }
};
int option_index = 0;
for ( ;; ) {
- int c = getopt_long(argc, argv, "d:", longopts, &option_index);
+ int c = getopt_long(argc, argv, "d:p:", longopts, &option_index);
switch (c) {
case 'd':
read_destination_list(optarg);
break;
+ case 'p':
+ port = atoi(optarg);
+ break;
case -1:
return; // end of argument list
default:
int server_sock;
parse_options(argc, argv);
- server_sock = get_server_socket(2007);
+ server_sock = get_server_socket(port);
// FIXME: fire off sender workers here