Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4727 → Rev 4728

/branches/network/uspace/srv/net/nil/eth/eth.c
458,7 → 458,7
}
suffix += sizeof( eth_fcs_t );
}
if( ERROR_OCCURRED( packet_set_addr( packet, header->header.src, header->header.dest, ETH_ADDR ))
if( ERROR_OCCURRED( packet_set_addr( packet, header->header.source_address, header->header.destination_address, ETH_ADDR ))
|| ERROR_OCCURRED( packet_trim( packet, prefix, suffix ))){
return NULL;
}
598,9 → 598,9
header_dix = PACKET_PREFIX( packet, eth_header_t );
if( ! header_dix ) return ENOMEM;
header_dix->ethertype = ( uint16_t ) ethertype;
memcpy( header_dix->src, src_addr, ETH_ADDR );
memcpy( header_dix->dest, dest, ETH_ADDR );
src = & header_dix->dest[ 0 ];
memcpy( header_dix->source_address, src_addr, ETH_ADDR );
memcpy( header_dix->destination_address, dest, ETH_ADDR );
src = & header_dix->destination_address[ 0 ];
}else if( IS_8023_2_SNAP( flags )){
header = PACKET_PREFIX( packet, eth_header_ex_t );
if( ! header ) return ENOMEM;
608,11 → 608,11
header->lsap.dsap = ( uint16_t ) ETH_LSAP_SNAP;
header->lsap.ssap = header->lsap.dsap;
header->lsap.ctrl = 0;
for( i = 0; i < 3; ++ i ) header->snap.proto[ i ] = 0;
for( i = 0; i < 3; ++ i ) header->snap.protocol[ i ] = 0;
header->snap.ethertype = ( uint16_t ) ethertype;
memcpy( header->header.src, src_addr, ETH_ADDR );
memcpy( header->header.dest, dest, ETH_ADDR );
src = & header->header.dest[ 0 ];
memcpy( header->header.source_address, src_addr, ETH_ADDR );
memcpy( header->header.destination_address, dest, ETH_ADDR );
src = & header->header.destination_address[ 0 ];
}
if( IS_DUMMY( flags )){
fcs = PACKET_SUFFIX( packet, eth_fcs_t );
/branches/network/uspace/srv/net/nil/eth/eth_header.h
32,7 → 32,7
 
/** @file
* Ethernet protocol header definitions.
* Names according to the linux src/include/linux/ip.h header file.
* Based on the IEEE~802.3-2005
*/
 
#ifndef __NET_ETH_HEADER_H__
124,7 → 124,7
struct eth_header_snap{
/** Protocol identifier or organization code.
*/
uint8_t proto[ 3 ];
uint8_t protocol[ 3 ];
/** Ethernet protocol identifier in the network byte order (big endian).
* @see ethernet_protocols.h
*/
150,10 → 150,10
struct eth_header{
/** Destination host Ethernet address (MAC address).
*/
uint8_t dest[ ETH_ADDR ];
uint8_t destination_address[ ETH_ADDR ];
/** Source host Ethernet address (MAC address).
*/
uint8_t src[ ETH_ADDR ];
uint8_t source_address[ ETH_ADDR ];
/** Ethernet protocol identifier in the network byte order (big endian).
* @see ethernet_protocols.h
*/