Subversion Repositories Kolibri OS

Rev

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

Rev 735 Rev 739
Line 18... Line 18...
18
;;   22.09.2003 - [Mike Hibbett] : mikeh@oceanfree.net          ;;
18
;;   22.09.2003 - [Mike Hibbett] : mikeh@oceanfree.net          ;;
19
;;   11.11.2006 - [Johnny_B] and [smb]                          ;;
19
;;   11.11.2006 - [Johnny_B] and [smb]                          ;;
20
;;                                                              ;;
20
;;                                                              ;;
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 22... Line 22...
22
 
22
 
Line 23... Line 23...
23
$Revision: 735 $
23
$Revision: 739 $
24
 
24
 
25
 
25
 
Line 341... Line 341...
341
    mov     edi, dword[Extra]
341
    mov     edi, dword[Extra]
342
    cld
342
    cld
343
    stosd
343
    stosd
344
    stosw
344
    stosw
Line -... Line 345...
-
 
345
 
-
 
346
 
-
 
347
    ; first, check destination IP to see if it is on 'this' network.
-
 
348
    ; The test is:
-
 
349
    ; if ( destIP & subnet_mask == stack_ip & subnet_mask )
-
 
350
    ;   destination is local
-
 
351
    ; else
-
 
352
    ;  destination is remote, so pass to gateway
-
 
353
 
-
 
354
    mov     eax, [Index]       ;eax=required IP
-
 
355
    mov     esi, eax
-
 
356
    and     esi, [subnet_mask]
-
 
357
    mov     ecx, [stack_ip]
-
 
358
    and     ecx, [subnet_mask]
-
 
359
    cmp     esi, ecx
-
 
360
    je      @f        ;if we and target IP are located in the same network
-
 
361
    mov     eax, [gateway_ip]
-
 
362
    mov     [Index], eax
-
 
363
  @@:
345
 
364
 
346
    cmp     dword[NumARP], 0
365
    cmp     dword[NumARP], 0
347
    je      .ip_to_mac_send_request ;if ARP-table not contain an entries, we have to request IP.
366
    je      .ip_to_mac_send_request ;if ARP-table not contain an entries, we have to request IP.
Line 348... Line -...
348
                                    ;EAX will be containing a zero, it's equal to ARP_NO_ENTRY
-
 
349
 
367
                                    ;EAX will be containing a zero, it's equal to ARP_NO_ENTRY
350
    mov     eax, [Index]       ;eax=required IP
368
 
Line 351... Line 369...
351
    mov     ecx, dword[NumARP]
369
    mov     ecx, dword[NumARP]
352
    imul    esi, ecx, ARP_ENTRY_SIZE  ;esi=current ARP-table size
370
    imul    esi, ecx, ARP_ENTRY_SIZE  ;esi=current ARP-table size