TCP/IP data structures

The definitions are in the file STRUCTS.FTH.

You will find the books TCP/IP Illustrated, Volumes 1 and 2 useful when exploring the PowerNet data structures.

Primary structures

These structures are used in almost all systems.

STRUCT ether_hdr        \ -- size ; of ether_hdr structure
Ethernet header. The fields have the prefix "ETHER_".

STRUCT arp_hdr          \ -- size ; of arp_hdr structure
ARP header. The fields have the prefix "AR_".

STRUCT arp_ip_data      \ -- size ; of arp_ip_data structure
ARP data.

STRUCT icmp_hdr         \ -- size ; of icmp header structure
ICMP header structure. The fields have the prefix "ICMP_".

STRUCT ip_hdr           \ -- size
IP header structure. The fields have the prefix "IP_".

STRUCT udp_hdr          \ -- size ; of udp header structure
UDP header structure. The fields have the prefix "UH_".

STRUCT (socket)         \ -- size ; of (socket) structure
The main socket structure. The fields have the prefix "SO_".

STRUCT tcpcb    \ -- size
TCP control block structure. Notes:

STRUCT port_struct      \ -- size ; of structure
Port control data. The fields have the prefix "PORT_". Unused by systems with only a single port.

STRUCT iproute_struct   \ -- size ; of structure
Routing table entry. The fields have the prefix "IPROUTE_". The entries are added to when a new IP address is received.

PSIZE ether_hdr - ip_hdr - udp_hdr - equ PDATA_MAX
The size of the largest data block.

STRUCT SOCKADDR_IN      \ -- size
Used to hold socket family (always AF_INET), port number and IP address. The fields have the prefix "SIN_".

SNMP structures

STRUCT TAGLIST_ENTRY    \ -- size
SNMP Tx/Rx taglist entry definition. The fields have the prefix "SNMP_".