Subversion Repositories HelenOS

Rev

Rev 4707 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4707 Rev 4722
Line 81... Line 81...
81
 
81
 
82
int ip_received_error_msg( int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error ){
82
int ip_received_error_msg( int ip_phone, device_id_t device_id, packet_t packet, services_t target, services_t error ){
83
    return generic_received_msg( ip_phone, NET_IP_RECEIVED_ERROR, device_id, packet_get_id( packet ), target, error );
83
    return generic_received_msg( ip_phone, NET_IP_RECEIVED_ERROR, device_id, packet_get_id( packet ), target, error );
84
}
84
}
85
 
85
 
-
 
86
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 ){
-
 
87
    aid_t           message_id;
-
 
88
    ipcarg_t        result;
-
 
89
    ipc_call_t      answer;
-
 
90
 
-
 
91
    if( !( destination && ( addrlen > 0 ))) return EINVAL;
-
 
92
    if( !( device_id && header && headerlen )) return EBADMEM;
-
 
93
    * header = NULL;
-
 
94
    message_id = async_send_1( ip_phone, NET_IP_GET_ROUTE, ( ipcarg_t ) protocol, & answer );
-
 
95
    if(( ipc_data_write_start( ip_phone, destination, addrlen ) == EOK )
-
 
96
    && ( ipc_data_read_start( ip_phone, headerlen, sizeof( * headerlen )) == EOK )
-
 
97
    && ( * headerlen > 0 )){
-
 
98
        * header = ( ip_pseudo_header_ref ) malloc( * headerlen );
-
 
99
        if( * header ){
-
 
100
            if( ipc_data_read_start( ip_phone, * header, * headerlen ) != EOK ){
-
 
101
                free( * header );
-
 
102
            }
-
 
103
        }
-
 
104
    }
-
 
105
    async_wait_for( message_id, & result );
-
 
106
    if(( result != EOK ) && ( * header )){
-
 
107
        free( * header );
-
 
108
    }else{
-
 
109
        * device_id = IPC_GET_DEVICE( & answer );
-
 
110
    }
-
 
111
    return ( int ) result;
-
 
112
}
-
 
113
 
86
/** @}
114
/** @}
87
 */
115
 */