Changeset fdbc3ff in mainline for uspace/lib/c/generic/net


Ignore:
Timestamp:
2010-11-19T23:50:06Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46d4d9f
Parents:
b4c9c61 (diff), a9c6b966 (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.

Location:
uspace/lib/c/generic/net
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/icmp_api.c

    rb4c9c61 rfdbc3ff  
    6666 * @param[in] addr      The target host address.
    6767 * @param[in] addrlen   The torget host address length.
    68  * @returns             ICMP_ECHO on success.
    69  * @returns             ETIMEOUT if the reply has not arrived before the
     68 * @return              ICMP_ECHO on success.
     69 * @return              ETIMEOUT if the reply has not arrived before the
    7070 *                      timeout.
    71  * @returns             ICMP type of the received error notification.
    72  * @returns             EINVAL if the addrlen parameter is less or equal to
     71 * @return              ICMP type of the received error notification.
     72 * @return              EINVAL if the addrlen parameter is less or equal to
    7373 *                      zero.
    74  * @returns             ENOMEM if there is not enough memory left.
    75  * @returns             EPARTY if there was an internal error.
     74 * @return              ENOMEM if there is not enough memory left.
     75 * @return              EPARTY if there was an internal error.
    7676 */
    7777int
  • uspace/lib/c/generic/net/icmp_common.c

    rb4c9c61 rfdbc3ff  
    5050 * @param[in] timeout   The connection timeout in microseconds. No timeout if
    5151 *                      set to zero.
    52  * @returns             The ICMP module phone on success.
    53  * @returns             ETIMEOUT if the connection timeouted.
     52 * @return              The ICMP module phone on success.
     53 * @return              ETIMEOUT if the connection timeouted.
    5454 */
    5555int icmp_connect_module(services_t service, suseconds_t timeout)
  • uspace/lib/c/generic/net/inet.c

    rb4c9c61 rfdbc3ff  
    5151 *  @param[out] address The character buffer to be filled.
    5252 *  @param[in] length   The buffer length.
    53  *  @returns            EOK on success.
    54  *  @returns            EINVAL if the data or address parameter is NULL.
    55  *  @returns            ENOMEM if the character buffer is not long enough.
    56  *  @returns            ENOTSUP if the address family is not supported.
     53 *  @return             EOK on success.
     54 *  @return             EINVAL if the data or address parameter is NULL.
     55 *  @return             ENOMEM if the character buffer is not long enough.
     56 *  @return             ENOTSUP if the address family is not supported.
    5757 */
    5858int
     
    101101 *  @param[in] address  The character buffer to be parsed.
    102102 *  @param[out] data    The address data to be filled.
    103  *  @returns            EOK on success.
    104  *  @returns            EINVAL if the data parameter is NULL.
    105  *  @returns            ENOENT if the address parameter is NULL.
    106  *  @returns            ENOTSUP if the address family is not supported.
     103 *  @return             EOK on success.
     104 *  @return             EINVAL if the data parameter is NULL.
     105 *  @return             ENOENT if the address parameter is NULL.
     106 *  @return             ENOTSUP if the address family is not supported.
    107107 */
    108108int inet_pton(uint16_t family, const char *address, uint8_t *data)
  • uspace/lib/c/generic/net/modules.c

    rb4c9c61 rfdbc3ff  
    159159 *
    160160 * @param[in] need      The needed module service.
    161  * @returns             The phone of the needed service.
     161 * @return              The phone of the needed service.
    162162 */
    163163int connect_to_service(services_t need)
     
    171171 *  @param[in] timeout  The connection timeout in microseconds. No timeout if
    172172 *                      set to zero (0).
    173  *  @returns            The phone of the needed service.
    174  *  @returns            ETIMEOUT if the connection timeouted.
     173 *  @return             The phone of the needed service.
     174 *  @return             ETIMEOUT if the connection timeouted.
    175175 */
    176176int connect_to_service_timeout(services_t need, suseconds_t timeout)
     
    204204 * @param[out] data     The data buffer to be filled.
    205205 * @param[out] length   The buffer length.
    206  * @returns             EOK on success.
    207  * @returns             EBADMEM if the data or the length parameter is NULL.
    208  * @returns             EINVAL if the client does not send data.
    209  * @returns             ENOMEM if there is not enough memory left.
    210  * @returns             Other error codes as defined for the
     206 * @return              EOK on success.
     207 * @return              EBADMEM if the data or the length parameter is NULL.
     208 * @return              EINVAL if the client does not send data.
     209 * @return              ENOMEM if there is not enough memory left.
     210 * @return              Other error codes as defined for the
    211211 *                      async_data_write_finalize() function.
    212212 */
     
    242242 * @param[in] data      The data buffer to be sent.
    243243 * @param[in] data_length The buffer length.
    244  * @returns             EOK on success.
    245  * @returns             EINVAL if the client does not expect the data.
    246  * @returns             EOVERFLOW if the client does not expect all the data.
     244 * @return              EOK on success.
     245 * @return              EINVAL if the client does not expect the data.
     246 * @return              EOVERFLOW if the client does not expect all the data.
    247247 *                      Only partial data are transfered.
    248  * @returns             Other error codes as defined for the
     248 * @return              Other error codes as defined for the
    249249 *                      async_data_read_finalize() function.
    250250 */
  • uspace/lib/c/generic/net/packet.c

    rb4c9c61 rfdbc3ff  
    6464typedef packet_t packet_map_t[PACKET_MAP_SIZE];
    6565
    66 /** Type definition of the packet map page pointer. */
    67 typedef packet_map_t * packet_map_ref;
    68 
    6966/** Packet map.
    7067 * Maps packet identifiers to the packet references.
     
    8582/** Initializes the packet map.
    8683 *
    87  * @returns             EOK on success.
    88  * @returns             ENOMEM if there is not enough memory left.
     84 * @return              EOK on success.
     85 * @return              ENOMEM if there is not enough memory left.
    8986 */
    9087int pm_init(void)
     
    104101 *
    105102 * @param[in] packet_id The packet identifier to be found.
    106  * @returns             The found packet reference.
    107  * @returns             NULL if the mapping does not exist.
     103 * @return              The found packet reference.
     104 * @return              NULL if the mapping does not exist.
    108105 */
    109106packet_t pm_find(packet_id_t packet_id)
    110107{
    111         packet_map_ref map;
     108        packet_map_t *map;
    112109        packet_t packet;
    113110
     
    133130 *
    134131 * @param[in] packet    The packet to be remembered.
    135  * @returns             EOK on success.
    136  * @returns             EINVAL if the packet is not valid.
    137  * @returns             EINVAL if the packet map is not initialized.
    138  * @returns             ENOMEM if there is not enough memory left.
     132 * @return              EOK on success.
     133 * @return              EINVAL if the packet is not valid.
     134 * @return              EINVAL if the packet map is not initialized.
     135 * @return              ENOMEM if there is not enough memory left.
    139136 */
    140137int pm_add(packet_t packet)
    141138{
    142         packet_map_ref map;
     139        packet_map_t *map;
    143140        int rc;
    144141
     
    154151        } else {
    155152                do {
    156                         map = (packet_map_ref) malloc(sizeof(packet_map_t));
     153                        map = (packet_map_t *) malloc(sizeof(packet_map_t));
    157154                        if (!map) {
    158155                                fibril_rwlock_write_unlock(&pm_globals.lock);
     
    180177        int count;
    181178        int index;
    182         packet_map_ref map;
     179        packet_map_t *map;
    183180        packet_t packet;
    184181
     
    208205 * @param[in] order     The packet order value.
    209206 * @param[in] metric    The metric value of the packet.
    210  * @returns             EOK on success.
    211  * @returns             EINVAL if the first parameter is NULL.
    212  * @returns             EINVAL if the packet is not valid.
     207 * @return              EOK on success.
     208 * @return              EINVAL if the first parameter is NULL.
     209 * @return              EINVAL if the packet is not valid.
    213210 */
    214211int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric)
     
    252249 * @param[in] first     The first packet of the queue.
    253250 * @param[in] order     The packet order value.
    254  * @returns             The packet with the given order.
    255  * @returns             NULL if the first packet is not valid.
    256  * @returns             NULL if the packet is not found.
     251 * @return              The packet with the given order.
     252 * @return              NULL if the first packet is not valid.
     253 * @return              NULL if the packet is not found.
    257254 */
    258255packet_t pq_find(packet_t packet, size_t order)
     
    278275 * @param[in] packet    The packet in the queue.
    279276 * @param[in] new_packet The new packet to be inserted.
    280  * @returns             EOK on success.
    281  * @returns             EINVAL if etiher of the packets is invalid.
     277 * @return              EOK on success.
     278 * @return              EINVAL if etiher of the packets is invalid.
    282279 */
    283280int pq_insert_after(packet_t packet, packet_t new_packet)
     
    301298 *
    302299 * @param[in] packet    The packet to be detached.
    303  * @returns             The next packet in the queue. If the packet is the first
     300 * @return              The next packet in the queue. If the packet is the first
    304301 *                      one of the queue, this becomes the new first one.
    305  * @returns             NULL if there is no packet left.
    306  * @returns             NULL if the packet is not valid.
     302 * @return              NULL if there is no packet left.
     303 * @return              NULL if the packet is not valid.
    307304 */
    308305packet_t pq_detach(packet_t packet)
     
    331328 * @param[in] order     The packet order value.
    332329 * @param[in] metric    The metric value of the packet.
    333  * @returns             EOK on success.
    334  * @returns             EINVAL if the packet is invalid.
     330 * @return              EOK on success.
     331 * @return              EINVAL if the packet is invalid.
    335332 */
    336333int pq_set_order(packet_t packet, size_t order, size_t metric)
     
    349346 * @param[out] order    The packet order value.
    350347 * @param[out] metric   The metric value of the packet.
    351  * @returns             EOK on success.
    352  * @returns             EINVAL if the packet is invalid.
     348 * @return              EOK on success.
     349 * @return              EINVAL if the packet is invalid.
    353350 */
    354351int pq_get_order(packet_t packet, size_t *order, size_t *metric)
     
    394391 *
    395392 * @param[in] packet    The packet queue member.
    396  * @returns             The next packet in the queue.
    397  * @returns             NULL if there is no next packet.
    398  * @returns             NULL if the packet is not valid.
     393 * @return              The next packet in the queue.
     394 * @return              NULL if there is no next packet.
     395 * @return              NULL if the packet is not valid.
    399396 */
    400397packet_t pq_next(packet_t packet)
     
    409406 *
    410407 * @param[in] packet    The packet queue member.
    411  * @returns             The previous packet in the queue.
    412  * @returns             NULL if there is no previous packet.
    413  * @returns             NULL if the packet is not valid.
     408 * @return              The previous packet in the queue.
     409 * @return              NULL if there is no previous packet.
     410 * @return              NULL if the packet is not valid.
    414411 */
    415412packet_t pq_previous(packet_t packet)
  • uspace/lib/c/generic/net/socket_client.c

    rb4c9c61 rfdbc3ff  
    7979typedef struct socket socket_t;
    8080
    81 /** Type definition of the socket specific data pointer.
    82  * @see socket
    83  */
    84 typedef socket_t *socket_ref;
    85 
    8681/** Socket specific data.
    8782 *
     
    162157
    163158        /** Active sockets. */
    164         sockets_ref sockets;
     159        sockets_t *sockets;
    165160
    166161        /** Safety lock.
     
    183178/** Returns the active sockets.
    184179 *
    185  *  @returns            The active sockets.
    186  */
    187 static sockets_ref socket_get_sockets(void)
     180 *  @return             The active sockets.
     181 */
     182static sockets_t *socket_get_sockets(void)
    188183{
    189184        if (!socket_globals.sockets) {
    190185                socket_globals.sockets =
    191                     (sockets_ref) malloc(sizeof(sockets_t));
     186                    (sockets_t *) malloc(sizeof(sockets_t));
    192187                if (!socket_globals.sockets)
    193188                        return NULL;
     
    213208        ipc_callid_t callid;
    214209        ipc_call_t call;
    215         socket_ref socket;
     210        socket_t *socket;
    216211        int rc;
    217212
     
    291286 * Connects to the TCP module if necessary.
    292287 *
    293  * @returns             The TCP module phone.
    294  * @returns             Other error codes as defined for the
     288 * @return              The TCP module phone.
     289 * @return              Other error codes as defined for the
    295290 *                      bind_service_timeout() function.
    296291 */
     
    310305 * Connects to the UDP module if necessary.
    311306 *
    312  * @returns             The UDP module phone.
    313  * @returns             Other error codes as defined for the
     307 * @return              The UDP module phone.
     308 * @return              Other error codes as defined for the
    314309 *                      bind_service_timeout() function.
    315310 */
     
    327322/** Tries to find a new free socket identifier.
    328323 *
    329  * @returns             The new socket identifier.
    330  * @returns             ELIMIT if there is no socket identifier available.
     324 * @return              The new socket identifier.
     325 * @return              ELIMIT if there is no socket identifier available.
    331326 */
    332327static int socket_generate_new_id(void)
    333328{
    334         sockets_ref sockets;
     329        sockets_t *sockets;
    335330        int socket_id = 0;
    336331        int count;
     
    372367 */
    373368static void
    374 socket_initialize(socket_ref socket, int socket_id, int phone,
     369socket_initialize(socket_t *socket, int socket_id, int phone,
    375370    services_t service)
    376371{
     
    392387 * @param[in] type      Socket type.
    393388 * @param[in] protocol  Socket protocol.
    394  * @returns             The socket identifier on success.
    395  * @returns             EPFNOTSUPPORT if the protocol family is not supported.
    396  * @returns             ESOCKNOTSUPPORT if the socket type is not supported.
    397  * @returns             EPROTONOSUPPORT if the protocol is not supported.
    398  * @returns             ENOMEM if there is not enough memory left.
    399  * @returns             ELIMIT if there was not a free socket identifier found
     389 * @return              The socket identifier on success.
     390 * @return              EPFNOTSUPPORT if the protocol family is not supported.
     391 * @return              ESOCKNOTSUPPORT if the socket type is not supported.
     392 * @return              EPROTONOSUPPORT if the protocol is not supported.
     393 * @return              ENOMEM if there is not enough memory left.
     394 * @return              ELIMIT if there was not a free socket identifier found
    400395 *                      this time.
    401  * @returns             Other error codes as defined for the NET_SOCKET message.
    402  * @returns             Other error codes as defined for the
     396 * @return              Other error codes as defined for the NET_SOCKET message.
     397 * @return              Other error codes as defined for the
    403398 *                      bind_service_timeout() function.
    404399 */
    405400int socket(int domain, int type, int protocol)
    406401{
    407         socket_ref socket;
     402        socket_t *socket;
    408403        int phone;
    409404        int socket_id;
     
    463458
    464459        // create a new socket structure
    465         socket = (socket_ref) malloc(sizeof(socket_t));
     460        socket = (socket_t *) malloc(sizeof(socket_t));
    466461        if (!socket)
    467462                return ENOMEM;
     
    514509 * @param[in] data      The data to be sent.
    515510 * @param[in] datalength The data length.
    516  * @returns             EOK on success.
    517  * @returns             ENOTSOCK if the socket is not found.
    518  * @returns             EBADMEM if the data parameter is NULL.
    519  * @returns             NO_DATA if the datalength parameter is zero (0).
    520  * @returns             Other error codes as defined for the spcific message.
     511 * @return              EOK on success.
     512 * @return              ENOTSOCK if the socket is not found.
     513 * @return              EBADMEM if the data parameter is NULL.
     514 * @return              NO_DATA if the datalength parameter is zero (0).
     515 * @return              Other error codes as defined for the spcific message.
    521516 */
    522517static int
     
    524519    const void *data, size_t datalength)
    525520{
    526         socket_ref socket;
     521        socket_t *socket;
    527522        aid_t message_id;
    528523        ipcarg_t result;
     
    559554 * @param[in] my_addr   The port address.
    560555 * @param[in] addrlen   The address length.
    561  * @returns             EOK on success.
    562  * @returns             ENOTSOCK if the socket is not found.
    563  * @returns             EBADMEM if the my_addr parameter is NULL.
    564  * @returns             NO_DATA if the addlen parameter is zero.
    565  * @returns             Other error codes as defined for the NET_SOCKET_BIND
     556 * @return              EOK on success.
     557 * @return              ENOTSOCK if the socket is not found.
     558 * @return              EBADMEM if the my_addr parameter is NULL.
     559 * @return              NO_DATA if the addlen parameter is zero.
     560 * @return              Other error codes as defined for the NET_SOCKET_BIND
    566561 *                      message.
    567562 */
     
    580575 * @param[in] socket_id Socket identifier.
    581576 * @param[in] backlog   The maximum number of waiting sockets to be accepted.
    582  * @returns             EOK on success.
    583  * @returns             EINVAL if the backlog parameter is not positive (<=0).
    584  * @returns             ENOTSOCK if the socket is not found.
    585  * @returns             Other error codes as defined for the NET_SOCKET_LISTEN
     577 * @return              EOK on success.
     578 * @return              EINVAL if the backlog parameter is not positive (<=0).
     579 * @return              ENOTSOCK if the socket is not found.
     580 * @return              Other error codes as defined for the NET_SOCKET_LISTEN
    586581 *                      message.
    587582 */
    588583int listen(int socket_id, int backlog)
    589584{
    590         socket_ref socket;
     585        socket_t *socket;
    591586        int result;
    592587
     
    618613 * @param[out] cliaddr  The remote client address.
    619614 * @param[in] addrlen   The address length.
    620  * @returns             EOK on success.
    621  * @returns             EBADMEM if the cliaddr or addrlen parameter is NULL.
    622  * @returns             EINVAL if the backlog parameter is not positive (<=0).
    623  * @returns             ENOTSOCK if the socket is not found.
    624  * @returns             Other error codes as defined for the NET_SOCKET_ACCEPT
     615 * @return              EOK on success.
     616 * @return              EBADMEM if the cliaddr or addrlen parameter is NULL.
     617 * @return              EINVAL if the backlog parameter is not positive (<=0).
     618 * @return              ENOTSOCK if the socket is not found.
     619 * @return              Other error codes as defined for the NET_SOCKET_ACCEPT
    625620 *                      message.
    626621 */
    627622int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen)
    628623{
    629         socket_ref socket;
    630         socket_ref new_socket;
     624        socket_t *socket;
     625        socket_t *new_socket;
    631626        aid_t message_id;
    632627        ipcarg_t ipc_result;
     
    661656
    662657        // create a new scoket
    663         new_socket = (socket_ref) malloc(sizeof(socket_t));
     658        new_socket = (socket_t *) malloc(sizeof(socket_t));
    664659        if (!new_socket) {
    665660                fibril_mutex_unlock(&socket->accept_lock);
     
    721716 * @param[in] serv_addr The remote server address.
    722717 * @param[in] addrlen   The address length.
    723  * @returns             EOK on success.
    724  * @returns             EBADMEM if the serv_addr parameter is NULL.
    725  * @returns             NO_DATA if the addlen parameter is zero.
    726  * @returns             ENOTSOCK if the socket is not found.
    727  * @returns             Other error codes as defined for the NET_SOCKET_CONNECT
     718 * @return              EOK on success.
     719 * @return              EBADMEM if the serv_addr parameter is NULL.
     720 * @return              NO_DATA if the addlen parameter is zero.
     721 * @return              ENOTSOCK if the socket is not found.
     722 * @return              Other error codes as defined for the NET_SOCKET_CONNECT
    728723 *                      message.
    729724 */
     
    745740 * @param[in] socket    The socket to be destroyed.
    746741 */
    747 static void socket_destroy(socket_ref socket)
     742static void socket_destroy(socket_t *socket)
    748743{
    749744        int accepted_id;
     
    761756 *
    762757 * @param[in] socket_id Socket identifier.
    763  * @returns             EOK on success.
    764  * @returns             ENOTSOCK if the socket is not found.
    765  * @returns             EINPROGRESS if there is another blocking function in
     758 * @return              EOK on success.
     759 * @return              ENOTSOCK if the socket is not found.
     760 * @return              EINPROGRESS if there is another blocking function in
    766761 *                      progress.
    767  * @returns             Other error codes as defined for the NET_SOCKET_CLOSE
     762 * @return              Other error codes as defined for the NET_SOCKET_CLOSE
    768763 *                      message.
    769764 */
    770765int closesocket(int socket_id)
    771766{
    772         socket_ref socket;
     767        socket_t *socket;
    773768        int rc;
    774769
     
    811806 *                      sockets.
    812807 * @param[in] addrlen   The address length. Used only if toaddr is not NULL.
    813  * @returns             EOK on success.
    814  * @returns             ENOTSOCK if the socket is not found.
    815  * @returns             EBADMEM if the data or toaddr parameter is NULL.
    816  * @returns             NO_DATA if the datalength or the addrlen parameter is
     808 * @return              EOK on success.
     809 * @return              ENOTSOCK if the socket is not found.
     810 * @return              EBADMEM if the data or toaddr parameter is NULL.
     811 * @return              NO_DATA if the datalength or the addrlen parameter is
    817812 *                      zero (0).
    818  * @returns             Other error codes as defined for the NET_SOCKET_SENDTO
     813 * @return              Other error codes as defined for the NET_SOCKET_SENDTO
    819814 *                      message.
    820815 */
     
    824819    socklen_t addrlen)
    825820{
    826         socket_ref socket;
     821        socket_t *socket;
    827822        aid_t message_id;
    828823        ipcarg_t result;
     
    913908 * @param[in] datalength The data length.
    914909 * @param[in] flags     Various send flags.
    915  * @returns             EOK on success.
    916  * @returns             ENOTSOCK if the socket is not found.
    917  * @returns             EBADMEM if the data parameter is NULL.
    918  * @returns             NO_DATA if the datalength parameter is zero.
    919  * @returns             Other error codes as defined for the NET_SOCKET_SEND
     910 * @return              EOK on success.
     911 * @return              ENOTSOCK if the socket is not found.
     912 * @return              EBADMEM if the data parameter is NULL.
     913 * @return              NO_DATA if the datalength parameter is zero.
     914 * @return              Other error codes as defined for the NET_SOCKET_SEND
    920915 *                      message.
    921916 */
     
    937932 * @param[in] toaddr    The destination address.
    938933 * @param[in] addrlen   The address length.
    939  * @returns             EOK on success.
    940  * @returns             ENOTSOCK if the socket is not found.
    941  * @returns             EBADMEM if the data or toaddr parameter is NULL.
    942  * @returns             NO_DATA if the datalength or the addrlen parameter is
     934 * @return              EOK on success.
     935 * @return              ENOTSOCK if the socket is not found.
     936 * @return              EBADMEM if the data or toaddr parameter is NULL.
     937 * @return              NO_DATA if the datalength or the addrlen parameter is
    943938 *                      zero.
    944  * @returns             Other error codes as defined for the NET_SOCKET_SENDTO
     939 * @return              Other error codes as defined for the NET_SOCKET_SENDTO
    945940 *                      message.
    946941 */
     
    971966 *                      read. The actual address length is set. Used only if
    972967 *                      fromaddr is not NULL.
    973  * @returns             EOK on success.
    974  * @returns             ENOTSOCK if the socket is not found.
    975  * @returns             EBADMEM if the data parameter is NULL.
    976  * @returns             NO_DATA if the datalength or addrlen parameter is zero.
    977  * @returns             Other error codes as defined for the spcific message.
     968 * @return              EOK on success.
     969 * @return              ENOTSOCK if the socket is not found.
     970 * @return              EBADMEM if the data parameter is NULL.
     971 * @return              NO_DATA if the datalength or addrlen parameter is zero.
     972 * @return              Other error codes as defined for the spcific message.
    978973 */
    979974static int
     
    981976    int flags, struct sockaddr *fromaddr, socklen_t *addrlen)
    982977{
    983         socket_ref socket;
     978        socket_t *socket;
    984979        aid_t message_id;
    985980        ipcarg_t ipc_result;
     
    11001095 * @param[in] datalength The data length.
    11011096 * @param[in] flags     Various receive flags.
    1102  * @returns             EOK on success.
    1103  * @returns             ENOTSOCK if the socket is not found.
    1104  * @returns             EBADMEM if the data parameter is NULL.
    1105  * @returns             NO_DATA if the datalength parameter is zero.
    1106  * @returns             Other error codes as defined for the NET_SOCKET_RECV
     1097 * @return              EOK on success.
     1098 * @return              ENOTSOCK if the socket is not found.
     1099 * @return              EBADMEM if the data parameter is NULL.
     1100 * @return              NO_DATA if the datalength parameter is zero.
     1101 * @return              Other error codes as defined for the NET_SOCKET_RECV
    11071102 *                      message.
    11081103 */
     
    11231118 * @param[in,out] addrlen The address length. The maximum address length is
    11241119 *                      read. The actual address length is set.
    1125  * @returns             EOK on success.
    1126  * @returns             ENOTSOCK if the socket is not found.
    1127  * @returns             EBADMEM if the data or fromaddr parameter is NULL.
    1128  * @returns             NO_DATA if the datalength or addrlen parameter is zero.
    1129  * @returns             Other error codes as defined for the NET_SOCKET_RECVFROM
     1120 * @return              EOK on success.
     1121 * @return              ENOTSOCK if the socket is not found.
     1122 * @return              EBADMEM if the data or fromaddr parameter is NULL.
     1123 * @return              NO_DATA if the datalength or addrlen parameter is zero.
     1124 * @return              Other error codes as defined for the NET_SOCKET_RECVFROM
    11301125 *                      message.
    11311126 */
     
    11531148 * @param[in,out] optlen The value buffer length. The maximum length is read.
    11541149 *                      The actual length is set.
    1155  * @returns             EOK on success.
    1156  * @returns             ENOTSOCK if the socket is not found.
    1157  * @returns             EBADMEM if the value or optlen parameter is NULL.
    1158  * @returns             NO_DATA if the optlen parameter is zero.
    1159  * @returns             Other error codes as defined for the
     1150 * @return              EOK on success.
     1151 * @return              ENOTSOCK if the socket is not found.
     1152 * @return              EBADMEM if the value or optlen parameter is NULL.
     1153 * @return              NO_DATA if the optlen parameter is zero.
     1154 * @return              Other error codes as defined for the
    11601155 *                      NET_SOCKET_GETSOCKOPT message.
    11611156 */
     
    11631158getsockopt(int socket_id, int level, int optname, void *value, size_t *optlen)
    11641159{
    1165         socket_ref socket;
     1160        socket_t *socket;
    11661161        aid_t message_id;
    11671162        ipcarg_t result;
     
    12061201 * @param[in] value     The value to be set.
    12071202 * @param[in] optlen    The value length.
    1208  * @returns             EOK on success.
    1209  * @returns             ENOTSOCK if the socket is not found.
    1210  * @returns             EBADMEM if the value parameter is NULL.
    1211  * @returns             NO_DATA if the optlen parameter is zero.
    1212  * @returns             Other error codes as defined for the
     1203 * @return              EOK on success.
     1204 * @return              ENOTSOCK if the socket is not found.
     1205 * @return              EBADMEM if the value parameter is NULL.
     1206 * @return              NO_DATA if the optlen parameter is zero.
     1207 * @return              Other error codes as defined for the
    12131208 *                      NET_SOCKET_SETSOCKOPT message.
    12141209 */
Note: See TracChangeset for help on using the changeset viewer.