Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

rom400_xnetstack.h File Reference


Detailed Description

Enhanced network stack for the DS80C400 ROM.

This library contains a replacement network stack with better performance and more standards compliant functionality. Since this library will replace the default ROM network stack, be careful of the physical location this library. If this library is targeted to reside in flash memory, your system will be limited by the speed of your flash.

To use this functionality, add xnetstack_install() to your program before calling init_rom and add the library to your build process.

For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.

Go to the source code of this file.

Defines

#define ROM400_XNETSTACK_VERSION   16
#define SOCKET_TYPE_RAW   2
#define SOCK_RAW   2
#define MDIO_ENABLE   0
#define MDIO_DISABLE_HDX   1
#define MDIO_DISABLE_FDX   2

Functions

void xnetstack_install (void)
 Installs the enhanced network stack.
unsigned int xnetstack_version (void)
 Returns the version number of this library.
void xnetstack_set_tcptimeoutfactor (int factor)
 Sets a factor to scale all TCP timeouts.
int xnetstack_get_tcptimeoutfactor (void)
 Gets the factor to scale all TCP timeouts.
void xnetstack_set_ipv6 (int enable)
 Enables/disables IPv6.
void xnetstack_set_icmpechoreplies (int enable)
 Enables/disables ICMP echo replies.
void xnetstack_set_icmpdestinationunreachable (int enable)
 Enables/disables ICMP destination unreachable messages.
void xnetstack_set_igmpreporttype (int type)
 Sets the IGMP membership report type.
void xnetstack_set_arptimeout (int timeout)
 Sets the ARP timeout.
int xnetstack_get_arptimeout (void)
 Gets the ARP timeout value.
int xnetstack_set_arptablesize (int entries)
 Sets the number of ARP table entries.
int xnetstack_get_arptablesize (void)
 Gets the maximum number of ARP table entries.
void xnetstack_set_rawfilter (unsigned int proto)
 Sets a protocol filter for the RAW socket.
void xnetstack_disable_rawfilter (void)
 Disables the protocol filter for the RAW socket.
void xnetstack_set_mdio (int value)
 Sets whether the MII interface should be used to talk to the physical network interface chip (PHY).
void xnetstack_set_igmp (int enable)
 Enables/disables inbound IGMP processing.


Define Documentation

#define MDIO_DISABLE_FDX   2
 

Argument to function xnetstack_set_mdio to disable MDIO link detection and to force the link to full duplex.

See also:
xnetstack_set_mdio

#define MDIO_DISABLE_HDX   1
 

Argument to function xnetstack_set_mdio to disable MDIO link detection and to force the link to half duplex.

See also:
xnetstack_set_mdio

#define MDIO_ENABLE   0
 

Argument to function xnetstack_set_mdio to enable MDIO link detection.

See also:
xnetstack_set_mdio

#define ROM400_XNETSTACK_VERSION   16
 

Version number associated with this header file. Should be the same as the version number returned by the xnetstack_version function.

See also:
xnetstack_version

#define SOCK_RAW   2
 

Argument to function socket to create a RAW socket (same as SOCKET_TYPE_RAW)

See also:
socket

#define SOCKET_TYPE_RAW   2
 

Argument to function socket to create a RAW socket (same as SOCK_RAW)

See also:
socket


Function Documentation

void xnetstack_disable_rawfilter void   ) 
 

Disables the protocol filter for the RAW socket.

This function disables the filter set by xnetstack_set_rawfilter.

See also:
xnetstack_set_rawfilter

int xnetstack_get_arptablesize void   ) 
 

Gets the maximum number of ARP table entries.

Returns:
ARP table size
See also:
xnetstack_set_arptimeout

int xnetstack_get_arptimeout void   ) 
 

Gets the ARP timeout value.

Returns:
ARP timeout
See also:
xnetstack_set_arptimeout

int xnetstack_get_tcptimeoutfactor void   ) 
 

