| 2595 | */ |
| 2596 | |
| 2597 | void |
| 2598 | sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, |
| 2599 | struct sctp_nets *net, uint32_t from) |
| 2600 | { |
| 2601 | struct sctp_timer *tmr; |
| 2602 | |
| 2603 | KASSERT(stcb == NULL || stcb->sctp_ep == inp, |
| 2604 | ("sctp_timer_stop of type %d: inp = %p, stcb->sctp_ep %p", |
| 2605 | t_type, stcb, stcb->sctp_ep)); |
| 2606 | if (stcb != NULL) { |
| 2607 | SCTP_TCB_LOCK_ASSERT(stcb); |
| 2608 | } else if (inp != NULL) { |
| 2609 | SCTP_INP_WLOCK_ASSERT(inp); |
| 2610 | } else { |
| 2611 | SCTP_WQ_ADDR_LOCK_ASSERT(); |
| 2612 | } |
| 2613 | tmr = NULL; |
| 2614 | switch (t_type) { |
| 2615 | case SCTP_TIMER_TYPE_SEND: |
| 2616 | if ((inp == NULL) || (stcb == NULL) || (net == NULL)) { |
| 2617 | #ifdef INVARIANTS |
| 2618 | panic("sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p", |
| 2619 | t_type, inp, stcb, net); |
| 2620 | #else |
| 2621 | return; |
| 2622 | #endif |
| 2623 | } |
| 2624 | tmr = &net->rxt_timer; |
| 2625 | break; |
| 2626 | case SCTP_TIMER_TYPE_INIT: |
| 2627 | if ((inp == NULL) || (stcb == NULL) || (net == NULL)) { |
| 2628 | #ifdef INVARIANTS |
| 2629 | panic("sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p", |
| 2630 | t_type, inp, stcb, net); |
| 2631 | #else |
| 2632 | return; |
| 2633 | #endif |
| 2634 | } |
| 2635 | tmr = &net->rxt_timer; |
| 2636 | break; |
| 2637 | case SCTP_TIMER_TYPE_RECV: |
| 2638 | if ((inp == NULL) || (stcb == NULL) || (net != NULL)) { |
| 2639 | #ifdef INVARIANTS |
| 2640 | panic("sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p", |
| 2641 | t_type, inp, stcb, net); |
| 2642 | #else |
| 2643 | return; |
| 2644 | #endif |
| 2645 | } |
| 2646 | tmr = &stcb->asoc.dack_timer; |
| 2647 | break; |
| 2648 | case SCTP_TIMER_TYPE_SHUTDOWN: |
| 2649 | if ((inp == NULL) || (stcb == NULL) || (net == NULL)) { |
| 2650 | #ifdef INVARIANTS |
| 2651 | panic("sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p", |
| 2652 | t_type, inp, stcb, net); |
| 2653 | #else |
| 2654 | return; |
no test coverage detected