/branches/network/uspace/srv/net/il/il_messages.h |
---|
31,6 → 31,9 |
*/ |
/** @file |
* Internetwork layer modules messages. |
* @see il_interface.h |
* @see ip_interface.h |
*/ |
#ifndef __NET_IL_MESSAGES_H__ |
38,19 → 41,30 |
#include <ipc/ipc.h> |
/** Internet layer modules messages. |
*/ |
typedef enum{ |
/* ( device_id, nil_service ) */ |
/** New device message. |
* @see ip_device_req() |
*/ |
NET_IL_DEVICE = NET_IL_FIRST, |
/* ( device_id, state ) */ |
/** Device state changed message. |
* @see il_device_state_msg() |
*/ |
NET_IL_DEVICE_STATE, |
/* ( device_id ), packet_send */ |
/** Packet received message. |
* @see il_received_msg() |
*/ |
NET_IL_RECEIVED, |
/* ( device_id ), measured_strings_send( address ) */ |
// NET_IL_MY_ADDR, |
/* ( packet_id ) */ |
/** Packet send message. |
* @see ip_send_msg() |
*/ |
NET_IL_SEND, |
} il_messages; |
/** Returns the ip protocol number message parameter. |
* @param call The message call structure. Input parameter. |
*/ |
#define IL_GET_PROTO( call ) ( int ) IPC_GET_ARG1( * call ) |
#endif |
/branches/network/uspace/srv/net/il/arp/arp_messages.h |
---|
31,6 → 31,8 |
*/ |
/** @file |
* ARP module messages. |
* @see arp_interface.h |
*/ |
#ifndef __NET_ARP_MESSAGES__ |
40,18 → 42,29 |
#include "../../messages.h" |
/** ARP module messages. |
*/ |
typedef enum{ |
/* ( device_id, nil_service, proto ), measured_strings_send( proto_addr ) */ |
/** New device message. |
* @see arp_device_req() |
*/ |
NET_ARP_DEVICE = NET_ARP_FIRST, |
/* ( device_id, protocol ), measured_strings_send( target ), measured_strings_return( translation ) */ |
/** Address translation message. |
* @see arp_translate_req() |
*/ |
NET_ARP_TRANSLATE, |
/* ( device_id ) */ |
/** Clear device cache message. |
* @see arp_clear_device_req() |
*/ |
NET_ARP_CLEAR_DEVICE, |
/* () */ |
/** Clean cache message. |
* @see arp_clean_cache() |
*/ |
NET_ARP_CLEAN_CACHE, |
} arp_messages; |
/** Returns the protocol service message parameter. |
* @param call The message call structure. Input parameter. |
*/ |
#define ARP_GET_NETIF( call ) ( services_t ) IPC_GET_ARG2( * call ) |
/branches/network/uspace/srv/net/il/arp/arp.c |
---|
72,9 → 72,6 |
*/ |
arp_globals_t arp_globals; |
int arp_device_req( int arp_phone, device_id_t device_id, services_t protocol, services_t netif, measured_string_ref address ); |
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 ); |
/** Clears the whole cache. |
* @returns EOK on success. |
*/ |
81,6 → 78,7 |
int arp_clean_cache_req( int arp_phone ); |
/** Clears the device specific data from the cache. |
* @param arp_phone The ARP module phone used for (semi)remote calls. Input parameter. |
* @param device_id The device identifier. Input parameter. |
* @returns EOK on success. |
* @returns ENOENT if the device is not found in the cache. |
/branches/network/uspace/srv/net/il/arp/arp_module.c |
---|
70,6 → 70,15 |
* @returns Other error codes as defined for the REGISTER_ME() macro function. |
*/ |
int module_start( async_client_conn_t client_connection ); |
/** Processes the ARP message. |
* @param callid The message identifier. Input parameter. |
* @param call The message parameters. Input parameter. |
* @param answer The message answer parameters. Output parameter. |
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter. |
* @returns EOK on success. |
* @returns Other error codes as defined for the arp_message() function. |
*/ |
int module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
/** ARP module global data. |
/branches/network/uspace/srv/net/il/arp/arp_module.h |
---|
51,9 → 51,9 |
* @param call The message parameters. Input parameter. |
* @param answer The message answer parameters. Output parameter. |
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter. |
* \todo all possible message returns? |
* @returns EOK on success. |
* @returns ENOTSUP if the message is not known. |
* @see arp_interface.h |
* @see IS_NET_ARP_MESSAGE() |
*/ |
int arp_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
/branches/network/uspace/srv/net/il/arp/arp_remote.c |
---|
31,6 → 31,8 |
*/ |
/** @file |
* ARP interface implementation for standalone remote modules. |
* @see arp_interface.h |
*/ |
#include <async.h> |
/branches/network/uspace/srv/net/il/ip/ip_header.h |
---|
110,7 → 110,7 |
/** This field indicates the next level protocol used in the data portion of the internet datagram. |
*/ |
uint8_t protocol; |
/** A checksum on the header only. |
/** A checksum of the header only. |
* Since some header fields change (e.g., time to live), this is recomputed and verified at each point that the internet header is processed. |
* The checksum algorithm is: The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header. |
* For purposes of computing the checksum, the value of the checksum field is zero. |
124,7 → 124,14 |
uint32_t destination_address; |
} __attribute__ ((packed)); |
/** Type definition of the internet option header. |
* @see ip_header |
*/ |
typedef struct ip_option ip_option_t; |
/** Type definition of the internet option header pointer. |
* @see ip_header |
*/ |
typedef ip_option * ip_option_ref; |
/** Internet option header. |
/branches/network/uspace/srv/net/il/ip/ip.c |
---|
91,7 → 91,7 |
return EOK; |
} |
int ip_device_req( int il_phone, device_id_t device_id, services_t service ){ |
int ip_device_req( int il_phone, device_id_t device_id, services_t netif ){ |
ERROR_DECLARE; |
ip_netif_ref ip_netif; |
149,9 → 149,9 |
} |
net_free_settings( configuration, data ); |
} |
ip_netif->phone = bind_service( service, ip_netif->device_id, SERVICE_IP, 0, ip_driver_receiver ); |
ip_netif->phone = bind_service( netif, ip_netif->device_id, SERVICE_IP, 0, ip_driver_receiver ); |
if( ip_netif->phone < 0 ){ |
printf( "Failed to contact the nil service %d\n", service ); |
printf( "Failed to contact the nil service %d\n", netif ); |
free( ip_netif ); |
return ip_netif->phone; |
} |
158,7 → 158,7 |
if( ip_netif->arp ){ |
configuration[ 0 ].value = ( char * ) & ip_netif->address; |
configuration[ 0 ].length = CONVERT_SIZE( in_addr_t, char, 1 ); |
if( ERROR_OCCURRED( arp_device_req( ip_netif->arp->phone, ip_netif->device_id, SERVICE_IP, service, & configuration[ 0 ] ))){ |
if( ERROR_OCCURRED( arp_device_req( ip_netif->arp->phone, ip_netif->device_id, SERVICE_IP, netif, & configuration[ 0 ] ))){ |
free( ip_netif ); |
return ERROR_CODE; |
} |