Unit IP

From Ultibo.org
Revision as of 02:35, 30 December 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Ultibo IP (Internet Protocol) unit

To be documented

Constants



IP specific constants IP_TRANSPORT_NAME*
IP_TRANSPORT_NAME = 'IP';  


IP constants IP_*_SIZE
MIN_IP_PACKET = 20; Not Counting Adapter Header
MAX_IP_PACKET = 65536; Not Counting Adapter Header
 
MAX_FRAG_LIFE = 32000; Only wait 32 seconds for the rest of the packet
 
IP_HEADER_SIZE = 20; SizeOf(TIPHeader); (Does Not Allow for Options)
IP_OPTIONS_SIZE = 40; Maximum Allowed Options
IP_PSEUDO_SIZE = 12; SizeOf(TPseudoHeader);
 
IP_PACKET_SIZE = 56; SizeOf(TIPPacket); (Previously 46)
IP_FRAGMENT_SIZE = 12; SizeOf(TIPFragment);


IP header flags / fragment offset constants IP_*
IP_CE = $8000; Congestion Experienced
IP_DF = $4000; 1 = Don't Fragment 0 = May Fragment
IP_MF = $2000; 1 = More Fragments 0 = Last Fragment
IP_OFFMASK = $1FFF; Fragment Offset Mask


IP header option constants IPOPT_*
IPOPT_EOL = 0; end-of-option list
IPOPT_NOP = 1; no-operation
IPOPT_RR = 7; record packet route
IPOPT_TS = 68; timestamp
IPOPT_SECURITY = 130; provide s,c,h,tcc
IPOPT_LSRR = 131; loose source route
IPOPT_SATID = 136; satnet id
IPOPT_SSRR = 137; strict source route
IPOPT_RA = 148; router alert


IP offset option constants IPOPT_OFFSET*
Offsets to fields in IP Options other than EOL and NOP
 
IPOPT_OPTVAL = 0; option ID
IPOPT_OLEN = 1; option length
IPOPT_OFFSET = 2; offset within option
IPOPT_MINOFF = 4; min value of above


IP TS flag option constants IPOPT_TS_*
Flags for IPOPT_TS Flags
 
IPOPT_TS_TSONLY = 0; timestamps only
IPOPT_TS_TSANDADDR = 1; timestamps and addresses
IPOPT_TS_PRESPEC = 3; specified modules only


IP security flag constants IPOPT_SECUR_*
Flags for IPOPT_SECURITY Flags (Network Order)
 
IPOPT_SECUR_UNCLASS = $0000;  
IPOPT_SECUR_CONFID = $F135;  
IPOPT_SECUR_EFTO = $789A;  
IPOPT_SECUR_MMMM = $BC4D;  
IPOPT_SECUR_RESTR = $AF13;  
IPOPT_SECUR_SECRET = $D788;  
IPOPT_SECUR_TOPSECRET = $6BC5;  


IP type of service constants IPTOS_*
IPTOS_LOWDELAY = $10;  
IPTOS_THROUGHPUT = $08;  
IPTOS_RELIABILITY = $04;  
IPTOS_MINCOST = $02;  


Type definitions


To be documented

Public variables


None defined

Function declarations



Initialization functions

procedure IPInit;
Description: To be documented
Note None documented


IP functions

function CheckIP(ABuffer:Pointer):Boolean;
Description: Verify that the packet is a valid IP packet
Buffer Complete packet without Adapter header


function GetIPHeaderOffset(ABuffer:Pointer):Word;
Description: Return Start of the IP Header (Start of Packet)
Buffer Complete packet including Transport header


function GetIPHeaderLength(ABuffer:Pointer):Word;
Description: Return Size of IP Header (Including Options)
Buffer Complete packet including Transport header


function GetIPOptionsLength(ABuffer:Pointer):Word;
Description: Return Size of IP Options (Header - IP_HEADER_SIZE)
Buffer Complete packet including Transport header


function GetIPDataOffset(ABuffer:Pointer):Word;
Description: Return Start of IP Packet Data (Length of IP Header)
Buffer Complete packet including Transport header


function GetIPDataLength(ABuffer:Pointer):Word;
Description: Return Size of IP Packet Data (IP TotalLength - IP Header)
Buffer Complete packet including Transport header


function ChecksumIPRecv(ABuffer:Pointer; AOffset,ALength:Word):Word;
Description: Validate the IP Header and Options Checksum on Receive
Buffer Complete packet including Transport header


function ChecksumIPSend(AHeader,AOptions:Pointer; ALength:Word):Word;
Description: Checksum the IP Header and Options on Send
Buffer Complete packet including Transport header


Return to Unit Reference