Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4306 → Rev 4307

/branches/network/uspace/srv/net/tl/tcp/tcp.c
44,7 → 44,7
#include "../../modules.h"
#include "../../structures/packet/packet_client.h"
 
#include "../../il/ip/ip_messages.h"
#include "../../include/ip_interface.h"
 
#include "tcp.h"
#include "tcp_module.h"
54,22 → 54,22
/** Initializes the module.
*/
int tcp_initialize( void ){
ERROR_DECLARE;
// ERROR_DECLARE;
 
ipcarg_t arg1, arg2;
// ipcarg_t arg1, arg2;
packet_t packet;
 
printf( "\nTCP - testing to send to IP:\t" );
/* printf( "TCP - testing to send to IP:\n" );
ERROR_PROPAGATE( ip_echo( tcp_globals.ip_phone, 12, 34, 0, 0, 0, & arg1, & arg2, NULL, NULL, NULL ));
if(( arg1 != 12 ) || ( arg2 != 34 )) return EINVAL;
printf( "OK\n" );
 
printf( "\nTCP - testing to send packet to IP:\t" );
packet = packet_get_4( tcp_globals.networking_phone, 6, 20, 30, 20 );
*/
printf( "TCP - testing to send packet to IP:\n" );
packet = packet_get_4( tcp_globals.net_phone, 6, 20, 30, 20 );
if( ! packet ) return ENOMEM;
packet_copy_data( packet, "Hi, this is TCP", 16 );
ip_send( tcp_globals.ip_phone, -1, packet );
printf( "\tOK\n" );
ip_send_msg( tcp_globals.ip_phone, -1, packet, SERVICE_TCP );
printf( "OK\n" );
return EOK;
}