TNetworkAdapter

From Ultibo.org
Revision as of 07:05, 20 August 2019 by Ultibo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Return to Unit Network


Description


To be documented

Class definitions



TNetworkAdapter = class(TListObject)

constructor Create(AManager:TAdapterManager; ADevice:PNetworkDevice; const AName:String);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
protected
FManager:TAdapterManager;  
FDevice:PNetworkDevice;  
FName:String;  
 
FState:Integer;  
FStatus:Integer;  
FMediaType:Word; Physical Media type (Ethernet/Tokenring etc)
FAdapterType:Word; Adapter type (Wired/Loopback/Wireless etc)
FLastError:Integer;  
FThread:TAdapterThread; Thread for adapter receiving
FBufferedReceive:Boolean;  
FBufferedTransmit:Boolean;  
 
FBindings:TNetworkList; List of TAdapterBinding objects
FTransports:TNetworkList; List of TAdapterTransport objects
FMonitors:TNetworkList; List of TAdapterMonitor objects
FAuthenticators:TNetworkList; List of TAdapterAuthenticator objects
 
FStatistics:TAdapterStatistics;  
 
function GetName:String;  
function GetThreadID:TThreadID;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
public
property Manager:TAdapterManager read FManager;  
property Device:PNetworkDevice read FDevice;  
property Name:String read GetName;  
 
property State:Integer read FState;  
property Status:Integer read FStatus write SetStatus;  
property MediaType:Word read FMediaType;  
property AdapterType:Word read FAdapterType;  
property LastError:Integer read FLastError;  
property ThreadID:TThreadID read GetThreadID;  
property BufferedReceive:Boolean read FBufferedReceive;  
property BufferedTransmit:Boolean read FBufferedTransmit;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  
 
function GetTransportByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterTransport;  
function GetTransportByType(APacketType,AFrameType:Word; ALock:Boolean; AState:LongWord):TAdapterTransport;  
function GetTransportByTransport(ATransport:TAdapterTransport; ALock:Boolean; AState:LongWord):TAdapterTransport;  
function GetTransportByNext(APrevious:TAdapterTransport; ALock,AUnlock:Boolean; AState:LongWord):TAdapterTransport;  
 
function GetBindingByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterBinding;  
function GetBindingByType(ATransport:TAdapterTransport; APacketType,AFrameType:Word; ALock:Boolean; AState:LongWord):TAdapterBinding;  
function GetBindingByTransport(ATransport:TAdapterTransport; ALock:Boolean; AState:LongWord):TAdapterBinding;  
function GetBindingByBinding(ABinding:TAdapterBinding; ALock:Boolean; AState:LongWord):TAdapterBinding;  
function GetBindingByNext(APrevious:TAdapterBinding; ALock,AUnlock:Boolean; AState:LongWord):TAdapterBinding;  
 
function GetMonitorByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterMonitor;  
function GetMonitorByMonitor(AMonitor:TAdapterMonitor; ALock:Boolean; AState:LongWord):TAdapterMonitor;  
function GetMonitorByNext(APrevious:TAdapterMonitor; ALock,AUnlock:Boolean; AState:LongWord):TAdapterMonitor;  
 
function GetAuthenticatorByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterAuthenticator;  
function GetAuthenticatorByType(AAuthType:Word; ALock:Boolean; AState:LongWord):TAdapterAuthenticator;  
function GetAuthenticatorByAuthenticator(AAuthenticator:TAdapterAuthenticator; ALock:Boolean; AState:LongWord):TAdapterAuthenticator;  
function GetAuthenticatorByNext(APrevious:TAdapterAuthenticator; ALock,AUnlock:Boolean; AState:LongWord):TAdapterAuthenticator;  
 
function AddTransport(APacketType,AFrameType:Word; const APacketName:String; APacketHandler:TAdapterPacketHandler):THandle; virtual;  
function RemoveTransport(AHandle:THandle; APacketType:Word):Boolean; virtual;  
 
function AddBinding(ATransport:TAdapterTransport; APacketType,AFrameType:Word):THandle; virtual;  
function RemoveBinding(AHandle:THandle; APacketType:Word):Boolean; virtual;  
 
function AddMonitor(AMonitorHandler:TAdapterMonitorHandler):THandle; virtual;  
function RemoveMonitor(AHandle:THandle):Boolean; virtual;  
 
