Changeset 14f1db0 in mainline for uspace/srv/net/il/arp/arp.c


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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.