Subversion Repositories Kolibri OS

Rev

Rev 6413 | Rev 6476 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6413 Rev 6474
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;  Part of the TCP/IP network stack for KolibriOS                 ;;
6
;;  Part of the TCP/IP network stack for KolibriOS                 ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;   Written by hidnplayr@kolibrios.org                            ;;
8
;;   Written by hidnplayr@kolibrios.org                            ;;
Line 12... Line 12...
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
12
;;          GNU GENERAL PUBLIC LICENSE                             ;;
13
;;             Version 2, June 1991                                ;;
13
;;             Version 2, June 1991                                ;;
14
;;                                                                 ;;
14
;;                                                                 ;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
$Revision: 6413 $
17
$Revision: 6474 $
18
 
18
 
19
;-----------------------------------------------------------------;
19
;-----------------------------------------------------------------;
20
;                                                                 ;
20
;                                                                 ;
Line 28... Line 28...
28
align 4
28
align 4
29
proc tcp_output
29
proc tcp_output
Line 30... Line 30...
30
 
30
 
31
locals
31
locals
-
 
32
        temp_bits       db ?
32
        temp_bits       db ?
33
        window          dd ?
Line 33... Line 34...
33
endl
34
endl
Line 34... Line 35...
34
 
35
 
Line 468... Line 469...
468
        cmp     ebx, ecx
469
        cmp     ebx, ecx
469
        ja      @f
470
        ja      @f
470
        mov     ebx, ecx
471
        mov     ebx, ecx
471
  @@:
472
  @@:
Line 472... Line 473...
472
 
473
 
-
 
474
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: window=%u\n", ebx
Line 473... Line 475...
473
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_send: window = %u\n", ebx
475
        mov     [window], ebx
474
 
476
 
475
        mov     cl, [eax + TCP_SOCKET.RCV_SCALE]
477
        mov     cl, [eax + TCP_SOCKET.RCV_SCALE]
Line 516... Line 518...
516
; Move TCP header from stack to TCP segment
518
; Move TCP header from stack to TCP segment
Line 517... Line 519...
517
 
519
 
518
        push    ecx
520
        push    ecx
519
        mov     ecx, [esp + 4]
521
        mov     ecx, [esp + 4]
520
        lea     esi, [esp + 8]
522
        lea     esi, [esp + 8]
521
        shr     ecx, 2                  ; count is in bytes, we will work with dwords
523
        shr     ecx, 2                          ; count is in bytes, we will work with dwords
522
        rep movsd
524
        rep movsd
Line 523... Line 525...
523
        pop     ecx                     ; full TCP packet size
525
        pop     ecx                             ; full TCP packet size
524
 
526
 
Line 525... Line 527...
525
        pop     esi                     ; headersize
527
        pop     esi                             ; headersize
Line 526... Line 528...
526
        add     esp, esi                ; remove it from stack
528
        add     esp, esi                        ; remove it from stack
527
 
529
 
528
        push    eax                     ; packet ptr for send proc
530
        push    eax                             ; packet ptr for send proc
529
 
531
 
Line 530... Line 532...
530
        mov     edx, edi                ; begin of data
532
        mov     edx, edi                        ; begin of data
531
        sub     edx, esi                ; begin of packet (edi = begin of data)
533
        sub     edx, esi                        ; begin of packet (edi = begin of data)
Line 532... Line 534...
532
        push    ecx
534
        push    ecx
Line 627... Line 629...
627
        call    net_ptr_to_num4
629
        call    net_ptr_to_num4
628
        inc     [TCP_segments_tx + edi]
630
        inc     [TCP_segments_tx + edi]
629
        inc     [TCPS_sndtotal]
631
        inc     [TCPS_sndtotal]
Line 630... Line 632...
630
 
632
 
-
 
633
; update advertised receive window
-
 
634
 
631
; update advertised receive window
635
        mov     ecx, [window]
632
        test    ecx, ecx
636
        test    ecx, ecx
633
        jz      @f
637
        jz      @f
634
        add     ecx, [eax + TCP_SOCKET.RCV_NXT]
638
        add     ecx, [eax + TCP_SOCKET.RCV_NXT]
635
        cmp     ecx, [eax + TCP_SOCKET.RCV_ADV]
639
        cmp     ecx, [eax + TCP_SOCKET.RCV_ADV]