Subversion Repositories Kolibri OS

Rev

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

Rev 9806 Rev 9807
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: 9806 $
19
$Revision: 9807 $
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 -... Line 510...
-
 
510
 
-
 
511
        ; FIXME: We should create NET_BUFF in eax instead of a rugular buffer with IP packet
510
 
512
 
511
  .rebuild_packet_loop:
513
  .rebuild_packet_loop:
512
        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
513
        xchg    cl, ch                                                                  ;  intel byte order
515
        xchg    cl, ch                                                                  ;  intel byte order
514
        shl     cx, 3                                                                   ;   multiply by 8 and clear first 3 bits
516
        shl     cx, 3                                                                   ;   multiply by 8 and clear first 3 bits
Line 554... Line 556...
554
 
556
 
555
        pop     ecx
557
        pop     ecx
556
        xchg    cl, ch
558
        xchg    cl, ch
557
        mov     edx, eax
559
        mov     edx, eax
558
        mov     [edx + IPv4_header.TotalLength], cx
560
        mov     [edx + IPv4_header.TotalLength], cx
559
        add     esp, 12
561
        add     esp, 8                  ; Remove pointer to first buffer and pointer to last buffer from the stack
560
        xchg    cl, ch
562
        xchg    cl, ch
561
        push    ecx edx                 ; size and pointer
563
        push    edx                     ; Push pointer to the new buffer with full IP packet
562
        mov     edi, [edi_saved]
564
        mov     edi, [edi_saved]
Line 563... Line 565...
563
        jmp     .handle_it              ; edx = buf ptr, ecx = size, [esp] buf ptr, [esp+4], total size, ebx=device ptr
565
        jmp     .handle_it              ; edx = buf ptr, ecx = size, [esp] buf ptr, ebx=device ptr
564
 
566
 
565
  .destroy_slot_pop:
567
  .destroy_slot_pop:
566
        add     esp, 4
568
        add     esp, 4