MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_build_readq_entry

Function sctp_build_readq_entry

freebsd/netinet/sctp_indata.c:134–169  ·  view source on GitHub ↗

* Build out our readq entry based on the incoming packet. */

Source from the content-addressed store, hash-verified

132 * Build out our readq entry based on the incoming packet.
133 */
134struct sctp_queued_to_read *
135sctp_build_readq_entry(struct sctp_tcb *stcb,
136 struct sctp_nets *net,
137 uint32_t tsn, uint32_t ppid,
138 uint32_t context, uint16_t sid,
139 uint32_t mid, uint8_t flags,
140 struct mbuf *dm)
141{
142 struct sctp_queued_to_read *read_queue_e = NULL;
143
144 sctp_alloc_a_readq(stcb, read_queue_e);
145 if (read_queue_e == NULL) {
146 goto failed_build;
147 }
148 memset(read_queue_e, 0, sizeof(struct sctp_queued_to_read));
149 read_queue_e->sinfo_stream = sid;
150 read_queue_e->sinfo_flags = (flags << 8);
151 read_queue_e->sinfo_ppid = ppid;
152 read_queue_e->sinfo_context = context;
153 read_queue_e->sinfo_tsn = tsn;
154 read_queue_e->sinfo_cumtsn = tsn;
155 read_queue_e->sinfo_assoc_id = sctp_get_associd(stcb);
156 read_queue_e->mid = mid;
157 read_queue_e->top_fsn = read_queue_e->fsn_included = 0xffffffff;
158 TAILQ_INIT(&read_queue_e->reasm);
159 read_queue_e->whoFrom = net;
160 atomic_add_int(&net->ref_count, 1);
161 read_queue_e->data = dm;
162 read_queue_e->stcb = stcb;
163 read_queue_e->port_from = stcb->rport;
164 if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) {
165 read_queue_e->do_not_ref_stcb = 1;
166 }
167failed_build:
168 return (read_queue_e);
169}
170
171struct mbuf *
172sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected