Changeset 32aea9f4 in mainline
- Timestamp:
- 2011-10-23T02:23:46Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f343a16
- Parents:
- 8c7a054
- Location:
- uspace/srv/net/tl/tcp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/iqueue.c
r8c7a054 r32aea9f4 65 65 { 66 66 tcp_iqueue_entry_t *iqe; 67 tcp_iqueue_entry_t *qe; 68 link_t *link; 67 69 log_msg(LVL_DEBUG, "tcp_iqueue_insert_seg()"); 68 70 … … 75 77 iqe->seg = seg; 76 78 77 /* XXX Sort by sequence number */ 78 list_append(&iqe->link, &iqueue->list); 79 /* Sort by sequence number */ 80 81 link = list_first(&iqueue->list); 82 while (link != NULL) { 83 qe = list_get_instance(link, 84 tcp_iqueue_entry_t, link); 85 86 if (seq_no_seg_cmp(iqueue->conn, iqe->seg, qe->seg) >= 0) 87 break; 88 } 89 90 if (link != NULL) 91 list_insert_before(&iqe->link, &qe->link); 92 else 93 list_append(&iqe->link, &iqueue->list); 79 94 } 80 95 -
uspace/srv/net/tl/tcp/seq_no.c
r8c7a054 r32aea9f4 178 178 179 179 /** Calculate the amount of trim needed to fit segment in receive window. */ 180 externvoid seq_no_seg_trim_calc(tcp_conn_t *conn, tcp_segment_t *seg,180 void seq_no_seg_trim_calc(tcp_conn_t *conn, tcp_segment_t *seg, 181 181 uint32_t *left, uint32_t *right) 182 182 { … … 207 207 } 208 208 209 /** Segment order comparison. 210 * 211 * Compare sequence order of two acceptable segments. 212 * 213 * @param conn Connection 214 * @param sa Segment A 215 * @param sb Segment B 216 * 217 * @return -1, 0, 1, resp. if A < B, A == B, A > B in terms 218 * of sequence order of the beginning of the segment. 219 */ 220 int seq_no_seg_cmp(tcp_conn_t *conn, tcp_segment_t *sa, tcp_segment_t *sb) 221 { 222 assert(seq_no_segment_acceptable(conn, sa)); 223 assert(seq_no_segment_acceptable(conn, sb)); 224 225 if (seq_no_lt_le(sa->seq, sb->seq, conn->rcv_nxt + conn->rcv_wnd)) 226 return -1; 227 228 if (seq_no_lt_le(sb->seq, sa->seq, conn->rcv_nxt + conn->rcv_wnd)) 229 return +1; 230 231 assert(sa->seq == sb->seq); 232 return 0; 233 } 234 209 235 /** 210 236 * @} -
uspace/srv/net/tl/tcp/seq_no.h
r8c7a054 r32aea9f4 48 48 extern void seq_no_seg_trim_calc(tcp_conn_t *, tcp_segment_t *, uint32_t *, 49 49 uint32_t *); 50 extern int seq_no_seg_cmp(tcp_conn_t *, tcp_segment_t *, tcp_segment_t *); 50 51 51 52 extern uint32_t seq_no_control_len(tcp_control_t);
Note:
See TracChangeset
for help on using the changeset viewer.