Changeset 774e6d1a in mainline for uspace/srv/net/il/arp/arp.c


Ignore:
Timestamp:
2011-01-09T23:24:53Z (13 years ago)
Author:
martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4b86dac
Parents:
3c106e88
Message:

partial networking stack overhaul

  • a lot of coding style changes (comments, indentation, etc.)
  • convert several ints to unsigned ints or size_t values
  • streamline many of the IPC-related macros (they no longer dereference the call structure by themselves)
  • get rid of netif_interface.h (containing only aliases for remote functions and not serving any purpose)
  • rename netif_local.{c|h} to netif_skel.{c|h} (it is really just a skeleton)
  • drop the "_remote" and "_standalone" suffixes from most of the netif_ functions (they do not serve any purpose anymore)
  • implement netif_client_connection() as a common framework function for all netif modules
    • update the lo module accordingly
  • ip module now reports the default gateway to the user whenever it is being set
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/arp/arp.c

    r3c106e88 r774e6d1a  
    457457        uint8_t *des_proto;
    458458        int rc;
    459 
     459       
    460460        length = packet_get_data_length(packet);
    461461        if (length <= sizeof(arp_header_t))
     
    677677int
    678678arp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
    679     ipc_call_t *answer, int *answer_count)
     679    ipc_call_t *answer, size_t *answer_count)
    680680{
    681681        measured_string_t *address;
     
    696696                        return rc;
    697697               
    698                 rc = arp_device_message(IPC_GET_DEVICE(call),
    699                     IPC_GET_SERVICE(call), ARP_GET_NETIF(call), address);
     698                rc = arp_device_message(IPC_GET_DEVICE(*call),
     699                    IPC_GET_SERVICE(*call), ARP_GET_NETIF(*call), address);
    700700                if (rc != EOK) {
    701701                        free(address);
     
    710710               
    711711                fibril_mutex_lock(&arp_globals.lock);
    712                 rc = arp_translate_message(IPC_GET_DEVICE(call),
    713                     IPC_GET_SERVICE(call), address, &translation);
     712                rc = arp_translate_message(IPC_GET_DEVICE(*call),
     713                    IPC_GET_SERVICE(*call), address, &translation);
    714714                free(address);
    715715                free(data);
     
    727727
    728728        case NET_ARP_CLEAR_DEVICE:
    729                 return arp_clear_device_req(0, IPC_GET_DEVICE(call));
     729                return arp_clear_device_req(0, IPC_GET_DEVICE(*call));
    730730
    731731        case NET_ARP_CLEAR_ADDRESS:
     
    734734                        return rc;
    735735               
    736                 arp_clear_address_req(0, IPC_GET_DEVICE(call),
    737                     IPC_GET_SERVICE(call), address);
     736                arp_clear_address_req(0, IPC_GET_DEVICE(*call),
     737                    IPC_GET_SERVICE(*call), address);
    738738                free(address);
    739739                free(data);
     
    750750               
    751751                rc = packet_translate_remote(arp_globals.net_phone, &packet,
    752                     IPC_GET_PACKET(call));
     752                    IPC_GET_PACKET(*call));
    753753                if (rc != EOK)
    754754                        return rc;
     
    757757                do {
    758758                        next = pq_detach(packet);
    759                         rc = arp_receive_message(IPC_GET_DEVICE(call), packet);
     759                        rc = arp_receive_message(IPC_GET_DEVICE(*call), packet);
    760760                        if (rc != 1) {
    761761                                pq_release_remote(arp_globals.net_phone,
     
    769769       
    770770        case NET_IL_MTU_CHANGED:
    771                 return arp_mtu_changed_message(IPC_GET_DEVICE(call),
    772                     IPC_GET_MTU(call));
     771                return arp_mtu_changed_message(IPC_GET_DEVICE(*call),
     772                    IPC_GET_MTU(*call));
    773773        }
    774774       
     
    791791        while (true) {
    792792                ipc_call_t answer;
    793                 int answer_count;
     793                size_t count;
    794794               
    795795                /* Clear the answer structure */
    796                 refresh_answer(&answer, &answer_count);
     796                refresh_answer(&answer, &count);
    797797               
    798798                /* Fetch the next message */
     
    802802                /* Process the message */
    803803                int res = il_module_message_standalone(callid, &call, &answer,
    804                     &answer_count);
     804                    &count);
    805805               
    806806                /*
     
    813813               
    814814                /* Answer the message */
    815                 answer_call(callid, res, &answer, answer_count);
     815                answer_call(callid, res, &answer, count);
    816816        }
    817817}
Note: See TracChangeset for help on using the changeset viewer.