9 "Usage: nmrpd [OPTIONS...]\n"
12 " -a <ipaddr> IP address to assign to target device\n"
13 " -f <firmware> Firmware file\n"
14 " -i <interface> Network interface directly connected to device\n"
15 " -m <mac> MAC address of target device (xx:xx:xx:xx:xx:xx)\n"
16 " -M <netmask> Subnet mask to assign to target device\n"
17 " -t <timeout> Timeout (in milliseconds) for regular messages\n"
18 " -T <timeout> Time to wait after successfull TFTP upload\n"
19 " -p <port> Port to use for TFTP upload\n"
20 " -h Show this screen\n"
22 "Options -a, -i and -f are mandatory!\n"
27 int main(int argc, char **argv)
30 struct nmrpd_args args = {
35 .ipmask = "255.255.255.0",
37 .mac = "ff:ff:ff:ff:ff:ff",
45 while ((c = getopt(argc, argv, "a:f:i:m:M:p:t:T:")) != -1) {
52 args.filename = optarg;
68 if (val <= 0 || val > max) {
69 fprintf(stderr, "Invalid numeric value for -%c.\n", c);
75 } else if (c == 't') {
76 args.rx_timeout = val;
78 args.ul_timeout = val;
91 if (!args.filename || !args.intf || !args.ipaddr) {
96 return nmrp_do(&args);