Changeset 14f1db0 in mainline for uspace/srv/net/tl


Ignore:
Timestamp:
2010-04-09T12:54:57Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1caa3c2
Parents:
24ab58b3
Message:

networking overhaul:

  • separation of conserns
  • removal of (almost all) overlaping symbols, libnetif is not needed anymore
  • again, it is possible to build the networking in multiple architecture configurations (however, currently only the bundling netif and nil layers is supported, more to come)
  • code style updates and fixes (still a huge amount of work to do)
Location:
uspace/srv/net/tl
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/icmp/icmp.c

    r24ab58b3 r14f1db0  
    5151#include <net_modules.h>
    5252#include <packet/packet_client.h>
     53#include <packet_remote.h>
    5354#include <net_byteorder.h>
    5455#include <net_checksum.h>
     
    6768#include <socket_errno.h>
    6869#include <tl_messages.h>
     70#include <tl_interface.h>
     71#include <tl_local.h>
    6972#include <icmp_messages.h>
    7073#include <icmp_header.h>
     
    288291        // TODO do not ask all the time
    289292        ERROR_PROPAGATE(ip_packet_size_req(icmp_globals.ip_phone, -1, &icmp_globals.packet_dimension));
    290         packet = packet_get_4(icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix);
     293        packet = packet_get_4_remote(icmp_globals.net_phone, size, icmp_globals.packet_dimension.addr_len, ICMP_HEADER_SIZE + icmp_globals.packet_dimension.prefix, icmp_globals.packet_dimension.suffix);
    291294        if(! packet){
    292295                return ENOMEM;
     
    626629        // compute the reply key
    627630        reply_key = ICMP_GET_REPLY_KEY(header->un.echo.identifier, header->un.echo.sequence_number);
    628         pq_release(icmp_globals.net_phone, packet_get_id(packet));
     631        pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
    629632        // lock the globals
    630633        fibril_rwlock_write_lock(&icmp_globals.lock);
     
    641644}
    642645
    643 int icmp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     646int icmp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    644647        ERROR_DECLARE;
    645648
     
    649652        switch(IPC_GET_METHOD(*call)){
    650653                case NET_TL_RECEIVED:
    651                         if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     654                        if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    652655                                ERROR_CODE = icmp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_ICMP, IPC_GET_ERROR(call));
    653656                        }
     
    759762        switch(IPC_GET_METHOD(*call)){
    760763                case NET_ICMP_DEST_UNREACH:
    761                         if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     764                        if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    762765                                ERROR_CODE = icmp_destination_unreachable_msg(0, ICMP_GET_CODE(call), ICMP_GET_MTU(call), packet);
    763766                        }
    764767                        return ERROR_CODE;
    765768                case NET_ICMP_SOURCE_QUENCH:
    766                         if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     769                        if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    767770                                ERROR_CODE = icmp_source_quench_msg(0, packet);
    768771                        }
    769772                        return ERROR_CODE;
    770773                case NET_ICMP_TIME_EXCEEDED:
    771                         if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     774                        if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    772775                                ERROR_CODE = icmp_time_exceeded_msg(0, ICMP_GET_CODE(call), packet);
    773776                        }
    774777                        return ERROR_CODE;
    775778                case NET_ICMP_PARAMETERPROB:
    776                         if(! ERROR_OCCURRED(packet_translate(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     779                        if(! ERROR_OCCURRED(packet_translate_remote(icmp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    777780                                ERROR_CODE = icmp_parameter_problem_msg(0, ICMP_GET_CODE(call), ICMP_GET_POINTER(call), packet);
    778781                        }
     
    784787
    785788int icmp_release_and_return(packet_t packet, int result){
    786         pq_release(icmp_globals.net_phone, packet_get_id(packet));
     789        pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
    787790        return result;
    788791}
     
    819822}
    820823
    821 #ifdef CONFIG_NETWORKING_modular
    822 
    823 #include <tl_standalone.h>
    824 
    825824/** Default thread for new connections.
    826825 *
     
    849848               
    850849                /* Process the message */
    851                 int res = tl_module_message(callid, &call, &answer, &answer_count);
     850                int res = tl_module_message_standalone(callid, &call, &answer,
     851                    &answer_count);
    852852               
    853853                /* End if said to either by the message or the processing result */
     
    874874       
    875875        /* Start the module */
    876         if (ERROR_OCCURRED(tl_module_start(tl_client_connection)))
     876        if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection)))
    877877                return ERROR_CODE;
    878878       
     
    880880}
    881881
    882 #endif /* CONFIG_NETWORKING_modular */
    883 
    884882/** @}
    885883 */
  • uspace/srv/net/tl/icmp/icmp_module.c

    r24ab58b3 r14f1db0  
    4747#include <packet/packet.h>
    4848#include <net_interface.h>
    49 #include <tl_standalone.h>
     49#include <tl_local.h>
    5050
    5151#include "icmp.h"
     
    6363 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6464 */
    65 int tl_module_start(async_client_conn_t client_connection){
     65int tl_module_start_standalone(async_client_conn_t client_connection){
    6666        ERROR_DECLARE;
    6767
     
    9494 *  @returns Other error codes as defined for the icmp_message() function.
    9595 */
    96 int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    97         return icmp_message(callid, call, answer, answer_count);
     96int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     97        return icmp_message_standalone(callid, call, answer, answer_count);
    9898}
    9999
  • uspace/srv/net/tl/icmp/icmp_module.h

    r24ab58b3 r14f1db0  
    5959 *  @see IS_NET_ICMP_MESSAGE()
    6060 */
    61 int icmp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     61int icmp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6262
    6363#endif
  • uspace/srv/net/tl/tcp/tcp.c

    r24ab58b3 r14f1db0  
    5151#include <adt/dynamic_fifo.h>
    5252#include <packet/packet_client.h>
     53#include <packet_remote.h>
    5354#include <net_checksum.h>
    5455#include <in.h>
     
    6869#include <tl_common.h>
    6970#include <tl_messages.h>
     71#include <tl_local.h>
     72#include <tl_interface.h>
    7073
    7174#include "tcp.h"
     
    421424                        break;
    422425                default:
    423                         pq_release(tcp_globals.net_phone, packet_get_id(packet));
     426                        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    424427        }
    425428
     
    473476                        // release the acknowledged packets
    474477                        next_packet = pq_next(packet);
    475                         pq_release(tcp_globals.net_phone, packet_get_id(packet));
     478                        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    476479                        packet = next_packet;
    477480                        offset -= length;
     
    517520                        next_packet = pq_next(next_packet);
    518521                        pq_insert_after(tmp_packet, next_packet);
    519                         pq_release(tcp_globals.net_phone, packet_get_id(tmp_packet));
     522                        pq_release_remote(tcp_globals.net_phone, packet_get_id(tmp_packet));
    520523                }
    521524                assert(new_sequence_number + total_length == socket_data->next_incoming + socket_data->window);
     
    548551                                        socket_data->incoming = next_packet;
    549552                                }
    550                                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     553                                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    551554                                packet = next_packet;
    552555                                continue;
     
    568571                                if(length <= 0){
    569572                                        // remove the empty packet
    570                                         pq_release(tcp_globals.net_phone, packet_get_id(packet));
     573                                        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    571574                                        packet = next_packet;
    572575                                        continue;
     
    595598                                }
    596599                                // remove the duplicit or corrupted packet
    597                                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     600                                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    598601                                packet = next_packet;
    599602                                continue;
     
    617620                if(ERROR_OCCURRED(pq_add(&socket_data->incoming, packet, new_sequence_number, length))){
    618621                        // remove the corrupted packets
    619                         pq_release(tcp_globals.net_phone, packet_get_id(packet));
    620                         pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
     622                        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
     623                        pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
    621624                }else{
    622625                        while(next_packet){
     
    626629                                if(ERROR_OCCURRED(pq_set_order(next_packet, new_sequence_number, length))
    627630                                        || ERROR_OCCURRED(pq_insert_after(packet, next_packet))){
    628                                         pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
     631                                        pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
    629632                                }
    630633                                next_packet = tmp_packet;
     
    634637                printf("unexpected\n");
    635638                // release duplicite or restricted
    636                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     639                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    637640        }
    638641
     
    679682        // queue the received packet
    680683        if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE))
    681                 || ERROR_OCCURRED(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension))){
     684            || ERROR_OCCURRED(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension))){
    682685                return tcp_release_and_return(packet, ERROR_CODE);
    683686        }
     
    710713                next_packet = pq_detach(packet);
    711714                if(next_packet){
    712                         pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
     715                        pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
    713716                }
    714717                // trim if longer than the header
     
    780783                                free(socket_data->addr);
    781784                                free(socket_data);
    782                                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     785                                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    783786                                return ERROR_CODE;
    784787                        }
     
    846849                        next_packet = pq_detach(packet);
    847850                        if(next_packet){
    848                                 pq_release(tcp_globals.net_phone, packet_get_id(next_packet));
     851                                pq_release_remote(tcp_globals.net_phone, packet_get_id(next_packet));
    849852                        }
    850853                        // trim if longer than the header
     
    895898
    896899                socket_data->next_incoming = ntohl(header->sequence_number);// + 1;
    897                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     900                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    898901                socket_data->state = TCP_SOCKET_ESTABLISHED;
    899902                listening_socket = socket_cores_find(socket_data->local_sockets, socket_data->listening_socket_id);
     
    981984                                        // add to acknowledged or release
    982985                                        if(pq_add(&acknowledged, packet, 0, 0) != EOK){
    983                                                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     986                                                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    984987                                        }
    985988                                        packet = next;
     
    990993                        // release acknowledged
    991994                        if(acknowledged){
    992                                 pq_release(tcp_globals.net_phone, packet_get_id(acknowledged));
     995                                pq_release_remote(tcp_globals.net_phone, packet_get_id(acknowledged));
    993996                        }
    994997                        return;
     
    10061009}
    10071010
    1008 int tcp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     1011int tcp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    10091012        ERROR_DECLARE;
    10101013
     
    10191022                case NET_TL_RECEIVED:
    10201023                        //fibril_rwlock_read_lock(&tcp_globals.lock);
    1021                         if(! ERROR_OCCURRED(packet_translate(tcp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     1024                        if(! ERROR_OCCURRED(packet_translate_remote(tcp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    10221025                                ERROR_CODE = tcp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_TCP, IPC_GET_ERROR(call));
    10231026                        }
     
    11111114                                        fibril_rwlock_write_unlock(&lock);
    11121115                                        if(res == EOK){
    1113                                                 if(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
     1116                                                if (tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
    11141117                                                        SOCKET_SET_DATA_FRAGMENT_SIZE(answer, ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size));
    11151118                                                }
     
    15651568                        }else{
    15661569                                if(ERROR_OCCURRED(pq_insert_after(previous, copy))){
    1567                                         pq_release(tcp_globals.net_phone, packet_get_id(copy));
     1570                                        pq_release_remote(tcp_globals.net_phone, packet_get_id(copy));
    15681571                                        return sending;
    15691572                                }
     
    15971600        // adjust the pseudo header
    15981601        if(ERROR_OCCURRED(ip_client_set_pseudo_header_data_length(socket_data->pseudo_header, socket_data->headerlen, packet_get_data_length(packet)))){
    1599                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     1602                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    16001603                return NULL;
    16011604        }
     
    16041607        header = (tcp_header_ref) packet_get_data(packet);
    16051608        if(! header){
    1606                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     1609                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    16071610                return NULL;
    16081611        }
     
    16251628        // prepare the timeout
    16261629                || ERROR_OCCURRED(tcp_prepare_timeout(tcp_timeout, socket, socket_data, sequence_number, socket_data->state, socket_data->timeout, true))){
    1627                 pq_release(tcp_globals.net_phone, packet_get_id(packet));
     1630                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    16281631                return NULL;
    16291632        }
     
    17501753                return NO_DATA;
    17511754        }
    1752         ERROR_PROPAGATE(packet_translate(tcp_globals.net_phone, &packet, packet_id));
     1755        ERROR_PROPAGATE(packet_translate_remote(tcp_globals.net_phone, &packet, packet_id));
    17531756
    17541757        // reply the packets
     
    17571760        // release the packet
    17581761        dyn_fifo_pop(&socket->received);
    1759         pq_release(tcp_globals.net_phone, packet_get_id(packet));
     1762        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    17601763        // return the total length
    17611764        return (int) length;
     
    18891892        ERROR_PROPAGATE(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, socket_data->device_id, &packet_dimension));
    18901893        // get a new packet
    1891         *packet = packet_get_4(tcp_globals.net_phone, TCP_HEADER_SIZE, packet_dimension->addr_len, packet_dimension->prefix, packet_dimension->suffix);
     1894        *packet = packet_get_4_remote(tcp_globals.net_phone, TCP_HEADER_SIZE, packet_dimension->addr_len, packet_dimension->prefix, packet_dimension->suffix);
    18921895        if(! * packet){
    18931896                return ENOMEM;
     
    19931996
    19941997int tcp_release_and_return(packet_t packet, int result){
    1995         pq_release(tcp_globals.net_phone, packet_get_id(packet));
     1998        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
    19961999        return result;
    19972000}
    1998 
    1999 #ifdef CONFIG_NETWORKING_modular
    2000 
    2001 #include <tl_standalone.h>
    20022001
    20032002/** Default thread for new connections.
     
    20272026               
    20282027                /* Process the message */
    2029                 int res = tl_module_message(callid, &call, &answer, &answer_count);
     2028                int res = tl_module_message_standalone(callid, &call, &answer,
     2029                    &answer_count);
    20302030               
    20312031                /* End if said to either by the message or the processing result */
     
    20522052       
    20532053        /* Start the module */
    2054         if (ERROR_OCCURRED(tl_module_start(tl_client_connection)))
     2054        if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection)))
    20552055                return ERROR_CODE;
    20562056       
     
    20582058}
    20592059
    2060 #endif /* CONFIG_NETWORKING_modular */
    2061 
    20622060/** @}
    20632061 */
  • uspace/srv/net/tl/tcp/tcp.h

    r24ab58b3 r14f1db0  
    232232        /** IP pseudo header.
    233233         */
    234         ip_pseudo_header_ref pseudo_header;
     234        void *pseudo_header;
    235235        /** IP pseudo header length.
    236236         */
  • uspace/srv/net/tl/tcp/tcp_module.c

    r24ab58b3 r14f1db0  
    4949#include <ip_protocols.h>
    5050#include <ip_interface.h>
    51 #include <tl_standalone.h>
     51#include <tl_local.h>
    5252
    5353#include "tcp.h"
     
    6565 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6666 */
    67 int tl_module_start(async_client_conn_t client_connection){
     67int tl_module_start_standalone(async_client_conn_t client_connection)
     68{
    6869        ERROR_DECLARE;
    69 
    70         ipcarg_t phonehash;
    71 
     70       
    7271        async_set_client_connection(client_connection);
    7372        tcp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
    7473        ERROR_PROPAGATE(pm_init());
    75         if(ERROR_OCCURRED(tcp_initialize(client_connection))
    76                 || ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))){
     74       
     75        ipcarg_t phonehash;
     76        if (ERROR_OCCURRED(tcp_initialize(client_connection))
     77            || ERROR_OCCURRED(REGISTER_ME(SERVICE_TCP, &phonehash))) {
    7778                pm_destroy();
    7879                return ERROR_CODE;
    7980        }
    80 
     81       
    8182        async_manager();
    82 
     83       
    8384        pm_destroy();
    8485        return EOK;
     
    9394 *  @returns Other error codes as defined for the tcp_message() function.
    9495 */
    95 int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    96         return tcp_message(callid, call, answer, answer_count);
     96int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     97        return tcp_message_standalone(callid, call, answer, answer_count);
    9798}
    9899
  • uspace/srv/net/tl/tcp/tcp_module.h

    r24ab58b3 r14f1db0  
    5959 *  @see IS_NET_TCP_MESSAGE()
    6060 */
    61 extern int tcp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     61extern int tcp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6262
    6363#endif
  • uspace/srv/net/tl/udp/udp.c

    r24ab58b3 r14f1db0  
    4848#include <adt/dynamic_fifo.h>
    4949#include <packet/packet_client.h>
     50#include <packet_remote.h>
    5051#include <net_checksum.h>
    5152#include <in.h>
     
    6364#include <socket_messages.h>
    6465#include <tl_common.h>
     66#include <tl_local.h>
     67#include <tl_interface.h>
    6568#include <tl_messages.h>
    6669
     
    258261        icmp_type_t type;
    259262        icmp_code_t code;
    260         ip_pseudo_header_ref ip_header;
     263        void *ip_header;
    261264        struct sockaddr * src;
    262265        struct sockaddr * dest;
     
    356359                        while(tmp_packet){
    357360                                next_packet = pq_detach(tmp_packet);
    358                                 pq_release(udp_globals.net_phone, packet_get_id(tmp_packet));
     361                                pq_release_remote(udp_globals.net_phone, packet_get_id(tmp_packet));
    359362                                tmp_packet = next_packet;
    360363                        }
     
    382385        // queue the received packet
    383386        if(ERROR_OCCURRED(dyn_fifo_push(&socket->received, packet_get_id(packet), SOCKET_MAX_RECEIVED_SIZE))
    384                 || ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){
     387            || ERROR_OCCURRED(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, device_id, &packet_dimension))){
    385388                return udp_release_and_return(packet, ERROR_CODE);
    386389        }
     
    392395}
    393396
    394 int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     397int udp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    395398        ERROR_DECLARE;
    396399
     
    400403        switch(IPC_GET_METHOD(*call)){
    401404                case NET_TL_RECEIVED:
    402                         if(! ERROR_OCCURRED(packet_translate(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     405                        if(! ERROR_OCCURRED(packet_translate_remote(udp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    403406                                ERROR_CODE = udp_received_msg(IPC_GET_DEVICE(call), packet, SERVICE_UDP, IPC_GET_ERROR(call));
    404407                        }
     
    457460
    458461                                if(res == EOK){
    459                                         if(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
     462                                        if (tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
    460463                                                SOCKET_SET_DATA_FRAGMENT_SIZE(answer, packet_dimension->content);
    461464                                        }
     
    533536        uint16_t dest_port;
    534537        uint32_t checksum;
    535         ip_pseudo_header_ref ip_header;
     538        void *ip_header;
    536539        size_t headerlen;
    537540        device_id_t device_id;
     
    662665                return NO_DATA;
    663666        }
    664         ERROR_PROPAGATE(packet_translate(udp_globals.net_phone, &packet, packet_id));
     667        ERROR_PROPAGATE(packet_translate_remote(udp_globals.net_phone, &packet, packet_id));
    665668        // get udp header
    666669        data = packet_get_data(packet);
    667670        if(! data){
    668                 pq_release(udp_globals.net_phone, packet_id);
     671                pq_release_remote(udp_globals.net_phone, packet_id);
    669672                return NO_DATA;
    670673        }
     
    674677        result = packet_get_addr(packet, (uint8_t **) &addr, NULL);
    675678        if(ERROR_OCCURRED(tl_set_address_port(addr, result, ntohs(header->source_port)))){
    676                 pq_release(udp_globals.net_phone, packet_id);
     679                pq_release_remote(udp_globals.net_phone, packet_id);
    677680                return ERROR_CODE;
    678681        }
     
    689692        // release the packet
    690693        dyn_fifo_pop(&socket->received);
    691         pq_release(udp_globals.net_phone, packet_get_id(packet));
     694        pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
    692695        // return the total length
    693696        return (int) length;
     
    695698
    696699int udp_release_and_return(packet_t packet, int result){
    697         pq_release(udp_globals.net_phone, packet_get_id(packet));
     700        pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
    698701        return result;
    699702}
    700 
    701 #ifdef CONFIG_NETWORKING_modular
    702 
    703 #include <tl_standalone.h>
    704703
    705704/** Default thread for new connections.
     
    729728               
    730729                /* Process the message */
    731                 int res = tl_module_message(callid, &call, &answer, &answer_count);
     730                int res = tl_module_message_standalone(callid, &call, &answer,
     731                    &answer_count);
    732732               
    733733                /* End if said to either by the message or the processing result */
     
    754754       
    755755        /* Start the module */
    756         if (ERROR_OCCURRED(tl_module_start(tl_client_connection)))
     756        if (ERROR_OCCURRED(tl_module_start_standalone(tl_client_connection)))
    757757                return ERROR_CODE;
    758758       
     
    760760}
    761761
    762 #endif /* CONFIG_NETWORKING_modular */
    763 
    764762/** @}
    765763 */
  • uspace/srv/net/tl/udp/udp_module.c

    r24ab58b3 r14f1db0  
    4747#include <packet/packet.h>
    4848#include <net_interface.h>
    49 #include <tl_standalone.h>
     49#include <tl_local.h>
    5050
    5151#include "udp.h"
     
    6363 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6464 */
    65 int tl_module_start(async_client_conn_t client_connection){
     65int tl_module_start_standalone(async_client_conn_t client_connection){
    6666        ERROR_DECLARE;
    6767
     
    9494 *  @returns Other error codes as defined for the udp_message() function.
    9595 */
    96 int tl_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    97         return udp_message(callid, call, answer, answer_count);
     96int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     97        return udp_message_standalone(callid, call, answer, answer_count);
    9898}
    9999
  • uspace/srv/net/tl/udp/udp_module.h

    r24ab58b3 r14f1db0  
    5959 *  @see IS_NET_UDP_MESSAGE()
    6060 */
    61 extern int udp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     61extern int udp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6262
    6363#endif
Note: See TracChangeset for help on using the changeset viewer.