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

Function sctp_find_stream_reset

freebsd/netinet/sctp_input.c:3405–3448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3403}
3404
3405struct sctp_stream_reset_request *
3406sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk)
3407{
3408 struct sctp_association *asoc;
3409 struct sctp_chunkhdr *ch;
3410 struct sctp_stream_reset_request *r;
3411 struct sctp_tmit_chunk *chk;
3412 int len, clen;
3413
3414 asoc = &stcb->asoc;
3415 if (TAILQ_EMPTY(&stcb->asoc.control_send_queue)) {
3416 asoc->stream_reset_outstanding = 0;
3417 return (NULL);
3418 }
3419 if (stcb->asoc.str_reset == NULL) {
3420 asoc->stream_reset_outstanding = 0;
3421 return (NULL);
3422 }
3423 chk = stcb->asoc.str_reset;
3424 if (chk->data == NULL) {
3425 return (NULL);
3426 }
3427 if (bchk) {
3428 /* he wants a copy of the chk pointer */
3429 *bchk = chk;
3430 }
3431 clen = chk->send_size;
3432 ch = mtod(chk->data, struct sctp_chunkhdr *);
3433 r = (struct sctp_stream_reset_request *)(ch + 1);
3434 if (ntohl(r->request_seq) == seq) {
3435 /* found it */
3436 return (r);
3437 }
3438 len = SCTP_SIZE32(ntohs(r->ph.param_length));
3439 if (clen > (len + (int)sizeof(struct sctp_chunkhdr))) {
3440 /* move to the next one, there can only be a max of two */
3441 r = (struct sctp_stream_reset_request *)((caddr_t)r + len);
3442 if (ntohl(r->request_seq) == seq) {
3443 return (r);
3444 }
3445 }
3446 /* that seq is not here */
3447 return (NULL);
3448}
3449
3450static void
3451sctp_clean_up_stream_reset(struct sctp_tcb *stcb)

Callers 2

sctp_strreset_timerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected