Subversion Repositories HelenOS

Rev

Rev 3666 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3666 Rev 3846
Line 33... Line 33...
33
/** @file
33
/** @file
34
 */
34
 */
35
 
35
 
36
#include <async.h>
36
#include <async.h>
37
#include <stdio.h>
37
#include <stdio.h>
-
 
38
 
38
#include <ipc/ipc.h>
39
#include <ipc/ipc.h>
39
#include <ipc/services.h>
40
#include <ipc/services.h>
40
 
41
 
-
 
42
#include "../err.h"
41
#include "../modules.h"
43
#include "../modules.h"
42
 
44
 
43
#include "ip.h"
45
#include "ip.h"
-
 
46
#include "ip_module.h"
44
 
47
 
45
#define NAME    "IP protocol"
48
#define NAME    "IP protocol"
46
 
49
 
47
void    ip_print_name( void );
50
void    ip_print_name( void );
48
int ip_start_module( void ( * client_connection )( ipc_callid_t iid, ipc_call_t * icall ));
51
int ip_start_module( async_client_conn_t client_connection );
49
 
52
 
50
extern ip_globals_t ip_globals;
53
extern ip_globals_t ip_globals;
51
 
54
 
52
void ip_print_name( void ){
55
void ip_print_name( void ){
53
    printf( NAME );
56
    printf( NAME );
54
}
57
}
55
 
58
 
56
int ip_start_module( void ( * client_connection )( ipc_callid_t iid, ipc_call_t * icall )){
59
int ip_start_module( async_client_conn_t client_connection ){
57
    services_t  need[ 2 ];
60
    ERROR_DECLARE;
-
 
61
 
58
    int *       need_phone[ 2 ];
62
    ipcarg_t    phonehash;
59
 
63
 
-
 
64
    async_set_client_connection( client_connection );
60
    need[ 0 ] = SERVICE_NETWORKING;
65
    ip_globals.networking_phone = connect_to_service( SERVICE_NETWORKING );
61
    need[ 1 ] = NULL;
66
    ERROR_PROPAGATE( ip_initialize());
62
    need_phone[ 0 ] = & ip_globals.networking_phone;
67
    ERROR_PROPAGATE( REGISTER_ME( SERVICE_IP, & phonehash ));
-
 
68
 
63
    need_phone[ 1 ] = NULL;
69
    async_manager();
-
 
70
 
64
    return start_service( SERVICE_IP, need, need_phone, client_connection, ip_initialize );
71
    return EOK;
65
}
72
}
66
 
73
 
67
/** @}
74
/** @}
68
 */
75
 */