83,5 → 83,33 |
return generic_received_msg( ip_phone, NET_IP_RECEIVED_ERROR, device_id, packet_get_id( packet ), target, error ); |
} |
|
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 ){ |
aid_t message_id; |
ipcarg_t result; |
ipc_call_t answer; |
|
if( !( destination && ( addrlen > 0 ))) return EINVAL; |
if( !( device_id && header && headerlen )) return EBADMEM; |
* header = NULL; |
message_id = async_send_1( ip_phone, NET_IP_GET_ROUTE, ( ipcarg_t ) protocol, & answer ); |
if(( ipc_data_write_start( ip_phone, destination, addrlen ) == EOK ) |
&& ( ipc_data_read_start( ip_phone, headerlen, sizeof( * headerlen )) == EOK ) |
&& ( * headerlen > 0 )){ |
* header = ( ip_pseudo_header_ref ) malloc( * headerlen ); |
if( * header ){ |
if( ipc_data_read_start( ip_phone, * header, * headerlen ) != EOK ){ |
free( * header ); |
} |
} |
} |
async_wait_for( message_id, & result ); |
if(( result != EOK ) && ( * header )){ |
free( * header ); |
}else{ |
* device_id = IPC_GET_DEVICE( & answer ); |
} |
return ( int ) result; |
} |
|
/** @} |
*/ |