Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3901 → Rev 3912

/branches/network/uspace/srv/net/il/ip/ip_module.h
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
26,12 → 26,11
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup net
* @{
/** @addtogroup ip
* @{
*/
 
/**
* @file
/** @file
*/
 
#ifndef __NET_IP_MODULE_H__
/branches/network/uspace/srv/net/il/ip/ip_messages.h
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
26,12 → 26,11
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup net
* @{
/** @addtogroup ip
* @{
*/
 
/**
* @file
/** @file
*/
 
#ifndef __NET_IP_MESSAGES_H__
/branches/network/uspace/srv/net/il/ip/ip_header.h
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
26,14 → 26,13
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup net
* @{
/** @addtogroup ip
* @{
*/
 
/**
* @file
* Interent protocol header and options definitions.
* Names according to the linux src/include/linux/ip.h header file.
/** @file
* Internet protocol header and options definitions.
* Names according to the linux src/include/linux/ip.h header file.
*/
 
#ifndef __NET_IP_HEADER_H__
42,9 → 41,17
#include <byteorder.h>
#include <types.h>
 
/** Type definition of the internet header.
* @see ip_header
*/
typedef struct ip_header ip_header_t;
 
/** Type definition of the internet header pointer.
* @see ip_header
*/
typedef ip_header_t * ip_header_ref;
 
 
/** Internet header.
* The variable options should be included after the header itself and indicated by the increased header length value.
*/
155,7 → 162,7
#define IPTOS_TOS_MASK 0x1E
#define IPTOS_PRECEDENCE_SHIFT 5
#define IPTOS_DELAY_SHIFT 4
#define IPTOS_TROUGHPUT_SHIFT 3
#define IPTOS_THROUGHPUT_SHIFT 3
#define IPTOS_RELIABILITY_SHIFT 2
#define IPTOS_COST_SHIFT 1
 
/branches/network/uspace/srv/net/il/ip/ip.c
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
26,8 → 26,8
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup net
* @{
/** @addtogroup ip
* @{
*/
 
/** @file
109,8 → 109,8
// TODO mapping
message = async_send_2( ip_globals.networking_phone, NET_NET_GET_DEVICE_CONF, ip_netif->device_id, count, & answer );
// send names and get settings
if( ERROR_OCCURED( measured_strings_send( ip_globals.networking_phone, configuration, count ))
|| ERROR_OCCURED( measured_strings_return( ip_globals.networking_phone, & settings, & data, count ))){
if( ERROR_OCCURRED( measured_strings_send( ip_globals.networking_phone, configuration, count ))
|| ERROR_OCCURRED( measured_strings_return( ip_globals.networking_phone, & settings, & data, count ))){
async_wait_for( message, NULL );
return ERROR_CODE;
}
126,8 → 126,8
free( ip_netif );
return ENOTSUP;
}else if( ip_netif->ipv == 4 ){
if( ERROR_OCCURED( inet_pton( AF_INET, settings[ 2 ].value, ( uint8_t * ) & ip_netif->address ))
|| ERROR_OCCURED( inet_pton( AF_INET, settings[ 3 ].value, ( uint8_t * ) & ip_netif->netmask ))
if( ERROR_OCCURRED( inet_pton( AF_INET, settings[ 2 ].value, ( uint8_t * ) & ip_netif->address ))
|| ERROR_OCCURRED( inet_pton( AF_INET, settings[ 3 ].value, ( uint8_t * ) & ip_netif->netmask ))
|| ( inet_pton( AF_INET, settings[ 4 ].value, ( uint8_t * ) & ip_netif->gateway ) == EINVAL )
|| ( inet_pton( AF_INET, settings[ 5 ].value, ( uint8_t * ) & ip_netif->broadcast ) == EINVAL )
|| ( inet_pton( AF_INET, settings[ 6 ].value, ( uint8_t * ) & ip_netif->dns1 ) == EINVAL )
170,7 → 170,7
}
// TODO mapping
ip_netif->phone = bind_service( service, ip_netif->device_id, SERVICE_IP, 0, ip_driver_receiver );
if( ERROR_OCCURED( ip_netifs_add( & ip_globals.netifs, ip_netif->device_id, ip_netif ))){
if( ERROR_OCCURRED( ip_netifs_add( & ip_globals.netifs, ip_netif->device_id, ip_netif ))){
free( ip_netif );
return ERROR_CODE;
}
214,7 → 214,7
// TODO packer received
case NET_IL_RECEIVED:
case NET_NIL_RECEIVED:
if( ! ERROR_OCCURED( result = packet_translate( ip_globals.networking_phone, & packet, IPC_GET_PACKET( & call )))){
if( ! ERROR_OCCURRED( result = packet_translate( ip_globals.networking_phone, & packet, IPC_GET_PACKET( & call )))){
//result = ip_receive_message( IPC_GET_DEVICE( call ), packet );
}
ipc_answer_0( callid, result );
237,7 → 237,7
if( ! proto ) return ENOMEM;
proto->protocol = protocol;
proto->phone = phone;
if( ERROR_OCCURED( ip_protos_add( & ip_globals.protos, proto->protocol, proto ))){
if( ERROR_OCCURRED( ip_protos_add( & ip_globals.protos, proto->protocol, proto ))){
free( proto );
return ERROR_CODE;
}
268,7 → 268,7
case IPC_M_CONNECT_TO_ME:
return ip_register_message( IPC_GET_PROTO( call ), IPC_GET_PHONE( call ));
case NET_IP_SEND:
if( ERROR_OCCURED( packet_translate( ip_globals.networking_phone, & packet, IPC_GET_PACKET( call )))){
if( ERROR_OCCURRED( packet_translate( ip_globals.networking_phone, & packet, IPC_GET_PACKET( call )))){
printf( "\nIP send E %d", ERROR_CODE );
return ERROR_CODE;
}
/branches/network/uspace/srv/net/il/ip/ip.h
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
26,8 → 26,8
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup net
* @{
/** @addtogroup ip
* @{
*/
 
/**
/branches/network/uspace/srv/net/il/ip/ip_module.c
1,5 → 1,5
/*
* Copyright (c) 2008 Lukas Mejdrech
* Copyright (c) 2009 Lukas Mejdrech
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/** @addtogroup net
/** @addtogroup ip
* @{
*/
 
71,6 → 71,7
 
async_manager();
 
pm_destroy();
return EOK;
}