Changeset 14f1db0 in mainline for uspace/srv


Ignore:
Timestamp:
2010-04-09T12:54:57Z (15 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
Files:
1 deleted
30 edited
6 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/Makefile

    r24ab58b3 r14f1db0  
    3939-include $(CONFIG_MAKEFILE)
    4040
    41 ifeq ($(CONFIG_NETWORKING),modular)
    42         BINARY = dp8390
     41ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
     42        LIBS += $(USPACE_PREFIX)/srv/net/nil/eth/libeth.a
    4343endif
    4444
    45 ifeq ($(CONFIG_NETWORKING),module)
    46         LIBRARY = libdp8390
    47 endif
     45BINARY = dp8390
    4846
    4947SOURCES = \
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r24ab58b3 r14f1db0  
    3737
    3838#include <net_byteorder.h>
    39 
     39#include <netif_local.h>
    4040#include <packet/packet.h>
    4141#include <packet/packet_client.h>
    42 
    43 #include <netif.h>
    4442
    4543#include "dp8390_drv.h"
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r24ab58b3 r14f1db0  
    5050#include <net_device.h>
    5151#include <nil_interface.h>
    52 #include <netif.h>
    53 #include <netif_module.h>
     52#include <netif_interface.h>
     53#include <netif_local.h>
    5454
    5555#include "dp8390.h"
     
    9595};
    9696
    97 /** Network interface module global data.
    98  */
    99 netif_globals_t netif_globals;
    100 
    10197/** Handles the interrupt messages.
    10298 *  This is the interrupt handler callback function.
     
    104100 *  @param[in] call The interrupt message.
    105101 */
    106 void irq_handler(ipc_callid_t iid, ipc_call_t * call);
    107 
    108 /** Changes the network interface state.
    109  *  @param[in,out] device The network interface.
    110  *  @param[in] state The new state.
    111  *  @returns The new state.
    112  */
    113 int change_state(device_ref device, device_state_t state);
    114 
    115 int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    116         return ENOTSUP;
    117 }
    118 
    119 int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
    120         ERROR_DECLARE;
    121 
    122         device_ref device;
    123         eth_stat_t * de_stat;
    124 
    125         if(! stats){
    126                 return EBADMEM;
    127         }
    128         ERROR_PROPAGATE(find_device(device_id, &device));
    129         de_stat = &((dpeth_t *) device->specific)->de_stat;
    130         null_device_stats(stats);
    131         stats->receive_errors = de_stat->ets_recvErr;
    132         stats->send_errors = de_stat->ets_sendErr;
    133         stats->receive_crc_errors = de_stat->ets_CRCerr;
    134         stats->receive_frame_errors = de_stat->ets_frameAll;
    135         stats->receive_missed_errors = de_stat->ets_missedP;
    136         stats->receive_packets = de_stat->ets_packetR;
    137         stats->send_packets = de_stat->ets_packetT;
    138         stats->collisions = de_stat->ets_collision;
    139         stats->send_aborted_errors = de_stat->ets_transAb;
    140         stats->send_carrier_errors = de_stat->ets_carrSense;
    141         stats->send_heartbeat_errors = de_stat->ets_CDheartbeat;
    142         stats->send_window_errors = de_stat->ets_OWC;
    143         return EOK;
    144 }
    145 
    146 int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
    147         ERROR_DECLARE;
    148 
    149         device_ref device;
    150 
    151         if(! address){
    152                 return EBADMEM;
    153         }
    154         ERROR_PROPAGATE(find_device(device_id, &device));
    155         address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
    156         address->length = CONVERT_SIZE(ether_addr_t, char, 1);
    157         return EOK;
    158 }
    159 
    160 void irq_handler(ipc_callid_t iid, ipc_call_t * call)
     102static void irq_handler(ipc_callid_t iid, ipc_call_t * call)
    161103{
    162         device_ref device;
     104        netif_device_t * device;
    163105        dpeth_t * dep;
    164106        packet_t received;
     
    203145}
    204146
     147/** Changes the network interface state.
     148 *  @param[in,out] device The network interface.
     149 *  @param[in] state The new state.
     150 *  @returns The new state.
     151 */
     152static int change_state(netif_device_t * device, device_state_t state)
     153{
     154        if (device->state != state) {
     155                device->state = state;
     156               
     157                printf("%s: State changed to %s\n", NAME,
     158                    (state == NETIF_ACTIVE) ? "active" : "stopped");
     159               
     160                return state;
     161        }
     162       
     163        return EOK;
     164}
     165
     166int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     167        return ENOTSUP;
     168}
     169
     170int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
     171        ERROR_DECLARE;
     172
     173        netif_device_t * device;
     174        eth_stat_t * de_stat;
     175
     176        if(! stats){
     177                return EBADMEM;
     178        }
     179        ERROR_PROPAGATE(find_device(device_id, &device));
     180        de_stat = &((dpeth_t *) device->specific)->de_stat;
     181        null_device_stats(stats);
     182        stats->receive_errors = de_stat->ets_recvErr;
     183        stats->send_errors = de_stat->ets_sendErr;
     184        stats->receive_crc_errors = de_stat->ets_CRCerr;
     185        stats->receive_frame_errors = de_stat->ets_frameAll;
     186        stats->receive_missed_errors = de_stat->ets_missedP;
     187        stats->receive_packets = de_stat->ets_packetR;
     188        stats->send_packets = de_stat->ets_packetT;
     189        stats->collisions = de_stat->ets_collision;
     190        stats->send_aborted_errors = de_stat->ets_transAb;
     191        stats->send_carrier_errors = de_stat->ets_carrSense;
     192        stats->send_heartbeat_errors = de_stat->ets_CDheartbeat;
     193        stats->send_window_errors = de_stat->ets_OWC;
     194        return EOK;
     195}
     196
     197int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
     198        ERROR_DECLARE;
     199
     200        netif_device_t * device;
     201
     202        if(! address){
     203                return EBADMEM;
     204        }
     205        ERROR_PROPAGATE(find_device(device_id, &device));
     206        address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
     207        address->length = CONVERT_SIZE(ether_addr_t, char, 1);
     208        return EOK;
     209}
     210
     211
     212
    205213int netif_probe_message(device_id_t device_id, int irq, uintptr_t io){
    206214        ERROR_DECLARE;
    207215
    208         device_ref device;
    209         dpeth_t * dep;
    210 
    211         device = (device_ref) malloc(sizeof(device_t));
     216        netif_device_t * device;
     217        dpeth_t * dep;
     218
     219        device = (netif_device_t *) malloc(sizeof(netif_device_t));
    212220        if(! device){
    213221                return ENOMEM;
     
    218226                return ENOMEM;
    219227        }
    220         bzero(device, sizeof(device_t));
     228        bzero(device, sizeof(netif_device_t));
    221229        bzero(dep, sizeof(dpeth_t));
    222230        device->device_id = device_id;
     
    233241                return ERROR_CODE;
    234242        }
    235         if(ERROR_OCCURRED(device_map_add(&netif_globals.device_map, device->device_id, device))){
     243        if(ERROR_OCCURRED(netif_device_map_add(&netif_globals.device_map, device->device_id, device))){
    236244                free(dep);
    237245                free(device);
     
    244252        ERROR_DECLARE;
    245253
    246         device_ref device;
     254        netif_device_t * device;
    247255        dpeth_t * dep;
    248256        packet_t next;
     
    271279}
    272280
    273 int netif_start_message(device_ref device){
     281int netif_start_message(netif_device_t * device){
    274282        ERROR_DECLARE;
    275283
     
    290298}
    291299
    292 int netif_stop_message(device_ref device){
     300int netif_stop_message(netif_device_t * device){
    293301        dpeth_t * dep;
    294302
     
    302310}
    303311
    304 int change_state(device_ref device, device_state_t state)
    305 {
    306         if (device->state != state) {
    307                 device->state = state;
    308                
    309                 printf("%s: State changed to %s\n", NAME,
    310                     (state == NETIF_ACTIVE) ? "active" : "stopped");
    311                
    312                 return state;
    313         }
    314        
    315         return EOK;
    316 }
    317 
    318312int netif_initialize(void){
    319313        ipcarg_t phonehash;
     
    323317        return REGISTER_ME(SERVICE_DP8390, &phonehash);
    324318}
    325 
    326 #ifdef CONFIG_NETWORKING_modular
    327 
    328 #include <netif_standalone.h>
    329319
    330320/** Default thread for new connections.
     
    386376}
    387377
    388 #endif /* CONFIG_NETWORKING_modular */
    389 
    390 
    391378/** @}
    392379 */
  • uspace/srv/net/cfg/Makefile

    r24ab58b3 r14f1db0  
    11#
    2 # Copyright (c) 2005 Martin Decky
    3 # Copyright (c) 2007 Jakub Jermar
     2# Copyright (c) 2010 Martin Decky
    43# All rights reserved.
    54#
     
    2827#
    2928
    30 USPACE_PREFIX = ../..
    31 EXTRA_CFLAGS = -Iinclude -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    32 LIBRARY = libnetif
     29USPACE_PREFIX = ../../..
     30ROOT_PATH = $(USPACE_PREFIX)/..
    3331
    34 SOURCES = \
    35         generic/netif_remote.c
     32COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
     33CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    3634
    37 include $(USPACE_PREFIX)/Makefile.common
     35-include $(COMMON_MAKEFILE)
     36-include $(CONFIG_MAKEFILE)
     37
     38ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
     39        LO_SOURCE = lo.netif_nil_bundle
     40        NE2K_SOURCE = ne2k.netif_nil_bundle
     41else
     42        LO_SOURCE = lo.netif_standalone
     43        NE2K_SOURCE = ne2k.netif_standalone
     44endif
     45
     46LO_TARGET = lo
     47NE2K_TARGET = ne2k
     48
     49.PHONY: all clean
     50
     51all: $(LO_TARGET) $(NE2K_TARGET)
     52
     53clean:
     54        rm -f $(LO_TARGET) $(NE2K_TARGET)
     55
     56$(LO_TARGET): $(LO_SOURCE)
     57        cp $< $@
     58
     59$(NE2K_TARGET): $(NE2K_SOURCE)
     60        cp $< $@
  • uspace/srv/net/il/arp/arp.c

    r24ab58b3 r14f1db0  
    5757#include <packet/packet.h>
    5858#include <packet/packet_client.h>
     59#include <packet_remote.h>
    5960#include <il_messages.h>
     61#include <il_interface.h>
     62#include <il_local.h>
    6063#include <arp_messages.h>
    6164
     
    370373}
    371374
    372 int arp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     375int arp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     376    ipc_call_t *answer, int *answer_count)
     377{
    373378        ERROR_DECLARE;
    374 
     379       
    375380        measured_string_ref address;
    376381        measured_string_ref translation;
     
    378383        packet_t packet;
    379384        packet_t next;
    380 
    381 //      printf("message %d - %d\n", IPC_GET_METHOD(*call), NET_ARP_FIRST);
     385       
    382386        *answer_count = 0;
    383         switch(IPC_GET_METHOD(*call)){
     387        switch (IPC_GET_METHOD(*call)) {
    384388                case IPC_M_PHONE_HUNGUP:
    385389                        return EOK;
     
    418422                        return EOK;
    419423                case NET_IL_RECEIVED:
    420                         if(! ERROR_OCCURRED(packet_translate(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
     424                        if(! ERROR_OCCURRED(packet_translate_remote(arp_globals.net_phone, &packet, IPC_GET_PACKET(call)))){
    421425                                fibril_rwlock_read_lock(&arp_globals.lock);
    422426                                do{
     
    424428                                        ERROR_CODE = arp_receive_message(IPC_GET_DEVICE(call), packet);
    425429                                        if(ERROR_CODE != 1){
    426                                                 pq_release(arp_globals.net_phone, packet_get_id(packet));
     430                                                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
    427431                                        }
    428432                                        packet = next;
     
    434438                        return arp_mtu_changed_message(IPC_GET_DEVICE(call), IPC_GET_MTU(call));
    435439        }
     440       
    436441        return ENOTSUP;
    437442}
     
    570575                return NULL;
    571576        }
    572         packet = packet_get_4(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
     577        packet = packet_get_4_remote(arp_globals.net_phone, device->packet_dimension.addr_len, device->packet_dimension.prefix, length, device->packet_dimension.suffix);
    573578        if(! packet){
    574579                return NULL;
     
    576581        header = (arp_header_ref) packet_suffix(packet, length);
    577582        if(! header){
    578                 pq_release(arp_globals.net_phone, packet_get_id(packet));
     583                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
    579584                return NULL;
    580585        }
     
    593598        memcpy(((uint8_t *) header) + length, target->value, target->length);
    594599        if(packet_set_addr(packet, (uint8_t *) device->addr->value, (uint8_t *) device->broadcast_addr->value, CONVERT_SIZE(char, uint8_t, device->addr->length)) != EOK){
    595                 pq_release(arp_globals.net_phone, packet_get_id(packet));
     600                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
    596601                return NULL;
    597602        }
     
    619624        }
    620625}
    621 
    622 #ifdef CONFIG_NETWORKING_modular
    623 
    624 #include <il_standalone.h>
    625626
    626627/** Default thread for new connections.
     
    650651               
    651652                /* Process the message */
    652                 int res = il_module_message(callid, &call, &answer, &answer_count);
     653                int res = il_module_message_standalone(callid, &call, &answer,
     654                    &answer_count);
    653655               
    654656                /* End if said to either by the message or the processing result */
     
    675677       
    676678        /* Start the module */
    677         if (ERROR_OCCURRED(il_module_start(il_client_connection)))
     679        if (ERROR_OCCURRED(il_module_start_standalone(il_client_connection)))
    678680                return ERROR_CODE;
    679681       
     
    681683}
    682684
    683 #endif /* CONFIG_NETWORKING_modular */
    684 
    685685/** @}
    686686 */
  • uspace/srv/net/il/arp/arp_module.c

    r24ab58b3 r14f1db0  
    4848#include <net_interface.h>
    4949#include <packet/packet.h>
    50 #include <il_standalone.h>
     50#include <il_local.h>
    5151
    5252#include "arp.h"
     
    6565 *  @returns Other error codes as defined for the arp_message() function.
    6666 */
    67 int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    68         return arp_message(callid, call, answer, answer_count);
     67int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     68        return arp_message_standalone(callid, call, answer, answer_count);
    6969}
    7070
     
    7676 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    7777 */
    78 int il_module_start(async_client_conn_t client_connection){
     78int il_module_start_standalone(async_client_conn_t client_connection){
    7979        ERROR_DECLARE;
    80 
    81         ipcarg_t phonehash;
    82 
     80       
    8381        async_set_client_connection(client_connection);
    8482        arp_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
    8583        ERROR_PROPAGATE(pm_init());
    86         if(ERROR_OCCURRED(arp_initialize(client_connection))
    87                 || ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))){
     84       
     85        ipcarg_t phonehash;
     86        if (ERROR_OCCURRED(arp_initialize(client_connection))
     87            || ERROR_OCCURRED(REGISTER_ME(SERVICE_ARP, &phonehash))) {
    8888                pm_destroy();
    8989                return ERROR_CODE;
    9090        }
    91 
     91       
    9292        async_manager();
    93 
     93       
    9494        pm_destroy();
    9595        return EOK;
  • uspace/srv/net/il/arp/arp_module.h

    r24ab58b3 r14f1db0  
    5858 *  @see IS_NET_ARP_MESSAGE()
    5959 */
    60 int arp_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     60int arp_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6161
    6262#endif
  • uspace/srv/net/il/ip/ip.c

    r24ab58b3 r14f1db0  
    6969#include <adt/module_map.h>
    7070#include <packet/packet_client.h>
     71#include <packet_remote.h>
    7172#include <nil_messages.h>
    7273#include <il_messages.h>
     74#include <il_local.h>
     75#include <ip_local.h>
    7376
    7477#include "ip.h"
     
    424427}
    425428
    426 int ip_device_req(int il_phone, device_id_t device_id, services_t netif){
     429int ip_device_req_local(int il_phone, device_id_t device_id, services_t netif){
    427430        ERROR_DECLARE;
    428431
     
    656659}
    657660
    658 int ip_send_msg(int il_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error){
     661int ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error){
    659662        ERROR_DECLARE;
    660663
     
    782785//                      sleep(1);
    783786//                      ERROR_PROPAGATE(arp_translate_req(netif->arp->phone, netif->device_id, SERVICE_IP, &destination, &translation, &data));
    784                         pq_release(ip_globals.net_phone, packet_get_id(packet));
     787                        pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
    785788                        return ERROR_CODE;
    786789                }
     
    799802        }else translation = NULL;
    800803        if(ERROR_OCCURRED(ip_prepare_packet(src, dest, packet, translation))){
    801                 pq_release(ip_globals.net_phone, packet_get_id(packet));
     804                pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
    802805        }else{
    803806                packet = ip_split_packet(packet, netif->packet_dimension.prefix, netif->packet_dimension.content, netif->packet_dimension.suffix, netif->packet_dimension.addr_len, error);
     
    891894}
    892895
    893 int ip_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     896int ip_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     897    ipc_call_t *answer, int * answer_count)
     898{
    894899        ERROR_DECLARE;
    895 
     900       
    896901        packet_t packet;
    897         struct sockaddr * addr;
     902        struct sockaddr *addr;
    898903        size_t addrlen;
    899904        size_t prefix;
    900905        size_t suffix;
    901906        size_t content;
    902         ip_pseudo_header_ref header;
     907        void *header;
    903908        size_t headerlen;
    904909        device_id_t device_id;
    905 
     910       
    906911        *answer_count = 0;
    907         switch(IPC_GET_METHOD(*call)){
     912        switch (IPC_GET_METHOD(*call)) {
    908913                case IPC_M_PHONE_HUNGUP:
    909914                        return EOK;
    910915                case NET_IL_DEVICE:
    911                         return ip_device_req(0, IPC_GET_DEVICE(call), IPC_GET_SERVICE(call));
     916                        return ip_device_req_local(0, IPC_GET_DEVICE(call),
     917                            IPC_GET_SERVICE(call));
    912918                case IPC_M_CONNECT_TO_ME:
    913                         return ip_register(IL_GET_PROTO(call), IL_GET_SERVICE(call), IPC_GET_PHONE(call), NULL);
     919                        return ip_register(IL_GET_PROTO(call), IL_GET_SERVICE(call),
     920                            IPC_GET_PHONE(call), NULL);
    914921                case NET_IL_SEND:
    915                         ERROR_PROPAGATE(packet_translate(ip_globals.net_phone, &packet, IPC_GET_PACKET(call)));
    916                         return ip_send_msg(0, IPC_GET_DEVICE(call), packet, 0, IPC_GET_ERROR(call));
     922                        ERROR_PROPAGATE(packet_translate_remote(ip_globals.net_phone, &packet,
     923                            IPC_GET_PACKET(call)));
     924                        return ip_send_msg_local(0, IPC_GET_DEVICE(call), packet, 0,
     925                            IPC_GET_ERROR(call));
    917926                case NET_IL_DEVICE_STATE:
    918                         return ip_device_state_message(IPC_GET_DEVICE(call), IPC_GET_STATE(call));
     927                        return ip_device_state_message(IPC_GET_DEVICE(call),
     928                            IPC_GET_STATE(call));
    919929                case NET_IL_RECEIVED:
    920                         ERROR_PROPAGATE(packet_translate(ip_globals.net_phone, &packet, IPC_GET_PACKET(call)));
     930                        ERROR_PROPAGATE(packet_translate_remote(ip_globals.net_phone, &packet,
     931                            IPC_GET_PACKET(call)));
    921932                        return ip_receive_message(IPC_GET_DEVICE(call), packet);
    922933                case NET_IP_RECEIVED_ERROR:
    923                         ERROR_PROPAGATE(packet_translate(ip_globals.net_phone, &packet, IPC_GET_PACKET(call)));
    924                         return ip_received_error_msg(0, IPC_GET_DEVICE(call), packet, IPC_GET_TARGET(call), IPC_GET_ERROR(call));
     934                        ERROR_PROPAGATE(packet_translate_remote(ip_globals.net_phone, &packet,
     935                            IPC_GET_PACKET(call)));
     936                        return ip_received_error_msg_local(0, IPC_GET_DEVICE(call), packet,
     937                            IPC_GET_TARGET(call), IPC_GET_ERROR(call));
    925938                case NET_IP_ADD_ROUTE:
    926                         return ip_add_route_req(0, IPC_GET_DEVICE(call), IP_GET_ADDRESS(call), IP_GET_NETMASK(call), IP_GET_GATEWAY(call));
     939                        return ip_add_route_req_local(0, IPC_GET_DEVICE(call),
     940                            IP_GET_ADDRESS(call), IP_GET_NETMASK(call), IP_GET_GATEWAY(call));
    927941                case NET_IP_SET_GATEWAY:
    928                         return ip_set_gateway_req(0, IPC_GET_DEVICE(call), IP_GET_GATEWAY(call));
     942                        return ip_set_gateway_req_local(0, IPC_GET_DEVICE(call),
     943                            IP_GET_GATEWAY(call));
    929944                case NET_IP_GET_ROUTE:
    930945                        ERROR_PROPAGATE(data_receive((void **) &addr, &addrlen));
    931                         ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen,
    932                             &device_id, &header, &headerlen));
     946                        ERROR_PROPAGATE(ip_get_route_req_local(0, IP_GET_PROTOCOL(call),
     947                            addr, (socklen_t) addrlen, &device_id, &header, &headerlen));
    933948                        IPC_SET_DEVICE(answer, device_id);
    934949                        IP_SET_HEADERLEN(answer, headerlen);
     950                       
    935951                        *answer_count = 2;
    936                         if(! ERROR_OCCURRED(data_reply(&headerlen, sizeof(headerlen)))){
     952                       
     953                        if (!ERROR_OCCURRED(data_reply(&headerlen, sizeof(headerlen))))
    937954                                ERROR_CODE = data_reply(header, headerlen);
    938                         }
     955                       
    939956                        free(header);
    940957                        return ERROR_CODE;
    941958                case NET_IL_PACKET_SPACE:
    942                         ERROR_PROPAGATE(ip_packet_size_message(IPC_GET_DEVICE(call), &addrlen, &prefix, &content, &suffix));
     959                        ERROR_PROPAGATE(ip_packet_size_message(IPC_GET_DEVICE(call),
     960                            &addrlen, &prefix, &content, &suffix));
    943961                        IPC_SET_ADDR(answer, addrlen);
    944962                        IPC_SET_PREFIX(answer, prefix);
     
    948966                        return EOK;
    949967                case NET_IL_MTU_CHANGED:
    950                         return ip_mtu_changed_message(IPC_GET_DEVICE(call), IPC_GET_MTU(call));
    951         }
     968                        return ip_mtu_changed_message(IPC_GET_DEVICE(call),
     969                            IPC_GET_MTU(call));
     970        }
     971       
    952972        return ENOTSUP;
    953973}
    954974
    955 int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension){
    956         if(! packet_dimension){
     975int ip_packet_size_req_local(int ip_phone, device_id_t device_id,
     976    packet_dimension_ref packet_dimension)
     977{
     978        if (!packet_dimension)
    957979                return EBADMEM;
    958         }
    959         return ip_packet_size_message(device_id, &packet_dimension->addr_len, &packet_dimension->prefix, &packet_dimension->content, &packet_dimension->suffix);
     980       
     981        return ip_packet_size_message(device_id, &packet_dimension->addr_len,
     982            &packet_dimension->prefix, &packet_dimension->content,
     983            &packet_dimension->suffix);
    960984}
    961985
     
    10031027}
    10041028
    1005 int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway){
     1029int ip_add_route_req_local(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway){
    10061030        ip_route_ref route;
    10071031        ip_netif_ref netif;
     
    10671091}
    10681092
    1069 int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway){
     1093int ip_set_gateway_req_local(int ip_phone, device_id_t device_id, in_addr_t gateway)
     1094{
    10701095        ip_netif_ref netif;
    10711096
     
    11121137                                        }
    11131138                                }else{
    1114                                         pq_release(ip_globals.net_phone, packet_get_id(next));
     1139                                        pq_release_remote(ip_globals.net_phone, packet_get_id(next));
    11151140                                }
    11161141                                next = new_packet;
     
    11531178        }
    11541179        // create the last fragment
    1155         new_packet = packet_get_4(ip_globals.net_phone, prefix, length, suffix, ((addrlen > addr_len) ? addrlen : addr_len));
     1180        new_packet = packet_get_4_remote(ip_globals.net_phone, prefix, length, suffix, ((addrlen > addr_len) ? addrlen : addr_len));
    11561181        if(! new_packet){
    11571182                return ENOMEM;
     
    11771202        // create middle framgents
    11781203        while(IP_TOTAL_LENGTH(header) > length){
    1179                 new_packet = packet_get_4(ip_globals.net_phone, prefix, length, suffix, ((addrlen >= addr_len) ? addrlen : addr_len));
     1204                new_packet = packet_get_4_remote(ip_globals.net_phone, prefix, length, suffix, ((addrlen >= addr_len) ? addrlen : addr_len));
    11801205                if(! new_packet){
    11811206                        return ENOMEM;
     
    13571382}
    13581383
    1359 int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){
     1384/** Notify the IP module about the received error notification packet.
     1385 *
     1386 * @param[in] ip_phone  The IP module phone used for (semi)remote calls.
     1387 * @param[in] device_id The device identifier.
     1388 * @param[in] packet    The received packet or the received packet queue.
     1389 * @param[in] target    The target internetwork module service to be
     1390 *                      delivered to.
     1391 * @param[in] error     The packet error reporting service. Prefixes the
     1392 *                      received packet.
     1393 *
     1394 * @return EOK on success.
     1395 *
     1396 */
     1397int ip_received_error_msg_local(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error){
    13601398        uint8_t * data;
    13611399        int offset;
     
    14921530        next = pq_detach(packet);
    14931531        if(next){
    1494                 pq_release(ip_globals.net_phone, packet_get_id(next));
     1532                pq_release_remote(ip_globals.net_phone, packet_get_id(next));
    14951533        }
    14961534        if(! header){
     
    15561594
    15571595int ip_release_and_return(packet_t packet, int result){
    1558         pq_release(ip_globals.net_phone, packet_get_id(packet));
     1596        pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
    15591597        return result;
    15601598}
    15611599
    1562 int ip_get_route_req(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, ip_pseudo_header_ref * header, size_t * headerlen){
     1600int ip_get_route_req_local(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, void **header, size_t * headerlen){
    15631601        struct sockaddr_in * address_in;
    15641602//      struct sockaddr_in6 *   address_in6;
     
    16241662        header_in->protocol = protocol;
    16251663        header_in->data_length = 0;
    1626         *header = (ip_pseudo_header_ref) header_in;
     1664        *header = header_in;
    16271665        return EOK;
    16281666}
    1629 
    1630 #ifdef CONFIG_NETWORKING_modular
    1631 
    1632 #include <il_standalone.h>
    16331667
    16341668/** Default thread for new connections.
     
    16581692               
    16591693                /* Process the message */
    1660                 int res = il_module_message(callid, &call, &answer, &answer_count);
     1694                int res = il_module_message_standalone(callid, &call, &answer,
     1695                    &answer_count);
    16611696               
    16621697                /* End if said to either by the message or the processing result */
     
    16831718       
    16841719        /* Start the module */
    1685         if (ERROR_OCCURRED(il_module_start(il_client_connection)))
     1720        if (ERROR_OCCURRED(il_module_start_standalone(il_client_connection)))
    16861721                return ERROR_CODE;
    16871722       
     
    16891724}
    16901725
    1691 #endif /* CONFIG_NETWORKING_modular */
    1692 
    16931726/** @}
    16941727 */
  • uspace/srv/net/il/ip/ip_module.c

    r24ab58b3 r14f1db0  
    4747#include <net_interface.h>
    4848#include <packet/packet.h>
    49 #include <il_standalone.h>
     49#include <il_local.h>
    5050
    5151#include "ip.h"
     
    5454/** IP module global data.
    5555 */
    56 extern ip_globals_t     ip_globals;
     56extern ip_globals_t ip_globals;
    5757
    5858/** Processes the IP message.
     
    6464 *  @returns Other error codes as defined for the ip_message() function.
    6565 */
    66 int il_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    67         return ip_message(callid, call, answer, answer_count);
     66int il_module_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     67        return ip_message_standalone(callid, call, answer, answer_count);
    6868}
    6969
     
    7575 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    7676 */
    77 int il_module_start(async_client_conn_t client_connection){
     77int il_module_start_standalone(async_client_conn_t client_connection){
    7878        ERROR_DECLARE;
    79 
    80         ipcarg_t phonehash;
    81 
     79       
    8280        async_set_client_connection(client_connection);
    8381        ip_globals.net_phone = net_connect_module(SERVICE_NETWORKING);
    8482        ERROR_PROPAGATE(pm_init());
    85         if(ERROR_OCCURRED(ip_initialize(client_connection))
    86                 || ERROR_OCCURRED(REGISTER_ME(SERVICE_IP, &phonehash))){
     83       
     84        ipcarg_t phonehash;
     85        if (ERROR_OCCURRED(ip_initialize(client_connection))
     86            || ERROR_OCCURRED(REGISTER_ME(SERVICE_IP, &phonehash))) {
    8787                pm_destroy();
    8888                return ERROR_CODE;
    8989        }
    90 
     90       
    9191        async_manager();
    92 
     92       
    9393        pm_destroy();
    9494        return EOK;
  • uspace/srv/net/il/ip/ip_module.h

    r24ab58b3 r14f1db0  
    5959 *  @see IS_NET_IP_MESSAGE()
    6060 */
    61 int ip_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     61int ip_message_standalone(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
    6262
    6363#endif
  • uspace/srv/net/net/Makefile

    r24ab58b3 r14f1db0  
    3030USPACE_PREFIX = ../../..
    3131ROOT_PATH = $(USPACE_PREFIX)/..
    32 LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    33 EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
     32LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
     33EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    3434
    3535COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
  • uspace/srv/net/net/net.c

    r24ab58b3 r14f1db0  
    5656#include <packet/packet.h>
    5757#include <il_messages.h>
     58#include <netif_remote.h>
    5859#include <net_device.h>
    59 #include <netif_interface.h>
    6060#include <nil_interface.h>
    6161#include <net_interface.h>
     
    461461        int io = setting ? strtol(setting->value, NULL, 16) : 0;
    462462       
    463         ERROR_PROPAGATE(netif_probe_req(netif->driver->phone, netif->id, irq, io));
     463        ERROR_PROPAGATE(netif_probe_req_remote(netif->driver->phone, netif->id, irq, io));
    464464       
    465465        /* Network interface layer startup */
     
    490490        }
    491491       
    492         ERROR_PROPAGATE(netif_start_req(netif->driver->phone, netif->id));
     492        ERROR_PROPAGATE(netif_start_req_remote(netif->driver->phone, netif->id));
    493493        return EOK;
    494494}
  • uspace/srv/net/net/net_standalone.c

    r24ab58b3 r14f1db0  
    4949/** Networking module global data.
    5050 */
    51 extern net_globals_t    net_globals;
     51extern net_globals_t net_globals;
    5252
    53 /** Initializes the networking module for the chosen subsystem build type.
    54  *  @param[in] client_connection The client connection processing function. The module skeleton propagates its own one.
    55  *  @returns EOK on success.
    56  *  @returns ENOMEM if there is not enough memory left.
     53/** Initialize the networking module for the chosen subsystem build type.
     54 *
     55 *  @param[in] client_connection The client connection processing function.
     56 *                               The module skeleton propagates its own one.
     57 *
     58 *  @return EOK on success.
     59 *  @return ENOMEM if there is not enough memory left.
     60 *
    5761 */
    5862int net_initialize_build(async_client_conn_t client_connection){
    5963        ERROR_DECLARE;
    60 
    61         task_id_t task_id;
    62 
    63         task_id = spawn("/srv/ip");
    64         if(! task_id){
     64       
     65        task_id_t task_id = spawn("/srv/ip");
     66        if (!task_id)
    6567                return EINVAL;
    66         }
    67         ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME, IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
    68         if(! spawn("/srv/icmp")){
     68       
     69        ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME,
     70            IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
     71       
     72        if (!spawn("/srv/icmp"))
    6973                return EINVAL;
    70         }
    71         if(! spawn("/srv/udp")){
     74       
     75        if (!spawn("/srv/udp"))
    7276                return EINVAL;
    73         }
    74         if(! spawn("/srv/tcp")){
     77       
     78        if (!spawn("/srv/tcp"))
    7579                return EINVAL;
    76         }
     80       
    7781        return EOK;
    7882}
    7983
    80 /** Processes the module message.
    81  *  Distributes the message to the right bundled module.
    82  *  @param[in] callid The message identifier.
    83  *  @param[in] call The message parameters.
    84  *  @param[out] answer The message answer parameters.
    85  *  @param[out] answer_count The last parameter for the actual answer in the answer parameter.
    86  *  @returns EOK on success.
    87  *  @returns ENOTSUP if the message is not known.
    88  *  @returns Other error codes as defined for each bundled module message function.
     84/** Process the module message.
     85 *
     86 * Distribute the message to the right module.
     87 *
     88 * @param[in]  callid       The message identifier.
     89 * @param[in]  call         The message parameters.
     90 * @param[out] answer       The message answer parameters.
     91 * @param[out] answer_count The last parameter for the actual answer in
     92 *                          the answer parameter.
     93 *
     94 * @return EOK on success.
     95 * @return ENOTSUP if the message is not known.
     96 * @return Other error codes as defined for each bundled module
     97 *         message function.
     98 *
    8999 */
    90 int net_module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
    91         if(IS_NET_PACKET_MESSAGE(call)){
     100int net_module_message(ipc_callid_t callid, ipc_call_t *call,
     101    ipc_call_t *answer, int *answer_count)
     102{
     103        if (IS_NET_PACKET_MESSAGE(call))
    92104                return packet_server_message(callid, call, answer, answer_count);
    93         }else{
    94                 return net_message(callid, call, answer, answer_count);
    95         }
     105       
     106        return net_message(callid, call, answer, answer_count);
    96107}
    97108
  • uspace/srv/net/netif/lo/Makefile

    r24ab58b3 r14f1db0  
    3939-include $(CONFIG_MAKEFILE)
    4040
    41 ifeq ($(CONFIG_NETWORKING),modular)
    42         BINARY = lo
     41ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
     42        LIBS += $(USPACE_PREFIX)/srv/net/nil/nildummy/libnildummy.a
    4343endif
    4444
    45 ifeq ($(CONFIG_NETWORKING),module)
    46         LIBRARY = liblo
    47 endif
     45BINARY = lo
    4846
    4947SOURCES = \
  • uspace/srv/net/netif/lo/lo.c

    r24ab58b3 r14f1db0  
    5151#include <nil_interface.h>
    5252#include <nil_messages.h>
    53 #include <netif.h>
    54 #include <netif_module.h>
     53#include <netif_interface.h>
     54#include <netif_local.h>
    5555
    5656/** Default hardware address.
     
    7676 *  @returns EOK otherwise.
    7777 */
    78 int change_state_message(device_ref device, device_state_t state);
     78int change_state_message(netif_device_t * device, device_state_t state);
    7979
    8080/** Creates and returns the loopback network interface structure.
     
    8585 *  @returns ENOMEM if there is not enough memory left.
    8686 */
    87 int create(device_id_t device_id, device_ref * device);
     87int create(device_id_t device_id, netif_device_t * * device);
    8888
    8989int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     
    103103        ERROR_DECLARE;
    104104
    105         device_ref device;
     105        netif_device_t * device;
    106106
    107107        if(! stats){
     
    113113}
    114114
    115 int change_state_message(device_ref device, device_state_t state)
     115int change_state_message(netif_device_t * device, device_state_t state)
    116116{
    117117        if (device->state != state) {
     
    127127}
    128128
    129 int create(device_id_t device_id, device_ref * device){
     129int create(device_id_t device_id, netif_device_t * * device){
    130130        int index;
    131131
    132         if(device_map_count(&netif_globals.device_map) > 0){
     132        if(netif_device_map_count(&netif_globals.device_map) > 0){
    133133                return EXDEV;
    134134        }else{
    135                 *device = (device_ref) malloc(sizeof(device_t));
     135                *device = (netif_device_t *) malloc(sizeof(netif_device_t));
    136136                if(!(*device)){
    137137                        return ENOMEM;
     
    146146                (** device).nil_phone = -1;
    147147                (** device).state = NETIF_STOPPED;
    148                 index = device_map_add(&netif_globals.device_map, (** device).device_id, * device);
     148                index = netif_device_map_add(&netif_globals.device_map, (** device).device_id, * device);
    149149                if(index < 0){
    150150                        free(*device);
     
    166166        ERROR_DECLARE;
    167167
    168         device_ref device;
     168        netif_device_t * device;
    169169
    170170        // create a new device
     
    178178        ERROR_DECLARE;
    179179
    180         device_ref device;
     180        netif_device_t * device;
    181181        size_t length;
    182182        packet_t next;
     
    204204}
    205205
    206 int netif_start_message(device_ref device){
     206int netif_start_message(netif_device_t * device){
    207207        return change_state_message(device, NETIF_ACTIVE);
    208208}
    209209
    210 int netif_stop_message(device_ref device){
     210int netif_stop_message(netif_device_t * device){
    211211        return change_state_message(device, NETIF_STOPPED);
    212212}
    213213
    214 #ifdef CONFIG_NETWORKING_modular
    215 
    216 #include <netif_standalone.h>
    217 
    218214/** Default thread for new connections.
    219215 *
    220  *  @param[in] iid The initial message identifier.
    221  *  @param[in] icall The initial message call structure.
    222  *
    223  */
    224 static void netif_client_connection(ipc_callid_t iid, ipc_call_t * icall)
     216 * @param[in] iid The initial message identifier.
     217 * @param[in] icall The initial message call structure.
     218 *
     219 */
     220static void netif_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    225221{
    226222        /*
     
    254250}
    255251
    256 /** Starts the module.
    257  *
    258  *  @param argc The count of the command line arguments. Ignored parameter.
    259  *  @param argv The command line parameters. Ignored parameter.
    260  *
    261  *  @returns EOK on success.
    262  *  @returns Other error codes as defined for each specific module start function.
    263  *
    264  */
    265252int main(int argc, char *argv[])
    266253{
     
    274261}
    275262
    276 #endif /* CONFIG_NETWORKING_modular */
    277 
    278263/** @}
    279264 */
  • uspace/srv/net/nil/eth/Makefile

    r24ab58b3 r14f1db0  
    2929
    3030USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    33 BINARY = eth
     31ROOT_PATH = $(USPACE_PREFIX)/..
     32LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
     33EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
     34
     35COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
     36CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     37
     38-include $(COMMON_MAKEFILE)
     39-include $(CONFIG_MAKEFILE)
     40
     41ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
     42        LIBRARY = libeth
     43else
     44        BINARY = eth
     45endif
    3446
    3547SOURCES = \
  • uspace/srv/net/nil/eth/eth.c

    r24ab58b3 r14f1db0  
    6060#include <adt/measured_strings.h>
    6161#include <packet/packet_client.h>
    62 #include <nil_module.h>
     62#include <packet_remote.h>
     63#include <nil_local.h>
    6364
    6465#include "eth.h"
     
    271272INT_MAP_IMPLEMENT(eth_protos, eth_proto_t)
    272273
    273 int nil_device_state_msg(int nil_phone, device_id_t device_id, int state){
     274int nil_device_state_msg_local(int nil_phone, device_id_t device_id, int state){
    274275        int index;
    275276        eth_proto_ref proto;
     
    475476}
    476477
    477 int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
     478int nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
    478479        eth_proto_ref proto;
    479480        packet_t next;
     
    497498                }else{
    498499                        // drop invalid/unknown
    499                         pq_release(eth_globals.net_phone, packet_get_id(packet));
     500                        pq_release_remote(eth_globals.net_phone, packet_get_id(packet));
    500501                }
    501502                packet = next;
     
    681682        ethertype = htons(protocol_map(SERVICE_ETHERNET, sender));
    682683        if(! ethertype){
    683                 pq_release(eth_globals.net_phone, packet_get_id(packet));
     684                pq_release_remote(eth_globals.net_phone, packet_get_id(packet));
    684685                return EINVAL;
    685686        }
     
    699700                                packet = tmp;
    700701                        }
    701                         pq_release(eth_globals.net_phone, packet_get_id(next));
     702                        pq_release_remote(eth_globals.net_phone, packet_get_id(next));
    702703                        next = tmp;
    703704                }else{
     
    713714}
    714715
    715 int nil_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
     716int nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
    716717    ipc_call_t *answer, int *answer_count)
    717718{
     
    733734                            IPC_GET_SERVICE(call), IPC_GET_MTU(call));
    734735                case NET_NIL_SEND:
    735                         ERROR_PROPAGATE(packet_translate(eth_globals.net_phone, &packet,
     736                        ERROR_PROPAGATE(packet_translate_remote(eth_globals.net_phone, &packet,
    736737                            IPC_GET_PACKET(call)));
    737738                        return eth_send_message(IPC_GET_DEVICE(call), packet,
     
    771772                switch(IPC_GET_METHOD(*icall)){
    772773                        case NET_NIL_DEVICE_STATE:
    773                                 nil_device_state_msg(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
     774                                nil_device_state_msg_local(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
    774775                                ipc_answer_0(iid, EOK);
    775776                                break;
    776777                        case NET_NIL_RECEIVED:
    777                                 if(! ERROR_OCCURRED(packet_translate(eth_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
    778                                         ERROR_CODE = nil_received_msg(0, IPC_GET_DEVICE(icall), packet, 0);
     778                                if(! ERROR_OCCURRED(packet_translate_remote(eth_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
     779                                        ERROR_CODE = nil_received_msg_local(0, IPC_GET_DEVICE(icall), packet, 0);
    779780                                }
    780781                                ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
     
    787788}
    788789
    789 #ifdef CONFIG_NETWORKING_modular
    790 
    791 #include <nil_standalone.h>
     790#ifndef CONFIG_NETIF_NIL_BUNDLE
    792791
    793792/** Default thread for new connections.
    794793 *
    795  *  @param[in] iid The initial message identifier.
    796  *  @param[in] icall The initial message call structure.
     794 * @param[in] iid The initial message identifier.
     795 * @param[in] icall The initial message call structure.
    797796 *
    798797 */
    799 static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)
     798static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    800799{
    801800        /*
     
    817816               
    818817                /* Process the message */
    819                 int res = nil_module_message(NAME, callid, &call, &answer,
     818                int res = nil_module_message_standalone(NAME, callid, &call, &answer,
    820819                    &answer_count);
    821820               
     
    829828}
    830829
    831 /** Starts the module.
    832  *
    833  *  @param argc The count of the command line arguments. Ignored parameter.
    834  *  @param argv The command line parameters. Ignored parameter.
    835  *
    836  *  @returns EOK on success.
    837  *  @returns Other error codes as defined for each specific module start function.
    838  *
    839  */
    840830int main(int argc, char *argv[])
    841831{
     
    843833       
    844834        /* Start the module */
    845         if (ERROR_OCCURRED(nil_module_start(nil_client_connection)))
     835        if (ERROR_OCCURRED(nil_module_start_standalone(nil_client_connection)))
    846836                return ERROR_CODE;
    847837       
     
    849839}
    850840
    851 #endif /* CONFIG_NETWORKING_modular */
     841#endif /* CONFIG_NETIF_NIL_BUNDLE */
    852842
    853843/** @}
  • uspace/srv/net/nil/eth/eth_module.c

    r24ab58b3 r14f1db0  
    4646#include <net_interface.h>
    4747#include <packet/packet.h>
    48 #include <nil_module.h>
    49 #include <nil_standalone.h>
     48#include <nil_local.h>
    5049
    5150#include "eth.h"
     
    5958 *  @returns Other error codes as defined for the REGISTER_ME() macro function.
    6059 */
    61 int nil_module_start(async_client_conn_t client_connection){
     60int nil_module_start_standalone(async_client_conn_t client_connection)
     61{
    6262        ERROR_DECLARE;
    63 
     63       
     64        async_set_client_connection(client_connection);
     65        int net_phone = net_connect_module(SERVICE_NETWORKING);
     66        ERROR_PROPAGATE(pm_init());
     67       
    6468        ipcarg_t phonehash;
    65         int net_phone;
    66 
    67         async_set_client_connection(client_connection);
    68         net_phone = net_connect_module(SERVICE_NETWORKING);
    69         ERROR_PROPAGATE(pm_init());
    70         if(ERROR_OCCURRED(nil_initialize(net_phone))
    71                 || ERROR_OCCURRED(REGISTER_ME(SERVICE_ETHERNET, &phonehash))){
     69        if (ERROR_OCCURRED(nil_initialize(net_phone))
     70            || ERROR_OCCURRED(REGISTER_ME(SERVICE_ETHERNET, &phonehash))) {
    7271                pm_destroy();
    7372                return ERROR_CODE;
    7473        }
    75 
     74       
    7675        async_manager();
    77 
     76       
    7877        pm_destroy();
    7978        return EOK;
     
    9594 *
    9695 */
    97 int nil_module_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
     96int nil_module_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
    9897    ipc_call_t *answer, int *answer_count)
    9998{
    100         return nil_message(name, callid, call, answer, answer_count);
     99        return nil_message_standalone(name, callid, call, answer, answer_count);
    101100}
    102101
  • uspace/srv/net/nil/nildummy/Makefile

    r24ab58b3 r14f1db0  
    2929
    3030USPACE_PREFIX = ../../../..
    31 LIBS = $(LIBNETIF_PREFIX)/libnetif.a $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
    32 EXTRA_CFLAGS = -I$(LIBNETIF_PREFIX)/include -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
    33 BINARY = nildummy
     31ROOT_PATH = $(USPACE_PREFIX)/..
     32LIBS = $(LIBNET_PREFIX)/libnet.a $(LIBSOCKET_PREFIX)/libsocket.a
     33EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include -I$(LIBSOCKET_PREFIX)/include
     34
     35COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
     36CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     37
     38-include $(COMMON_MAKEFILE)
     39-include $(CONFIG_MAKEFILE)
     40
     41ifeq ($(CONFIG_NETIF_NIL_BUNDLE),y)
     42        LIBRARY = libnildummy
     43else
     44        BINARY = nildummy
     45endif
    3446
    3547SOURCES = \
  • uspace/srv/net/nil/nildummy/nildummy.c

    r24ab58b3 r14f1db0  
    2828
    2929/** @addtogroup nildummy
    30  *  @{
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  Dummy network interface layer module implementation.
    35  *  @see nildummy.h
     34 * Dummy network interface layer module implementation.
     35 * @see nildummy.h
    3636 */
    3737
     
    4141#include <stdio.h>
    4242#include <str.h>
    43 
    4443#include <ipc/ipc.h>
    4544#include <ipc/services.h>
     
    5453#include <adt/measured_strings.h>
    5554#include <packet/packet.h>
    56 #include <nil_module.h>
     55#include <packet_remote.h>
     56#include <nil_local.h>
    5757
    5858#include "nildummy.h"
    5959
    6060/** The module name.
     61 *
    6162 */
    6263#define NAME  "nildummy"
    6364
    6465/** Default maximum transmission unit.
    65  */
    66 #define NET_DEFAULT_MTU 1500
     66 *
     67 */
     68#define NET_DEFAULT_MTU  1500
    6769
    6870/** Network interface layer module global data.
    69  */
    70 nildummy_globals_t      nildummy_globals;
    71 
    72 /** @name Message processing functions
    73  */
    74 /*@{*/
    75 
    76 /** Processes IPC messages from the registered device driver modules in an infinite loop.
    77  *  @param[in] iid The message identifier.
    78  *  @param[in,out] icall The message parameters.
    79  */
    80 void nildummy_receiver(ipc_callid_t iid, ipc_call_t * icall);
    81 
    82 /** Registers new device or updates the MTU of an existing one.
    83  *  Determines the device local hardware address.
    84  *  @param[in] device_id The new device identifier.
    85  *  @param[in] service The device driver service.
    86  *  @param[in] mtu The device maximum transmission unit.
    87  *  @returns EOK on success.
    88  *  @returns EEXIST if the device with the different service exists.
    89  *  @returns ENOMEM if there is not enough memory left.
    90  *  @returns Other error codes as defined for the netif_bind_service() function.
    91  *  @returns Other error codes as defined for the netif_get_addr_req() function.
    92  */
    93 int nildummy_device_message(device_id_t device_id, services_t service, size_t mtu);
    94 
    95 /** Returns the device packet dimensions for sending.
    96  *  @param[in] device_id The device identifier.
    97  *  @param[out] addr_len The minimum reserved address length.
    98  *  @param[out] prefix The minimum reserved prefix size.
    99  *  @param[out] content The maximum content size.
    100  *  @param[out] suffix The minimum reserved suffix size.
    101  *  @returns EOK on success.
    102  *  @returns EBADMEM if either one of the parameters is NULL.
    103  *  @returns ENOENT if there is no such device.
    104  */
    105 int nildummy_packet_space_message(device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix);
    106 
    107 /** Registers receiving module service.
    108  *  Passes received packets for this service.
    109  *  @param[in] service The module service.
    110  *  @param[in] phone The service phone.
    111  *  @returns EOK on success.
    112  *  @returns ENOENT if the service is not known.
    113  *  @returns ENOMEM if there is not enough memory left.
    114  */
    115 int nildummy_register_message(services_t service, int phone);
    116 
    117 /** Sends the packet queue.
    118  *  @param[in] device_id The device identifier.
    119  *  @param[in] packet The packet queue.
    120  *  @param[in] sender The sending module service.
    121  *  @returns EOK on success.
    122  *  @returns ENOENT if there no such device.
    123  *  @returns EINVAL if the service parameter is not known.
    124  */
    125 int nildummy_send_message(device_id_t device_id, packet_t packet, services_t sender);
    126 
    127 /** Returns the device hardware address.
    128  *  @param[in] device_id The device identifier.
    129  *  @param[out] address The device hardware address.
    130  *  @returns EOK on success.
    131  *  @returns EBADMEM if the address parameter is NULL.
    132  *  @returns ENOENT if there no such device.
    133  */
    134 int nildummy_addr_message(device_id_t device_id, measured_string_ref * address);
    135 
    136 /*@}*/
    137 
    138 DEVICE_MAP_IMPLEMENT(nildummy_devices, nildummy_device_t)
    139 
    140 int nil_device_state_msg(int nil_phone, device_id_t device_id, int state){
     71 *
     72 */
     73nildummy_globals_t nildummy_globals;
     74
     75DEVICE_MAP_IMPLEMENT(nildummy_devices, nildummy_device_t);
     76
     77int nil_device_state_msg_local(int nil_phone, device_id_t device_id, int state)
     78{
    14179        fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
    142         if(nildummy_globals.proto.phone){
    143                 il_device_state_msg(nildummy_globals.proto.phone, device_id, state, nildummy_globals.proto.service);
    144         }
     80       
     81        if (nildummy_globals.proto.phone)
     82                il_device_state_msg(nildummy_globals.proto.phone, device_id, state,
     83                    nildummy_globals.proto.service);
     84       
    14585        fibril_rwlock_read_unlock(&nildummy_globals.protos_lock);
    146         return EOK;
    147 }
    148 
    149 int nil_initialize(int net_phone){
     86       
     87        return EOK;
     88}
     89
     90int nil_initialize(int net_phone)
     91{
    15092        ERROR_DECLARE;
    151 
     93       
    15294        fibril_rwlock_initialize(&nildummy_globals.devices_lock);
    15395        fibril_rwlock_initialize(&nildummy_globals.protos_lock);
    15496        fibril_rwlock_write_lock(&nildummy_globals.devices_lock);
    15597        fibril_rwlock_write_lock(&nildummy_globals.protos_lock);
     98       
    15699        nildummy_globals.net_phone = net_phone;
    157100        nildummy_globals.proto.phone = 0;
    158101        ERROR_PROPAGATE(nildummy_devices_initialize(&nildummy_globals.devices));
     102       
    159103        fibril_rwlock_write_unlock(&nildummy_globals.protos_lock);
    160104        fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
    161         return EOK;
    162 }
    163 
    164 int nildummy_device_message(device_id_t device_id, services_t service, size_t mtu){
     105       
     106        return EOK;
     107}
     108
     109/** Process IPC messages from the registered device driver modules in an infinite loop.
     110 *
     111 * @param[in]     iid   The message identifier.
     112 * @param[in,out] icall The message parameters.
     113 *
     114 */
     115static void nildummy_receiver(ipc_callid_t iid, ipc_call_t * icall){
     116        ERROR_DECLARE;
     117
     118        packet_t packet;
     119
     120        while(true){
     121                switch(IPC_GET_METHOD(*icall)){
     122                        case NET_NIL_DEVICE_STATE:
     123                                ERROR_CODE = nil_device_state_msg_local(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
     124                                ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
     125                                break;
     126                        case NET_NIL_RECEIVED:
     127                                if(! ERROR_OCCURRED(packet_translate_remote(nildummy_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
     128                                        ERROR_CODE = nil_received_msg_local(0, IPC_GET_DEVICE(icall), packet, 0);
     129                                }
     130                                ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
     131                                break;
     132                        default:
     133                                ipc_answer_0(iid, (ipcarg_t) ENOTSUP);
     134                }
     135                iid = async_get_call(icall);
     136        }
     137}
     138
     139/** Register new device or updates the MTU of an existing one.
     140 *
     141 * Determine the device local hardware address.
     142 *
     143 * @param[in] device_id The new device identifier.
     144 * @param[in] service   The device driver service.
     145 * @param[in] mtu       The device maximum transmission unit.
     146 *
     147 * @returns EOK on success.
     148 * @returns EEXIST if the device with the different service exists.
     149 * @returns ENOMEM if there is not enough memory left.
     150 * @returns Other error codes as defined for the netif_bind_service() function.
     151 * @returns Other error codes as defined for the netif_get_addr_req() function.
     152 *
     153 */
     154static int nildummy_device_message(device_id_t device_id, services_t service,
     155    size_t mtu)
     156{
    165157        ERROR_DECLARE;
    166158
     
    235227}
    236228
    237 int nildummy_addr_message(device_id_t device_id, measured_string_ref * address){
     229/** Return the device hardware address.
     230 *
     231 * @param[in]  device_id The device identifier.
     232 * @param[out] address   The device hardware address.
     233 *
     234 * @return EOK on success.
     235 * @return EBADMEM if the address parameter is NULL.
     236 * @return ENOENT if there no such device.
     237 *
     238 */
     239static int nildummy_addr_message(device_id_t device_id,
     240    measured_string_ref *address)
     241{
    238242        nildummy_device_ref device;
    239243
     
    252256}
    253257
    254 int nildummy_packet_space_message(device_id_t device_id, size_t * addr_len, size_t * prefix, size_t * content, size_t * suffix){
     258/** Return the device packet dimensions for sending.
     259 *
     260 * @param[in]  device_id The device identifier.
     261 * @param[out] addr_len  The minimum reserved address length.
     262 * @param[out] prefix    The minimum reserved prefix size.
     263 * @param[out] content   The maximum content size.
     264 * @param[out] suffix    The minimum reserved suffix size.
     265 *
     266 * @return EOK on success.
     267 * @return EBADMEM if either one of the parameters is NULL.
     268 * @return ENOENT if there is no such device.
     269 *
     270 */
     271static int nildummy_packet_space_message(device_id_t device_id,
     272    size_t *addr_len, size_t *prefix, size_t *content, size_t *suffix)
     273{
    255274        nildummy_device_ref device;
    256275
     
    272291}
    273292
    274 int nil_received_msg(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
     293int nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet, services_t target){
    275294        packet_t next;
    276295
     
    287306}
    288307
    289 int nildummy_register_message(services_t service, int phone){
     308/** Register receiving module service.
     309 *
     310 * Pass received packets for this service.
     311 *
     312 * @param[in] service The module service.
     313 * @param[in] phone   The service phone.
     314 *
     315 * @return EOK on success.
     316 * @return ENOENT if the service is not known.
     317 * @return ENOMEM if there is not enough memory left.
     318 *
     319 */
     320static int nildummy_register_message(services_t service, int phone)
     321{
    290322        fibril_rwlock_write_lock(&nildummy_globals.protos_lock);
    291323        nildummy_globals.proto.service = service;
     
    299331}
    300332
    301 int nildummy_send_message(device_id_t device_id, packet_t packet, services_t sender){
     333/** Send the packet queue.
     334 *
     335 * @param[in] device_id The device identifier.
     336 * @param[in] packet    The packet queue.
     337 * @param[in] sender    The sending module service.
     338 *
     339 * @return EOK on success.
     340 * @return ENOENT if there no such device.
     341 * @return EINVAL if the service parameter is not known.
     342 *
     343 */
     344static int nildummy_send_message(device_id_t device_id, packet_t packet,
     345    services_t sender)
     346{
    302347        nildummy_device_ref device;
    303348
     
    316361}
    317362
    318 int nil_message(const char *name, ipc_callid_t callid, ipc_call_t *call,
     363int nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
    319364    ipc_call_t *answer, int *answer_count)
    320365{
     
    336381                            IPC_GET_SERVICE(call), IPC_GET_MTU(call));
    337382                case NET_NIL_SEND:
    338                         ERROR_PROPAGATE(packet_translate(nildummy_globals.net_phone,
     383                        ERROR_PROPAGATE(packet_translate_remote(nildummy_globals.net_phone,
    339384                            &packet, IPC_GET_PACKET(call)));
    340385                        return nildummy_send_message(IPC_GET_DEVICE(call), packet,
     
    353398                            &address));
    354399                        return measured_strings_reply(address, 1);
     400                case NET_NIL_BROADCAST_ADDR:
     401                        ERROR_PROPAGATE(nildummy_addr_message(IPC_GET_DEVICE(call),
     402                            &address));
     403                        return measured_strings_reply(address, 1);
    355404                case IPC_M_CONNECT_TO_ME:
    356405                        return nildummy_register_message(NIL_GET_PROTO(call),
     
    361410}
    362411
    363 void nildummy_receiver(ipc_callid_t iid, ipc_call_t * icall){
    364         ERROR_DECLARE;
    365 
    366         packet_t packet;
    367 
    368         while(true){
    369 //              printf("message %d - %d\n", IPC_GET_METHOD(*icall), NET_NIL_FIRST);
    370                 switch(IPC_GET_METHOD(*icall)){
    371                         case NET_NIL_DEVICE_STATE:
    372                                 ERROR_CODE = nil_device_state_msg(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));
    373                                 ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
    374                                 break;
    375                         case NET_NIL_RECEIVED:
    376                                 if(! ERROR_OCCURRED(packet_translate(nildummy_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){
    377                                         ERROR_CODE = nil_received_msg(0, IPC_GET_DEVICE(icall), packet, 0);
    378                                 }
    379                                 ipc_answer_0(iid, (ipcarg_t) ERROR_CODE);
    380                                 break;
    381                         default:
    382                                 ipc_answer_0(iid, (ipcarg_t) ENOTSUP);
    383                 }
    384                 iid = async_get_call(icall);
    385         }
    386 }
    387 
    388 #ifdef CONFIG_NETWORKING_modular
    389 
    390 #include <nil_standalone.h>
     412#ifndef CONFIG_NETIF_NIL_BUNDLE
    391413
    392414/** Default thread for new connections.
    393415 *
    394  *  @param[in] iid The initial message identifier.
    395  *  @param[in] icall The initial message call structure.
    396  *
    397  */
    398 static void nil_client_connection(ipc_callid_t iid, ipc_call_t * icall)
     416 * @param[in] iid  The initial message identifier.
     417 * @param[in] icall The initial message call structure.
     418 *
     419 */
     420static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    399421{
    400422        /*
     
    416438               
    417439                /* Process the message */
    418                 int res = nil_module_message(NAME, callid, &call, &answer,
     440                int res = nil_module_message_standalone(NAME, callid, &call, &answer,
    419441                    &answer_count);
    420442               
     
    428450}
    429451
    430 /** Starts the module.
    431  *
    432  *  @param argc The count of the command line arguments. Ignored parameter.
    433  *  @param argv The command line parameters. Ignored parameter.
    434  *
    435  *  @returns EOK on success.
    436  *  @returns Other error codes as defined for each specific module start function.
    437  *
    438  */
    439452int main(int argc, char *argv[])
    440453{
     
    442455       
    443456        /* Start the module */
    444         if (ERROR_OCCURRED(nil_module_start(nil_client_connection)))
     457        if (ERROR_OCCURRED(nil_module_start_standalone(nil_client_connection)))
    445458                return ERROR_CODE;
    446459       
     
    448461}
    449462
    450 #endif /* CONFIG_NETWORKING_modular */
     463#endif /* CONFIG_NETIF_NIL_BUNDLE */
    451464
    452465/** @}
  • uspace/srv/net/nil/nildummy/nildummy_module.c

    r24ab58b3 r14f1db0  
    4646#include <net_interface.h>
    4747#include <packet/packet.h>
    48 #include <nil_module.h>
    49 #include <nil_standalone.h>
     48#include <nil_local.h>
    5049
    5150#include "nildummy.h"
     
    6766 *
    6867 */
    69 int nil_module_start(async_client_conn_t client_connection)
     68int nil_module_start_standalone(async_client_conn_t client_connection)
    7069{
    7170        ERROR_DECLARE;
     
    103102 *
    104103 */
    105 int nil_module_message(const char *name, ipc_callid_t callid,
     104int nil_module_message_standalone(const char *name, ipc_callid_t callid,
    106105    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
    107106{
    108         return nil_message(name, callid, call, answer, answer_count);
     107        return nil_message_standalone(name, callid, call, answer, answer_count);
    109108}
    110109
  • 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.