Changeset e948fde in mainline for uspace/app


Ignore:
Timestamp:
2013-09-29T21:43:49Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a324d99
Parents:
f023251
Message:

dnsr_name2host should use ip_ver_t instead of AF.

Location:
uspace/app
Files:
7 edited

Legend:

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

    rf023251 re948fde  
    5454        }
    5555       
    56         uint16_t af;
     56        uint16_t ver;
    5757        char *hname;
    5858       
     
    6363                }
    6464               
    65                 af = AF_INET;
     65                ver = ip_v4;
    6666                hname = argv[2];
    6767        } else if (str_cmp(argv[1], "-6") == 0) {
     
    7171                }
    7272               
    73                 af = AF_INET6;
     73                ver = ip_v6;
    7474                hname = argv[2];
    7575        } else {
    76                 af = 0;
     76                ver = ip_any;
    7777                hname = argv[1];
    7878        }
    7979       
    8080        dnsr_hostinfo_t *hinfo;
    81         int rc = dnsr_name2host(hname, &hinfo, af);
     81        int rc = dnsr_name2host(hname, &hinfo, ver);
    8282        if (rc != EOK) {
    8383                printf("%s: Error resolving '%s'.\n", NAME, hname);
  • uspace/app/nettest1/nettest1.c

    rf023251 re948fde  
    5959#define NETTEST1_TEXT  "Networking test 1 - sockets"
    6060
    61 static uint16_t family = AF_INET;
     61static uint16_t family = AF_NONE;
    6262static sock_type_t type = SOCK_DGRAM;
    6363static size_t size = 27;
     
    335335                /* Interpret as a host name */
    336336                dnsr_hostinfo_t *hinfo = NULL;
    337                 rc = dnsr_name2host(addr_s, &hinfo, family);
     337                rc = dnsr_name2host(addr_s, &hinfo, ipver_from_af(family));
    338338               
    339339                if (rc != EOK) {
     
    348348        struct sockaddr_in6 addr6;
    349349        uint16_t af = inet_addr_sockaddr_in(&addr_addr, &addr, &addr6);
     350       
     351        if (family == AF_NONE)
     352                family = af;
    350353       
    351354        if (af != family) {
  • uspace/app/nettest2/nettest2.c

    rf023251 re948fde  
    6060#define NETTEST2_TEXT  "Networking test 2 - transfer"
    6161
    62 static uint16_t family = PF_INET;
     62static uint16_t family = AF_NONE;
    6363static size_t size = 28;
    6464static bool verbose = false;
     
    271271                /* Interpret as a host name */
    272272                dnsr_hostinfo_t *hinfo = NULL;
    273                 rc = dnsr_name2host(addr_s, &hinfo, family);
     273                rc = dnsr_name2host(addr_s, &hinfo, ipver_from_af(family));
    274274               
    275275                if (rc != EOK) {
     
    284284        struct sockaddr_in6 addr6;
    285285        uint16_t af = inet_addr_sockaddr_in(&addr_addr, &addr, &addr6);
     286       
     287        if (family == AF_NONE)
     288                family = af;
    286289       
    287290        if (af != family) {
  • uspace/app/nettest3/nettest3.c

    rf023251 re948fde  
    7878                if (rc != EOK) {
    7979                        /* Try interpreting as a host name */
    80                         rc = dnsr_name2host(argv[1], &hinfo, AF_INET);
     80                        rc = dnsr_name2host(argv[1], &hinfo, ip_v4);
    8181                        if (rc != EOK) {
    8282                                printf("Error resolving host '%s'.\n", argv[1]);
    8383                                return rc;
    8484                        }
    85                        
     85
    8686                        uint16_t af = inet_addr_sockaddr_in(&hinfo->addr, &addr, NULL);
    8787                        if (af != AF_INET) {
  • uspace/app/nterm/conn.c

    rf023251 re948fde  
    8484                /* Interpret as a host name */
    8585                dnsr_hostinfo_t *hinfo = NULL;
    86                 rc = dnsr_name2host(addr_s, &hinfo, 0);
     86                rc = dnsr_name2host(addr_s, &hinfo, ip_any);
    8787               
    8888                if (rc != EOK) {
  • uspace/app/ping/ping.c

    rf023251 re948fde  
    262262        if (rc != EOK) {
    263263                /* Try interpreting as a host name */
    264                 rc = dnsr_name2host(argv[optind], &hinfo, AF_INET);
     264                rc = dnsr_name2host(argv[optind], &hinfo, ip_v4);
    265265                if (rc != EOK) {
    266266                        printf("Error resolving host '%s'.\n", argv[optind]);
  • uspace/app/ping6/ping6.c

    rf023251 re948fde  
    262262        if (rc != EOK) {
    263263                /* Try interpreting as a host name */
    264                 rc = dnsr_name2host(argv[optind], &hinfo, AF_INET);
     264                rc = dnsr_name2host(argv[optind], &hinfo, ip_v6);
    265265                if (rc != EOK) {
    266266                        printf("Error resolving host '%s'.\n", argv[optind]);
Note: See TracChangeset for help on using the changeset viewer.