85,7 → 85,6 |
ICMP_PHOTURIS_DECRYPT_FAILED = 3 ; decrypt failed |
|
|
|
struct ICMP_header |
|
Type db ? |
107,13 → 106,13 |
|
|
|
;----------------------------------------------------------------- |
; |
; ICMP_init |
; |
;----------------------------------------------------------------- |
;-----------------------------------------------------------------; |
; ; |
; ICMP_init ; |
; ; |
;-----------------------------------------------------------------; |
|
macro ICMP_init { |
macro icmp_init { |
|
xor eax, eax |
mov edi, ICMP_PACKETS_TX |
123,25 → 122,23 |
} |
|
|
;----------------------------------------------------------------- |
; |
; ICMP_input: |
; |
; This procedure will send reply's to ICMP echo's |
; and insert packets into sockets when needed |
; |
; IN: Pointer to buffer in [esp] |
; ebx = pointer to device struct |
; ecx = ICMP Packet size |
; edx = ptr to IPv4 header |
; esi = ptr to ICMP Packet data |
; edi = interface number*4 |
; |
; OUT: / |
; |
;----------------------------------------------------------------- |
;-----------------------------------------------------------------; |
; ; |
; icmp_input: Send a reply's to an ICMP echo or insert packets ; |
; into socket. ; |
; ; |
; IN: [esp] = ptr to buffer ; |
; ebx = ptr to device struct ; |
; ecx = ICMP Packet size ; |
; edx = ptr to IPv4 header ; |
; esi = ptr to ICMP Packet data ; |
; edi = interface number*4 ; |
; ; |
; OUT: / ; |
; ; |
;-----------------------------------------------------------------; |
align 4 |
ICMP_input: |
icmp_input: |
|
DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input\n" |
|
204,7 → 201,7 |
call mutex_lock |
popa |
|
jmp SOCKET_input |
jmp socket_input |
|
|
|
274,7 → 271,7 |
test eax, eax |
jnz @f |
DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP transmit failed\n" |
call NET_ptr_to_num4 |
call net_ptr_to_num4 |
inc [ICMP_PACKETS_TX + edi] |
@@: |
ret |
293,26 → 290,26 |
|
.dump: |
DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input: dumping\n" |
call NET_BUFF_free |
call net_buff_free |
ret |
|
|
if 0 |
;----------------------------------------------------------------- |
; |
; ICMP_output |
; |
; IN: eax = dest ip |
; bh = type |
; bl = code |
; ecx = data length |
; edx = source ip |
; esi = data offset |
; edi = identifier shl 16 + sequence number |
; |
;----------------------------------------------------------------- |
;-----------------------------------------------------------------; |
; ; |
; icmp_output ; |
; ; |
; IN: eax = dest ip ; |
; bh = type ; |
; bl = code ; |
; ecx = data length ; |
; edx = source ip ; |
; esi = data offset ; |
; edi = identifier shl 16 + sequence number ; |
; ; |
;-----------------------------------------------------------------; |
align 4 |
ICMP_output: |
icmp_output: |
|
DEBUGF DEBUG_NETWORK_VERBOSE, "Creating ICMP Packet\n" |
|
364,17 → 361,17 |
|
|
|
;----------------------------------------------------------------- |
; |
; ICMP_output_raw |
; |
; IN: eax = socket ptr |
; ecx = data length |
; edx = data pointer |
; |
;----------------------------------------------------------------- |
;-----------------------------------------------------------------; |
; ; |
; icmp_output_raw ; |
; ; |
; IN: eax = socket ptr ; |
; ecx = data length ; |
; edx = data pointer ; |
; ; |
;-----------------------------------------------------------------; |
align 4 |
ICMP_output_raw: |
icmp_output_raw: |
|
DEBUGF DEBUG_NETWORK_VERBOSE, "Creating ICMP Packet for socket %x, data ptr=%x\n", eax, edx |
|
384,7 → 381,7 |
mov edi, [eax + IP_SOCKET.RemoteIP] |
mov al, [eax + IP_SOCKET.ttl] |
mov ah, IP_PROTO_ICMP |
call IPv4_output |
call ipv4_output |
jz .fail |
|
pop esi |
407,7 → 404,7 |
call [ebx + NET_DEVICE.transmit] |
test eax, eax |
jnz @f |
call NET_ptr_to_num4 |
call net_ptr_to_num4 |
inc [ICMP_PACKETS_TX + edi] |
@@: |
ret |
422,21 → 419,19 |
|
|
|
;----------------------------------------------------------------- |
; |
; ICMP_API |
; |
; This function is called by system function 75 |
; |
; IN: subfunction number in bl |
; device number in bh |
; ecx, edx, .. depends on subfunction |
; |
; OUT: |
; |
;----------------------------------------------------------------- |
;-----------------------------------------------------------------; |
; ; |
; icmp_api: Part of system function 76. ; |
; ; |
; IN: bl = subfunction number ; |
; bh = device number ; |
; ecx, edx, .. depends on subfunction ; |
; ; |
; OUT: depends on subfunction ; |
; ; |
;-----------------------------------------------------------------; |
align 4 |
ICMP_api: |
icmp_api: |
|
movzx eax, bh |
shl eax, 2 |