Changes in uspace/lib/net/include/ip_interface.h [14f1db0:849ed54] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/include/ip_interface.h
r14f1db0 r849ed54 31 31 */ 32 32 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 33 40 #ifndef __NET_IP_INTERFACE_H__ 34 41 #define __NET_IP_INTERFACE_H__ … … 44 51 #include <socket_codes.h> 45 52 46 #ifdef CONFIG_IL_TL_BUNDLE47 48 #include <ip_local.h>49 50 #define ip_received_error_msg ip_received_error_msg_local51 #define ip_set_gateway_req ip_set_gateway_req_local52 #define ip_packet_size_req ip_packet_size_req_local53 #define ip_device_req ip_device_req_local54 #define ip_add_route_req ip_add_route_req_local55 #define ip_send_msg ip_send_msg_local56 #define ip_get_route_req ip_get_route_req_local57 58 #else59 60 #include <ip_remote.h>61 62 #define ip_received_error_msg ip_received_error_msg_remote63 #define ip_set_gateway_req ip_set_gateway_req_remote64 #define ip_packet_size_req ip_packet_size_req_remote65 #define ip_device_req ip_device_req_remote66 #define ip_add_route_req ip_add_route_req_remote67 #define ip_send_msg ip_send_msg_remote68 #define ip_get_route_req ip_get_route_req_remote69 70 #endif71 72 53 /** @name IP module interface 73 54 * This interface is used by other modules. 74 55 */ 75 56 /*@{*/ 57 58 /** Type definition of the internet pseudo header pointer. 59 */ 60 typedef void * ip_pseudo_header_ref; 76 61 77 62 /** The transport layer notification function type definition. … … 97 82 extern int ip_bind_service(services_t service, int protocol, services_t me, async_client_conn_t receiver, tl_received_msg_t tl_received_msg); 98 83 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 99 112 /** Connects to the IP module. 100 113 * @param service The IP module service. Ignored parameter. … … 104 117 extern int ip_connect_module(services_t service); 105 118 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 106 168 /*@}*/ 107 169
Note:
See TracChangeset
for help on using the changeset viewer.