Difference between revisions of "Unit Loopback"

From Ultibo.org
Jump to: navigation, search
Line 54: Line 54:
 
----
 
----
  
''To be documented''
+
 
 +
'''Loopback adapter'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TLoopbackAdapter = class(TNetworkAdapter)</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:TAdapterManager; ADevice:PNetworkDevice; const AName:String);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FHardwareAddress:THardwareAddress;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>function AddTransport(APacketType,AFrameType:Word; const APacketName:String; APacketHandler:TAdapterPacketHandler):THandle; override;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveTransport(AHandle:THandle; APacketType:Word):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetMTU(AHandle:THandle):Word; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function SendPacket(AHandle:THandle; ADest:Pointer; APacket:PPacketFragment; ASize:Integer):Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetHardwareAddress(AHandle:THandle):THardwareAddress; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartAdapter:Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopAdapter:Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessAdapter:Boolean; override;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Loopback adapter transport'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TLoopbackAdapterTransport = class(TAdapterTransport)</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>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Buffer:TAdapterBuffer; </code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===

Revision as of 06:23, 15 March 2017

Return to Unit Reference


Description


Ultibo Loopback Network adapter unit

To be documented

Constants



Loopback specific constants _LOOPBACK_*
MAX_LOOPBACK_BUFFERS = 256; Used for Recv Queues (Increased to Handle Higher Data Rate)
MIN_LOOPBACK_BUFFERS = 4; Used for Send Queues


Type definitions



Loopback buffer

PLoopbackBuffer = ^TLoopbackBuffer;

TLoopbackBuffer = packed record

Size:Word; Size of Data
Data:array[0..MAX_PHYSICAL_PACKET - 3] of Byte; MAX_PHYSICAL_PACKET - Word


Class definitions



Loopback adapter

TLoopbackAdapter = class(TNetworkAdapter)

constructor Create(AManager:TAdapterManager; ADevice:PNetworkDevice; const AName:String);  
private
FHardwareAddress:THardwareAddress;  
public
function AddTransport(APacketType,AFrameType:Word; const APacketName:String; APacketHandler:TAdapterPacketHandler):THandle; override;  
function RemoveTransport(AHandle:THandle; APacketType:Word):Boolean; override;  
 
function GetMTU(AHandle:THandle):Word; override;  
 
function SendPacket(AHandle:THandle; ADest:Pointer; APacket:PPacketFragment; ASize:Integer):Boolean; override;  
 
function GetHardwareAddress(AHandle:THandle):THardwareAddress; override;  
 
function StartAdapter:Boolean; override;  
function StopAdapter:Boolean; override;  
function ProcessAdapter:Boolean; override;  

Loopback adapter transport

TLoopbackAdapterTransport = class(TAdapterTransport)

constructor Create;  
destructor Destroy; override;  
public
Buffer:TAdapterBuffer;  


Public variables


None defined

Function declarations



Initialization functions

procedure LoopbackInit;
Description: To be documented
Note None documented


Return to Unit Reference