Subversion Repositories Kolibri OS

Rev

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

Rev 3600 Rev 3601
Line 566... Line 566...
566
;
566
;
567
;------------------------------------------------------------------
567
;------------------------------------------------------------------
568
align 4
568
align 4
569
IPv4_output:
569
IPv4_output:
Line 570... Line 570...
570
 
570
 
Line 571... Line 571...
571
        DEBUGF  DEBUG_NETWORK_VERBOSE, "IPv4_output: size=%u\n", ecx
571
        DEBUGF  DEBUG_NETWORK_VERBOSE, "IPv4_output: size=%u ip=0x%x\n", ecx, eax
572
 
572
 
Line 573... Line 573...
573
        cmp     ecx, 65500              ; Max IPv4 packet size
573
        cmp     ecx, 65500              ; Max IPv4 packet size
Line 583... Line 583...
583
        test    eax, 0xffff0000         ; error bits
583
        test    eax, 0xffff0000         ; error bits
584
        jnz     .arp_error
584
        jnz     .arp_error
585
        push    ebx                     ; push the mac onto the stack
585
        push    ebx                     ; push the mac onto the stack
586
        push    ax
586
        push    ax
Line 587... Line 587...
587
 
587
 
Line 588... Line 588...
588
        inc     [IP_packets_tx + edi]   ; update stats
588
        inc     [IP_packets_tx + 4*edi] ; update stats
589
 
589
 
590
        mov     ebx, [NET_DRV_LIST + edi]
590
        mov     ebx, [NET_DRV_LIST + 4*edi]
591
        lea     eax, [ebx + ETH_DEVICE.mac]
591
        lea     eax, [ebx + ETH_DEVICE.mac]
592
        mov     edx, esp
592
        mov     edx, esp
593
        mov     ecx, [esp + 10 + 6]
593
        mov     ecx, [esp + 10 + 6]
Line 673... Line 673...
673
        jnz     .arp_error
673
        jnz     .arp_error
Line 674... Line 674...
674
 
674
 
675
        push    ebx                     ; push the mac
675
        push    ebx                     ; push the mac
Line 676... Line 676...
676
        push    ax
676
        push    ax
677
 
677
 
678
        inc     [IP_packets_tx + edi]
678
        inc     [IP_packets_tx + 4*edi]
679
        mov     ebx, [NET_DRV_LIST + edi]
679
        mov     ebx, [NET_DRV_LIST + 4*edi]
680
        lea     eax, [ebx + ETH_DEVICE.mac]
680
        lea     eax, [ebx + ETH_DEVICE.mac]
681
        mov     edx, esp
681
        mov     edx, esp
682
        mov     ecx, [esp + 6 + 4]
682
        mov     ecx, [esp + 6 + 4]
Line 853... Line 853...
853
;---------------------------------------------------------------------------
853
;---------------------------------------------------------------------------
854
;
854
;
855
; IPv4_route
855
; IPv4_route
856
;
856
;
857
; IN:   eax = Destination IP
857
; IN:   eax = Destination IP
858
; OUT:  edi = device id * 4
858
; OUT:  edi = device number
859
;       eax = ip of gateway if nescessary, unchanged otherwise
859
;       eax = ip of gateway if nescessary, unchanged otherwise
860
;
860
;
861
;---------------------------------------------------------------------------
861
;---------------------------------------------------------------------------
862
align 4
862
align 4
863
IPv4_route:
863
IPv4_route:
Line 880... Line 880...
880
        add     edi, 4
880
        add     edi, 4
881
        dec     ecx
881
        dec     ecx
882
        jnz     .loop
882
        jnz     .loop
Line 883... Line 883...
883
 
883
 
884
  .invalid:
884
  .invalid:
-
 
885
        xor     edi, edi                        ; if none found, use device 1 as default        ;;; FIXME
885
        xor     edi, edi                        ; if none found, use device 0 as default
886
        inc     di
Line 886... Line 887...
886
        mov     eax, [GATEWAY_LIST]
887
        mov     eax, [GATEWAY_LIST+4]
887
 
888
 
888
  .found_it:
889
  .found_it:
Line 889... Line 890...
889
        DEBUGF  DEBUG_NETWORK_VERBOSE, "IPv4_route: %u\n", edi
890
        DEBUGF  DEBUG_NETWORK_VERBOSE, "IPv4_route: %u\n", edi
-
 
891
        ret
890
        ret
892
 
891
 
893
  .broadcast:
Line 892... Line 894...
892
  .broadcast:
894
        xor     edi, edi                ;;;; FIXME
Line 971... Line 973...
971
        mov     ebx, [SUBNET_LIST + eax]
973
        mov     ebx, [SUBNET_LIST + eax]
972
        not     ebx
974
        not     ebx
973
        or      ebx, ecx
975
        or      ebx, ecx
974
        mov     [BROADCAST_LIST + eax], ebx
976
        mov     [BROADCAST_LIST + eax], ebx
Line -... Line 977...
-
 
977
 
975
 
978
        mov     ebx, [NET_DRV_LIST + eax]
976
        mov     eax, ecx
979
        mov     eax, [IP_LIST + eax]
Line 977... Line 980...
977
        call    ARP_output_request              ; now send a gratuitous ARP
980
        call    ARP_output_request              ; now send a gratuitous ARP
978
 
981
 
979
        call    NET_send_event
982
        call    NET_send_event