Changeset fdbc3ff in mainline for uspace/lib/net/tl


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/net/tl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/tl/icmp_client.c

    rb4c9c61 rfdbc3ff  
    5757 * @param[out] pointer  The ICMP header pointer.
    5858 * @param[out] mtu      The ICMP header MTU.
    59  * @returns             The ICMP header length.
    60  * @returns             Zero if the packet contains no data.
     59 * @return              The ICMP header length.
     60 * @return              Zero if the packet contains no data.
    6161 */
    6262int
     
    6464    icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu)
    6565{
    66         icmp_header_ref header;
     66        icmp_header_t *header;
    6767
    68         header = (icmp_header_ref) packet_get_data(packet);
     68        header = (icmp_header_t *) packet_get_data(packet);
    6969        if (!header ||
    7070            (packet_get_data_length(packet) < sizeof(icmp_header_t))) {
     
    9292 *
    9393 * @param[in] packet    The packet.
    94  * @returns             The ICMP header length in bytes.
     94 * @return              The ICMP header length in bytes.
    9595 */
    9696size_t icmp_client_header_length(packet_t packet)
  • uspace/lib/net/tl/icmp_remote.c

    rb4c9c61 rfdbc3ff  
    5757 * @param[in] mtu       The error MTU value.
    5858 * @param[in] packet    The original packet.
    59  * @returns             EOK on success.
    60  * @returns             EPERM if the ICMP error notifications are disabled.
    61  * @returns             ENOMEM if there is not enough memory left.
     59 * @return              EOK on success.
     60 * @return              EPERM if the ICMP error notifications are disabled.
     61 * @return              ENOMEM if there is not enough memory left.
    6262 */
    6363int
     
    7878 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.
    7979 * @param[in] packet    The original packet.
    80  * @returns             EOK on success.
    81  * @returns             EPERM if the ICMP error notifications are disabled.
    82  * @returns             ENOMEM if there is not enough memory left.
     80 * @return              EOK on success.
     81 * @return              EPERM if the ICMP error notifications are disabled.
     82 * @return              ENOMEM if there is not enough memory left.
    8383 */
    8484int icmp_source_quench_msg(int icmp_phone, packet_t packet)
     
    9898 * @param[in] code      The error specific code.
    9999 * @param[in] packet    The original packet.
    100  * @returns             EOK on success.
    101  * @returns             EPERM if the ICMP error notifications are disabled.
    102  * @returns             ENOMEM if there is not enough memory left.
     100 * @return              EOK on success.
     101 * @return              EPERM if the ICMP error notifications are disabled.
     102 * @return              ENOMEM if there is not enough memory left.
    103103 */
    104104int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet)
     
    119119 * @param[in] pointer   The problematic parameter offset.
    120120 * @param[in] packet    The original packet.
    121  * @returns             EOK on success.
    122  * @returns             EPERM if the ICMP error notifications are disabled.
    123  * @returns             ENOMEM if there is not enough memory left.
     121 * @return              EOK on success.
     122 * @return              EPERM if the ICMP error notifications are disabled.
     123 * @return              ENOMEM if there is not enough memory left.
    124124 */
    125125int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code,
  • uspace/lib/net/tl/socket_core.c

    rb4c9c61 rfdbc3ff  
    6868INT_MAP_IMPLEMENT(socket_cores, socket_core_t);
    6969
    70 GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_ref);
     70GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_t *);
    7171
    7272INT_MAP_IMPLEMENT(socket_ports, socket_port_t);
     
    8585 */
    8686static void
    87 socket_destroy_core(int packet_phone, socket_core_ref socket,
    88     socket_cores_ref local_sockets, socket_ports_ref global_sockets,
    89     void (* socket_release)(socket_core_ref socket))
     87socket_destroy_core(int packet_phone, socket_core_t *socket,
     88    socket_cores_t *local_sockets, socket_ports_t *global_sockets,
     89    void (* socket_release)(socket_core_t *socket))
    9090{
    9191        int packet_id;
     
    121121 */
    122122void
    123 socket_cores_release(int packet_phone, socket_cores_ref local_sockets,
    124     socket_ports_ref global_sockets,
    125     void (* socket_release)(socket_core_ref socket))
     123socket_cores_release(int packet_phone, socket_cores_t *local_sockets,
     124    socket_ports_t *global_sockets,
     125    void (* socket_release)(socket_core_t *socket))
    126126{
    127127        int index;
     
    156156 * @param[in] key       The socket key identifier.
    157157 * @param[in] key_length The socket key length.
    158  * @returns             EOK on success.
    159  * @returns             ENOMEM if there is not enough memory left.
     158 * @return              EOK on success.
     159 * @return              ENOMEM if there is not enough memory left.
    160160 */
    161161static int
    162 socket_port_add_core(socket_port_ref socket_port, socket_core_ref socket,
     162socket_port_add_core(socket_port_t *socket_port, socket_core_t *socket,
    163163    const char *key, size_t key_length)
    164164{
    165         socket_core_ref *socket_ref;
     165        socket_core_t **socket_ref;
    166166        int rc;
    167167
     
    194194 * @param[in] socket    The socket to be added.
    195195 * @param[in] port      The port number to be bound to.
    196  * @returns             EOK on success.
    197  * @returns             ENOMEM if there is not enough memory left.
    198  * @returns             Other error codes as defined for the
     196 * @return              EOK on success.
     197 * @return              ENOMEM if there is not enough memory left.
     198 * @return              Other error codes as defined for the
    199199 *                       socket_ports_add() function.
    200200 */
    201201static int
    202 socket_bind_insert(socket_ports_ref global_sockets, socket_core_ref socket,
     202socket_bind_insert(socket_ports_t *global_sockets, socket_core_t *socket,
    203203    int port)
    204204{
    205         socket_port_ref socket_port;
     205        socket_port_t *socket_port;
    206206        int rc;
    207207
     
    248248 * @param[in] free_ports_end The maximum free port.
    249249 * @param[in] last_used_port The last used free port.
    250  * @returns             EOK on success.
    251  * @returns             ENOTSOCK if the socket was not found.
    252  * @returns             EAFNOSUPPORT if the address family is not supported.
    253  * @returns             EADDRINUSE if the port is already in use.
    254  * @returns             Other error codes as defined for the
     250 * @return              EOK on success.
     251 * @return              ENOTSOCK if the socket was not found.
     252 * @return              EAFNOSUPPORT if the address family is not supported.
     253 * @return              EADDRINUSE if the port is already in use.
     254 * @return              Other error codes as defined for the
    255255 *                      socket_bind_free_port() function.
    256  * @returns             Other error codes as defined for the
     256 * @return              Other error codes as defined for the
    257257 *                      socket_bind_insert() function.
    258258 */
    259259int
    260 socket_bind(socket_cores_ref local_sockets, socket_ports_ref global_sockets,
     260socket_bind(socket_cores_t *local_sockets, socket_ports_t *global_sockets,
    261261    int socket_id, void *addr, size_t addrlen, int free_ports_start,
    262262    int free_ports_end, int last_used_port)
    263263{
    264         socket_core_ref socket;
    265         socket_port_ref socket_port;
     264        socket_core_t *socket;
     265        socket_port_t *socket_port;
    266266        struct sockaddr *address;
    267267        struct sockaddr_in *address_in;
     
    322322 * @param[in] free_ports_end The maximum free port.
    323323 * @param[in] last_used_port The last used free port.
    324  * @returns             EOK on success.
    325  * @returns             ENOTCONN if no free port was found.
    326  * @returns             Other error codes as defined for the
     324 * @return              EOK on success.
     325 * @return              ENOTCONN if no free port was found.
     326 * @return              Other error codes as defined for the
    327327 *                      socket_bind_insert() function.
    328328 */
    329329int
    330 socket_bind_free_port(socket_ports_ref global_sockets, socket_core_ref socket,
     330socket_bind_free_port(socket_ports_t *global_sockets, socket_core_t *socket,
    331331    int free_ports_start, int free_ports_end, int last_used_port)
    332332{
     
    367367 *                      requested. A negative identifier is requested if set to
    368368 *                      false.
    369  * @returns             The new socket identifier.
    370  * @returns             ELIMIT if there is no socket identifier available.
    371  */
    372 static int socket_generate_new_id(socket_cores_ref local_sockets, int positive)
     369 * @return              The new socket identifier.
     370 * @return              ELIMIT if there is no socket identifier available.
     371 */
     372static int socket_generate_new_id(socket_cores_t *local_sockets, int positive)
    373373{
    374374        int socket_id;
     
    410410 *                      chosen if set to zero or negative. A negative identifier
    411411 *                      is chosen if set to negative.
    412  * @returns             EOK on success.
    413  * @returns             EINVAL if the socket_id parameter is NULL.
    414  * @returns             ENOMEM if there is not enough memory left.
     412 * @return              EOK on success.
     413 * @return              EINVAL if the socket_id parameter is NULL.
     414 * @return              ENOMEM if there is not enough memory left.
    415415 */
    416416int
    417 socket_create(socket_cores_ref local_sockets, int app_phone,
     417socket_create(socket_cores_t *local_sockets, int app_phone,
    418418    void *specific_data, int *socket_id)
    419419{
    420         socket_core_ref socket;
     420        socket_core_t *socket;
    421421        int positive;
    422422        int rc;
     
    437437        }
    438438       
    439         socket = (socket_core_ref) malloc(sizeof(*socket));
     439        socket = (socket_core_t *) malloc(sizeof(*socket));
    440440        if (!socket)
    441441                return ENOMEM;
     
    482482 * @param[in,out] global_sockets The global sockets to be updated.
    483483 * @param[in] socket_release The client release callback function.
    484  * @returns             EOK on success.
    485  * @returns             ENOTSOCK if the socket is not found.
     484 * @return              EOK on success.
     485 * @return              ENOTSOCK if the socket is not found.
    486486 */
    487487int
    488 socket_destroy(int packet_phone, int socket_id, socket_cores_ref local_sockets,
    489     socket_ports_ref global_sockets,
    490     void (*socket_release)(socket_core_ref socket))
    491 {
    492         socket_core_ref socket;
     488socket_destroy(int packet_phone, int socket_id, socket_cores_t *local_sockets,
     489    socket_ports_t *global_sockets,
     490    void (*socket_release)(socket_core_t *socket))
     491{
     492        socket_core_t *socket;
    493493        int accepted_id;
    494494
     
    516516 * @param[in] packet    The packet to be transfered.
    517517 * @param[out] length   The total data length.
    518  * @returns             EOK on success.
    519  * @returns             EBADMEM if the length parameter is NULL.
    520  * @returns             ENOMEM if there is not enough memory left.
    521  * @returns             Other error codes as defined for the data_reply()
     518 * @return              EOK on success.
     519 * @return              EBADMEM if the length parameter is NULL.
     520 * @return              ENOMEM if there is not enough memory left.
     521 * @return              Other error codes as defined for the data_reply()
    522522 *                      function.
    523523 */
     
    598598 * @param[in] key       The socket key identifier.
    599599 * @param[in] key_length The socket key length.
    600  * @returns             The found socket.
    601  * @returns             NULL if no socket was found.
    602  */
    603 socket_core_ref
    604 socket_port_find(socket_ports_ref global_sockets, int port, const char *key,
     600 * @return              The found socket.
     601 * @return              NULL if no socket was found.
     602 */
     603socket_core_t *
     604socket_port_find(socket_ports_t *global_sockets, int port, const char *key,
    605605    size_t key_length)
    606606{
    607         socket_port_ref socket_port;
    608         socket_core_ref *socket_ref;
     607        socket_port_t *socket_port;
     608        socket_core_t **socket_ref;
    609609
    610610        socket_port = socket_ports_find(global_sockets, port);
     
    628628 */
    629629void
    630 socket_port_release(socket_ports_ref global_sockets, socket_core_ref socket)
    631 {
    632         socket_port_ref socket_port;
    633         socket_core_ref *socket_ref;
     630socket_port_release(socket_ports_t *global_sockets, socket_core_t *socket)
     631{
     632        socket_port_t *socket_port;
     633        socket_core_t **socket_ref;
    634634
    635635        if (!socket->port)
     
    673673 * @param[in] key       The socket key identifier.
    674674 * @param[in] key_length The socket key length.
    675  * @returns             EOK on success.
    676  * @returns             ENOENT if the port is not already used.
    677  * @returns             Other error codes as defined for the
     675 * @return              EOK on success.
     676 * @return              ENOENT if the port is not already used.
     677 * @return              Other error codes as defined for the
    678678 *                      socket_port_add_core() function.
    679679 */
    680680int
    681 socket_port_add(socket_ports_ref global_sockets, int port,
    682     socket_core_ref socket, const char *key, size_t key_length)
    683 {
    684         socket_port_ref socket_port;
     681socket_port_add(socket_ports_t *global_sockets, int port,
     682    socket_core_t *socket, const char *key, size_t key_length)
     683{
     684        socket_port_t *socket_port;
    685685        int rc;
    686686
  • uspace/lib/net/tl/tl_common.c

    rb4c9c61 rfdbc3ff  
    6464 * @param[in] addrlen   The address length.
    6565 * @param[out] port     The set port.
    66  * @returns             EOK on success.
    67  * @returns             EINVAL if the address length does not match the address
     66 * @return              EOK on success.
     67 * @return              EINVAL if the address length does not match the address
    6868 *                      family.
    69  * @returns             EAFNOSUPPORT if the address family is not supported.
     69 * @return              EAFNOSUPPORT if the address family is not supported.
    7070 */
    7171int
     
    120120int
    121121tl_get_ip_packet_dimension(int ip_phone,
    122     packet_dimensions_ref packet_dimensions, device_id_t device_id,
    123     packet_dimension_ref *packet_dimension)
     122    packet_dimensions_t *packet_dimensions, device_id_t device_id,
     123    packet_dimension_t **packet_dimension)
    124124{
    125125        int rc;
     
    158158 * @param[in] device_id The device identifier.
    159159 * @param[in] content   The new maximum content size.
    160  * @returns             EOK on success.
     160 * @return              EOK on success.
    161161 * @return              ENOENT if the packet dimension is not cached.
    162162 */
    163163int
    164 tl_update_ip_packet_dimension(packet_dimensions_ref packet_dimensions,
     164tl_update_ip_packet_dimension(packet_dimensions_t *packet_dimensions,
    165165    device_id_t device_id, size_t content)
    166166{
    167         packet_dimension_ref packet_dimension;
     167        packet_dimension_t *packet_dimension;
    168168
    169169        packet_dimension = packet_dimensions_find(packet_dimensions, device_id);
     
    196196 * @param[in] addrlen   The address length.
    197197 * @param[in] port      The port to be set.
    198  * @returns             EOK on success.
    199  * @returns             EINVAL if the address length does not match the address
     198 * @return              EOK on success.
     199 * @return              EINVAL if the address length does not match the address
    200200 *                      family.
    201  * @returns             EAFNOSUPPORT if the address family is not supported.
     201 * @return              EAFNOSUPPORT if the address family is not supported.
    202202 */
    203203int tl_set_address_port(struct sockaddr * addr, int addrlen, uint16_t port)
     
    244244 * @param[in] error     The packet error reporting service. Prefixes the
    245245 *                      received packet.
    246  * @returns             EOK on success.
    247  * @returns             ENOENT if no packet may be sent.
     246 * @return              EOK on success.
     247 * @return              ENOENT if no packet may be sent.
    248248 */
    249249int
     
    280280 * @param[in] addr      The destination address.
    281281 * @param[in] addrlen   The address length.
    282  * @returns             Number of bytes received.
    283  * @returns             EINVAL if the client does not send data.
    284  * @returns             ENOMEM if there is not enough memory left.
    285  * @returns             Other error codes as defined for the
     282 * @return              Number of bytes received.
     283 * @return              EINVAL if the client does not send data.
     284 * @return              ENOMEM if there is not enough memory left.
     285 * @return              Other error codes as defined for the
    286286 *                      async_data_read_finalize() function.
    287287 */
    288288int
    289 tl_socket_read_packet_data(int packet_phone, packet_ref packet, size_t prefix,
    290     const packet_dimension_ref dimension, const struct sockaddr *addr,
     289tl_socket_read_packet_data(int packet_phone, packet_t *packet, size_t prefix,
     290    const packet_dimension_t *dimension, const struct sockaddr *addr,
    291291    socklen_t addrlen)
    292292{
Note: See TracChangeset for help on using the changeset viewer.