Ignore:
Timestamp:
2010-04-23T21:42:26Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c39a907
Parents:
38aaacc2 (diff), 80badbe (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/lib/net/include/ip_interface.h

    r38aaacc2 rf4f866c  
    3131 */
    3232
    33 /** @file
    34  *  IP module interface.
    35  *  The same interface is used for standalone remote modules as well as for bundle modules.
    36  *  The standalone remote modules have to be compiled with the ip_remote.c source file.
    37  *  The bundle modules with the ip.c source file.
    38  */
    39 
    4033#ifndef __NET_IP_INTERFACE_H__
    4134#define __NET_IP_INTERFACE_H__
     
    5144#include <socket_codes.h>
    5245
     46#ifdef CONFIG_IL_TL_BUNDLE
     47
     48#include <ip_local.h>
     49
     50#define ip_received_error_msg  ip_received_error_msg_local
     51#define ip_set_gateway_req     ip_set_gateway_req_local
     52#define ip_packet_size_req     ip_packet_size_req_local
     53#define ip_device_req          ip_device_req_local
     54#define ip_add_route_req       ip_add_route_req_local
     55#define ip_send_msg            ip_send_msg_local
     56#define ip_get_route_req       ip_get_route_req_local
     57
     58#else
     59
     60#include <ip_remote.h>
     61
     62#define ip_received_error_msg  ip_received_error_msg_remote
     63#define ip_set_gateway_req     ip_set_gateway_req_remote
     64#define ip_packet_size_req     ip_packet_size_req_remote
     65#define ip_device_req          ip_device_req_remote
     66#define ip_add_route_req       ip_add_route_req_remote
     67#define ip_send_msg            ip_send_msg_remote
     68#define ip_get_route_req       ip_get_route_req_remote
     69
     70#endif
     71
    5372/** @name IP module interface
    5473 *  This interface is used by other modules.
    5574 */
    5675/*@{*/
    57 
    58 /** Type definition of the internet pseudo header pointer.
    59  */
    60 typedef void *          ip_pseudo_header_ref;
    6176
    6277/** The transport layer notification function type definition.
     
    8297extern int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg);
    8398
    84 /** Registers the new device.
    85  *  Registers itself as the ip packet receiver.
    86  *  If the device uses ARP registers also the new ARP device.
    87  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    88  *  @param[in] device_id The new device identifier.
    89  *  @param[in] netif The underlying device network interface layer service.
    90  *  @returns EOK on success.
    91  *  @returns ENOMEM if there is not enough memory left.
    92  *  @returns EINVAL if the device configuration is invalid.
    93  *  @returns ENOTSUP if the device uses IPv6.
    94  *  @returns ENOTSUP if the device uses DHCP.
    95  *  @returns Other error codes as defined for the net_get_device_conf_req() function.
    96  *  @returns Other error codes as defined for the arp_device_req() function.
    97  */
    98 extern int ip_device_req(int ip_phone, device_id_t device_id, services_t netif);
    99 
    100 /** Sends the packet queue.
    101  *  The packets may get fragmented if needed.
    102  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    103  *  @param[in] device_id The device identifier.
    104  *  @param[in] packet The packet fragments as a~packet queue. All the packets have to have the same destination address.
    105  *  @param[in] sender The sending module service.
    106  *  @param[in] error The packet error reporting service. Prefixes the received packet.
    107  *  @returns EOK on success.
    108  *  @returns Other error codes as defined for the generic_send_msg() function.
    109  */
    110 extern int ip_send_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t sender, services_t error);
    111 
    11299/** Connects to the IP module.
    113100 *  @param service The IP module service. Ignored parameter.
     
    117104extern int ip_connect_module(services_t service);
    118105
    119 /** Adds a route to the device routing table.
    120  *  The target network is routed using this device.
    121  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    122  *  @param[in] device_id The device identifier.
    123  *  @param[in] address The target network address.
    124  *  @param[in] netmask The target network mask.
    125  *  @param[in] gateway The target network gateway. Not used if zero.
    126  */
    127 extern int ip_add_route_req(int ip_phone, device_id_t device_id, in_addr_t address, in_addr_t netmask, in_addr_t gateway);
    128 
    129 /** Sets the default gateway.
    130  *  This gateway is used if no other route is found.
    131  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    132  *  @param[in] device_id The device identifier.
    133  *  @param[in] gateway The default gateway.
    134  */
    135 extern int ip_set_gateway_req(int ip_phone, device_id_t device_id, in_addr_t gateway);
    136 
    137 /** Returns the device packet dimension for sending.
    138  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    139  *  @param[in] device_id The device identifier.
    140  *  @param[out] packet_dimension The packet dimension.
    141  *  @returns EOK on success.
    142  *  @returns ENOENT if there is no such device.
    143  *  @returns Other error codes as defined for the generic_packet_size_req() function.
    144  */
    145 extern int ip_packet_size_req(int ip_phone, device_id_t device_id, packet_dimension_ref packet_dimension);
    146 
    147 /** Notifies the IP module about the received error notification packet.
    148  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    149  *  @param[in] device_id The device identifier.
    150  *  @param[in] packet The received packet or the received packet queue.
    151  *  @param[in] target The target internetwork module service to be delivered to.
    152  *  @param[in] error The packet error reporting service. Prefixes the received packet.
    153  *  @returns EOK on success.
    154  */
    155 extern int ip_received_error_msg(int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error);
    156 
    157 /** Returns the device identifier and the IP pseudo header based on the destination address.
    158  *  @param[in] ip_phone The IP module phone used for (semi)remote calls.
    159  *  @param[in] protocol The transport protocol.
    160  *  @param[in] destination The destination address.
    161  *  @param[in] addrlen The destination address length.
    162  *  @param[out] device_id The device identifier.
    163  *  @param[out] header The constructed IP pseudo header.
    164  *  @param[out] headerlen The IP pseudo header length.
    165  */
    166 extern int ip_get_route_req(int ip_phone, ip_protocol_t protocol, const struct sockaddr * destination, socklen_t addrlen, device_id_t * device_id, ip_pseudo_header_ref * header, size_t * headerlen);
    167 
    168106/*@}*/
    169107
Note: See TracChangeset for help on using the changeset viewer.