Subversion Repositories Kolibri OS

Rev

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

Rev 4339 Rev 4344
Line 80... Line 80...
80
align 4
80
align 4
81
proc TCP_process_input
81
proc TCP_process_input
Line 82... Line 82...
82
 
82
 
83
locals
83
locals
-
 
84
        dataoffset      dd ?
84
        dataoffset      dd ?
85
        timestamp       dd ?
Line 85... Line 86...
85
endl
86
endl
86
 
87
 
87
        xor     esi, esi
88
        xor     esi, esi
Line 96... Line 97...
96
 
97
 
97
  .loop:
98
  .loop:
Line 98... Line 99...
98
        get_from_queue TCP_queue, TCP_QUEUE_SIZE, sizeof.TCP_queue_entry, .wait
99
        get_from_queue TCP_queue, TCP_QUEUE_SIZE, sizeof.TCP_queue_entry, .wait
-
 
100
 
99
 
101
        push    [esi + TCP_queue_entry.timestamp]
Line 100... Line 102...
100
        push    [esi + TCP_queue_entry.timestamp]
102
        pop     [timestamp]
101
        push    [esi + TCP_queue_entry.buffer_ptr]
103
        push    [esi + TCP_queue_entry.buffer_ptr]
102
 
104
 
Line 370... Line 372...
370
        jz      @f
372
        jz      @f
371
        or      [ebx + TCP_SOCKET.t_flags], TF_RCVD_TSTMP
373
        or      [ebx + TCP_SOCKET.t_flags], TF_RCVD_TSTMP
372
       @@:
374
       @@:
Line 373... Line 375...
373
 
375
 
-
 
376
        lodsd
374
        lodsd
377
        bswap   eax
375
        mov     [ebx + TCP_SOCKET.ts_val], eax
378
        mov     [ebx + TCP_SOCKET.ts_val], eax
376
        lodsd                                   ; timestamp echo reply
379
        lodsd                                   ; timestamp echo reply
377
        mov     [ebx + TCP_SOCKET.ts_ecr], eax
380
        mov     [ebx + TCP_SOCKET.ts_ecr], eax
Line 384... Line 387...
384
 
387
 
385
        mov     eax, [ebx + TCP_SOCKET.ts_recent]
388
        mov     eax, [ebx + TCP_SOCKET.ts_recent]
386
        test    eax, eax
389
        test    eax, eax
387
        jz      .no_paws
390
        jz      .no_paws
388
        cmp     eax, [ebx + TCP_SOCKET.ts_val]
391
        cmp     eax, [ebx + TCP_SOCKET.ts_val]
Line 389... Line 392...
389
        jge     .no_paws
392
        jbe     .no_paws
Line 390... Line 393...
390
 
393
 
391
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: PAWS: detected an old segment\n"
394
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: PAWS: detected an old segment\n"
Line 392... Line 395...
392
 
395
 
393
        mov     eax, [esp+4+4]                          ; tcp_now
396
        mov     eax, [timestamp]
394
        sub     eax, [ebx + TCP_SOCKET.ts_recent_age]
397
        sub     eax, [ebx + TCP_SOCKET.ts_recent_age]
Line 480... Line 483...
480
 
483
 
Line 481... Line 484...
481
; Update RTT estimators
484
; Update RTT estimators
482
 
485
 
483
        test    [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP
486
        test    [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP
484
        jz      .no_timestamp_rtt
487
        jz      .no_timestamp_rtt
485
        mov     eax, [esp + 4]                          ; timestamp when this segment was received
488
        mov     eax, [timestamp]
486
        sub     eax, [ebx + TCP_SOCKET.ts_ecr]
489
        sub     eax, [ebx + TCP_SOCKET.ts_ecr]
487
        inc     eax
490
        inc     eax
Line 540... Line 543...
540
 
543
 
Line 541... Line 544...
541
; Complete processing of received data
544
; Complete processing of received data
Line 542... Line -...
542
 
-
 
543
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: Header prediction: we are receiving %u bytes\n", ecx
-
 
544
 
545
 
545
        add     [ebx + TCP_SOCKET.RCV_NXT], ecx         ; Update sequence number with number of bytes we have copied
546
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: Header prediction: we are receiving %u bytes\n", ecx
546
 
547
 
547
        mov     esi, [dataoffset]
548
        mov     esi, [dataoffset]
-
 
549
        add     esi, edx
Line 548... Line 550...
548
        add     esi, edx
550
        lea     eax, [ebx + STREAM_SOCKET.rcv]
549
        lea     eax, [ebx + STREAM_SOCKET.rcv]
551
        call    SOCKET_ring_write                       ; Add the data to the socket buffer
Line 550... Line 552...
550
        call    SOCKET_ring_write                       ; Add the data to the socket buffer
552
        add     [ebx + TCP_SOCKET.RCV_NXT], ecx         ; Update sequence number with number of bytes we have copied
Line 732... Line 734...
732
        sub     eax, ecx
734
        sub     eax, ecx
733
        jae     .no_timestamp
735
        jae     .no_timestamp
Line 734... Line 736...
734
 
736
 
Line 735... Line 737...
735
        DEBUGF  DEBUG_NETWORK_VERBOSE, "Recording timestamp\n"
737
        DEBUGF  DEBUG_NETWORK_VERBOSE, "Recording timestamp\n"
736
 
738
 
737
        mov     eax, [esp + 4]                                  ; tcp_now
739
        mov     eax, [timestamp]
738
        mov     [ebx + TCP_SOCKET.ts_recent_age], eax
740
        mov     [ebx + TCP_SOCKET.ts_recent_age], eax
739
        mov     eax, [ebx + TCP_SOCKET.ts_val]
741
        mov     eax, [ebx + TCP_SOCKET.ts_val]
Line 1006... Line 1008...
1006
 
1008
 
Line 1007... Line 1009...
1007
; If we have a timestamp, update smoothed RTT
1009
; If we have a timestamp, update smoothed RTT
1008
 
1010
 
1009
        test    [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP
1011
        test    [ebx + TCP_SOCKET.temp_bits], TCP_BIT_TIMESTAMP
1010
        jz      .timestamp_not_present
1012
        jz      .timestamp_not_present
1011
        mov     eax, [esp+4]
1013
        mov     eax, [timestamp]
1012
        sub     eax, [ebx + TCP_SOCKET.ts_ecr]
1014
        sub     eax, [ebx + TCP_SOCKET.ts_ecr]
1013
        inc     eax
1015
        inc     eax
Line 1643... Line 1645...
1643
 
1645
 
1644
  .dumpit:
1646
  .dumpit:
Line 1645... Line 1647...
1645
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: dumping\n"
1647
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: dumping\n"
1646
 
-
 
1647
        call    NET_packet_free
1648
 
Line 1648... Line 1649...
1648
        add     esp, 4
1649
        call    NET_packet_free
1649
        jmp     .loop
1650
        jmp     .loop
Line 1716... Line 1717...
1716
 
1717
 
1717
  .drop_no_socket:
1718
  .drop_no_socket:
Line 1718... Line 1719...
1718
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: Drop (no socket)\n"
1719
        DEBUGF  DEBUG_NETWORK_VERBOSE, "TCP_input: Drop (no socket)\n"
1719
 
-
 
1720
        call    NET_packet_free
1720
 
Line 1721... Line 1721...
1721
        add     esp, 4
1721
        call    NET_packet_free