Changeset 774e6d1a in mainline for uspace/srv/net/tl/icmp/icmp.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/tl/icmp/icmp.c

    r3c106e88 r774e6d1a  
    696696        case NET_ICMP_DEST_UNREACH:
    697697                rc = packet_translate_remote(icmp_globals.net_phone, &packet,
    698                     IPC_GET_PACKET(call));
     698                    IPC_GET_PACKET(*call));
    699699                if (rc != EOK)
    700700                        return rc;
    701701                return icmp_destination_unreachable_msg_local(0,
    702                     ICMP_GET_CODE(call), ICMP_GET_MTU(call), packet);
     702                    ICMP_GET_CODE(*call), ICMP_GET_MTU(*call), packet);
    703703        case NET_ICMP_SOURCE_QUENCH:
    704704                rc = packet_translate_remote(icmp_globals.net_phone, &packet,
    705                     IPC_GET_PACKET(call));
     705                    IPC_GET_PACKET(*call));
    706706                if (rc != EOK)
    707707                        return rc;
     
    709709        case NET_ICMP_TIME_EXCEEDED:
    710710                rc = packet_translate_remote(icmp_globals.net_phone, &packet,
    711                     IPC_GET_PACKET(call));
     711                    IPC_GET_PACKET(*call));
    712712                if (rc != EOK)
    713713                        return rc;
    714                 return icmp_time_exceeded_msg_local(0, ICMP_GET_CODE(call),
     714                return icmp_time_exceeded_msg_local(0, ICMP_GET_CODE(*call),
    715715                    packet);
    716716        case NET_ICMP_PARAMETERPROB:
    717717                rc = packet_translate_remote(icmp_globals.net_phone, &packet,
    718                     IPC_GET_PACKET(call));
     718                    IPC_GET_PACKET(*call));
    719719                if (rc != EOK)
    720720                        return rc;
    721                 return icmp_parameter_problem_msg_local(0, ICMP_GET_CODE(call),
    722                     ICMP_GET_POINTER(call), packet);
     721                return icmp_parameter_problem_msg_local(0, ICMP_GET_CODE(*call),
     722                    ICMP_GET_POINTER(*call), packet);
    723723        default:
    724724                return ENOTSUP;
     
    787787        bool keep_on_going = true;
    788788        ipc_call_t answer;
    789         int answer_count;
     789        size_t answer_count;
    790790        size_t length;
    791791        struct sockaddr *addr;
     
    894894 */
    895895int icmp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
    896     ipc_call_t *answer, int *answer_count)
     896    ipc_call_t *answer, size_t *answer_count)
    897897{
    898898        packet_t *packet;
     
    903903        case NET_TL_RECEIVED:
    904904                rc = packet_translate_remote(icmp_globals.net_phone, &packet,
    905                     IPC_GET_PACKET(call));
     905                    IPC_GET_PACKET(*call));
    906906                if (rc != EOK)
    907907                        return rc;
    908                 return icmp_received_msg_local(IPC_GET_DEVICE(call), packet,
    909                     SERVICE_ICMP, IPC_GET_ERROR(call));
     908                return icmp_received_msg_local(IPC_GET_DEVICE(*call), packet,
     909                    SERVICE_ICMP, IPC_GET_ERROR(*call));
    910910       
    911911        case NET_ICMP_INIT:
    912                 return icmp_process_client_messages(callid, * call);
     912                return icmp_process_client_messages(callid, *call);
    913913       
    914914        default:
     
    936936        while (true) {
    937937                ipc_call_t answer;
    938                 int answer_count;
     938                size_t answer_count;
    939939               
    940940                /* Clear the answer structure */
Note: See TracChangeset for help on using the changeset viewer.