Rev 4307 | Rev 4503 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4307 | Rev 4350 | ||
|---|---|---|---|
| Line 29... | Line 29... | ||
| 29 | /** @addtogroup arp |
29 | /** @addtogroup arp |
| 30 | * @{ |
30 | * @{ |
| 31 | */ |
31 | */ |
| 32 | 32 | ||
| 33 | /** @file |
33 | /** @file |
| - | 34 | * ARP 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 arp_remote.c source file. |
|
| - | 37 | * The bundle modules with the arp.c source file. |
|
| 34 | */ |
38 | */ |
| 35 | 39 | ||
| 36 | #ifndef __NET_ARP_INTERFACE_H__ |
40 | #ifndef __NET_ARP_INTERFACE_H__ |
| 37 | #define __NET_ARP_INTERFACE_H__ |
41 | #define __NET_ARP_INTERFACE_H__ |
| 38 | 42 | ||
| 39 | #include "../structures/measured_strings.h" |
43 | #include "../structures/measured_strings.h" |
| 40 | 44 | ||
| 41 | #include "device.h" |
45 | #include "device.h" |
| 42 | 46 | ||
| - | 47 | /** Registers the new device and the requesting protocol service. |
|
| - | 48 | * Determines the device broadcast address, its address lengths and packet size. |
|
| - | 49 | * @param arp_phone The ARP module phone used for (semi)remote calls. Input parameter. |
|
| - | 50 | * @param device_id The new device identifier. Input parameter. |
|
| - | 51 | * @param protocol The requesting protocol service. Input parameter. |
|
| - | 52 | * @param netif The underlying device network interface layer service. Input parameter. |
|
| - | 53 | * @param address The local requesting protocol address of the device. Input parameter. |
|
| - | 54 | * @returns EOK on success. |
|
| - | 55 | * @returns EEXIST if the device is already used. |
|
| - | 56 | * @returns ENOMEM if there is not enough memory left. |
|
| - | 57 | * @returns ENOENT if the network interface service is not known. |
|
| - | 58 | * @returns EREFUSED if the network interface service is not responding. |
|
| - | 59 | * @returns Other error codes as defined for the nil_packet_get_size() function. |
|
| - | 60 | * @returns Other error codes as defined for the nil_get_addr() function. |
|
| - | 61 | * @returns Other error codes as defined for the nil_get_broadcast_addr() function. |
|
| - | 62 | */ |
|
| 43 | int arp_device_req( int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address ); |
63 | int arp_device_req( int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address ); |
| - | 64 | ||
| - | 65 | /** Translates the given protocol address to the network interface address. |
|
| - | 66 | * Broadcasts the ARP request if the mapping is not found. |
|
| - | 67 | * @param arp_phone The ARP module phone used for (semi)remote calls. Input parameter. |
|
| - | 68 | * @param device_id The device identifier. Input parameter. |
|
| - | 69 | * @param protocol The requesting protocol service. Input parameter. |
|
| - | 70 | * @param address The local requesting protocol address. Input parameter. |
|
| - | 71 | * @param translation The translation of the local protocol address. Output parameter. |
|
| - | 72 | * @param data The raw translation data container. Output parameter. |
|
| - | 73 | * @returns EOK on success. |
|
| - | 74 | * @returns EINVAL if the configuration parameter is NULL. |
|
| - | 75 | * @returns EINVAL if the count parameter is zero (0). |
|
| - | 76 | * @returns EBADMEM if the translation or the data parameters are NULL. |
|
| - | 77 | * @returns ENOENT if the mapping is not found. |
|
| - | 78 | */ |
|
| 44 | 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 ); |
79 | 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 ); |
| - | 80 | ||
| - | 81 | /** Clears the device cache. |
|
| - | 82 | * @param arp_phone The ARP module phone used for (semi)remote calls. Input parameter. |
|
| - | 83 | * @param device_id The device identifier. Input parameter. |
|
| - | 84 | * @returns EOK on success. |
|
| - | 85 | * @returns ENOENT if the device is not found. |
|
| - | 86 | */ |
|
| 45 | int arp_clear_device_req( int arp_phone, device_id_t device_id ); |
87 | int arp_clear_device_req( int arp_phone, device_id_t device_id ); |
| - | 88 | ||
| - | 89 | /** Cleans the cache. |
|
| - | 90 | * @param arp_phone The ARP module phone used for (semi)remote calls. Input parameter. |
|
| - | 91 | * @returns EOK on success. |
|
| - | 92 | */ |
|
| 46 | int arp_clean_cache_req( int arp_phone ); |
93 | int arp_clean_cache_req( int arp_phone ); |
| - | 94 | ||
| - | 95 | /** Connects to the ARP module. |
|
| - | 96 | * @param service The ARP module service. Ignored parameter. |
|
| - | 97 | * @returns The ARP module phone on success. |
|
| - | 98 | * @returns 0 if called by the bundle module. |
|
| - | 99 | */ |
|
| 47 | int arp_connect_module( services_t service ); |
100 | int arp_connect_module( services_t service ); |
| - | 101 | ||
| - | 102 | /** Returns the ARP task identifier. |
|
| - | 103 | * @returns The current task identifier if called by the bundle module. |
|
| - | 104 | * @returns 0 if called by the remote module. |
|
| - | 105 | */ |
|
| 48 | int arp_task_get_id( void ); |
106 | int arp_task_get_id( void ); |
| 49 | 107 | ||
| 50 | #endif |
108 | #endif |
| 51 | 109 | ||
| 52 | /** @} |
110 | /** @} |