Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/seq_no.c

    re73dbc1 r8d2dd7f2  
    134134}
    135135
    136 /** Determine whether segment is fully acked.
    137  *
    138  * @param conn Connection
    139  * @param seg  Segment
    140  * @param ack  Last received ACK (i.e. SND.UNA)
    141  *
    142  * @return @c true if segment is fully acked, @c false otherwise
    143  */
     136/** Determine whether segment is fully acked */
    144137bool seq_no_segment_acked(tcp_conn_t *conn, tcp_segment_t *seg, uint32_t ack)
    145138{
     
    148141}
    149142
    150 /** Determine whether initial SYN is acked.
    151  *
    152  * @param conn Connection
    153  * @return @c true if initial SYN is acked, @c false otherwise
    154  */
     143/** Determine whether initial SYN is acked */
    155144bool seq_no_syn_acked(tcp_conn_t *conn)
    156145{
     
    158147}
    159148
    160 /** Determine whether segment overlaps the receive window.
    161  *
    162  * @param conn Connection
    163  * @param seg  Segment
    164  * @return @c true if segment overlaps the receive window, @c false otherwise
    165  */
     149/** Determine whether segment overlaps the receive window */
    166150bool seq_no_segment_acceptable(tcp_conn_t *conn, tcp_segment_t *seg)
    167151{
    168152        bool b_in, e_in;
    169         bool wb_in, we_in;
    170 
    171         /* Beginning of segment is inside window */
     153
    172154        b_in = seq_no_le_lt(conn->rcv_nxt, seg->seq, conn->rcv_nxt
    173155            + conn->rcv_wnd);
    174156
    175         /* End of segment is inside window */
    176157        e_in = seq_no_le_lt(conn->rcv_nxt, seg->seq + seg->len - 1,
    177158            conn->rcv_nxt + conn->rcv_wnd);
    178 
    179         /* Beginning of window is inside segment */
    180         wb_in = seq_no_le_lt(seg->seq, conn->rcv_nxt,
    181             seg->seq + seg->len);
    182 
    183         /* End of window is inside segment */
    184         we_in = seq_no_le_lt(seg->seq, conn->rcv_nxt + conn->rcv_wnd - 1,
    185             seg->seq + seg->len);
    186159
    187160        if (seg->len == 0 && conn->rcv_wnd == 0) {
     
    192165                return false;
    193166        } else {
    194                 return b_in || e_in || wb_in || we_in;
    195         }
    196 }
    197 
    198 /** Determine size that control bits occupy in sequence space.
    199  *
    200  * @param ctrl Control bits combination
    201  * @return Number of sequence space units occupied
    202  */
     167                return b_in || e_in;
     168        }
     169}
     170
     171/** Determine size that control bits occupy in sequence space. */
    203172uint32_t seq_no_control_len(tcp_control_t ctrl)
    204173{
     
    214183}
    215184
    216 /** Calculate the amount of trim needed to fit segment in receive window.
    217  *
    218  * @param conn  Connection
    219  * @param seg   Segment
    220  * @param left  Place to store number of units to trim at the beginning
    221  * @param right Place to store number of units to trim at the end
    222  */
     185/** Calculate the amount of trim needed to fit segment in receive window. */
    223186void seq_no_seg_trim_calc(tcp_conn_t *conn, tcp_segment_t *seg,
    224187    uint32_t *left, uint32_t *right)
Note: See TracChangeset for help on using the changeset viewer.