Changeset 9520af7 in mainline for uspace/srv/net/tcp/rqueue.c
- Timestamp:
- 2017-09-12T15:48:01Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d40c93d
- Parents:
- 0a1e7e4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/rqueue.c
r0a1e7e4 r9520af7 43 43 #include <fibril_synch.h> 44 44 #include "conn.h" 45 #include "pdu.h"46 45 #include "rqueue.h" 47 46 #include "segment.h" 48 47 #include "tcp_type.h" 49 48 #include "ucall.h" 50 51 /** Transcode bounced segments.52 *53 * If defined, segments bounced via the internal debugging loopback will54 * be encoded to a PDU and the decoded. Otherwise they will be bounced back55 * directly without passing the encoder-decoder.56 */57 #define BOUNCE_TRANSCODE58 49 59 50 static prodcons_t rqueue; … … 87 78 } 88 79 89 /** Bounce segment directy into receive queue without constructing the PDU.90 *91 * This is for testing purposes only.92 *93 * @param sp Endpoint pair, oriented for transmission94 * @param seg Segment95 */96 void tcp_rqueue_bounce_seg(inet_ep2_t *epp, tcp_segment_t *seg)97 {98 inet_ep2_t rident;99 100 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_rqueue_bounce_seg()");101 102 #ifdef BOUNCE_TRANSCODE103 tcp_pdu_t *pdu;104 tcp_segment_t *dseg;105 106 if (tcp_pdu_encode(epp, seg, &pdu) != EOK) {107 log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");108 return;109 }110 111 if (tcp_pdu_decode(pdu, &rident, &dseg) != EOK) {112 log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");113 return;114 }115 116 tcp_pdu_delete(pdu);117 118 /** Insert decoded segment into rqueue */119 tcp_rqueue_insert_seg(&rident, dseg);120 tcp_segment_delete(seg);121 #else122 /* Reverse the identification */123 tcp_ep2_flipped(epp, &rident);124 125 /* Insert segment back into rqueue */126 tcp_rqueue_insert_seg(&rident, seg);127 #endif128 }129 130 80 /** Insert segment into receive queue. 131 81 * 132 82 * @param epp Endpoint pair, oriented for reception 133 * @param seg Segment 83 * @param seg Segment (ownership transferred to rqueue) 134 84 */ 135 85 void tcp_rqueue_insert_seg(inet_ep2_t *epp, tcp_segment_t *seg)
Note:
See TracChangeset
for help on using the changeset viewer.