Difference between revisions of "Unit Network"
Line 735: | Line 735: | ||
---- | ---- | ||
− | '' | + | |
+ | '''Hardware address''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PHardwareAddress = ^THardwareAddress;</code> | ||
+ | |||
+ | <code>THardwareAddress = array[0..HARDWARE_ADDRESS_SIZE - 1] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Hardware addresses''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PHardwareAddresses = ^THardwareAddresses;</code> | ||
+ | |||
+ | <code>THardwareAddresses = array[0..0] of THardwareAddress;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Multicast addresses''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMulticastAddresses = ^TMulticastAddresses;</code> | ||
+ | |||
+ | <code>TMulticastAddresses = array[0..MAX_MULTICAST_ADDRESS - 1] of THardwareAddress;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network packet''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkPacket = ^TNetworkPacket;</code> | ||
+ | |||
+ | <code>TNetworkPacket = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Buffer:Pointer;</code> | ||
+ | | Pointer to buffer (Set by driver that owns this packet) | ||
+ | |- | ||
+ | | <code>Data:Pointer;</code> | ||
+ | | Start of data within buffer (Set by driver that owns this packet) | ||
+ | |- | ||
+ | | <code>Length:LongInt;</code> | ||
+ | | Length of packet data (Set by driver on Receive / Set by caller on Transmit, contains maximum length on Allocate) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Packet specific flags (eg Error, Broadcast etc) (Dependent on network type) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network Buffer''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkBuffer = ^TNetworkBuffer;</code> | ||
+ | |||
+ | <code>TNetworkBuffer = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Wait:TSemaphoreHandle;</code> | ||
+ | | Packet ready semaphore | ||
+ | |- | ||
+ | | <code>Start:LongWord;</code> | ||
+ | | Index of first packet ready | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Number of packets ready in buffer | ||
+ | |- | ||
+ | | <code>Packets:array[0..(NETWORK_BUFFER_SIZE - 1)] of PNetworkPacket;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkEntry = ^TNetworkEntry;</code> | ||
+ | |||
+ | <code>TNetworkEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Buffer:Pointer;</code> | ||
+ | | Pointer to buffer (Allocated by driver that owns this entry) | ||
+ | |- | ||
+ | | <code>Size:LongWord;</code> | ||
+ | | Size of the buffer (Total size, usable size is Size minus Offset) | ||
+ | |- | ||
+ | | <code>Offset:LongWord;</code> | ||
+ | | Offset to start of data (Data for first packet will be at Buffer plus Offset, must be less than size) | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Number of packets in the entry (Set by driver that owns this entry, must be at least one) | ||
+ | |- | ||
+ | | <code>DriverData:Pointer;</code> | ||
+ | | Driver private data (Managed by driver that owns this entry) | ||
+ | |- | ||
+ | | <code>Packets:array of TNetworkPacket; {Array of 0 to Count - 1 packets in this entry</code> | ||
+ | | Allocated by driver that owns this entry, must be at least one) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network queue''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkQueue = ^TNetworkQueue;</code> | ||
+ | |||
+ | <code>TNetworkQueue = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Buffer:TBufferHandle;</code> | ||
+ | | Handle for entry buffers | ||
+ | |- | ||
+ | | <code>Wait:TSemaphoreHandle;</code> | ||
+ | | Entry ready semaphore | ||
+ | |- | ||
+ | | <code>Start:LongWord;</code> | ||
+ | | Index of first entry ready | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Number of entries ready in queue | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Queue specific flags (eg Paused, Halted etc) (Managed by driver) | ||
+ | |- | ||
+ | | <code>Entries:array of PNetworkEntry;</code> | ||
+ | | Array of 0 to Total - 1 entries in this queue (Allocated by driver that owns this queue) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network enumeration callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkEnumerate = function(Network:PNetworkDevice; Data:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network notification callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network device open''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkDeviceOpen = function(Network:PNetworkDevice):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network device close''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkDeviceClose = function(Network:PNetworkDevice):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network device read''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkDeviceRead = function(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network device write''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkDeviceWrite = function(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network device control''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkDeviceControl = function(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network buffer allocate''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkBufferAllocate = function(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network buffer release''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkBufferRelease = function(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network buffer receive''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkBufferReceive = function(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network buffer transmit''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkBufferTransmit = function(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network device types''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkDevice = ^TNetworkDevice;</code> | ||
+ | |||
+ | <code>TNetworkDevice = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Device Properties'' | ||
+ | |- | ||
+ | | <code>Device:TDevice;</code> | ||
+ | | The Device entry for this Network | ||
+ | |- | ||
+ | |colspan="2"|''Network Properties'' | ||
+ | |- | ||
+ | | <code>NetworkId:LongWord;</code> | ||
+ | | Unique Id of this Network in the Network table | ||
+ | |- | ||
+ | | <code>NetworkState:LongWord;</code> | ||
+ | | Network state (eg NETWORK_STATE_OPEN) | ||
+ | |- | ||
+ | | <code>NetworkStatus:LongWord;</code> | ||
+ | | Network status (eg NETWORK_STATUS_UP) | ||
+ | |- | ||
+ | | <code>DeviceOpen:TNetworkDeviceOpen;</code> | ||
+ | | A Device specific DeviceOpen method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>DeviceClose:TNetworkDeviceClose;</code> | ||
+ | | A Device specific DeviceClose method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>DeviceRead:TNetworkDeviceRead;</code> | ||
+ | | A Device specific DeviceRead method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>DeviceWrite:TNetworkDeviceWrite;</code> | ||
+ | | A Device specific DeviceWrite method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>DeviceControl:TNetworkDeviceControl;</code> | ||
+ | | A Device specific DeviceControl method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>BufferAllocate:TNetworkBufferAllocate;</code> | ||
+ | | A Device specific BufferAllocate method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>BufferRelease:TNetworkBufferRelease;</code> | ||
+ | | A Device specific BufferRelease method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>BufferReceive:TNetworkBufferReceive;</code> | ||
+ | | A Device specific BufferReceive method implementing a standard Network device interface | ||
+ | |- | ||
+ | | <code>BufferTransmit:TNetworkBufferTransmit;</code> | ||
+ | | A Device specific BufferTransmit method implementing a standard Network device interface | ||
+ | |- | ||
+ | |colspan="2"|''Driver Properties'' | ||
+ | |- | ||
+ | | <code>Lock:TMutexHandle;</code> | ||
+ | | Network lock | ||
+ | |- | ||
+ | | <code>Buffer:TNetworkBuffer;</code> | ||
+ | | Network receive buffer | ||
+ | |- | ||
+ | | <code>TransmitWait:TSemaphoreHandle;</code> | ||
+ | | Transmit complete semaphore | ||
+ | |- | ||
+ | | <code>ReceiveBuffer:TBufferHandle;</code> | ||
+ | | Buffer for receive packets | ||
+ | |- | ||
+ | | <code>TransmitBuffer:TBufferHandle;</code> | ||
+ | | Buffer for transmit packets | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>ReceiveQueue:TNetworkQueue;</code> | ||
+ | | Queue for receive packets | ||
+ | |- | ||
+ | | <code>TransmitQueue:TNetworkQueue;</code> | ||
+ | | Queue for transmit packets (If applicable) | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | <code>ReceiveCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReceiveErrors:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TransmitCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TransmitErrors:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>BufferOverruns:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>BufferUnavailable:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PNetworkDevice;</code> | ||
+ | | Previous entry in Network table | ||
+ | |- | ||
+ | | <code>Next:PNetworkDevice;</code> | ||
+ | | Next entry in Network table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network event callback''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TNetworkEventCallback = function(Data:Pointer; Event:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Network Event''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkEvent = ^TNetworkEvent;</code> | ||
+ | |||
+ | <code>TNetworkEvent = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Event Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>EventState:LongWord;</code> | ||
+ | | Event state (eg Registered/Unregistered) | ||
+ | |- | ||
+ | | <code>EventFlags:LongWord;</code> | ||
+ | | Event flags (eg NETWORK_EVENT_FLAG_NONE) | ||
+ | |- | ||
+ | | <code>Callback:TNetworkEventCallback;</code> | ||
+ | | The callback for network events | ||
+ | |- | ||
+ | | <code>Data:Pointer;</code> | ||
+ | | A pointer to callback specific data to be passed with events (Optional) | ||
+ | |- | ||
+ | | <code>Event:LongWord;</code> | ||
+ | | The mask of events to notify on (eg NETWORK_EVENT_SYSTEM_START etc) | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PNetworkEvent;</code> | ||
+ | | Previous entry in Event table | ||
+ | |- | ||
+ | | <code>Next:PNetworkEvent;</code> | ||
+ | | Next entry in Event table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Packet fragment''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PPacketFragment = ^TPacketFragment;</code> | ||
+ | |||
+ | <code>TPacketFragment = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Size:Integer;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>Data:Pointer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Next:PPacketFragment;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Ethernet 802.3 network''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PLLCHeader = ^TLLCHeader;</code> | ||
+ | |||
+ | <code>TLLCHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: FRAME_TYPE_ETHERNET_8022 | ||
+ | |- | ||
+ | | <code>DSAP:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SSAP:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Control:Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Information:array[0..0] of Byte;</code> | ||
+ | | Optional (Control byte can be 1 or 2 octets) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Ethernet SNAP network''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSNAPHeader = ^TSNAPHeader;</code> | ||
+ | |||
+ | <code>TSNAPHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: FRAME_TYPE_ETHERNET_SNAP | ||
+ | |- | ||
+ | | <code>OUI:array[0..2] of Byte;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ProtocolID:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Data:array[0..0] of Byte;</code> | ||
+ | | Not part of header, included to provide a pointer to the start of data | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Token ring network''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTokenRingAddress = ^TTokenRingAddress;</code> | ||
+ | |||
+ | <code>TTokenRingAddress = array[0..5] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Token ring header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTokenRingHeader = ^TTokenRingHeader;</code> | ||
+ | |||
+ | <code>TTokenRingHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Adapter params''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PAdapterParams = ^TAdapterParams;</code> | ||
+ | |||
+ | <code>TAdapterParams = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Version:Word;</code> | ||
+ | | Driver version | ||
+ | |- | ||
+ | | <code>FrameType:Byte;</code> | ||
+ | | Driver class | ||
+ | |- | ||
+ | | <code>AdapterType:Word;</code> | ||
+ | | Driver type | ||
+ | |- | ||
+ | | <code>Number:Byte;</code> | ||
+ | | Driver number | ||
+ | |- | ||
+ | | <code>Name:PChar;</code> | ||
+ | | Driver name | ||
+ | |- | ||
+ | | <code>Functionality:Byte;</code> | ||
+ | | How good is this driver | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Network params''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PNetworkParams = ^TNetworkParams;</code> | ||
+ | |||
+ | <code>TNetworkParams = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MajorRevision:Byte;</code> | ||
+ | | Major revision ID of packet specs | ||
+ | |- | ||
+ | | <code>MinorRevision:Byte;</code> | ||
+ | | Minor revision ID of packet specs | ||
+ | |- | ||
+ | | <code>ParamLength:Byte;</code> | ||
+ | | Length of structure in Bytes | ||
+ | |- | ||
+ | | <code>AddressLength:Byte;</code> | ||
+ | | Length of a MAC address | ||
+ | |- | ||
+ | | <code>MTU:Word;</code> | ||
+ | | MTU, including MAC headers | ||
+ | |- | ||
+ | | <code>MulticastAvailable:Word;</code> | ||
+ | | buffer size for multicast addr. | ||
+ | |- | ||
+ | | <code>RxBuffers:Word;</code> | ||
+ | | No of back-to-back MTU rcvs) - 1 | ||
+ | |- | ||
+ | | <code>TxBuffers:Word;</code> | ||
+ | | No of successive xmits) - 1 | ||
+ | |- | ||
+ | | <code>IntNo:Word;</code> | ||
+ | | Interrupt No to hook for post-EOI processing, 0 = none | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Adapter statistics''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PAdapterStatistics = ^TAdapterStatistics;</code> | ||
+ | |||
+ | <code>TAdapterStatistics = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>PacketsIn:Int64;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>PacketsOut:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>BytesIn:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>BytesOut:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ErrorsIn:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ErrorsOut:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>PacketsLost:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Ethernet address''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PEthernetAddress = ^TEthernetAddress;</code> | ||
+ | |||
+ | <code>TEthernetAddress = array[0..ETHERNET_ADDRESS_SIZE - 1] of Byte;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Ethernet header''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PEthernetHeader = ^TEthernetHeader;</code> | ||
+ | |||
+ | <code>TEthernetHeader = packed record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DestAddress:THardwareAddress;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SourceAddress:THardwareAddress;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TypeLength:Word;</code> | ||
+ | | Length or Type (IEEE 802.3 or BlueBook/DIX Ethernet) | ||
+ | |- | ||
+ | | <code>Data:array[0..0] of Byte;</code> | ||
+ | | Not part of header, included to provide a pointer to the start of data | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Class definitions === | === Class definitions === |
Revision as of 04:00, 22 January 2017
Return to Unit Reference
Contents
[hide]Description
Ultibo Network interface unit
To be documented
Constants
NETWORK_*
NETWORK_TYPE_*
NETWORK_STATE_*
NETWORK_STATUS_*
NETWORK_FLAG_*
NETWORK_CONTROL_*
NETWORK_LOCK_*
NETWORK_BUFFER_*
NETWORK_EVENT_*
NETWORK_EVENT_SIGNATURE*
NETWORK_EVENT_STATE_*
NETWORK_EVENT_FLAG_*
ADAPTER_TYPE_*
ADAPTER_THREAD_*
ADAPTER_STATE_*
ADAPTER_STATUS_*
CONFIG_TYPE_*
AUTH_TYPE_*
FRAME_TYPE_*
CONFIG_*
AUTH_COMMAND_*
MAX_MULTICAST_*
HARDWARE_ADDRESS_*
MEDIA_TYPE_*
PACKET_TYPE_*
*_ETHERNET_PACKET
LLC_HEADER_*
SNAP_HEADER_*
SERVICE_SET_*
NETWORK_LOG_*
ETHERNET_*
ETHERNET_*_SIZE*
Type definitions
Hardware address
PHardwareAddress = ^THardwareAddress;
THardwareAddress = array[0..HARDWARE_ADDRESS_SIZE - 1] of Byte;
Hardware addresses
PHardwareAddresses = ^THardwareAddresses;
THardwareAddresses = array[0..0] of THardwareAddress;
Multicast addresses
PMulticastAddresses = ^TMulticastAddresses;
TMulticastAddresses = array[0..MAX_MULTICAST_ADDRESS - 1] of THardwareAddress;
Network packet
Network Buffer
Network entry
Network queue
Network enumeration callback
TNetworkEnumerate = function(Network:PNetworkDevice; Data:Pointer):LongWord;
|
Network notification callback
TNetworkNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
Network device open
TNetworkDeviceOpen = function(Network:PNetworkDevice):LongWord;
|
Network device close
TNetworkDeviceClose = function(Network:PNetworkDevice):LongWord;
|
Network device read
TNetworkDeviceRead = function(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;
|
Network device write
TNetworkDeviceWrite = function(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;
|
Network device control
TNetworkDeviceControl = function(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
|
Network buffer allocate
TNetworkBufferAllocate = function(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
|
Network buffer release
TNetworkBufferRelease = function(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
|
Network buffer receive
TNetworkBufferReceive = function(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
|
Network buffer transmit
TNetworkBufferTransmit = function(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
|
Network device types
Network event callback
TNetworkEventCallback = function(Data:Pointer; Event:LongWord):LongWord;
|
Network Event
Packet fragment
Ethernet 802.3 network
Ethernet SNAP network
Token ring network
Token ring header
Adapter params
Network params
Adapter statistics
Ethernet address
PEthernetAddress = ^TEthernetAddress;
TEthernetAddress = array[0..ETHERNET_ADDRESS_SIZE - 1] of Byte;
Ethernet header
Class definitions
To be documented
Public variables
Network logging
NETWORK_DEFAULT_LOG_LEVEL:LongWord = NETWORK_LOG_LEVEL_DEBUG;
|
Minimum level for Network messages. Only messages with level greater than or equal to this will be printed. |
NETWORK_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
Network functions
function NetworkDeviceClose(Network:PNetworkDevice):LongWord;
function NetworkDeviceRead(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;
function NetworkDeviceWrite(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;
function NetworkDeviceControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
function NetworkBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
function NetworkBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
function NetworkBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
function NetworkBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
function NetworkDeviceSetState(Network:PNetworkDevice; State:LongWord):LongWord;
function NetworkDeviceSetStatus(Network:PNetworkDevice; Status:LongWord):LongWord;
function NetworkDeviceCreateEx(Size:LongWord):PNetworkDevice;
function NetworkDeviceDestroy(Network:PNetworkDevice):LongWord;
function NetworkDeviceRegister(Network:PNetworkDevice):LongWord;
function NetworkDeviceDeregister(Network:PNetworkDevice):LongWord;
function NetworkDeviceFind(NetworkId:LongWord):PNetworkDevice;
function NetworkDeviceFindByName(const Name:String):PNetworkDevice; inline;
function NetworkDeviceFindByDescription(const Description:String):PNetworkDevice; inline;
function NetworkDeviceEnumerate(Callback:TNetworkEnumerate; Data:Pointer):LongWord;
function NetworkDeviceNotification(Network:PNetworkDevice; Callback:TNetworkNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
function NetworkEventAllocate(Callback:TNetworkEventCallback; Data:Pointer; Event:LongWord):PNetworkEvent;
function NetworkEventRelease(Event:PNetworkEvent):LongWord;
function NetworkEventRegister(Callback:TNetworkEventCallback; Data:Pointer; Event:LongWord):THandle;
function NetworkEventDeregister(Handle:THandle):LongWord;
RTL network functions
Network helper functions
function NetworkDeviceCheck(Network:PNetworkDevice):PNetworkDevice;
function NetworkDeviceTypeToString(NetworkType:LongWord):String;
function NetworkDeviceStateToString(NetworkState:LongWord):String;
function NetworkDeviceStatusToString(NetworkStatus:LongWord):String;
function NetworkDeviceStateToNotification(State:LongWord):LongWord;
function NetworkDeviceStatusToNotification(Status:LongWord):LongWord;
function NetworkEventCheck(Event:PNetworkEvent):PNetworkEvent;
procedure NetworkLog(Level:LongWord; Network:PNetworkDevice; const AText:String);
procedure NetworkLogInfo(Network:PNetworkDevice; const AText:String);
procedure NetworkLogError(Network:PNetworkDevice; const AText:String);
procedure NetworkLogDebug(Network:PNetworkDevice; const AText:String);
function HardwareAddressToString(const AAddress:THardwareAddress):String;
function StringToHardwareAddress(const AAddress:String):THardwareAddress;
function CompareHardwareAddress(const AAddress1,AAddress2:THardwareAddress):Boolean;
function CompareHardwareDefault(const AAddress:THardwareAddress):Boolean;
function CompareHardwareBroadcast(const AAddress:THardwareAddress):Boolean;
function CompareHardwareMulticast(const AAddress:THardwareAddress):Boolean;
Return to Unit Reference