git-svn-id: https://spexeah.com:8443/svn/Asuro@713 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,6 +20,7 @@ procedure register;
|
||||
function IPv4ToMAC(ip : puint8) : puint8;
|
||||
function MACToIIPv4(mac : puint8) : puint8;
|
||||
procedure sendGratuitous;
|
||||
procedure sendRequest(ip : puint8);
|
||||
procedure send(hType : uint16; pType : uint16; op : uint16; p_context : PPacketContext);
|
||||
|
||||
implementation
|
||||
@@ -123,6 +124,20 @@ begin
|
||||
freePacketContext(context);
|
||||
end;
|
||||
|
||||
procedure sendRequest(ip : puint8);
|
||||
var
|
||||
context : PPacketContext;
|
||||
|
||||
begin
|
||||
context:= newPacketContext;
|
||||
CopyIPv4(ip, @context^.IP.Destination[0]);
|
||||
CopyIPv4(@getIPv4Config^.Address[0], @context^.IP.Source[0]);
|
||||
CopyMAC(GetMAC, @context^.MAC.Source[0]);
|
||||
CopyMAC(@BROADCAST_MAC[0], @context^.MAC.Destination[0]);
|
||||
arp.send($1, $0800, $1, context);
|
||||
freePacketContext(context);
|
||||
end;
|
||||
|
||||
procedure recv(p_data : void; p_len : uint16; p_context : PPacketContext);
|
||||
var
|
||||
Header : PARPHeader;
|
||||
|
||||
@@ -81,7 +81,9 @@ procedure terminal_command_ifconfig(params : PParamList);
|
||||
var
|
||||
Command, Sub, Address, Gateway, Netmask : pchar;
|
||||
_Address, _Gateway, _Netmask : puint8;
|
||||
Target : TIPv4Address;
|
||||
context : PPacketContext;
|
||||
i : uint32;
|
||||
|
||||
begin
|
||||
push_trace('ipv4.terminal_command_ifconfig');
|
||||
@@ -115,14 +117,21 @@ begin
|
||||
end;
|
||||
end;
|
||||
arp.sendGratuitous;
|
||||
context:= newPacketContext;
|
||||
CopyIPv4(@Config.Gateway[0], @context^.IP.Destination[0]);
|
||||
CopyIPv4(@Config.Address[0], @context^.IP.Source[0]);
|
||||
CopyMAC(GetMAC, @context^.MAC.Source[0]);
|
||||
//copyMAC(@FORCE_MAC[0], @context^.MAC.Source[0]);
|
||||
CopyMAC(@BROADCAST_MAC[0], @context^.MAC.Destination[0]);
|
||||
arp.send($1, $0800, $1, context);
|
||||
freePacketContext(context);
|
||||
|
||||
CopyIPv4(@Config.Address[0], @Target[0]);
|
||||
for i:=1 to 255 do begin
|
||||
Target[3]:= i;
|
||||
arp.sendRequest(@Target[0]);
|
||||
end;
|
||||
|
||||
// context:= newPacketContext;
|
||||
// CopyIPv4(@Config.Gateway[0], @context^.IP.Destination[0]);
|
||||
// CopyIPv4(@Config.Address[0], @context^.IP.Source[0]);
|
||||
// CopyMAC(GetMAC, @context^.MAC.Source[0]);
|
||||
// //copyMAC(@FORCE_MAC[0], @context^.MAC.Source[0]);
|
||||
// CopyMAC(@BROADCAST_MAC[0], @context^.MAC.Destination[0]);
|
||||
// arp.send($1, $0800, $1, context);
|
||||
// freePacketContext(context);
|
||||
end else begin
|
||||
writestringWND(' MAC: ', getTerminalHWND);
|
||||
writeMACAddress(net.GetMAC, getTerminalHWND);
|
||||
|
||||
@@ -9,14 +9,14 @@ const
|
||||
VERSION_SUB = '1';
|
||||
REVISION = '677';
|
||||
RELEASE = 'ia';
|
||||
LINE_COUNT = 28014;
|
||||
LINE_COUNT = 28038;
|
||||
FILE_COUNT = 90;
|
||||
DRIVER_COUNT = 32;
|
||||
FPC_VERSION = '2.6.4';
|
||||
NASM_VERSION = '2.10.09';
|
||||
MAKE_VERSION = '3.81';
|
||||
COMPILE_DATE = '10/05/18';
|
||||
COMPILE_TIME = '18:05:58';
|
||||
COMPILE_TIME = '18:17:20';
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user