print E1DP Mode as string, not in numeric format

Change-Id: I4d221a45bdd5d85b3ab6eaa35d67683b50bea21f
This commit is contained in:
Harald Welte 2020-07-11 10:40:37 +02:00
parent f5962496d4
commit 9fbd4e819e
3 changed files with 3 additions and 2 deletions

View File

@ -111,7 +111,7 @@ _e1d_ts_start(struct e1_ts *ts, enum e1_ts_mode mode)
{
int ret, sd[2];
LOGPTS(ts, DE1D, LOGL_INFO, "Starting in mode %u\n", mode);
LOGPTS(ts, DE1D, LOGL_INFO, "Starting in mode %s\n", get_value_string(e1_ts_mode_names, mode));
ret = socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sd);
if (ret < 0)

View File

@ -33,6 +33,7 @@ enum e1_ts_mode {
E1_TS_MODE_RAW,
E1_TS_MODE_HDLCFCS,
};
extern const struct value_string e1_ts_mode_names[];
struct e1_ts {
struct e1_line *line;

View File

@ -86,7 +86,7 @@ static int get_remote_pid(int fd)
return uc.pid;
}
static const struct value_string e1_ts_mode_names[] = {
const struct value_string e1_ts_mode_names[] = {
{ E1_TS_MODE_OFF, "OFF" },
{ E1_TS_MODE_RAW, "RAW" },
{ E1_TS_MODE_HDLCFCS, "HDLC-FCS" },