Difference between revisions of "Unit IP"
From Ultibo.org
Line 4: | Line 4: | ||
=== Description === | === Description === | ||
---- | ---- | ||
+ | |||
+ | '''Ultibo IP (Internet Protocol) unit''' | ||
''To be documented'' | ''To be documented'' | ||
Line 10: | Line 12: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP specific constants''' <code> IP_TRANSPORT_NAME* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IP_TRANSPORT_NAME = 'IP';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP constants''' <code> IP_*_SIZE </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MIN_IP_PACKET = 20;</code> | ||
+ | | Not Counting Adapter Header | ||
+ | |- | ||
+ | | <code>MAX_IP_PACKET = 65536;</code> | ||
+ | | Not Counting Adapter Header | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>MAX_FRAG_LIFE = 32000;</code> | ||
+ | | Only wait 32 seconds for the rest of the packet | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>IP_HEADER_SIZE = 20;</code> | ||
+ | | SizeOf(TIPHeader); (Does Not Allow for Options) | ||
+ | |- | ||
+ | | <code>IP_OPTIONS_SIZE = 40;</code> | ||
+ | | Maximum Allowed Options | ||
+ | |- | ||
+ | | <code>IP_PSEUDO_SIZE = 12;</code> | ||
+ | | SizeOf(TPseudoHeader); | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>IP_PACKET_SIZE = 56;</code> | ||
+ | | SizeOf(TIPPacket); (Previously 46) | ||
+ | |- | ||
+ | | <code>IP_FRAGMENT_SIZE = 12;</code> | ||
+ | | SizeOf(TIPFragment); | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP header flags / fragment offset constants''' <code> IP_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IP_CE = $8000;</code> | ||
+ | | Congestion Experienced | ||
+ | |- | ||
+ | | <code>IP_DF = $4000;</code> | ||
+ | | 1 = Don't Fragment 0 = May Fragment | ||
+ | |- | ||
+ | | <code>IP_MF = $2000;</code> | ||
+ | | 1 = More Fragments 0 = Last Fragment | ||
+ | |- | ||
+ | | <code>IP_OFFMASK = $1FFF;</code> | ||
+ | | Fragment Offset Mask | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP header option constants''' <code> IPOPT_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IPOPT_EOL = 0;</code> | ||
+ | | end-of-option list | ||
+ | |- | ||
+ | | <code>IPOPT_NOP = 1;</code> | ||
+ | | no-operation | ||
+ | |- | ||
+ | | <code>IPOPT_RR = 7;</code> | ||
+ | | record packet route | ||
+ | |- | ||
+ | | <code>IPOPT_TS = 68;</code> | ||
+ | | timestamp | ||
+ | |- | ||
+ | | <code>IPOPT_SECURITY = 130;</code> | ||
+ | | provide s,c,h,tcc | ||
+ | |- | ||
+ | | <code>IPOPT_LSRR = 131;</code> | ||
+ | | loose source route | ||
+ | |- | ||
+ | | <code>IPOPT_SATID = 136;</code> | ||
+ | | satnet id | ||
+ | |- | ||
+ | | <code>IPOPT_SSRR = 137;</code> | ||
+ | | strict source route | ||
+ | |- | ||
+ | | <code>IPOPT_RA = 148;</code> | ||
+ | | router alert | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP offset option constants''' <code> IPOPT_OFFSET* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Offsets to fields in IP Options other than EOL and NOP | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>IPOPT_OPTVAL = 0;</code> | ||
+ | | option ID | ||
+ | |- | ||
+ | | <code>IPOPT_OLEN = 1;</code> | ||
+ | | option length | ||
+ | |- | ||
+ | | <code>IPOPT_OFFSET = 2;</code> | ||
+ | | offset within option | ||
+ | |- | ||
+ | | <code>IPOPT_MINOFF = 4;</code> | ||
+ | | min value of above | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP TS flag option constants''' <code> IPOPT_TS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Flags for IPOPT_TS Flags | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>IPOPT_TS_TSONLY = 0;</code> | ||
+ | | timestamps only | ||
+ | |- | ||
+ | | <code>IPOPT_TS_TSANDADDR = 1;</code> | ||
+ | | timestamps and addresses | ||
+ | |- | ||
+ | | <code>IPOPT_TS_PRESPEC = 3;</code> | ||
+ | | specified modules only | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP security flag constants''' <code> IPOPT_SECUR_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Flags for IPOPT_SECURITY Flags (Network Order) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_UNCLASS = $0000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_CONFID = $F135;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_EFTO = $789A;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_MMMM = $BC4D;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_RESTR = $AF13;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_SECRET = $D788;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPOPT_SECUR_TOPSECRET = $6BC5;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''IP type of service constants''' <code> IPTOS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IPTOS_LOWDELAY = $10;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>IPTOS_THROUGHPUT = $08;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPTOS_RELIABILITY = $04;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IPTOS_MINCOST = $02;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 06:01, 21 December 2016
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
To be documented
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