Changeset 10056483 in mainline for uspace/srv


Ignore:
Timestamp:
2010-10-13T22:48:25Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef689ef0
Parents:
b278b4e (diff), 753bca3 (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 from lp:~jakub/helenos/net.

Location:
uspace/srv/net
Files:
6 edited

Legend:

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

    rb278b4e r10056483  
    227227        printf("Device %d cleared\n", device_id);
    228228        fibril_rwlock_write_unlock(&arp_globals.lock);
    229         return EOK;
    230 }
    231 
    232 int arp_connect_module(services_t service){
    233         if(service != SERVICE_ARP){
    234                 return EINVAL;
    235         }
    236229        return EOK;
    237230}
     
    603596        nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
    604597        return NULL;
    605 }
    606 
    607 int arp_translate_req(int arp_phone, device_id_t device_id, services_t protocol, measured_string_ref address, measured_string_ref * translation, char ** data){
    608         measured_string_ref tmp;
    609 
    610         fibril_rwlock_read_lock(&arp_globals.lock);
    611         tmp = arp_translate_message(device_id, protocol, address);
    612         if(tmp){
    613                 *translation = measured_string_copy(tmp);
    614                 fibril_rwlock_read_unlock(&arp_globals.lock);
    615                 if(*translation){
    616                         *data = (** translation).value;
    617                         return EOK;
    618                 }else{
    619                         return ENOMEM;
    620                 }
    621         }else{
    622                 fibril_rwlock_read_unlock(&arp_globals.lock);
    623                 return ENOENT;
    624         }
    625598}
    626599
  • uspace/srv/net/il/ip/ip.c

    rb278b4e r10056483  
    5858#include <net_device.h>
    5959#include <icmp_client.h>
    60 #include <icmp_codes.h>
     60#include <net/icmp_codes.h>
    6161#include <icmp_interface.h>
    6262#include <il_interface.h>
     
    618618        printf("%s: Device %d changed state to %d\n", NAME, device_id, state);
    619619        fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
    620         return EOK;
    621 }
    622 
    623 int ip_connect_module(services_t service){
    624620        return EOK;
    625621}
  • uspace/srv/net/tl/icmp/icmp.c

    rb278b4e r10056483  
    4444#include <ipc/ipc.h>
    4545#include <ipc/services.h>
     46#include <ipc/icmp.h>
    4647#include <sys/time.h>
    4748#include <sys/types.h>
     
    5960#include <packet_remote.h>
    6061#include <net_checksum.h>
    61 #include <icmp_api.h>
     62#include <net/icmp_api.h>
    6263#include <icmp_client.h>
    63 #include <icmp_codes.h>
    64 #include <icmp_common.h>
     64#include <net/icmp_codes.h>
     65#include <net/icmp_common.h>
    6566#include <icmp_interface.h>
    6667#include <il_interface.h>
     
    7172#include <tl_interface.h>
    7273#include <tl_local.h>
    73 #include <icmp_messages.h>
    7474#include <icmp_header.h>
    7575
     
    449449}
    450450
    451 int icmp_connect_module(services_t service, suseconds_t timeout){
    452         icmp_echo_ref echo_data;
    453         icmp_param_t id;
    454         int index;
    455 
    456         echo_data = (icmp_echo_ref) malloc(sizeof(*echo_data));
    457         if(! echo_data){
    458                 return ENOMEM;
    459         }
    460         // assign a new identifier
    461         fibril_rwlock_write_lock(&icmp_globals.lock);
    462         index = icmp_bind_free_id(echo_data);
    463         if(index < 0){
    464                 free(echo_data);
    465                 fibril_rwlock_write_unlock(&icmp_globals.lock);
    466                 return index;
    467         }else{
    468                 id = echo_data->identifier;
    469                 fibril_rwlock_write_unlock(&icmp_globals.lock);
    470                 // return the echo data identifier as the ICMP phone
    471                 return id;
    472         }
    473 }
    474 
    475451int icmp_initialize(async_client_conn_t client_connection){
    476452        ERROR_DECLARE;
     
    485461        icmp_replies_initialize(&icmp_globals.replies);
    486462        icmp_echo_data_initialize(&icmp_globals.echo_data);
    487         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);
    488464        if(icmp_globals.ip_phone < 0){
    489465                return icmp_globals.ip_phone;
  • uspace/srv/net/tl/icmp/icmp.h

    rb278b4e r10056483  
    4040#include <fibril_synch.h>
    4141
    42 #include <icmp_codes.h>
     42#include <net/icmp_codes.h>
    4343#include <adt/int_map.h>
    4444#include <icmp_header.h>
     
    6767
    6868/** Echo specific data map.
    69  *  The bundle module gets an identifier of the assigned echo specific data while connecting.
    7069 *  The identifier is used in the future semi-remote calls instead of the ICMP phone.
    7170 */
  • uspace/srv/net/tl/tcp/tcp.c

    rb278b4e r10056483  
    260260            ICMP_CONNECT_TIMEOUT);
    261261        tcp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_TCP,
    262             SERVICE_TCP, client_connection, tcp_received_msg);
     262            SERVICE_TCP, client_connection);
    263263        if (tcp_globals.ip_phone < 0)
    264264                return tcp_globals.ip_phone;
  • uspace/srv/net/tl/udp/udp.c

    rb278b4e r10056483  
    241241            ICMP_CONNECT_TIMEOUT);
    242242        udp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_UDP,
    243             SERVICE_UDP, client_connection, udp_received_msg);
     243            SERVICE_UDP, client_connection);
    244244        if (udp_globals.ip_phone < 0)
    245245                return udp_globals.ip_phone;
Note: See TracChangeset for help on using the changeset viewer.