* Build out our readq entry based on the incoming packet. */
| 132 | * Build out our readq entry based on the incoming packet. |
| 133 | */ |
| 134 | struct sctp_queued_to_read * |
| 135 | sctp_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 | } |
| 167 | failed_build: |
| 168 | return (read_queue_e); |
| 169 | } |
| 170 | |
| 171 | struct mbuf * |
| 172 | sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo) |
no test coverage detected