Changeset 0c2d9bb in mainline for uspace/app/inet/inet.c


Ignore:
Timestamp:
2013-12-25T22:54:29Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b51cf2c
Parents:
f7a33de (diff), ac36aed (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/inet/inet.c

    rf7a33de r0c2d9bb  
    312312}
    313313
     314static int link_list(void)
     315{
     316        sysarg_t *link_list;
     317        inet_link_info_t linfo;
     318
     319        size_t count;
     320        size_t i;
     321        int rc;
     322
     323        rc = inetcfg_get_link_list(&link_list, &count);
     324        if (rc != EOK) {
     325                printf(NAME ": Failed getting link list.\n");
     326                return rc;
     327        }
     328
     329        printf("IP links:\n");
     330        if (count > 0)
     331                printf("    [Link-layer Address] [Link-Name] [Def-MTU]\n");
     332
     333        for (i = 0; i < count; i++) {
     334                rc = inetcfg_link_get(link_list[i], &linfo);
     335                if (rc != EOK) {
     336                        printf("Failed getting properties of link %zu.\n",
     337                            (size_t)link_list[i]);
     338                        continue;
     339                }
     340
     341                printf("    %02x:%02x:%02x:%02x:%02x:%02x %s %zu\n",
     342                    linfo.mac_addr[0], linfo.mac_addr[1],
     343                    linfo.mac_addr[2], linfo.mac_addr[3],
     344                    linfo.mac_addr[4], linfo.mac_addr[5],
     345                    linfo.name, linfo.def_mtu);
     346
     347                free(linfo.name);
     348
     349                linfo.name = NULL;
     350        }
     351
     352        if (count == 0)
     353                printf("    None\n");
     354
     355        free(link_list);
     356
     357        return EOK;
     358}
     359
    314360static int sroute_list(void)
    315361{
     
    404450                if (rc != EOK)
    405451                        return 1;
     452                rc = link_list();
     453                if (rc != EOK)
     454                        return 1;
    406455                return 0;
    407456        }
Note: See TracChangeset for help on using the changeset viewer.