Changeset b9f7848b in mainline for uspace/srv/net/inetsrv/inet_link.c


Ignore:
Timestamp:
2013-09-16T06:07:42Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
884c56b, f65d9cc, f9a2831
Parents:
5ed8b72 (diff), 947e2ef (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 DHCP improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/inet_link.c

    r5ed8b72 rb9f7848b  
    493493}
    494494
     495/** Get IDs of all links. */
     496int inet_link_get_id_list(sysarg_t **rid_list, size_t *rcount)
     497{
     498        sysarg_t *id_list;
     499        size_t count, i;
     500
     501        fibril_mutex_lock(&inet_discovery_lock);
     502        count = list_count(&inet_link_list);
     503
     504        id_list = calloc(count, sizeof(sysarg_t));
     505        if (id_list == NULL) {
     506                fibril_mutex_unlock(&inet_discovery_lock);
     507                return ENOMEM;
     508        }
     509
     510        i = 0;
     511        list_foreach(inet_link_list, link_list, inet_link_t, ilink) {
     512                id_list[i++] = ilink->svc_id;
     513                log_msg(LOG_DEFAULT, LVL_NOTE, "add link to list");
     514        }
     515
     516        fibril_mutex_unlock(&inet_discovery_lock);
     517
     518        log_msg(LOG_DEFAULT, LVL_NOTE, "return %zu links", count);
     519        *rid_list = id_list;
     520        *rcount = count;
     521
     522        return EOK;
     523}
     524
    495525/** @}
    496526 */
Note: See TracChangeset for help on using the changeset viewer.