Changeset efedee77 in mainline for uspace/srv/net/tl/icmp/icmp.c


Ignore:
Timestamp:
2010-11-02T22:38:46Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af894a21
Parents:
aab02fb (diff), e06ef614 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    raab02fb refedee77  
    4444#include <ipc/ipc.h>
    4545#include <ipc/services.h>
     46#include <ipc/net.h>
     47#include <ipc/tl.h>
     48#include <ipc/icmp.h>
    4649#include <sys/time.h>
    4750#include <sys/types.h>
    48 
    49 #include <net_err.h>
    50 #include <net_messages.h>
    51 #include <net_modules.h>
    52 #include <packet/packet_client.h>
     51#include <byteorder.h>
     52#include <errno.h>
     53#include <err.h>
     54
     55#include <net/socket_codes.h>
     56#include <net/ip_protocols.h>
     57#include <net/inet.h>
     58
     59#include <net/modules.h>
     60#include <packet_client.h>
    5361#include <packet_remote.h>
    54 #include <net_byteorder.h>
    5562#include <net_checksum.h>
    56 #include <icmp_api.h>
     63#include <net/icmp_api.h>
    5764#include <icmp_client.h>
    58 #include <icmp_codes.h>
    59 #include <icmp_common.h>
     65#include <net/icmp_codes.h>
     66#include <net/icmp_common.h>
    6067#include <icmp_interface.h>
    6168#include <il_interface.h>
    62 #include <inet.h>
    6369#include <ip_client.h>
    6470#include <ip_interface.h>
    65 #include <ip_protocols.h>
    6671#include <net_interface.h>
    67 #include <socket_codes.h>
    68 #include <socket_errno.h>
    69 #include <tl_messages.h>
    7072#include <tl_interface.h>
    7173#include <tl_local.h>
    72 #include <icmp_messages.h>
    7374#include <icmp_header.h>
    7475
     
    448449}
    449450
    450 int icmp_connect_module(services_t service, suseconds_t timeout){
    451         icmp_echo_ref echo_data;
    452         icmp_param_t id;
    453         int index;
    454 
    455         echo_data = (icmp_echo_ref) malloc(sizeof(*echo_data));
    456         if(! echo_data){
    457                 return ENOMEM;
    458         }
    459         // assign a new identifier
    460         fibril_rwlock_write_lock(&icmp_globals.lock);
    461         index = icmp_bind_free_id(echo_data);
    462         if(index < 0){
    463                 free(echo_data);
    464                 fibril_rwlock_write_unlock(&icmp_globals.lock);
    465                 return index;
    466         }else{
    467                 id = echo_data->identifier;
    468                 fibril_rwlock_write_unlock(&icmp_globals.lock);
    469                 // return the echo data identifier as the ICMP phone
    470                 return id;
    471         }
    472 }
    473 
    474451int icmp_initialize(async_client_conn_t client_connection){
    475452        ERROR_DECLARE;
     
    484461        icmp_replies_initialize(&icmp_globals.replies);
    485462        icmp_echo_data_initialize(&icmp_globals.echo_data);
    486         icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection, icmp_received_msg);
     463        icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection);
    487464        if(icmp_globals.ip_phone < 0){
    488465                return icmp_globals.ip_phone;
Note: See TracChangeset for help on using the changeset viewer.