1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-06-24 01:41:35 +03:00

Add UDP support to the NET module

This commit is contained in:
Manuel Pégourié-Gonnard
2014-03-23 17:38:16 +01:00
committed by Paul Bakker
parent d6b721c7ee
commit f5a1312eaa
13 changed files with 97 additions and 38 deletions

View File

@ -135,7 +135,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
if( ( ret = net_connect( &server_fd, SERVER_NAME,
SERVER_PORT ) ) != 0 )
SERVER_PORT, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_connect returned %d\n\n", ret );
goto exit;

View File

@ -163,7 +163,7 @@ int main( int argc, char *argv[] )
printf( "\n . Waiting for a remote connection" );
fflush( stdout );
if( ( ret = net_bind( &listen_fd, NULL, SERVER_PORT ) ) != 0 )
if( ( ret = net_bind( &listen_fd, NULL, SERVER_PORT, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_bind returned %d\n\n", ret );
goto exit;

View File

@ -140,7 +140,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
if( ( ret = net_connect( &server_fd, SERVER_NAME,
SERVER_PORT ) ) != 0 )
SERVER_PORT, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_connect returned %d\n\n", ret );
goto exit;

View File

@ -844,7 +844,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
if( ( ret = net_connect( &server_fd, opt.server_addr,
opt.server_port ) ) != 0 )
opt.server_port, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_connect returned -0x%x\n\n", -ret );
goto exit;
@ -1260,7 +1260,7 @@ reconnect:
}
if( ( ret = net_connect( &server_fd, opt.server_name,
opt.server_port ) ) != 0 )
opt.server_port , NET_PROTO_TCP) ) != 0 )
{
printf( " failed\n ! net_connect returned -0x%x\n\n", -ret );
goto exit;

View File

@ -179,7 +179,7 @@ int main( int argc, char *argv[] )
printf( " . Bind on https://localhost:4433/ ..." );
fflush( stdout );
if( ( ret = net_bind( &listen_fd, NULL, 4433 ) ) != 0 )
if( ( ret = net_bind( &listen_fd, NULL, 4433, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_bind returned %d\n\n", ret );
goto exit;

View File

@ -574,7 +574,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
if( ( ret = net_connect( &server_fd, opt.server_name,
opt.server_port ) ) != 0 )
opt.server_port, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_connect returned %d\n\n", ret );
goto exit;

View File

@ -445,7 +445,7 @@ int main( int argc, char *argv[] )
printf( " . Bind on https://localhost:4433/ ..." );
fflush( stdout );
if( ( ret = net_bind( &listen_fd, NULL, 4433 ) ) != 0 )
if( ( ret = net_bind( &listen_fd, NULL, 4433, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_bind returned %d\n\n", ret );
goto exit;

View File

@ -159,7 +159,7 @@ int main( int argc, char *argv[] )
printf( " . Bind on https://localhost:4433/ ..." );
fflush( stdout );
if( ( ret = net_bind( &listen_fd, NULL, 4433 ) ) != 0 )
if( ( ret = net_bind( &listen_fd, NULL, 4433, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_bind returned %d\n\n", ret );
goto exit;

View File

@ -1246,7 +1246,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
if( ( ret = net_bind( &listen_fd, opt.server_addr,
opt.server_port ) ) != 0 )
opt.server_port, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_bind returned -0x%x\n\n", -ret );
goto exit;

View File

@ -193,7 +193,7 @@ static int ssl_test( struct options *opt )
if( opt->opmode == OPMODE_CLIENT )
{
if( ( ret = net_connect( &client_fd, opt->server_name,
opt->server_port ) ) != 0 )
opt->server_port, NET_PROTO_TCP ) ) != 0 )
{
printf( " ! net_connect returned %d\n\n", ret );
return( ret );
@ -242,7 +242,7 @@ static int ssl_test( struct options *opt )
if( server_fd < 0 )
{
if( ( ret = net_bind( &server_fd, NULL,
opt->server_port ) ) != 0 )
opt->server_port, NET_PROTO_TCP ) ) != 0 )
{
printf( " ! net_bind returned %d\n\n", ret );
return( ret );

View File

@ -402,7 +402,7 @@ int main( int argc, char *argv[] )
fflush( stdout );
if( ( ret = net_connect( &server_fd, opt.server_name,
opt.server_port ) ) != 0 )
opt.server_port, NET_PROTO_TCP ) ) != 0 )
{
printf( " failed\n ! net_connect returned %d\n\n", ret );
goto exit;