Changeset 975d528 in mainline for uspace/srv/net/tcp/conn.c
- Timestamp:
- 2017-09-10T17:48:58Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e1b4ae0
- Parents:
- 12dcd5f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/conn.c
r12dcd5f r975d528 44 44 #include <stdlib.h> 45 45 #include "conn.h" 46 #include "inet.h" 46 47 #include "iqueue.h" 48 #include "pdu.h" 47 49 #include "segment.h" 48 50 #include "seq_no.h" … … 62 64 static amap_t *amap; 63 65 64 static void tcp_conn_seg_process(tcp_conn_t *conn, tcp_segment_t *seg); 65 static void tcp_conn_tw_timer_set(tcp_conn_t *conn); 66 static void tcp_conn_tw_timer_clear(tcp_conn_t *conn); 66 static void tcp_conn_seg_process(tcp_conn_t *, tcp_segment_t *); 67 static void tcp_conn_tw_timer_set(tcp_conn_t *); 68 static void tcp_conn_tw_timer_clear(tcp_conn_t *); 69 static void tcp_transmit_segment(inet_ep2_t *, tcp_segment_t *); 70 71 static tcp_tqueue_cb_t tcp_conn_tqueue_cb = { 72 .transmit_seg = tcp_transmit_segment 73 }; 67 74 68 75 /** Initialize connections. */ … … 130 137 131 138 /* Initialize retransmission queue */ 132 if (tcp_tqueue_init(&conn->retransmit, conn) != EOK) 139 if (tcp_tqueue_init(&conn->retransmit, conn, &tcp_conn_tqueue_cb) 140 != EOK) { 133 141 goto error; 142 } 134 143 135 144 tqueue_inited = true; … … 295 304 void tcp_conn_remove(tcp_conn_t *conn) 296 305 { 306 if (!link_used(&conn->link)) 307 return; 308 297 309 fibril_mutex_lock(&conn_list_lock); 298 310 amap_remove(amap, &conn->ident); … … 1346 1358 } 1347 1359 1360 static void tcp_transmit_segment(inet_ep2_t *epp, tcp_segment_t *seg) 1361 { 1362 log_msg(LOG_DEFAULT, LVL_DEBUG, 1363 "tcp_transmit_segment(l:(%u),f:(%u), %p)", 1364 epp->local.port, epp->remote.port, seg); 1365 1366 log_msg(LOG_DEFAULT, LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32, 1367 seg->seq, seg->wnd); 1368 1369 tcp_segment_dump(seg); 1370 1371 // tcp_rqueue_bounce_seg(sp, seg); 1372 // tcp_ncsim_bounce_seg(sp, seg); 1373 1374 tcp_pdu_t *pdu; 1375 1376 if (tcp_pdu_encode(epp, seg, &pdu) != EOK) { 1377 log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped."); 1378 return; 1379 } 1380 1381 tcp_transmit_pdu(pdu); 1382 tcp_pdu_delete(pdu); 1383 } 1384 1348 1385 /** Compute flipped endpoint pair for response. 1349 1386 *
Note:
See TracChangeset
for help on using the changeset viewer.