Subversion Repositories Kolibri OS

Rev

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

Rev 9807 Rev 9809
Line 14... Line 14...
14
;;          GNU GENERAL PUBLIC LICENSE                             ;;
14
;;          GNU GENERAL PUBLIC LICENSE                             ;;
15
;;             Version 2, June 1991                                ;;
15
;;             Version 2, June 1991                                ;;
16
;;                                                                 ;;
16
;;                                                                 ;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
$Revision: 9807 $
19
$Revision: 9809 $
20
 
20
 
Line 21... Line 21...
21
IPv4_MAX_FRAGMENTS              = 64
21
IPv4_MAX_FRAGMENTS              = 64
Line 506... Line 506...
506
        call    kernel_alloc
506
        call    kernel_alloc
507
        test    eax, eax
507
        test    eax, eax
508
        je      .destroy_slot_pop                                                       ; If we dont have enough space to allocate the buffer, discard all packets in slot
508
        je      .destroy_slot_pop                                                       ; If we dont have enough space to allocate the buffer, discard all packets in slot
509
        mov     edx, [esp+4]                                                            ; Get pointer to first fragment entry back in edx
509
        mov     edx, [esp+4]                                                            ; Get pointer to first fragment entry back in edx
Line 510... Line 510...
510
 
510
 
Line 511... Line 511...
511
        ; FIXME: We should create NET_BUFF in eax instead of a rugular buffer with IP packet
511
        ; FIXME: Allocate NET_BUFF here instead of raw IP packet buffer
512
 
512
 
513
  .rebuild_packet_loop:
513
  .rebuild_packet_loop:
514
        movzx   ecx, [edx + sizeof.NET_BUFF + sizeof.IPv4_FRAGMENT_entry + IPv4_header.FlagsAndFragmentOffset] ; Calculate the fragment offset
514
        movzx   ecx, [edx + sizeof.NET_BUFF + sizeof.IPv4_FRAGMENT_entry + IPv4_header.FlagsAndFragmentOffset] ; Calculate the fragment offset
Line 560... Line 560...
560
        mov     [edx + IPv4_header.TotalLength], cx
560
        mov     [edx + IPv4_header.TotalLength], cx
561
        add     esp, 8                  ; Remove pointer to first buffer and pointer to last buffer from the stack
561
        add     esp, 8                  ; Remove pointer to first buffer and pointer to last buffer from the stack
562
        xchg    cl, ch
562
        xchg    cl, ch
563
        push    edx                     ; Push pointer to the new buffer with full IP packet
563
        push    edx                     ; Push pointer to the new buffer with full IP packet
564
        mov     edi, [edi_saved]
564
        mov     edi, [edi_saved]
-
 
565
 
-
 
566
; FIXME: Remove this block once allocated network buffers handling is implemented.
-
 
567
if 1
-
 
568
        DEBUGF  DEBUG_NETWORK_ERROR, "IPv4_input: fragmented packet of size %d is dropped\n", ecx
-
 
569
        call    kernel_free             ; Ptr to buffer is on the stack already
-
 
570
        inc     [IPv4_packets_dumped + edi]
-
 
571
        ret
-
 
572
end if
-
 
573
 
565
        jmp     .handle_it              ; edx = buf ptr, ecx = size, [esp] buf ptr, ebx=device ptr
574
        jmp     .handle_it              ; edx = buf ptr, ecx = size, [esp] buf ptr, ebx=device ptr
Line 566... Line 575...
566
 
575
 
567
  .destroy_slot_pop:
576
  .destroy_slot_pop:
568
        add     esp, 4
577
        add     esp, 4