Difference between revisions of "Unit ARP"
From Ultibo.org
(4 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
'''Ultibo ARP (Address Resolution Protocol) unit''' | '''Ultibo ARP (Address Resolution Protocol) unit''' | ||
− | |||
− | |||
=== Constants === | === Constants === | ||
Line 162: | Line 160: | ||
− | '''ARP | + | '''ARP specific classes''' |
− | + | ||
− | + | ||
− | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | |
− | + | ||
− | {| class="wikitable" style="font-size: 14px; | + | |
|- | |- | ||
− | | <code> | + | | [[TARPTransportAdapter|<code>TARPTransportAdapter = class(TTransportAdapter)</code>]] |
− | + | ||
|- | |- | ||
− | | | + | |} |
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
|- | |- | ||
− | | <code> | + | | [[TARPTransport|<code>TARPTransport = class(TNetworkTransport)</code>]] |
− | + | ||
|- | |- | ||
|} | |} | ||
− | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | <code> | + | | [[TARPAddressEntry|<code>TARPAddressEntry = class(TAddressEntry)</code>]] |
− | + | ||
|- | |- | ||
− | | | + | |} |
− | | | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
|- | |- | ||
− | | | + | | [[TRARPTransportAdapter|<code>TRARPTransportAdapter = class(TTransportAdapter)</code>]] |
|- | |- | ||
− | | | + | |} |
− | | | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
|- | |- | ||
− | | <code> | + | | [[TRARPTransport|<code>TRARPTransport = class(TNetworkTransport)</code>]] |
− | + | ||
|- | |- | ||
− | | | + | |} |
− | | | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
|- | |- | ||
− | | | + | | [[TRARPAddressEntry|<code>TRARPAddressEntry = class(TAddressEntry)</code>]] |
− | + | ||
− | | <code> | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
− | </ | + | <br /> |
− | + | ||
=== Public variables === | === Public variables === | ||
Line 327: | Line 211: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 342: | Line 226: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Buffer |
| Buffer points to the complete packet without Adapter header | | Buffer points to the complete packet without Adapter header | ||
|- | |- | ||
Line 354: | Line 238: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Buffer |
| Buffer points to the complete packet without Adapter header | | Buffer points to the complete packet without Adapter header | ||
|- | |- |
Latest revision as of 05:20, 31 August 2021
Return to Unit Reference
Contents
Description
Ultibo ARP (Address Resolution Protocol) unit
Constants
ARP specific constants
ARP_TRANSPORT_*, RARP_TRANSPORT_*
ARP_TRANSPORT_NAME = 'ARP';
|
|
RARP_TRANSPORT_NAME = 'RARP';
|
ARP and RARP constants
MIN_*, MAX_*, ARP_*, RARP_*
MIN_ARP_PACKET = 46;
|
Not Counting Adapter Header |
MAX_ARP_PACKET = 46;
|
Not Counting Adapter Header |
ARP_TIMEOUT = 1000;
|
We wait for 1 second approx for reply |
ARP_RETRIES = 4;
|
We try the request 4 times |
RARP_TIMEOUT = 4000;
|
We wait for 4 seconds for a RARP reply |
RARP_RETRIES = 4;
|
We try the request 4 times |
ARP_HEADER_SIZE = 46;
|
SizeOf(TARPHeader); |
RARP_HEADER_SIZE = 46;
|
SizeOf(TRARPHeader); |
ARP and RARP messages
ARP_*, RARP_*, INARP_*
ARP_REQUEST = $0001;
|
ARP/RARP op codes, Request |
ARP_REPLY = $0002;
|
ARP/RARP op codes, Reply |
RARP_REQUEST = $0003;
|
|
RARP_REPLY = $0004;
|
|
INARP_REQUEST = $0008;
|
Inverse ARP see RFC 1293 |
INARP_REPLY = $0009;
|
Type definitions
ARP specific types
PARPHeader = ^TARPHeader;
TARPHeader = packed record
Note: 46 Bytes | |
HardwareType:Word;
|
Hardware address space (Network Order) |
ProtocolType:Word;
|
Protocol address space (Network Order) |
HardwareLength:Byte;
|
Byte length of hardware address |
ProtocolLength:Byte;
|
Byte length of each protocol address |
Opcode:Word;
|
Op code (eg ARP_REQUEST or ARP_REPLY) (Network Order) |
SourceHardware:THardwareAddress;
|
Source hardware address (of sender) |
SourceIP:TInAddr;
|
Source protocol address (of sender) (Network Order) |
TargetHardware:THardwareAddress;
|
Target hardware address (if known) |
TargetIP:TInAddr;
|
Target protocol address (Network Order) |
Reserved:array[0..17] of Word;
|
RARP specific types
PRARPHeader = ^TRARPHeader;
TRARPHeader = TARPHeader;
Note: 46 Bytes | |
Class definitions
ARP specific classes
TARPTransportAdapter = class(TTransportAdapter)
|
TARPTransport = class(TNetworkTransport)
|
TARPAddressEntry = class(TAddressEntry)
|
TRARPTransportAdapter = class(TTransportAdapter)
|
TRARPTransport = class(TNetworkTransport)
|
TRARPAddressEntry = class(TAddressEntry)
|
Public variables
None defined
Function declarations
Initialization functions
procedure ARPInit;
Description: To be documented
Note | None documented |
---|
ARP functions
function CheckARP(ABuffer:Pointer):Boolean;
Description: Verify that the packet is a valid ARP packet
Buffer | Buffer points to the complete packet without Adapter header |
---|
function CheckRARP(ABuffer:Pointer):Boolean;
Description: Verify that the packet is a valid RARP packet
Buffer | Buffer points to the complete packet without Adapter header |
---|
Return to Unit Reference