Skip to content

Commit

Permalink
Add SCTPDBG statement for connections closing.
Browse files Browse the repository at this point in the history
This reuses the existing sctp_log_closing mechanism.
  • Loading branch information
JonathanLennox committed Apr 15, 2024
1 parent d45b53f commit f7dc99e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion usrsctplib/netinet/sctp_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ extern void getwintimeofday(struct timeval *tv);
#define SCTP_DEBUG_ASCONF1 0x00010000
#define SCTP_DEBUG_ASCONF2 0x00020000
#define SCTP_DEBUG_OUTPUT5 0x00040000 /* unused */
#define SCTP_DEBUG_XXX 0x00080000 /* unused */
#define SCTP_DEBUG_CLOSING 0x00080000
#define SCTP_DEBUG_PCB1 0x00100000
#define SCTP_DEBUG_PCB2 0x00200000 /* unused */
#define SCTP_DEBUG_PCB3 0x00400000
Expand Down
3 changes: 3 additions & 0 deletions usrsctplib/netinet/sctputil.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc)
sctp_clog.x.misc.log3,
sctp_clog.x.misc.log4);
#endif
SCTPDBG(SCTP_DEBUG_CLOSING,
"Connection closing: inp=%p, flags=%x, stcb=%p, state=%d, loc=%d\n",
inp, inp->sctp_flags, stcb, stcb ? stcb->asoc.state : 0, loc);
}

void
Expand Down
4 changes: 4 additions & 0 deletions usrsctplib/netinet/sctputil.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ void rto_logging(struct sctp_nets *net, int from);

void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc);

#ifdef SCTP_DEBUG
#define SCTP_LOG_CLOSING 1
#endif

void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from);
void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t);
void sctp_log_block(uint8_t, struct sctp_association *, ssize_t);
Expand Down

0 comments on commit f7dc99e

Please sign in to comment.