Changes in uspace/app/nettest1/nettest1.c [fff7ef4:d4d74dc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nettest1/nettest1.c
rfff7ef4 rd4d74dc 46 46 #include <arg_parse.h> 47 47 48 #include <inet/dnsr.h>49 48 #include <net/in.h> 50 49 #include <net/in6.h> … … 76 75 printf( 77 76 "Network Networking test 1 aplication - sockets\n" 78 "Usage: nettest1 [options] host\n"77 "Usage: echo [options] numeric_address\n" 79 78 "Where options are:\n" 80 79 "-f protocol_family | --family=protocol_family\n" … … 291 290 struct sockaddr_in address_in; 292 291 struct sockaddr_in6 address_in6; 293 dnsr_hostinfo_t *hinfo;294 292 uint8_t *address_start; 295 293 … … 321 319 } 322 320 323 /* If not before the last argument containing the host*/321 /* If not before the last argument containing the address */ 324 322 if (index >= argc) { 325 printf("Command line error: missing host name\n");323 printf("Command line error: missing address\n"); 326 324 nettest1_print_help(); 327 325 return EINVAL; … … 350 348 } 351 349 352 /* Parse the last argument which should contain the host/address */350 /* Parse the last argument which should contain the address */ 353 351 rc = inet_pton(family, argv[argc - 1], address_start); 354 352 if (rc != EOK) { 355 /* Try interpreting as a host name */ 356 rc = dnsr_name2host(argv[argc - 1], &hinfo); 357 if (rc != EOK) { 358 printf("Error resolving host '%s'.\n", argv[argc - 1]); 359 return rc; 360 } 361 362 address_in.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4); 353 fprintf(stderr, "Address parse error %d\n", rc); 354 return rc; 363 355 } 364 356
Note:
See TracChangeset
for help on using the changeset viewer.