Subversion Repositories Kolibri OS

Rev

Rev 2877 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2877 Rev 2891
Line 15... Line 15...
15
;;             Version 2, June 1991                                ;;
15
;;             Version 2, June 1991                                ;;
16
;;                                                                 ;;
16
;;                                                                 ;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
$Revision: 2877 $
20
$Revision: 2891 $
Line 140... Line 140...
140
;
140
;
141
;-----------------------------------------------------------------
141
;-----------------------------------------------------------------
142
align 4
142
align 4
143
ICMP_input:
143
ICMP_input:
Line 144... Line 144...
144
 
144
 
Line 145... Line 145...
145
        DEBUGF  1,"ICMP_input - start\n"
145
        DEBUGF  1,"ICMP_input:\n"
Line 146... Line 146...
146
 
146
 
147
; First, check the checksum (altough some implementations ignore it)
147
; First, check the checksum (altough some implementations ignore it)
Line 161... Line 161...
161
        jne     .check_sockets
161
        jne     .check_sockets
Line 162... Line 162...
162
 
162
 
163
; We well re-use the packet so we can create the response as fast as possible
163
; We well re-use the packet so we can create the response as fast as possible
Line 164... Line 164...
164
; Notice: this only works on pure ethernet
164
; Notice: this only works on pure ethernet
165
 
165
 
Line 166... Line 166...
166
        DEBUGF  1,"ICMP_input - echo request\n"
166
        DEBUGF  1,"got echo request\n"
167
        mov     [edx + ICMP_header.Type], ICMP_ECHOREPLY        ; Change Packet type to reply
167
        mov     [edx + ICMP_header.Type], ICMP_ECHOREPLY        ; Change Packet type to reply
168
 
168
 
Line 250... Line 250...
250
;        call    IPv4_dest_to_dev
250
;        call    IPv4_dest_to_dev
251
;        cmp     edi,-1
251
;        cmp     edi,-1
252
;        je      .dump
252
;        je      .dump
253
;        inc     [ICMP_PACKETS_RX+edi]
253
;        inc     [ICMP_PACKETS_RX+edi]
Line 254... Line 254...
254
 
254
 
Line 255... Line 255...
255
        DEBUGF 1,"Found valid ICMP packet for socket %x\n", eax
255
        DEBUGF 1,"socket=%x\n", eax
256
 
256
 
257
        pusha
257
        pusha
258
        lea     ecx, [eax + SOCKET.mutex]
258
        lea     ecx, [eax + SOCKET.mutex]
Line 262... Line 262...
262
        mov     esi, edx
262
        mov     esi, edx
263
        jmp     SOCKET_input
263
        jmp     SOCKET_input
Line 264... Line 264...
264
 
264
 
265
 
265
 
Line 266... Line 266...
266
  .checksum_mismatch:
266
  .checksum_mismatch:
267
        DEBUGF  1,"ICMP_Handler - checksum mismatch\n"
267
        DEBUGF  1,"checksum mismatch\n"
Line 268... Line 268...
268
 
268
 
269
  .dump:
269
  .dump:
Line 270... Line 270...
270
        DEBUGF  1,"ICMP_Handler - dumping\n"
270
        DEBUGF  1,"ICMP_input: dumping\n"