Subversion Repositories Kolibri OS

Rev

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

Rev 3600 Rev 3601
Line 14... Line 14...
14
;;          GNU GENERAL PUBLIC LICENSE                             ;;
14
;;          GNU GENERAL PUBLIC LICENSE                             ;;
15
;;             Version 2, June 1991                                ;;
15
;;             Version 2, June 1991                                ;;
16
;;                                                                 ;;
16
;;                                                                 ;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 18... Line -...
18
 
-
 
19
 
18
 
Line 20... Line 19...
20
$Revision: 2924 $
19
$Revision: 2924 $
Line 21... Line 20...
21
 
20
 
Line 166... Line 165...
166
        DEBUGF  DEBUG_NETWORK_VERBOSE, "got echo request\n"
165
        DEBUGF  DEBUG_NETWORK_VERBOSE, "got echo request\n"
167
        mov     [edx + ICMP_header.Type], ICMP_ECHOREPLY        ; Change Packet type to reply
166
        mov     [edx + ICMP_header.Type], ICMP_ECHOREPLY        ; Change Packet type to reply
Line 168... Line 167...
168
 
167
 
Line 169... Line -...
169
        mov     esi, [esp]                                      ; Start of buffer
-
 
170
 
-
 
171
        cmp     dword[edi + 4], 1 shl 24 + 127
-
 
172
        je      .loopback
168
        mov     esi, [esp]                                      ; Start of buffer
173
 
169
 
174
; Update stats (and validate device ptr)
170
; Update stats (and validate device ptr)
175
        call    NET_ptr_to_num
171
        call    NET_ptr_to_num
176
        cmp     edi,-1
172
        cmp     edi, -1
177
        je      .dump
173
        je      .dump
Line -... Line 174...
-
 
174
        inc     [ICMP_PACKETS_RX + 4*edi]
-
 
175
        inc     [ICMP_PACKETS_TX + 4*edi]
-
 
176
 
-
 
177
        cmp     ebx, LOOPBACK_DEVICE
-
 
178
        je      .loopback
178
        inc     [ICMP_PACKETS_RX + 4*edi]
179
 
179
        inc     [ICMP_PACKETS_TX + 4*edi]
180
; FIXME: dont assume device is an ethernet device!
180
 
181
 
181
; exchange dest and source address in IP header
182
; exchange dest and source address in IP header
182
; exchange dest and source MAC in ETH header
183
; exchange dest and source MAC in ETH header
183
        push    dword [esi + ETH_header.DstMAC]
184
        push    dword [esi + ETH_header.DstMAC]
184
        push    dword [esi + ETH_header.SrcMAC]
185
        push    dword [esi + ETH_header.SrcMAC]
185
        pop     dword [esi + ETH_header.DstMAC]
186
        pop     dword [esi + ETH_header.DstMAC]
186
        pop     dword [esi + ETH_header.SrcMAC]
187
        pop     dword [esi + ETH_header.SrcMAC]
187
        push    word [esi + ETH_header.DstMAC + 4]
188
        push    word [esi + ETH_header.DstMAC + 4]
188
        push    word [esi + ETH_header.SrcMAC + 4]
189
        push    word [esi + ETH_header.SrcMAC + 4]
Line 189... Line 190...
189
        pop     word [esi + ETH_header.DstMAC + 4]
190
        pop     word [esi + ETH_header.DstMAC + 4]
190
        pop     word [esi + ETH_header.SrcMAC + 4]
191
        pop     word [esi + ETH_header.SrcMAC + 4]
191
        add     esi, sizeof.ETH_header-2
192
        add     esi, sizeof.ETH_header-4
192
 
193
 
193
  .loopback:
194
  .loopback:
194
        add     esi, 2
195
        add     esi, 4