Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3845 → Rev 3846

/branches/network/uspace/srv/net/tcp/tcp_module.c
35,17 → 35,22
 
#include <async.h>
#include <stdio.h>
 
#include <ipc/ipc.h>
#include <ipc/services.h>
 
#include "../err.h"
#include "../modules.h"
 
#include "../include/protocols.h"
 
#include "tcp.h"
#include "tcp_module.h"
 
#define NAME "TCP protocol"
 
void tcp_print_name( void );
int tcp_start_module( void ( * client_connection )( ipc_callid_t iid, ipc_call_t * icall ));
int tcp_start_module( async_client_conn_t client_connection );
 
extern tcp_globals_t tcp_globals;
 
53,17 → 58,20
printf( NAME );
}
 
int tcp_start_module( void ( * client_connection )( ipc_callid_t iid, ipc_call_t * icall )){
services_t need[ 3 ];
int * need_phone[ 3 ];
int tcp_start_module( async_client_conn_t client_connection ){
ERROR_DECLARE;
 
need[ 0 ] = SERVICE_IP;
need[ 1 ] = SERVICE_NETWORKING;
need[ 2 ] = NULL;
need_phone[ 0 ] = & tcp_globals.ip_phone;
need_phone[ 1 ] = & tcp_globals.networking_phone;
need_phone[ 2 ] = NULL;
return start_service( SERVICE_TCP, need, need_phone, client_connection, tcp_initialize );
ipcarg_t phonehash;
 
async_set_client_connection( client_connection );
tcp_globals.networking_phone = connect_to_service( SERVICE_NETWORKING );
tcp_globals.ip_phone = bind_service( SERVICE_IP, IPPROTO_TCP, 0, 0, client_connection );
ERROR_PROPAGATE( tcp_initialize());
ERROR_PROPAGATE( REGISTER_ME( SERVICE_TCP, & phonehash ));
 
async_manager();
 
return EOK;
}
 
/** @}