git-svn-id: https://spexeah.com:8443/svn/Asuro@484 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron
2018-04-11 14:21:06 +00:00
parent 3bed07c80a
commit c8b3b14893
43 changed files with 340 additions and 108 deletions

View File

@ -3,6 +3,7 @@ unit eth2;
interface
uses
tracer,
nettypes, netutils,
net,
console;
@ -19,8 +20,10 @@ var
procedure registerType(eType : uint16; RecvCB : TRecvCallback);
begin
push_trace('eth2.registerType');
register;
if EthTypes[eType] = nil then EthTypes[eType]:= RecvCB;
pop_trace;
end;
procedure recv(p_data : void; p_len : uint16; p_context : PPacketContext);
@ -30,6 +33,7 @@ var
buf : puint8;
begin
push_trace('eth2.recv');
//console.outputln('net.eth2', 'RECV.');
buf:= puint8(p_data);
@ -56,6 +60,7 @@ begin
EthTypes[proto_type](void(buf), p_len - 14, p_context);
end;
end;
pop_trace;
end;
procedure register;
@ -63,6 +68,7 @@ var
i : uint16;
begin
push_trace('eth2.register');
if not Registered then begin
for i:=0 to 65535 do begin
EthTypes[i]:= nil;
@ -71,6 +77,7 @@ begin
MAC:= net.getMAC;
Registered:= true;
end;
pop_trace;
end;
end.