Changes in uspace/app/nettest2/nettest2.c [fff7ef4:3e6a98c5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nettest2/nettest2.c
rfff7ef4 r3e6a98c5 47 47 #include <stdbool.h> 48 48 49 #include <inet/dnsr.h>50 49 #include <net/in.h> 51 50 #include <net/in6.h> … … 72 71 printf( 73 72 "Network Networking test 2 aplication - UDP transfer\n" 74 "Usage: nettest2 [options] host\n"73 "Usage: echo [options] address\n" 75 74 "Where options are:\n" 76 75 "-f protocol_family | --family=protocol_family\n" … … 228 227 struct sockaddr_in address_in; 229 228 struct sockaddr_in6 address_in6; 230 dnsr_hostinfo_t *hinfo;231 229 socklen_t addrlen; 232 230 uint8_t *address_start; … … 267 265 } 268 266 269 /* If not before the last argument containing the host*/267 /* If not before the last argument containing the address */ 270 268 if (index >= argc) { 271 printf("Command line error: missing host name\n");269 printf("Command line error: missing address\n"); 272 270 nettest2_print_help(); 273 271 return EINVAL; … … 296 294 } 297 295 298 /* Parse the last argument which should contain the host/address*/296 /* Parse the last argument which should contain the address. */ 299 297 rc = inet_pton(family, argv[argc - 1], address_start); 300 298 if (rc != EOK) { 301 /* Try interpreting as a host name */ 302 rc = dnsr_name2host(argv[argc - 1], &hinfo); 303 if (rc != EOK) { 304 printf("Error resolving host '%s'.\n", argv[argc - 1]); 305 return rc; 306 } 307 308 address_in.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4); 299 fprintf(stderr, "Address parse error %d\n", rc); 300 return rc; 309 301 } 310 302
Note:
See TracChangeset
for help on using the changeset viewer.