Subversion Repositories Kolibri OS

Rev

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

Rev 431 Rev 511
Line 1... Line 1...
1
$Revision: 431 $
1
$Revision: 511 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
Line 343... Line 343...
343
 
343
 
344
    cmp     dword[NumARP], 0
344
    cmp     dword[NumARP], 0
345
    je      .ip_to_mac_send_request ;if ARP-table not contain an entries, we have to request IP.
345
    je      .ip_to_mac_send_request ;if ARP-table not contain an entries, we have to request IP.
Line 346... Line -...
346
                                    ;EAX will be containing a zero, it's equal to ARP_NO_ENTRY
-
 
347
 
-
 
348
    ; first, check destination IP to see if it is on 'this' network.
-
 
349
    ; The test is:
-
 
350
    ; if ( destIP & subnet_mask == stack_ip & subnet_mask )
-
 
351
    ;   destination is local
-
 
352
    ; else
-
 
353
    ;  destination is remote, so pass to gateway
346
                                    ;EAX will be containing a zero, it's equal to ARP_NO_ENTRY
354
 
-
 
355
    mov     eax, [Index]       ;eax=required IP
-
 
356
    mov     esi, eax
-
 
357
    and     esi, [subnet_mask]
-
 
358
    mov     ecx, [stack_ip]
-
 
359
    and     ecx, [subnet_mask]
-
 
360
    cmp     esi, ecx
-
 
361
    je      @f        ;if we and target IP are located in the same network
-
 
362
    mov     eax, [gateway_ip]
-
 
363
  @@:
347
 
364
 
348
    mov     eax, [Index]       ;eax=required IP
Line 365... Line 349...
365
    mov     ecx, dword[NumARP]
349
    mov     ecx, dword[NumARP]
366
    imul    esi, ecx, ARP_ENTRY_SIZE  ;esi=current ARP-table size
350
    imul    esi, ecx, ARP_ENTRY_SIZE  ;esi=current ARP-table size