Difference between revisions of "Unit IP"

From Ultibo.org
Jump to: navigation, search
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
----
 
----
 +
 +
'''Ultibo IP (Internet Protocol) unit'''
  
 
''To be documented''
 
''To be documented''
Line 10: Line 12:
 
----
 
----
  
''To be documented''
+
 
 +
<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%;"|&nbsp;
 +
|-
 +
|}
 +
</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"|&nbsp;
 +
|-
 +
| <code>MAX_FRAG_LIFE = 32000;</code>
 +
| Only wait 32 seconds for the rest of the packet
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <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"|&nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_UNCLASS = $0000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_CONFID = $F135;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_EFTO = $789A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_MMMM = $BC4D;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_RESTR = $AF13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_SECRET = $D788;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPOPT_SECUR_TOPSECRET = $6BC5;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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%;"|&nbsp;
 +
|-
 +
| <code>IPTOS_THROUGHPUT = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPTOS_RELIABILITY = $04;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPTOS_MINCOST = $02;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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



[Expand]
IP specific constants IP_TRANSPORT_NAME*


[Expand]
IP constants IP_*_SIZE


[Expand]
IP header flags / fragment offset constants IP_*


[Expand]
IP header option constants IPOPT_*


[Expand]
IP offset option constants IPOPT_OFFSET*


[Expand]
IP TS flag option constants IPOPT_TS_*


[Expand]
IP security flag constants IPOPT_SECUR_*


[Expand]
IP type of service constants IPTOS_*


Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

[Expand]
procedure IPInit;
Description: To be documented


IP functions

[Expand]
function CheckIP(ABuffer:Pointer):Boolean;
Description: Verify that the packet is a valid IP packet


[Expand]
function GetIPHeaderOffset(ABuffer:Pointer):Word;
Description: Return Start of the IP Header (Start of Packet)


[Expand]
function GetIPHeaderLength(ABuffer:Pointer):Word;
Description: Return Size of IP Header (Including Options)


[Expand]
function GetIPOptionsLength(ABuffer:Pointer):Word;
Description: Return Size of IP Options (Header - IP_HEADER_SIZE)


[Expand]
function GetIPDataOffset(ABuffer:Pointer):Word;
Description: Return Start of IP Packet Data (Length of IP Header)


[Expand]
function GetIPDataLength(ABuffer:Pointer):Word;
Description: Return Size of IP Packet Data (IP TotalLength - IP Header)


[Expand]
function ChecksumIPRecv(ABuffer:Pointer; AOffset,ALength:Word):Word;
Description: Validate the IP Header and Options Checksum on Receive


[Expand]
function ChecksumIPSend(AHeader,AOptions:Pointer; ALength:Word):Word;
Description: Checksum the IP Header and Options on Send


Return to Unit Reference