" Write process id to FILE.\n"
" If no FILE specified, use " DEFAULT_PID_FILE "\n"
"\n"
+ " -tPORT, --tcp-port PORT\n"
+ " Listen on TCP/IP port PORT.\n"
+ "\n"
" -h, --help\n"
" Print this help.\n"
"\n"
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
- rc = getaddrinfo(host, USBIP_PORT_STRING, &hints, &ai_head);
+ rc = getaddrinfo(host, usbip_port_string, &hints, &ai_head);
if (rc) {
- err("failed to get a network address %s: %s", USBIP_PORT_STRING,
+ err("failed to get a network address %s: %s", usbip_port_string,
gai_strerror(rc));
return NULL;
}
{ "daemon", no_argument, NULL, 'D' },
{ "debug", no_argument, NULL, 'd' },
{ "pid", optional_argument, NULL, 'P' },
+ { "tcp-port", required_argument, NULL, 't' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
{ NULL, 0, NULL, 0 }
cmd = cmd_standalone_mode;
for (;;) {
- opt = getopt_long(argc, argv, "DdP::hv", longopts, NULL);
+ opt = getopt_long(argc, argv, "DdP::t:hv", longopts, NULL);
if (opt == -1)
break;
case 'P':
pid_file = optarg ? optarg : DEFAULT_PID_FILE;
break;
+ case 't':
+ usbip_setup_port_number(optarg);
+ break;
case 'v':
cmd = cmd_version;
break;