Gets the factor to scale all TCP timeouts.

Returns:
TCP scale factor
See also:
xnetstack_set_tcptimeoutfactor

void xnetstack_install void   ) 
 

Installs the enhanced network stack.

This function installs the enhanced network stack functionality. The function has to be called before init_rom().

int xnetstack_set_arptablesize int  entries  ) 
 

Sets the number of ARP table entries.

Parameters:
entries ARP table entries (16 to 127)
Returns:
0 on success
This function allocates the new ARP table from the kernel memory subsystem. The memory allocated will be the table entry count * 12. NOTE: Resizing the ARP table will destroy all entries, including manually set static entries.

See also:
xnetstack_set_arptablesize

void xnetstack_set_arptimeout int  timeout  ) 
 

Sets the ARP timeout.

Parameters:
timeout ARP timeout (1 to 255, default: 16)
This function manipulates the amount of timer ticks an ARP entry can be pending (be unresolved) before the network stack considers a host to be unreachable.

Note that init_rom() resets the ARP timeout value.

See also:
xnetstack_get_arptimeout

void xnetstack_set_icmpdestinationunreachable int  enable  ) 
 

Enables/disables ICMP destination unreachable messages.

Parameters:
enable 1 to enable, 0 to disable
Setting this to 0 prevents the network stack from generating ICMP destination unreachables (i.e. the device will not respond when an unused port is accessed).

void xnetstack_set_icmpechoreplies int  enable  ) 
 

Enables/disables ICMP echo replies.

Parameters:
enable 1 to enable, 0 to disable
Setting this to 0 prevents the network stack from generating ICMP echo replies (i.e. the device will no longer respond to "ping").

void xnetstack_set_igmp int  enable  ) 
 

Enables/disables inbound IGMP processing.

Parameters:
enable 1 to enable, 0 to disable
NOTE: This function disables the IGMP receiver and feeds all inbound packets to the raw packet queue. If there is no raw socket, or if the raw filter doesn't match, the packets will be discarded.

void xnetstack_set_igmpreporttype int  type  ) 
 

Sets the IGMP membership report type.

Parameters:
type (0x12 for version 1, 0x16 for version 2)
NOTE: This does not enable IGMPv2 compatibility, it merely changes the type of membership reports to work around a problem with certain switches. The default is IGMPv1.

void xnetstack_set_ipv6 int  enable  ) 
 

Enables/disables IPv6.

Parameters:
enable 1 to enable, 0 to disable
NOTE: This function disables the IPv6 receiver and transmitter. An application can still send packet to IPv6 addresses without receiving an error message; these packets will be discarded at the driver level.

void xnetstack_set_mdio int  value  ) 
 

Sets whether the MII interface should be used to talk to the physical network interface chip (PHY).

Parameters:
value MDIO_ENABLE, MDIO_DISABLE_HDX, MDIO_DISABLE_FDX
This function enables / disables MII communication over the MII interface. MII communication with the physical interface is used to determine link availability and status. When disabling MDIO, you must specify whether the link is half duplex or full duplex. This function should be called after xnetstack_install, but before init_rom.

void xnetstack_set_rawfilter unsigned int  proto  ) 
 

Sets a protocol filter for the RAW socket.

Parameters:
proto Ethernet protocol (e.g. 0x0800 for IPv4)
This function reduces the system load when a raw socket is used by filtering for a given Ethernet protocol type at the Ethernet driver layer. Note: The network stack only supports Ethernet II frames.

See also:
xnetstack_disable_rawfilter

void xnetstack_set_tcptimeoutfactor int  factor  ) 
 

Sets a factor to scale all TCP timeouts.

Parameters:
factor TCP scale factor (1 to 255, default: 32)
See also:
xnetstack_get_tcptimeoutfactor

unsigned int xnetstack_version void   ) 
 

Returns the version number of this library.

Returns:
Version number of this library.


Copyright 2005 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.