Changeset b8e72fd1 in mainline for uspace/app/nettest3/nettest3.c


Ignore:
Timestamp:
2013-05-30T17:13:02Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
98abd40
Parents:
be2bb4f (diff), 94dfb92 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    rbe2bb4f rb8e72fd1  
    3939#include <str.h>
    4040
     41#include <inet/dnsr.h>
    4142#include <net/in.h>
    4243#include <net/in6.h>
     
    6061        int fd;
    6162        char *endptr;
     63        dnsr_hostinfo_t *hinfo;
    6264
    6365        port = 7;
     
    7577                rc = inet_pton(AF_INET, argv[1], (uint8_t *)&addr.sin_addr.s_addr);
    7678                if (rc != EOK) {
    77                         fprintf(stderr, "Error parsing address\n");
    78                         return 1;
     79                        /* Try interpreting as a host name */
     80                        rc = dnsr_name2host(argv[1], &hinfo);
     81                        if (rc != EOK) {
     82                                printf("Error resolving host '%s'.\n", argv[1]);
     83                                return rc;
     84                        }
     85
     86                        addr.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4);
     87                        addr.sin_family = AF_INET;
    7988                }
    8089                printf("result: rc=%d, family=%d, addr=%x\n", rc,
Note: See TracChangeset for help on using the changeset viewer.