Subversion Repositories Kolibri OS

Rev

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

Rev 505 Rev 511
Line 1... Line 1...
1
$Revision: 505 $
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 277... Line 277...
277
    movsd
277
    movsd
278
    movsw
278
    movsw
279
    cmp     edx, 0xffffffff
279
    cmp     edx, 0xffffffff
280
    je	    .send		 ; If it is broadcast, just send
280
    je	    .send		 ; If it is broadcast, just send
Line -... Line 281...
-
 
281
 
-
 
282
    ; first, check destination IP to see if it is on 'this' network.
-
 
283
    ; The test is:
-
 
284
    ; if ( destIP & subnet_mask == stack_ip & subnet_mask )
-
 
285
    ;   destination is local
-
 
286
    ; else
-
 
287
    ;  destination is remote, so pass to gateway
-
 
288
 
-
 
289
    mov     eax, edx
-
 
290
    and     eax, [subnet_mask]
-
 
291
    mov     ecx, [stack_ip]
-
 
292
    and     ecx, [subnet_mask]
-
 
293
    cmp     eax, ecx
-
 
294
    je      .local
-
 
295
 
-
 
296
    mov     edx, [gateway_ip]
-
 
297
  .local:
281
 
298
 
282
    lea     eax, [MACAddress]	 ;cause this is local variable
299
    lea     eax, [MACAddress]	 ;cause this is local variable
Line 283... Line 300...
283
    stdcall arp_table_manager, ARP_TABLE_IP_TO_MAC, edx, eax ;opcode,IP,MAC_ptr - Get the MAC address.
300
    stdcall arp_table_manager, ARP_TABLE_IP_TO_MAC, edx, eax ;opcode,IP,MAC_ptr - Get the MAC address.
284
 
301