Changeset efedee77 in mainline for uspace/lib/net/include/generic.h


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 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/include/generic.h

    raab02fb refedee77  
    2727 */
    2828
    29 /** @addtogroup icmp
    30  *  @{
     29/** @addtogroup libnet
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  ICMP application interface implementation.
    35  *  @see icmp_api.h
     34 * Generic communication interfaces for networking.
    3635 */
    3736
     37#ifndef LIBNET_GENERIC_H_
     38#define LIBNET_GENERIC_H_
     39
    3840#include <async.h>
    39 
    4041#include <ipc/ipc.h>
    4142#include <ipc/services.h>
    4243
    43 #include <sys/types.h>
     44#include <net/device.h>
     45#include <adt/measured_strings.h>
     46#include <net/packet.h>
    4447
    45 #include <net_modules.h>
    46 #include <icmp_api.h>
    47 #include <inet.h>
    48 #include <ip_codes.h>
    49 #include <socket_codes.h>
    50 #include <icmp_messages.h>
     48extern int generic_device_state_msg_remote(int, int, device_id_t, int,
     49    services_t);
     50extern int generic_device_req_remote(int, int, device_id_t, int, services_t);
     51extern int generic_get_addr_req(int, int, device_id_t, measured_string_ref *,
     52    char **);
     53extern int generic_packet_size_req_remote(int, int, device_id_t,
     54    packet_dimension_ref);
     55extern int generic_received_msg_remote(int, int, device_id_t, packet_id_t,
     56    services_t, services_t);
     57extern int generic_send_msg_remote(int, int, device_id_t, packet_id_t,
     58    services_t, services_t);
     59extern int generic_translate_req(int, int, device_id_t, services_t,
     60    measured_string_ref, size_t, measured_string_ref *, char **);
    5161
    52 int icmp_echo_msg(int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr * addr, socklen_t addrlen){
    53         aid_t message_id;
    54         ipcarg_t result;
    55 
    56         if(addrlen <= 0){
    57                 return EINVAL;
    58         }
    59         message_id = async_send_5(icmp_phone, NET_ICMP_ECHO, size, timeout, ttl, tos, (ipcarg_t) dont_fragment, NULL);
    60         // send the address
    61         async_data_write_start(icmp_phone, addr, (size_t) addrlen);
    62         // timeout version may cause inconsistency - there is also an inner timer
    63         // return async_wait_timeout(message_id, &result, timeout);
    64         async_wait_for(message_id, &result);
    65         return (int) result;
    66 }
     62#endif
    6763
    6864/** @}
Note: See TracChangeset for help on using the changeset viewer.