MINOR: tevt/muxes: Add CTL and SCTL command to get the termination event logs

MUX_CTL_TEVTS command is added to get the termination event logs of a mux
connection and MUX_SCTL_TEVTS command to get the termination event logs of a
mux stream.
This commit is contained in:
Christopher Faulet 2024-12-23 14:56:33 +01:00
parent 95029305d3
commit a4c281a190
3 changed files with 11 additions and 0 deletions

View File

@ -339,12 +339,14 @@ enum mux_ctl_type {
MUX_CTL_GET_GLITCHES, /* returns number of glitches on the connection */
MUX_CTL_GET_NBSTRM, /* Return the current number of streams on the connection */
MUX_CTL_GET_MAXSTRM, /* Return the max number of streams supported by the connection */
MUX_CTL_TEVTS, /* Return the termination events log of the mux connection */
};
/* sctl command used by mux->sctl() */
enum mux_sctl_type {
MUX_SCTL_SID, /* Return the mux stream ID as output, as a signed 64bits integer */
MUX_SCTL_DBG_STR, /* takes a mux_sctl_dbg_str_ctx argument, reads flags and returns debug info */
MUX_SCTL_TEVTS, /* Return the termination events log of the mux stream */
};
#define MUX_SCTL_DBG_STR_L_MUXS 0x00000001 // info from mux stream

View File

@ -5262,6 +5262,8 @@ static int h1_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
return h1_used_streams(conn);
case MUX_CTL_GET_MAXSTRM:
return 1;
case MUX_CTL_TEVTS:
return h1c->term_evts_log;
default:
return -1;
}
@ -5297,6 +5299,8 @@ static int h1_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *output)
/* other layers not implemented */
dbg_ctx->ret.buf = *buf;
return ret;
case MUX_SCTL_TEVTS:
return h1s->sd->term_evts_log;
default:
return -1;
}

View File

@ -5244,6 +5244,9 @@ static int h2_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
case MUX_CTL_GET_MAXSTRM:
return h2c->streams_limit;
case MUX_CTL_TEVTS:
return h2c->term_evts_log;
default:
return -1;
}
@ -5279,6 +5282,8 @@ static int h2_sctl(struct stconn *sc, enum mux_sctl_type mux_sctl, void *output)
/* other layers not implemented */
dbg_ctx->ret.buf = *buf;
return ret;
case MUX_SCTL_TEVTS:
return h2s->sd->term_evts_log;
default:
return -1;