Changeset 2f19103 in mainline for uspace/srv/net/udp/ucall.c


Ignore:
Timestamp:
2015-05-22T07:21:37Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
58e9dec
Parents:
bf7587b0
Message:

TCP and UDP servers can make use of inet/endpoint.h types internally.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/ucall.c

    rbf7587b0 r2f19103  
    11/*
    2  * Copyright (c) 2012 Jiri Svoboda
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    5050
    5151        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_create()");
    52         nassoc = udp_assoc_new(NULL, NULL, NULL, NULL);
     52        nassoc = udp_assoc_new(NULL, NULL, NULL);
    5353        if (nassoc == NULL)
    5454                return UDP_ENORES;
     
    6767}
    6868
    69 udp_error_t udp_uc_set_foreign(udp_assoc_t *assoc, udp_sock_t *fsock)
     69udp_error_t udp_uc_set_remote(udp_assoc_t *assoc, inet_ep_t *ep)
    7070{
    71         log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_set_foreign(%p, %p)", assoc, fsock);
     71        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_set_remote(%p, %p)", assoc, ep);
    7272
    73         udp_assoc_set_foreign(assoc, fsock);
     73        udp_assoc_set_remote(assoc, ep);
    7474        return UDP_EOK;
    7575}
    7676
    77 udp_error_t udp_uc_set_local(udp_assoc_t *assoc, udp_sock_t *lsock)
     77udp_error_t udp_uc_set_local(udp_assoc_t *assoc, inet_ep_t *ep)
    7878{
    79         log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_set_local(%p, %p)", assoc, lsock);
    80        
    81         udp_assoc_set_local(assoc, lsock);
     79        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_set_local(%p, %p)", assoc, ep);
     80
     81        udp_assoc_set_local(assoc, ep);
    8282        return UDP_EOK;
    8383}
     
    8686{
    8787        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_set_local(%p, %" PRIu16 ")", assoc, lport);
    88        
     88
    8989        udp_assoc_set_local_port(assoc, lport);
    9090        return UDP_EOK;
    9191}
    9292
    93 udp_error_t udp_uc_send(udp_assoc_t *assoc, udp_sock_t *fsock, void *data,
     93udp_error_t udp_uc_send(udp_assoc_t *assoc, inet_ep_t *remote, void *data,
    9494    size_t size, xflags_t flags)
    9595{
     
    102102        msg.data_size = size;
    103103
    104         rc = udp_assoc_send(assoc, fsock, &msg);
     104        rc = udp_assoc_send(assoc, remote, &msg);
    105105        switch (rc) {
    106106        case ENOMEM:
     
    115115
    116116udp_error_t udp_uc_receive(udp_assoc_t *assoc, void *buf, size_t size,
    117     size_t *rcvd, xflags_t *xflags, udp_sock_t *fsock)
     117    size_t *rcvd, xflags_t *xflags, inet_ep_t *remote)
    118118{
    119119        size_t xfer_size;
     
    122122
    123123        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_uc_receive()", assoc->name);
    124         rc = udp_assoc_recv(assoc, &msg, fsock);
     124        rc = udp_assoc_recv(assoc, &msg, remote);
    125125        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv -> %d", rc);
    126126        switch (rc) {
Note: See TracChangeset for help on using the changeset viewer.