Difference between revisions of "Unit IPv6"

From Ultibo.org
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo IPv6 (Internet Protocol version 6) unit'''
+
'''Ultibo IPv6 (Internet Protocol Version 6) unit'''
 
+
''To be documented''
+
  
 
=== Constants ===
 
=== Constants ===
Line 124: Line 122:
 
|-
 
|-
 
| <code>VersionClassLabel:LongWord;</code>
 
| <code>VersionClassLabel:LongWord;</code>
| Version (4 bits)(Always 6) / Traffic Class (8 bits) / Flow Label (20 bits)
+
| Version (4 bits)(Always 6)/Traffic Class (8 bits)/Flow Label (20 bits)
 
|-
 
|-
 
| <code>PayloadLength:Word;</code>
 
| <code>PayloadLength:Word;</code>
Line 281: Line 279:
  
  
'''IPv6 buffer'''
+
'''IPv6 specific classes'''
  
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
<code>TIP6Buffer = class(TTransportBufferEx)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|Note: Different to Socket Buffer.
+
| [[TIP6Buffer|<code>TIP6Buffer = class(TTransportBufferEx)</code>]]
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>constructor Create(ATransport:TNetworkTransport);</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FFirst:PIP6Packet;</code>
+
| &nbsp;
+
|-
+
| <code>FLast:PIP6Packet;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetFragment(APacket:PIP6Packet; AOffset:LongWord; ASize:Word):PIP6Fragment;</code>
+
| &nbsp;
+
|-
+
| <code>function AddFragment(APacket:PIP6Packet; AOffset:LongWord; ASize:Word):PIP6Fragment;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveFragment(APacket:PIP6Packet):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>procedure FlushFragments(APacket:PIP6Packet);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>function GetPacket(AId:LongWord; const ASource,ADest:TIn6Addr; ALock:Boolean):PIP6Packet;</code>
+
| &nbsp;
+
|-
+
| <code>function AddPacket(AId:LongWord; const ASource,ADest:TIn6Addr; ALock:Boolean):PIP6Packet;</code>
+
| &nbsp;
+
|-
+
| <code>function RemovePacket(APacket:PIP6Packet):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function UnlockPacket(APacket:PIP6Packet):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>procedure FlushPackets(All:Boolean);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function PutHeader(APacket:PIP6Packet; ABuffer:Pointer; ALength:Word):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function PutFragment(APacket:PIP6Packet; ABuffer:Pointer; AOffset,ASize,AFlags:Word):Boolean;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 transport adapter'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6TransportAdapter = class(TTransportAdapter)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6TransportAdapter|<code>TIP6TransportAdapter = class(TTransportAdapter)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>Address:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Netmask:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Gateway:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Network:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Directed:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>Server:TIn6Addr;</code>
+
| DHCP Server
+
|-
+
| <code>LeaseTime:LongWord;</code>
+
| DHCP Lease Time
+
|-
+
| <code>RetryTime:Int64;</code>
+
| DHCP Retry Time
+
|-
+
| <code>ExpiryTime:Int64;</code>
+
| DHCP Expiry Time
+
|-
+
| <code>RenewalTime:Int64;</code>
+
| DHCP Renewal Time
+
|-
+
| <code>RebindingTime:Int64;</code>
+
| DHCP Rebinding Time
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>ConfigDefault:Word;</code>
+
| BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
+
|-
+
| <code>ConfigAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>ConfigNetmask:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>ConfigGateway:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>ConfigServer:TIn6Addr;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 transport binding'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6TransportBinding = class(TTransportBinding)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6TransportBinding|<code>TIP6TransportBinding = class(TTransportBinding)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>Address:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Netmask:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Gateway:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Network:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>Directed:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>Server:TIn6Addr;</code>
+
| DHCP Server
+
|-
+
| <code>LeaseTime:LongWord;</code>
+
| DHCP Lease Time
+
|-
+
| <code>RetryTime:Int64;</code>
+
| DHCP Retry Time
+
|-
+
| <code>ExpiryTime:Int64;</code>
+
| DHCP Expiry Time
+
|-
+
| <code>RenewalTime:Int64;</code>
+
| DHCP Renewal Time
+
|-
+
| <code>RebindingTime:Int64;</code>
+
| DHCP Rebinding Time
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>ConfigDefault:Word;</code>
+
| BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
+
|-
+
| <code>ConfigAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>ConfigNetmask:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>ConfigGateway:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>ConfigServer:TIn6Addr;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 transport protocol'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6TransportProtocol = class(TTransportProtocol)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
| [[TIP6TransportProtocol|<code>TIP6TransportProtocol = class(TTransportProtocol)</code>]]
|-
+
|colspan="2"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 transport filter'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6TransportFilter = class(TTransportFilter)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
| [[TIP6TransportFilter|<code>TIP6TransportFilter = class(TTransportFilter)</code>]]
|-
+
|colspan="2"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 transport configuration'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6TransportConfig = class(TTransportConfig)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
| [[TIP6TransportConfig|<code>TIP6TransportConfig = class(TTransportConfig)</code>]]
|-
+
|colspan="2"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 transport'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6Transport = class(TNetworkTransport)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create(AManager:TTransportManager; const AName:String);</code>
+
| [[TIP6Transport|<code>TIP6Transport = class(TNetworkTransport)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FNextIP6Id:Word;</code>
+
| &nbsp;
+
|-
+
| <code>FNextIP6Lock:TMutexHandle;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FFragments:TIP6Buffer;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FHosts:TNetworkList;</code>
+
| &nbsp;
+
|-
+
| <code>FServs:TNetworkList;</code>
+
| &nbsp;
+
|-
+
| <code>FProtos:TNetworkList;</code>
+
| &nbsp;
+
|-
+
| <code>FRoutes:TNetworkList;</code>
+
| &nbsp;
+
|-
+
| <code>FNetworks:TNetworkList;</code>
+
| &nbsp;
+
|-
+
| <code>FAddresses:TNetworkList;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FDefaultAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FLoopbackAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FBroadcastAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FNameservers:TIP6Nameservers;</code>
+
| (Part of TNetworkList)
+
|-
+
| <code>FNameserverLock:TMutexHandle;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>FDefaultHopLimit:LongWord;</code>
+
| &nbsp;
+
|-
+
| <code>FAutoRelease:Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function PacketHandler(AHandle:THandle; ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function FragmentHandler(ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function CheckFragment(ABuffer:Pointer):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetNextIP6Id(AIncrement:Boolean):Word;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetIP6Nameserver(ACount:LongWord):TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetAdapterConfigType(const AName:String):Word;</code>
+
| &nbsp;
+
|-
+
| <code>function GetAdapterConfigAddress(const AName:String):TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>function GetAdapterConfigNetmask(const AName:String):TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>function GetAdapterConfigGateway(const AName:String):TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>function GetAdapterConfigServer(const AName:String):TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
+
|-
+
| <code>function FilterPacket(ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function ForwardPacket(AAdapter:TTransportAdapter; ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Nameservers:TIP6Nameservers read FNameservers;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property DefaultHopLimit:LongWord read FDefaultHopLimit write FDefaultHopLimit;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>property AutoRelease:Boolean read FAutoRelease write FAutoRelease;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AddAdapter(AAdapter:TNetworkAdapter; AConfigType:Word; AAddress,ANetmask,AGateway,AServer:Pointer):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AddProtocol(AProtocol:Word; APacketHandler:TTransportPacketHandler; AControlHandler:TTransportControlHandler):THandle; override;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveProtocol(AHandle:THandle; AProtocol:Word):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AddFilter(AProtocol:Word; AFilterHandler:TTransportFilterHandler):THandle; override;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveFilter(AHandle:THandle; AProtocol:Word):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AddConfig(AConfigType:Word; AConfigAuto:Boolean; AConfigHandler:TTransportConfigHandler):THandle; override;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveConfig(AHandle:THandle; AConfigType:Word):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function SendPacket(ASocket:TTransportSocket; ASource,ADest:Pointer; APacket:PPacketFragment; ASize,AFlags:Integer):Integer; override;</code>
+
| &nbsp;
+
|-
+
| <code>function SendControl(ASource,ADest:Pointer; AProtocol,ACommand,ACode:Word; AAddress,AData:Pointer; ASize:Integer):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetSockOpt(ASocket:TTransportSocket; ALevel,AOptName:Integer; AOptValue:PChar; var AOptLength:Integer):Integer; override;</code>
+
| &nbsp;
+
|-
+
| <code>function SetSockOpt(ASocket:TTransportSocket; ALevel,AOptName:Integer; AOptValue:PChar; AOptLength:Integer):Integer; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function StartTransport:Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function StopTransport:Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function ProcessTransport:Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function BindTransport(AAdapter:TNetworkAdapter):Boolean; override;</code>
+
| &nbsp;
+
|-
+
| <code>function UnbindTransport(AAdapter:TNetworkAdapter):Boolean; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AddNameserver(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveNameserver(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetHostByName(const AName:String; ALock:Boolean):TIP6HostEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetHostByAddress(const AAddress:TIn6Addr; ALock:Boolean):TIP6HostEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetHostByNext(APrevious:TIP6HostEntry; ALock,AUnlock:Boolean):TIP6HostEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function AddHost(const AAddress:TIn6Addr; const AName:String; AType:Word; ALock:Boolean):TIP6HostEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveHost(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>procedure FlushHosts(All:Boolean);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetRouteByAddress(const AAddress:TIn6Addr; ALock:Boolean; AState:LongWord):TIP6RouteEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetRouteByNetwork(const ANetwork,AAddress:TIn6Addr; ALock:Boolean; AState:LongWord):TIP6RouteEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetRouteByNext(APrevious:TIP6RouteEntry; ALock,AUnlock:Boolean; AState:LongWord):TIP6RouteEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function AddRoute(const ANetwork,ANetmask,AGateway,AAddress:TIn6Addr; AType:Word; ALock:Boolean; AState:LongWord):TIP6RouteEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveRoute(const ANetwork,AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>procedure FlushRoutes(All:Boolean);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetAddressByAddress(const AAddress:TIn6Addr; ALock:Boolean; AState:LongWord):TIP6AddressEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetAddressByNext(APrevious:TIP6AddressEntry; ALock,AUnlock:Boolean; AState:LongWord):TIP6AddressEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function AddAddress(const AAddress:TIn6Addr; AType:Word; AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TIP6AddressEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveAddress(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>procedure FlushAddresses(All:Boolean);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetNetworkByName(const AName:String; ALock:Boolean):TIP6NetworkEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetNetworkByAddress(const ANetwork:TIn6Addr; ALock:Boolean):TIP6NetworkEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function AddNetwork(const AName:String; const ANetwork:TIn6Addr; ALock:Boolean):TIP6NetworkEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveNetwork(const AName:String):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetServByName(const AName,AProtocol:String; ALock:Boolean):TIP6ServEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetServByPort(APort:Word; const AProtocol:String; ALock:Boolean):TIP6ServEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function AddServ(const AName,AProtocol:String; APort:Word; ALock:Boolean):TIP6ServEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveServ(const AName,AProtocol:String):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetProtoByName(const AName:String; ALock:Boolean):TIP6ProtoEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function GetProtoByNumber(ANumber:Word; ALock:Boolean):TIP6ProtoEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function AddProto(const AName:String; ANumber:Word; ALock:Boolean):TIP6ProtoEntry;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveProto(const AName:String):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function CompareLocal(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareDefault(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareLoopback(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareDirected(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareBroadcast(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareMulticast(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareAddress(const AAddress1,AAddress2:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function CompareSubnet(const AAddress,ANetwork,ANetmask:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 state'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6State = class(TTransportState)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6State|<code>TIP6State = class(TTransportState)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FLocalAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FRemoteAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetLocalAddress(const ALocalAddress:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetRemoteAddress(const ARemoteAddress:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property LocalAddress:TIn6Addr read FLocalAddress write SetLocalAddress;</code>
+
| &nbsp;
+
|-
+
| <code>property RemoteAddress:TIn6Addr read FRemoteAddress write SetRemoteAddress;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 options'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6Options = class(TTransportOptions)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6Options|<code>TIP6Options = class(TTransportOptions)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
| <code>destructor Destroy; override;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FHopLimit:Byte;</code>
+
| Hop Limit
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetHopLimit(AHopLimit:Byte);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property HopLimit:Byte read FHopLimit write SetHopLimit;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 host entry'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6HostEntry = class(THostEntry)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6HostEntry|<code>TIP6HostEntry = class(THostEntry)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FAddresses:array[0..MAX_HOST_ALIASES - 1] of TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function GetAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetAddress(const AAddress:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
| <code>function GetAddresses(Index:Integer):TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Address:TIn6Addr read GetAddress write SetAddress;</code>
+
| &nbsp;
+
|-
+
| <code>property Addresses[Index:Integer]:TIn6Addr read GetAddresses;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function FindAddress(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>function AddAddress(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
|-
+
| <code>function RemoveAddress(const AAddress:TIn6Addr):Boolean;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 route entry'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6RouteEntry = class(TRouteEntry)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6RouteEntry|<code>TIP6RouteEntry = class(TRouteEntry)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FNetwork:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FNetmask:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FGateway:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
| <code>FAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetNetwork(const ANetwork:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetNetmask(const ANetmask:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetGateway(const AGateway:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
| <code>procedure SetAddress(const AAddress:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Network:TIn6Addr read FNetwork write SetNetwork;</code>
+
| &nbsp;
+
|-
+
| <code>property Netmask:TIn6Addr read FNetmask write SetNetmask;</code>
+
| &nbsp;
+
|-
+
| <code>property Gateway:TIn6Addr read FGateway write SetGateway;</code>
+
| &nbsp;
+
|-
+
| <code>property Address:TIn6Addr read FAddress write SetAddress;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 address entry'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6AddressEntry = class(TAddressEntry)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
|colspan="2"|Note: Used for secondary addresses.
+
| [[TIP6AddressEntry|<code>TIP6AddressEntry = class(TAddressEntry)</code>]]
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>constructor Create;</code>
+
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FAddress:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetAddress(const AAddress:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Address:TIn6Addr read FAddress write SetAddress;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 network entry'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6NetworkEntry = class(TNetworkEntry)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6NetworkEntry|<code>TIP6NetworkEntry = class(TNetworkEntry)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
| <code>FNetwork:TIn6Addr;</code>
+
| &nbsp;
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
| <code>procedure SetNetwork(const ANetwork:TIn6Addr);</code>
+
| &nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
| <code>property Network:TIn6Addr read FNetwork write SetNetwork;</code>
+
| &nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 service entry'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6ServEntry = class(TServEntry)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6ServEntry|<code>TIP6ServEntry = class(TServEntry)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div>
+
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
+
'''IPv6 protocol entry'''
+
 
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
+
 
+
<code>TIP6ProtoEntry = class(TProtoEntry)</code>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
 
|-
 
|-
| <code>constructor Create;</code>
+
| [[TIP6ProtoEntry|<code>TIP6ProtoEntry = class(TProtoEntry)</code>]]
| style="width: 50%;"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
|-
+
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
+
|-
+
|colspan="2"|&nbsp;
+
 
|-
 
|-
 
|}
 
|}
</div></div> 
 
 
<br />
 
<br />
  
Line 1,181: Line 375:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 1,196: Line 390:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet without Adapter header
 
| Complete packet without Adapter header
 
|-
 
|-
Line 1,208: Line 402:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet including Transport header
 
| Complete packet including Transport header
 
|-
 
|-
Line 1,220: Line 414:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet including Transport header
 
| Complete packet including Transport header
 
|-
 
|-
Line 1,232: Line 426:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet including Transport header
 
| Complete packet including Transport header
 
|-
 
|-
Line 1,244: Line 438:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet including Transport header
 
| Complete packet including Transport header
 
|-
 
|-
Line 1,256: Line 450:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet including Transport header
 
| Complete packet including Transport header
 
|-
 
|-
Line 1,268: Line 462:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Complete packet including Transport header
 
| Complete packet including Transport header
 
|-
 
|-

Latest revision as of 05:26, 31 August 2021

Return to Unit Reference


Description


Ultibo IPv6 (Internet Protocol Version 6) unit

Constants



IPv6 specific constants IP6_TRANSPORT_*
IP6_TRANSPORT_NAME = 'IPV6';  


IPv6 header IP6_HEADER_*
MIN_IP6_PACKET = 40; Not Counting Adapter Header
MAX_IP6_PACKET = 1500; Not Counting Adapter Header
 
MAX_FRAG_LIFE = 32000; Only wait 32 seconds for the rest of the packet
 
IP6_HEADER_SIZE = 40; SizeOf(TIP6Header); Does Not Allow for Extensions


IPv6 extension header IP6_HEADER_*
See: https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
 
IP6_HEADER_HOP = 0; Hop-by-hop option header
IP6_HEADER_TCP = 6; Next header is a TCP segment (The payload)
IP6_HEADER_UDP = 17; Next header is a UDP message (The payload)
IP6_HEADER_IPV6 = 41; Next header is a IPv6 packet (IPv6 Encapsulation) (The payload)
IP6_HEADER_ROUTING = 43; Next header is a Routing header
IP6_HEADER_FRAGMENT = 44; Next header is a Fragmentation/reassembly header
IP6_HEADER_GRE = 47; Next header is a GRE header
IP6_HEADER_ESP = 50; Next header is a Encapsulating security payload
IP6_HEADER_AUTH = 51; Next header is a Authentication header
IP6_HEADER_ICMP = 58; Next header is a ICMP for IPv6 message
IP6_HEADER_NONE = 59; There is no next header (Do not process payload)
IP6_HEADER_DEST = 60; Next header is a Destination options header
IP6_HEADER_SCTP = 132; Next header is a SCTP message (The payload)
IP6_HEADER_MOBILITY = 135; Next header is a Mobility header
 
IP6_MTU = MAX_IP6_PACKET;  


Type definitions



IPv6 header

PIP6Header = ^TIP6Header;

TIP6Header = packed record

Note: 40 Bytes
VersionClassLabel:LongWord; Version (4 bits)(Always 6)/Traffic Class (8 bits)/Flow Label (20 bits)
PayloadLength:Word; The size of the payload in octets, including any extension headers (The length is set to zero when a Hop-by-Hop extension header carries a Jumbo Payload option)
NextHeader:Byte; Specifies the type of the next header (When extension headers are present in the packet this field indicates which extension header follows)
HopLimit:Byte; This value is decremented by one at each intermediate node visited by the packet. When the counter reaches 0 the packet is discarded (Replaces the time to live field of IPv4)
SourceIP:TIn6Addr; Source IP
DestIP:TIn6Addr; Destination IP

IPv6 extension header

PIP6ExtensionHeader = ^TIP6ExtensionHeader;

TIP6ExtensionHeader = packed record

Note: 2 Bytes (Common Header of all Extension Headers)
NextHeader:Byte; Specifies the type of the next header (If zero discard the packet)
ExtensionLength:Byte;  

IPv6 pseudo

PIP6Pseudo = ^TIP6Pseudo;

TIP6Pseudo = packed record

Note: ?? Bytes (Used by UDP/TCP Checksum)
SourceIP:TIn6Addr; Source IP
DestIP:TIn6Addr; Destination IP
Mbz:Byte; Must Be Zero
Protocol:Byte; IP6 Protocol Type IPPROTO_UDP, IPPROTO_TCP etc
Length:Word; Length of UDP/TCP Header and Data

IPv6 fragment

PIP6Fragment = ^TIP6Fragment;

TIP6Fragment = record

Note: ?? Bytes (Used by Fragment Buffer)
Offset:LongWord; Offset of this Fragment in the Packet
Size:Word; Size of this Fragment
Prev:PIP6Fragment; Pointer to Prev Fragment
Next:PIP6Fragment; Pointer to Next Fragment

IPv6 packet

PIP6Packet = ^TIP6Packet;

TIP6Packet = record

Note: ?? Bytes (Used by Fragment Buffer)
Lock:TMutexHandle; Packet Lock
 
Id:LongWord; IP6 Id
Dest:TIn6Addr; IP6 Dest
Source:TIn6Addr; IP6 Source
 
Data:Pointer; Pointer to Data
Timeout:Int64; Packet Timeout
Total:Word; IP Total Length
Length:Word; IP Header Length
Received:Word; Received Bytes
Prev:PIP6Packet; Pointer to Prev Packet
Next:PIP6Packet; Pointer to Next Packet
First:PIP6Fragment; Pointer to First Fragment
Last:PIP6Fragment; Pointer to Last Fragment


Class definitions



IPv6 specific classes

TIP6Buffer = class(TTransportBufferEx)
TIP6TransportAdapter = class(TTransportAdapter)
TIP6TransportBinding = class(TTransportBinding)
TIP6TransportProtocol = class(TTransportProtocol)
TIP6TransportFilter = class(TTransportFilter)
TIP6TransportConfig = class(TTransportConfig)
TIP6Transport = class(TNetworkTransport)
TIP6State = class(TTransportState)
TIP6Options = class(TTransportOptions)
TIP6HostEntry = class(THostEntry)
TIP6RouteEntry = class(TRouteEntry)
TIP6AddressEntry = class(TAddressEntry)
TIP6NetworkEntry = class(TNetworkEntry)
TIP6ServEntry = class(TServEntry)
TIP6ProtoEntry = class(TProtoEntry)


Public variables


None defined

Function declarations



Initialization functions

procedure IP6Init;
Description: To be documented
Note None documented


IPv6 functions

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


function GetIP6Protocol(ABuffer:Pointer):Byte;
Description: To be documented
Buffer Complete packet including Transport header


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


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


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


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


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


Return to Unit Reference