Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nettest1/nettest1.c

    rfff7ef4 rd4d74dc  
    4646#include <arg_parse.h>
    4747
    48 #include <inet/dnsr.h>
    4948#include <net/in.h>
    5049#include <net/in6.h>
     
    7675        printf(
    7776            "Network Networking test 1 aplication - sockets\n"
    78             "Usage: nettest1 [options] host\n"
     77            "Usage: echo [options] numeric_address\n"
    7978            "Where options are:\n"
    8079            "-f protocol_family | --family=protocol_family\n"
     
    291290        struct sockaddr_in address_in;
    292291        struct sockaddr_in6 address_in6;
    293         dnsr_hostinfo_t *hinfo;
    294292        uint8_t *address_start;
    295293
     
    321319        }
    322320
    323         /* If not before the last argument containing the host */
     321        /* If not before the last argument containing the address */
    324322        if (index >= argc) {
    325                 printf("Command line error: missing host name\n");
     323                printf("Command line error: missing address\n");
    326324                nettest1_print_help();
    327325                return EINVAL;
     
    350348        }
    351349
    352         /* Parse the last argument which should contain the host/address */
     350        /* Parse the last argument which should contain the address */
    353351        rc = inet_pton(family, argv[argc - 1], address_start);
    354352        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;
    363355        }
    364356
Note: See TracChangeset for help on using the changeset viewer.