function AddAuthenticator(AAuthType:Word; AAuthenticatorHandler:TAdapterAuthenticatorHandler):THandle; virtual;  
function RemoveAuthenticator(AHandle:THandle; AAuthType:Word):Boolean; virtual;  
 
function GetMTU(AHandle:THandle):Word; virtual;  
 
function SendPacket(AHandle:THandle; ADest:Pointer; APacket:PPacketFragment; ASize:Integer):Boolean; virtual;  
 
function ResetInterface(AHandle:THandle):Boolean; virtual;  
function TerminateDriver(AHandle:THandle):Boolean; virtual;  
 
function GetReceiveMode(AHandle:THandle):Word; virtual;  
function SetReceiveMode(AHandle:THandle; AMode:Word):Boolean; virtual;  
 
function ClearStatistics(AHandle:THandle):Boolean; virtual;  
function GetStatistics(AHandle:THandle):TAdapterStatistics; virtual;  
 
function GetDefaultAddress(AHandle:THandle):THardwareAddress; virtual;  
function GetHardwareAddress(AHandle:THandle):THardwareAddress; virtual;  
function SetHardwareAddress(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  
function GetBroadcastAddress(AHandle:THandle):THardwareAddress; virtual;  
function GetMulticastAddresses(AHandle:THandle):TMulticastAddresses; virtual;  
 ;
function AddMulticastAddress(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  
function RemoveMulticastAddress(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  
 
function StartAdapter:Boolean; virtual;  
function StopAdapter:Boolean; virtual;  
function ProcessStatus:Boolean; virtual;  
function ProcessAdapter:Boolean; virtual;  
 
function CompareAddress(const AAddress1,AAddress2:THardwareAddress):Boolean; virtual;  
function CompareDefault(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  
function CompareHardware(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  
function CompareBroadcast(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  
function CompareMulticast(AHandle:THandle; const AAddress:THardwareAddress):Boolean; virtual;  


Function declarations



constructor TNetworkAdapter.Create(AManager:TAdapterManager; ADevice:PNetworkDevice; const AName:String);
Description: To be documented
Note None documented


destructor TNetworkAdapter.Destroy;
Description: To be documented
Note None documented


function TNetworkAdapter.GetName:String;
Description: To be documented
Note None documented


function TNetworkAdapter.GetThreadID:TThreadID;
Description: To be documented
Note None documented


procedure TNetworkAdapter.SetStatus(AStatus:Integer);
Description: To be documented
Note None documented


function TNetworkAdapter.AcquireLock:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ReleaseLock:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ReaderLock:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ReaderUnlock:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ReaderConvert:Boolean;
Description: Convert a Reader lock to a Writer lock
Note None documented


function TNetworkAdapter.WriterLock:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.WriterUnlock:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.WriterConvert:Boolean;
Description: Convert a Writer lock to a Reader lock
Note None documented


function TNetworkAdapter.GetTransportByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterTransport;
Description: To be documented
Note None documented


function TNetworkAdapter.GetTransportByType(APacketType,AFrameType:Word; ALock:Boolean; AState:LongWord):TAdapterTransport;
Description: To be documented
Note None documented


function TNetworkAdapter.GetTransportByTransport(ATransport:TAdapterTransport; ALock:Boolean; AState:LongWord):TAdapterTransport;
Description: To be documented
Note None documented


function TNetworkAdapter.GetTransportByNext(APrevious:TAdapterTransport; ALock,AUnlock:Boolean; AState:LongWord):TAdapterTransport;
Description: To be documented
Note None documented


function TNetworkAdapter.GetBindingByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterBinding;
Description: To be documented
Note None documented


function TNetworkAdapter.GetBindingByType(ATransport:TAdapterTransport; APacketType,AFrameType:Word; ALock:Boolean; AState:LongWord):TAdapterBinding;
Description: To be documented
Note None documented


function TNetworkAdapter.GetBindingByTransport(ATransport:TAdapterTransport; ALock:Boolean; AState:LongWord):TAdapterBinding;
Description: To be documented
Note None documented


function TNetworkAdapter.GetBindingByBinding(ABinding:TAdapterBinding; ALock:Boolean; AState:LongWord):TAdapterBinding;
Description: To be documented
Note None documented


function TNetworkAdapter.GetBindingByNext(APrevious:TAdapterBinding; ALock,AUnlock:Boolean; AState:LongWord):TAdapterBinding;
Description: To be documented
Note None documented


function TNetworkAdapter.GetMonitorByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterMonitor;
Description: To be documented
Note None documented


function TNetworkAdapter.GetMonitorByMonitor(AMonitor:TAdapterMonitor; ALock:Boolean; AState:LongWord):TAdapterMonitor;
Description: To be documented
Note None documented


function TNetworkAdapter.GetMonitorByNext(APrevious:TAdapterMonitor; ALock,AUnlock:Boolean; AState:LongWord):TAdapterMonitor;
Description: To be documented
Note None documented


function TNetworkAdapter.GetAuthenticatorByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAdapterAuthenticator;
Description: To be documented
Note None documented


function TNetworkAdapter.GetAuthenticatorByType(AAuthType:Word; ALock:Boolean; AState:LongWord):TAdapterAuthenticator;
Description: To be documented
Note None documented


function TNetworkAdapter.GetAuthenticatorByAuthenticator(AAuthenticator:TAdapterAuthenticator; ALock:Boolean; AState:LongWord):TAdapterAuthenticator;
Description: To be documented
Note None documented


function TNetworkAdapter.GetAuthenticatorByNext(APrevious:TAdapterAuthenticator; ALock,AUnlock:Boolean; AState:LongWord):TAdapterAuthenticator;
Description: To be documented
Note None documented


function TNetworkAdapter.AddTransport(APacketType,AFrameType:Word; const APacketName:String; APacketHandler:TAdapterPacketHandler):THandle;
Description: To be documented
Note None documented


function TNetworkAdapter.RemoveTransport(AHandle:THandle; APacketType:Word):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.AddBinding(ATransport:TAdapterTransport; APacketType,AFrameType:Word):THandle;
Description: To be documented
Note None documented


function TNetworkAdapter.RemoveBinding(AHandle:THandle; APacketType:Word):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.AddMonitor(AMonitorHandler:TAdapterMonitorHandler):THandle;
Description: To be documented
Note None documented


function TNetworkAdapter.RemoveMonitor(AHandle:THandle):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.AddAuthenticator(AAuthType:Word; AAuthenticatorHandler:TAdapterAuthenticatorHandler):THandle;
Description: To be documented
Note None documented


function TNetworkAdapter.RemoveAuthenticator(AHandle:THandle; AAuthType:Word):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.GetMTU(AHandle:THandle):Word;
Description: To be documented
Note None documented


function TNetworkAdapter.SendPacket(AHandle:THandle; ADest:Pointer; APacket:PPacketFragment; ASize:Integer):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ResetInterface(AHandle:THandle):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.TerminateDriver(AHandle:THandle):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.GetReceiveMode(AHandle:THandle):Word;
Description: To be documented
Note None documented


function TNetworkAdapter.SetReceiveMode(AHandle:THandle; AMode:Word):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ClearStatistics(AHandle:THandle):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.GetStatistics(AHandle:THandle):TAdapterStatistics;
Description: To be documented
Note None documented


function TNetworkAdapter.GetDefaultAddress(AHandle:THandle):THardwareAddress;
Description: To be documented
Note None documented


function TNetworkAdapter.GetHardwareAddress(AHandle:THandle):THardwareAddress;
Description: To be documented
Note None documented


function TNetworkAdapter.SetHardwareAddress(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.GetBroadcastAddress(AHandle:THandle):THardwareAddress;
Description: To be documented
Note None documented


function TNetworkAdapter.GetMulticastAddresses(AHandle:THandle):TMulticastAddresses;
Description: To be documented
Note None documented


function TNetworkAdapter.AddMulticastAddress(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.RemoveMulticastAddress(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.StartAdapter:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.StopAdapter:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ProcessStatus:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.ProcessAdapter:Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.CompareAddress(const AAddress1,AAddress2:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.CompareDefault(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.CompareHardware(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.CompareBroadcast(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


function TNetworkAdapter.CompareMulticast(AHandle:THandle; const AAddress:THardwareAddress):Boolean;
Description: To be documented
Note None documented


Return to Unit Reference