Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/include/inet/globalvariables.h File Reference


Detailed Description

Author:
Version:
1.0
Date:
10.7.2002
Here are declarations of global variables that are commonly used in other OpenTCP modules as well as OpenTCP applications in general. Basically just a bunch of externs.

Definition in file globalvariables.h.

Go to the source code of this file.

Variables

UINT8 NE2000NextPktPtr
UINT8 NE2000CurrPktPtr
UINT32 base_timer
UINT8 net_buf []
 Transmit buffer used by all OpenTCP applications.

ethernet_frame received_frame
 Used for storing various information about the received Ethernet frame.

ethernet_frame send_frame
 Used for storing various information about the Ethernet frame that will be sent.

netif localmachine
ip_frame received_ip_packet
 Used for storing various information about the incoming IP packet.

ip_frame send_ip_packet
 Used for storing various information about the outgoing IP packet.

udp_frame received_udp_packet
 Used for storing field information about the received UDP packet.

tcp_frame received_tcp_packet
 Used for storing field information about the received TCP packet.


Variable Documentation

UINT8 NE2000NextPktPtr  
 

Start address of next packet in the Ethernet controller

Definition at line 74 of file globalvariables.h.

UINT8 NE2000CurrPktPtr  
 

Start address of current packet in the Ethernet controller

Definition at line 75 of file globalvariables.h.

UINT32 base_timer  
 

System 1.024 msec timer

Definition at line 77 of file globalvariables.h.

UINT8 net_buf[]  
 

This buffer is the transmit buffer used by all OpenTCP applications for sending of data. Please note the warnings below for correct usage of this buffer that ensures proper operation of the applications.

Warning:
  • Transmit buffer start - to avoid data copying, the TCP/IP stack will use first part of the net_buf buffer to add it's data. This means that applications using TCP and/or UDP must not write application-level data from the beginning of the buffer but from certain offset. This offset depends on the transport-layer protocol (it's header size that is). For TCP this value is defined by the TCP_APP_OFFSET and for the UDP it is UDP_APP_OFFSET.
  • Buffer sharing - since all applications share this buffer among each other, and with the TCP/IP stack as well, care must be taken not to overwrite other applications' data before it is sent. This is best achieved if all applications work in the main loop and when they wish to send data they fill in the buffer and send it immediately.

Definition at line 80 of file globalvariables.h.

struct ethernet_frame received_frame  
 

Fields from Ethernet packet (dest/source hardware address, protocol, frame size, start of the Ethernet packet in Ethernet controller) are stored in this structure. These values are later used from upper layer protocols (IP, ARP). See ethernet_frame definition for more information about struct fields.

Definition at line 84 of file globalvariables.h.

struct ethernet_frame send_frame  
 

Fields from Ethernet packet (dest/source hardware address, protocol, frame size) are stored in this structure by the upper layer protocols (IP, ARP, other). These values are then used for initializing transmission of an Ethernet frame. See ethernet_frame definition for more information about struct fields.

Definition at line 85 of file globalvariables.h.

struct netif localmachine
 

MUST BE PUT SOMEWHERE

Definition at line 86 of file globalvariables.h.

struct ip_frame received_ip_packet  
 

Various fields from the IP packet are stored in this structure. These values are later used from other upper layer protocols (ICMP, UDP, TCP and possibly others) to extract needed information about the received packet. See ip_frame definition for struct information.

Definition at line 87 of file globalvariables.h.

struct ip_frame send_ip_packet  
 

Various fields from the IP packet are stored in this structure. These values are filled based on the information supplied by the upper layer protocols (ICMP, UDP, TCP and possibly others) and used to form a correct IP packet (correct filed values, checksum,..). See ip_frame definition for struct information.

Definition at line 88 of file globalvariables.h.

struct udp_frame received_udp_packet  
 

Various fields from the received UDP packet are stored in this variable. See udp_frame definition for struct information.

Definition at line 89 of file globalvariables.h.

struct tcp_frame received_tcp_packet  
 

Various fields from the TCP packet are stored in this variable. These values are then used to perform the necessary actions as defined by the TCP specification: correctnes of the received TCP packet is checked by analyzing these fields, appropriate socket data is adjusted and/or control packet is sent based on it. See tcp_frame definition for struct information.

Definition at line 90 of file globalvariables.h.


Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by doxygen1.2.18