git-svn-id: https://spexeah.com:8443/svn/Asuro@719 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
79ef3385d8
commit
da474b5573
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
Binary file not shown.
BIN
lib/arp.ppu
BIN
lib/arp.ppu
Binary file not shown.
BIN
lib/asuro.ppu
BIN
lib/asuro.ppu
Binary file not shown.
BIN
lib/eth2.ppu
BIN
lib/eth2.ppu
Binary file not shown.
BIN
lib/ipv4.ppu
BIN
lib/ipv4.ppu
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/libpsystem.a
BIN
lib/libpsystem.a
Binary file not shown.
BIN
lib/net.ppu
BIN
lib/net.ppu
Binary file not shown.
BIN
lib/shell.ppu
BIN
lib/shell.ppu
Binary file not shown.
BIN
lib/terminal.ppu
BIN
lib/terminal.ppu
Binary file not shown.
@ -13,6 +13,7 @@ uses
|
|||||||
|
|
||||||
procedure send(p_data : void; p_len : uint16; eth_type : uint16; p_context : PPacketContext);
|
procedure send(p_data : void; p_len : uint16; eth_type : uint16; p_context : PPacketContext);
|
||||||
procedure registerType(eType : uint16; RecvCB : TRecvCallback);
|
procedure registerType(eType : uint16; RecvCB : TRecvCallback);
|
||||||
|
procedure registerTypePromisc(eType : uint16; RecvCB : TRecvCallback);
|
||||||
procedure register;
|
procedure register;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -23,14 +24,22 @@ uses
|
|||||||
var
|
var
|
||||||
Registered : Boolean = false;
|
Registered : Boolean = false;
|
||||||
EthTypes : Array[0..65535] of TRecvCallback;
|
EthTypes : Array[0..65535] of TRecvCallback;
|
||||||
|
Promisc : Array[0..65535] of Boolean;
|
||||||
MAC : puint8;
|
MAC : puint8;
|
||||||
|
|
||||||
|
procedure registerTypePromisc(eType : uint16; RecvCB : TRecvCallback);
|
||||||
|
begin
|
||||||
|
push_trace('eth2.registerType');
|
||||||
|
register;
|
||||||
|
if EthTypes[eType] = nil then EthTypes[eType]:= RecvCB;
|
||||||
|
Promisc[eType]:= true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure registerType(eType : uint16; RecvCB : TRecvCallback);
|
procedure registerType(eType : uint16; RecvCB : TRecvCallback);
|
||||||
begin
|
begin
|
||||||
push_trace('eth2.registerType');
|
push_trace('eth2.registerType');
|
||||||
register;
|
register;
|
||||||
if EthTypes[eType] = nil then EthTypes[eType]:= RecvCB;
|
if EthTypes[eType] = nil then EthTypes[eType]:= RecvCB;
|
||||||
pop_trace;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure send(p_data : void; p_len : uint16; eth_type : uint16; p_context : PPacketContext);
|
procedure send(p_data : void; p_len : uint16; eth_type : uint16; p_context : PPacketContext);
|
||||||
@ -81,7 +90,9 @@ begin
|
|||||||
copyMAC(@Header^.src[0], @p_context^.MAC.Source[0]);
|
copyMAC(@Header^.src[0], @p_context^.MAC.Source[0]);
|
||||||
copyMAC(@Header^.dst[0], @p_context^.MAC.Destination[0]);
|
copyMAC(@Header^.dst[0], @p_context^.MAC.Destination[0]);
|
||||||
|
|
||||||
if MACEqual(@Header^.dst[0], @Header^.src[0]) or MACEqual(@Header^.dst[0], @BROADCAST_MAC[0]) then begin
|
if MACEqual(@Header^.dst[0], @Header^.src[0]) or
|
||||||
|
MACEqual(@Header^.dst[0], @BROADCAST_MAC[0]) or
|
||||||
|
Promisc[proto_type] then begin
|
||||||
if EthTypes[proto_type] <> nil then begin
|
if EthTypes[proto_type] <> nil then begin
|
||||||
EthTypes[proto_type](void(buf), p_len - 14, p_context);
|
EthTypes[proto_type](void(buf), p_len - 14, p_context);
|
||||||
end;
|
end;
|
||||||
@ -98,6 +109,7 @@ begin
|
|||||||
if not Registered then begin
|
if not Registered then begin
|
||||||
for i:=0 to 65535 do begin
|
for i:=0 to 65535 do begin
|
||||||
EthTypes[i]:= nil;
|
EthTypes[i]:= nil;
|
||||||
|
Promisc[i]:= false;
|
||||||
end;
|
end;
|
||||||
net.registerNextLayer(@recv);
|
net.registerNextLayer(@recv);
|
||||||
MAC:= net.getMAC;
|
MAC:= net.getMAC;
|
||||||
|
@ -250,7 +250,7 @@ begin
|
|||||||
push_trace('arp.register');
|
push_trace('arp.register');
|
||||||
if not Registered then begin
|
if not Registered then begin
|
||||||
Cache:= LL_New(sizeof(TARPCacheRecord));
|
Cache:= LL_New(sizeof(TARPCacheRecord));
|
||||||
eth2.registerType($0806, @recv);
|
eth2.registerTypePromisc($0806, @recv);
|
||||||
terminal.registerCommand('ARP', @terminal_command_arp, 'Get ARP Table.');
|
terminal.registerCommand('ARP', @terminal_command_arp, 'Get ARP Table.');
|
||||||
Registered:= true;
|
Registered:= true;
|
||||||
end;
|
end;
|
||||||
|
@ -9,14 +9,14 @@ const
|
|||||||
VERSION_SUB = '1';
|
VERSION_SUB = '1';
|
||||||
REVISION = '677';
|
REVISION = '677';
|
||||||
RELEASE = 'ia';
|
RELEASE = 'ia';
|
||||||
LINE_COUNT = 28032;
|
LINE_COUNT = 28044;
|
||||||
FILE_COUNT = 90;
|
FILE_COUNT = 90;
|
||||||
DRIVER_COUNT = 32;
|
DRIVER_COUNT = 32;
|
||||||
FPC_VERSION = '2.6.4';
|
FPC_VERSION = '2.6.4';
|
||||||
NASM_VERSION = '2.10.09';
|
NASM_VERSION = '2.10.09';
|
||||||
MAKE_VERSION = '3.81';
|
MAKE_VERSION = '3.81';
|
||||||
COMPILE_DATE = '11/05/18';
|
COMPILE_DATE = '11/05/18';
|
||||||
COMPILE_TIME = '09:58:04';
|
COMPILE_TIME = '10:09:01';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user