Changes in / [10056483:b278b4e] in mainline


Ignore:
Location:
uspace
Files:
7 added
7 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/netecho/print_error.c

    r10056483 rb278b4e  
    3838#include <errno.h>
    3939
    40 #include <net/icmp_codes.h>
     40#include <icmp_codes.h>
    4141
    4242#include "print_error.h"
  • uspace/app/ping/ping.c

    r10056483 rb278b4e  
    4545#include <arg_parse.h>
    4646
    47 #include <net/icmp_api.h>
     47#include <icmp_api.h>
    4848#include <net/in.h>
    4949#include <net/in6.h>
    5050#include <net/inet.h>
    5151#include <net/socket_parse.h>
    52 #include <net/ip_codes.h>
     52#include <ip_codes.h>
    5353
    5454#include "print_error.h"
  • uspace/lib/c/Makefile

    r10056483 rb278b4e  
    100100        generic/vfs/canonify.c \
    101101        generic/net/inet.c \
    102         generic/net/icmp_common.c \
    103         generic/net/icmp_api.c \
    104102        generic/net/modules.c \
    105103        generic/net/packet.c \
  • uspace/lib/c/include/sys/time.h

    r10056483 rb278b4e  
    4343typedef long suseconds_t;
    4444
    45 typedef uint32_t useconds_t;
    46 typedef uint32_t mseconds_t;
    47 
    4845struct timeval {
    4946        time_t tv_sec;        /* seconds */
  • uspace/lib/c/include/unistd.h

    r10056483 rb278b4e  
    3737
    3838#include <sys/types.h>
    39 #include <time.h>
    4039#include <libarch/config.h>
    4140
     
    5756        #define SEEK_END  2
    5857#endif
     58
     59typedef uint32_t useconds_t;
    5960
    6061extern int dup2(int oldfd, int newfd);
  • uspace/lib/net/il/ip_remote.c

    r10056483 rb278b4e  
    7272
    7373int ip_bind_service(services_t service, int protocol, services_t me,
    74     async_client_conn_t receiver)
     74    async_client_conn_t receiver, tl_received_msg_t tl_received_msg)
    7575{
    7676        return (int) bind_service(service, (ipcarg_t) protocol, me, service,
  • uspace/lib/net/include/icmp_client.h

    r10056483 rb278b4e  
    3838#define __NET_ICMP_CLIENT_H__
    3939
    40 #include <net/icmp_codes.h>
     40#include <icmp_codes.h>
    4141#include <net/packet.h>
    4242
  • uspace/lib/net/include/icmp_header.h

    r10056483 rb278b4e  
    4242
    4343#include <net/in.h>
    44 #include <net/icmp_codes.h>
     44#include <icmp_codes.h>
    4545
    4646/** ICMP header size in bytes.
  • uspace/lib/net/include/icmp_interface.h

    r10056483 rb278b4e  
    4141#include <net/packet.h>
    4242#include <net/inet.h>
    43 #include <net/ip_codes.h>
    44 #include <net/icmp_codes.h>
    45 #include <net/icmp_common.h>
     43#include <ip_codes.h>
     44#include <icmp_codes.h>
     45#include <icmp_common.h>
    4646
    4747/** @name ICMP module interface
  • uspace/lib/net/include/ip_client.h

    r10056483 rb278b4e  
    4242
    4343#include <net/packet.h>
    44 #include <net/ip_codes.h>
     44#include <ip_codes.h>
    4545#include <ip_interface.h>
    4646
  • uspace/lib/net/include/ip_interface.h

    r10056483 rb278b4e  
    4242
    4343#include <net/in.h>
    44 #include <net/ip_codes.h>
     44#include <ip_codes.h>
    4545
    4646#include <ip_remote.h>
     
    7474 *  @param[in] me The requesting module service.
    7575 *  @param[in] receiver The message receiver. Used for remote connection.
     76 *  @param[in] tl_received_msg The message processing function. Used if bundled together.
    7677 *  @returns The phone of the needed service.
    7778 *  @returns EOK on success.
    7879 *  @returns Other error codes as defined for the bind_service() function.
    7980 */
    80 extern int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver);
     81extern int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg);
    8182
    8283/** Connects to the IP module.
  • uspace/lib/net/include/ip_local.h

    r10056483 rb278b4e  
    3737#include <ipc/services.h>
    3838
    39 #include <net/ip_codes.h>
     39#include <ip_codes.h>
    4040#include <net/inet.h>
    4141#include <net/in.h>
  • uspace/lib/net/include/ip_messages.h

    r10056483 rb278b4e  
    4343
    4444#include <net/in.h>
    45 #include <net/ip_codes.h>
     45#include <ip_codes.h>
    4646
    4747/** IP module messages.
  • uspace/lib/net/include/ip_remote.h

    r10056483 rb278b4e  
    3737#include <ipc/services.h>
    3838
    39 #include <net/ip_codes.h>
     39#include <ip_codes.h>
    4040#include <net/inet.h>
    4141#include <net/in.h>
  • uspace/lib/net/netif/netif_local.c

    r10056483 rb278b4e  
    228228       
    229229        return ERROR_CODE;
     230}
     231
     232/** Create bidirectional connection with the network interface module and registers the message receiver.
     233 *
     234 * @param[in] service   The network interface module service.
     235 * @param[in] device_id The device identifier.
     236 * @param[in] me        The requesting module service.
     237 * @param[in] receiver  The message receiver.
     238 *
     239 * @return The phone of the needed service.
     240 * @return EOK on success.
     241 * @return Other error codes as defined for the bind_service() function.
     242 *
     243 */
     244int netif_bind_service_local(services_t service, device_id_t device_id,
     245    services_t me, async_client_conn_t receiver)
     246{
     247        return EOK;
    230248}
    231249
  • uspace/lib/net/netif/netif_remote.c

    r10056483 rb278b4e  
    9191}
    9292
    93 /** Create bidirectional connection with the network interface module and
    94  * registers the message receiver.
    95  *
    96  * @param[in] service   The network interface module service.
    97  * @param[in] device_id The device identifier.
    98  * @param[in] me        The requesting module service.
    99  * @param[in] receiver  The message receiver.
    100  *
    101  * @return The phone of the needed service.
    102  * @return EOK on success.
    103  * @return Other error codes as defined for the bind_service() function.
    104  *
    105  */
    10693int netif_bind_service_remote(services_t service, device_id_t device_id, services_t me,
    10794    async_client_conn_t receiver)
  • uspace/lib/net/tl/icmp_client.c

    r10056483 rb278b4e  
    4343#include <sys/types.h>
    4444
    45 #include <net/icmp_codes.h>
     45#include <icmp_codes.h>
    4646#include <icmp_client.h>
    4747#include <net/packet.h>
  • uspace/lib/net/tl/icmp_remote.c

    r10056483 rb278b4e  
    4040#include <ipc/ipc.h>
    4141#include <ipc/services.h>
    42 #include <ipc/icmp.h>
    4342#include <sys/types.h>
    4443
     
    4746#include <icmp_interface.h>
    4847#include <packet_client.h>
     48#include <icmp_messages.h>
    4949
    5050int icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, icmp_param_t mtu, packet_t packet){
  • uspace/lib/socket/Makefile

    r10056483 rb278b4e  
    3333
    3434SOURCES = \
     35        generic/icmp_common.c \
     36        generic/icmp_api.c \
    3537        packet/packet_server.c
    3638
  • uspace/srv/net/il/arp/arp.c

    r10056483 rb278b4e  
    227227        printf("Device %d cleared\n", device_id);
    228228        fibril_rwlock_write_unlock(&arp_globals.lock);
     229        return EOK;
     230}
     231
     232int arp_connect_module(services_t service){
     233        if(service != SERVICE_ARP){
     234                return EINVAL;
     235        }
    229236        return EOK;
    230237}
     
    596603        nil_send_msg(device->phone, device_id, packet, SERVICE_ARP);
    597604        return NULL;
     605}
     606
     607int 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        }
    598625}
    599626
  • uspace/srv/net/il/ip/ip.c

    r10056483 rb278b4e  
    5858#include <net_device.h>
    5959#include <icmp_client.h>
    60 #include <net/icmp_codes.h>
     60#include <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
     623int ip_connect_module(services_t service){
    620624        return EOK;
    621625}
  • uspace/srv/net/tl/icmp/icmp.c

    r10056483 rb278b4e  
    4444#include <ipc/ipc.h>
    4545#include <ipc/services.h>
    46 #include <ipc/icmp.h>
    4746#include <sys/time.h>
    4847#include <sys/types.h>
     
    6059#include <packet_remote.h>
    6160#include <net_checksum.h>
    62 #include <net/icmp_api.h>
     61#include <icmp_api.h>
    6362#include <icmp_client.h>
    64 #include <net/icmp_codes.h>
    65 #include <net/icmp_common.h>
     63#include <icmp_codes.h>
     64#include <icmp_common.h>
    6665#include <icmp_interface.h>
    6766#include <il_interface.h>
     
    7271#include <tl_interface.h>
    7372#include <tl_local.h>
     73#include <icmp_messages.h>
    7474#include <icmp_header.h>
    7575
     
    449449}
    450450
     451int 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
    451475int icmp_initialize(async_client_conn_t client_connection){
    452476        ERROR_DECLARE;
     
    461485        icmp_replies_initialize(&icmp_globals.replies);
    462486        icmp_echo_data_initialize(&icmp_globals.echo_data);
    463         icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection);
     487        icmp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, client_connection, icmp_received_msg);
    464488        if(icmp_globals.ip_phone < 0){
    465489                return icmp_globals.ip_phone;
  • uspace/srv/net/tl/icmp/icmp.h

    r10056483 rb278b4e  
    4040#include <fibril_synch.h>
    4141
    42 #include <net/icmp_codes.h>
     42#include <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.
    6970 *  The identifier is used in the future semi-remote calls instead of the ICMP phone.
    7071 */
  • uspace/srv/net/tl/tcp/tcp.c

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

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