/branches/network/uspace/srv/net/include/ethernet_lsap.h |
---|
37,6 → 37,10 |
#ifndef __NET_ETHERNET_LSAP_H__ |
#define __NET_ETHERNET_LSAP_H__ |
#include <sys/types.h> |
typedef uint8_t eth_lsap_t; |
/** Null LSAP LSAP identifier. |
*/ |
#define ETH_LSAP_NULL 0x00 |
/branches/network/uspace/srv/net/include/hardware.h |
---|
38,6 → 38,10 |
#ifndef __NET_HW_TYPES_H__ |
#define __NET_HW_TYPES_H__ |
#include <sys/types.h> |
typedef uint8_t hw_type_t; |
/** Ethernet (10Mb) hardware type. |
*/ |
#define HW_ETHER 1 |
/branches/network/uspace/srv/net/include/protocol_map.h |
---|
49,7 → 49,7 |
* @returns Network interface layer type of the internetworking layer service. |
* @returns 0 if mapping is not found. |
*/ |
static inline int protocol_map( services_t nil, services_t il ){ |
static inline eth_type_t protocol_map( services_t nil, services_t il ){ |
switch( nil ){ |
case SERVICE_ETHERNET: |
case SERVICE_DP8390: |
94,7 → 94,7 |
* @returns Ethernet protocol identifier of the link service access point identifier. |
* @returns ETH_LSAP_NULL if mapping is not found. |
*/ |
static inline int lsap_map( int lsap ){ |
static inline int lsap_map( eth_lsap_t lsap ){ |
switch( lsap ){ |
case ETH_LSAP_IP: |
return ETH_P_IP; |
110,7 → 110,7 |
* @returns The hardware type of the network interface service. |
* @returns 0 if mapping is not found. |
*/ |
static inline int hardware_map( services_t nil ){ |
static inline hw_type_t hardware_map( services_t nil ){ |
switch( nil ){ |
case SERVICE_ETHERNET: |
case SERVICE_DP8390: |
/branches/network/uspace/srv/net/include/ip_client.h |
---|
37,6 → 37,12 |
#ifndef __NET_IP_CLIENT_H__ |
#define __NET_IP_CLIENT_H__ |
#include <sys/types.h> |
typedef uint8_t ip_ttl_t; |
typedef uint8_t ip_tos_t; |
typedef uint8_t ip_protocol_t; |
#include "../structures/packet/packet.h" |
#define IPVERSION 4 |
127,7 → 133,7 |
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ |
#define IPOPT_TS_PRESPEC 3 /* specified modules only */ |
int ip_client_prepare_packet( packet_t packet, int protocol, int ttl, int tos, int dont_fragment, int ipopt_length ); |
int ip_client_prepare_packet( packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, size_t ipopt_length ); |
// TODO ipopt manipulation |
/branches/network/uspace/srv/net/include/crc.h |
---|
59,7 → 59,7 |
* @param length Length of the data in bits. Input parameter. |
* @returns The computed CRC32 of the length bits of the data. |
*/ |
uint32_t compute_crc32_le( uint32_t seed, uint8_t * data, int length ); |
uint32_t compute_crc32_le( uint32_t seed, uint8_t * data, size_t length ); |
/** Computes CRC32 value in the big-endian environment. |
* @param seed Initial value. Often used as 0 or ~0. Input parameter. |
67,7 → 67,7 |
* @param length Length of the data in bits. Input parameter. |
* @returns The computed CRC32 of the length bits of the data. |
*/ |
uint32_t compute_crc32_be( uint32_t seed, uint8_t * data, int length ); |
uint32_t compute_crc32_be( uint32_t seed, uint8_t * data, size_t length ); |
/** Computes sum of the 2 byte fields. |
* Padds one zero (0) byte if odd. |
76,7 → 76,7 |
* @param length Length of the data in bytes. Input parameter. |
* @returns The computed checksum of the length bytes of the data. |
*/ |
uint32_t compute_checksum( uint32_t seed, uint8_t * data, int length ); |
uint32_t compute_checksum( uint32_t seed, uint8_t * data, size_t length ); |
/** Compacts the computed checksum to the 16 bit number adding the carries. |
* @param Computed checksum. Input parameter. |
/branches/network/uspace/srv/net/include/ethernet_protocols.h |
---|
38,6 → 38,10 |
#ifndef __NET_ETHERNET_PROTOCOLS_H__ |
#define __NET_ETHERNET_PROTOCOLS_H__ |
#include <sys/types.h> |
typedef uint16_t eth_type_t; |
/** Ethernet minimal protocol number. |
* According to the IEEE 802.3 specification. |
*/ |