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

This commit is contained in:
kieron
2018-05-10 15:35:35 +00:00
parent ad10fa1a19
commit 413ca35e61
72 changed files with 16 additions and 3 deletions

View File

@ -117,6 +117,7 @@ type
const
BROADCAST_MAC : Array[0..5] of uint8 = ($FF, $FF, $FF, $FF, $FF, $FF);
NULL_MAC : Array[0..5] of uint8 = ($00, $00, $00, $00, $00, $00);
FORCE_MAC : Array[0..5] of uint8 = ($08, $00, $27, $E6, $3F, $81);
implementation

View File

@ -56,9 +56,10 @@ begin
memcpy(uint32(@hdr), uint32(buffer), sizeof(TEthernetHeader));
memcpy(uint32(p_data), uint32(buffer)+sizeof(TEthernetHeader), p_len);
FCS:= puint32((uint32(buffer) + size) - 4);
FCS^:= crc32(puint8(buffer), size - 5);
FCS^:= switchendian32(crc32(puint8(buffer), size - 4));
//writehexlnWND(FCS^, getTerminalHWND);
net.send(buffer, size);
//printmemoryWND(uint32(buffer), size, 16, ' ', true, getTerminalHWND);
kfree(buffer);
end;
end;

View File

@ -95,6 +95,7 @@ begin
hdr^.Operation_Hi:= op SHR 8;
hdr^.Operation_Lo:= op AND $FF;
copyMAC(@p_context^.MAC.Source[0], @hdr^.Source_Hardware[0]);
//copyMAC(@FORCE_MAC[0], @hdr^.Source_Hardware[0]);
copyIPv4(@p_context^.IP.Source[0], @hdr^.Source_Protocol[0]);
copyMAC(@p_context^.MAC.Destination[0], @hdr^.Destination_Hardware[0]);
copyIPv4(@p_context^.IP.Destination[0], @hdr^.Destination_Protocol[0]);

View File

@ -118,6 +118,7 @@ begin
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(@NULL_MAC[0], @context^.MAC.Destination[0]);
arp.send($1, $0800, $1, context);
freePacketContext(context);