Subversion Repositories Kolibri OS

Rev

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

Rev 3626 Rev 3725
Line 53... Line 53...
53
                                rb 2    ; to match ethernet header size         ;;; FIXME
53
                                rb 2    ; to match ethernet header size         ;;; FIXME
54
                                        ; Ip header begins here (we will need the IP header to re-construct the complete packet)
54
                                        ; Ip header begins here (we will need the IP header to re-construct the complete packet)
55
ends
55
ends
Line 56... Line -...
56
 
-
 
57
 
56
 
-
 
57
 
Line 58... Line 58...
58
align 4
58
uglobal
59
uglobal
59
align 4
60
 
60
 
61
        IP_LIST                 rd NET_DEVICES_MAX
61
        IP_LIST                 rd NET_DEVICES_MAX
Line 67... Line 67...
67
        IP_packets_tx           rd NET_DEVICES_MAX
67
        IP_packets_tx           rd NET_DEVICES_MAX
68
        IP_packets_rx           rd NET_DEVICES_MAX
68
        IP_packets_rx           rd NET_DEVICES_MAX
69
        IP_packets_dumped       rd NET_DEVICES_MAX
69
        IP_packets_dumped       rd NET_DEVICES_MAX
Line 70... Line 70...
70
 
70
 
-
 
71
        FRAGMENT_LIST           rb MAX_FRAGMENTS * sizeof.FRAGMENT_slot
71
        FRAGMENT_LIST           rb MAX_FRAGMENTS * sizeof.FRAGMENT_slot
72
 
Line 72... Line 73...
72
endg
73
endg
73
 
74
 
Line 221... Line 222...
221
        DEBUGF  DEBUG_NETWORK_VERBOSE, "IPv4_input: Checksum ok\n"
222
        DEBUGF  DEBUG_NETWORK_VERBOSE, "IPv4_input: Checksum ok\n"
Line 222... Line 223...
222
 
223
 
223
;-----------------------------------
224
;-----------------------------------
Line 224... Line 225...
224
; Check if destination IP is correct
225
; Check if destination IP is correct
225
 
-
 
Line 226... Line 226...
226
        call    NET_ptr_to_num
226
 
Line 227... Line 227...
227
        shl     edi, 2
227
        call    NET_ptr_to_num4
228
 
228
 
Line 584... Line 584...
584
        test    eax, 0xffff0000         ; error bits
584
        test    eax, 0xffff0000         ; error bits
585
        jnz     .arp_error
585
        jnz     .arp_error
586
        push    ebx                     ; push the mac onto the stack
586
        push    ebx                     ; push the mac onto the stack
587
        push    ax
587
        push    ax
Line 588... Line 588...
588
 
588
 
Line 589... Line 589...
589
        inc     [IP_packets_tx + 4*edi] ; update stats
589
        inc     [IP_packets_tx + edi]   ; update stats
590
 
590
 
591
        mov     ebx, [NET_DRV_LIST + 4*edi]
591
        mov     ebx, [NET_DRV_LIST + edi]
592
        lea     eax, [ebx + ETH_DEVICE.mac]
592
        lea     eax, [ebx + ETH_DEVICE.mac]
593
        mov     edx, esp
593
        mov     edx, esp
594
        mov     ecx, [esp + 10 + 6]
594
        mov     ecx, [esp + 10 + 6]
Line 855... Line 855...
855
;---------------------------------------------------------------------------
855
;---------------------------------------------------------------------------
856
;
856
;
857
; IPv4_route
857
; IPv4_route
858
;
858
;
859
; IN:   eax = Destination IP
859
; IN:   eax = Destination IP
860
; OUT:  edi = device number
860
; OUT:  edi = device number*4
861
;       eax = ip of gateway if nescessary, unchanged otherwise
861
;       eax = ip of gateway if nescessary, unchanged otherwise
862
;
862
;
863
;---------------------------------------------------------------------------
863
;---------------------------------------------------------------------------
864
align 4
864
align 4
865
IPv4_route:
865
IPv4_route:
Line 888... Line 888...
888
        jnz     .loop
888
        jnz     .loop
Line 889... Line 889...
889
 
889
 
890
  .invalid:
890
  .invalid:
891
        mov     eax, [GATEWAY_LIST+4]       ;;; FIXME
891
        mov     eax, [GATEWAY_LIST+4]       ;;; FIXME
892
  .broadcast:
892
  .broadcast:
893
        xor     edi, edi                ; if none found, use device 1 as default     ;;;; FIXME
-
 
894
        inc     di
893
        mov     edi, 4                  ; if none found, use device 1 as default     ;;;; FIXME
Line 895... Line 894...
895
        ret
894
        ret