aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-07-29 14:26:50 +0200
committerHarald Welte <laforge@gnumonks.org>2016-07-29 14:26:50 +0200
commitb7e40238d75754a00ac5dd57627b08980d032cbe (patch)
tree25b702d8c349e97a2623982acc6a27d0f46a17cd /src/vty.c
parent0e91aa1ec5a74704044a9cbb06964d47a1861d24 (diff)
first functional version that actually records + mirrors data
Diffstat (limited to 'src/vty.c')
-rw-r--r--src/vty.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/vty.c b/src/vty.c
index 694dab1..ae032fb 100644
--- a/src/vty.c
+++ b/src/vty.c
@@ -15,8 +15,14 @@ DEFUN(cfg_recorder, cfg_recorder_cmd,
return CMD_SUCCESS;
}
+static const struct e1inp_line_ops dummy_e1i_line_ops = {
+ .sign_link_up = NULL,
+ .sign_link_down = NULL,
+ .sign_link = NULL,
+};
+
DEFUN(cfg_rec_line_ts_mode, cfg_rec_line_ts_mode_cmd,
- "line <0-255> ts <0-31> mode (none|signalling|trau|raw)",
+ "line <0-255> ts <1-31> mode (none|signalling|trau|raw)",
LINE_STR
"E1/T1 Timeslot Number\n"
"E1/T1 Timeslot Number\n"
@@ -46,8 +52,10 @@ DEFUN(cfg_rec_line_ts_mode, cfg_rec_line_ts_mode_cmd,
vty_out(vty, "Timeslot %d is too large%s", ts_nr, VTY_NEWLINE);
return CMD_WARNING;
}
- ts = &line->ts[ts_nr];
+ ts = &line->ts[ts_nr-1];
+ e1inp_line_bind_ops(line, &dummy_e1i_line_ops);
+ vty_out(vty, "Line %u TS %u mode %u%s", line_nr, ts_nr, mode, VTY_NEWLINE);
switch (mode) {
case E1INP_TS_TYPE_NONE:
/* TOOD: have eqinp_ts_config_none ? */
@@ -59,6 +67,9 @@ DEFUN(cfg_rec_line_ts_mode, cfg_rec_line_ts_mode_cmd,
case E1INP_TS_TYPE_RAW:
e1inp_ts_config_raw(ts, line, &e1ts_raw_recv);
break;
+ default:
+ vty_out(vty, "Unknown mode %u ?!?%s", mode, VTY_NEWLINE);
+ break;
}
/* notify driver of change */
@@ -157,6 +168,12 @@ static void config_write_recorder_line(struct vty *vty, unsigned int lnr)
for (i = 0; i < line->num_ts; i++) {
struct e1inp_ts *ts = &line->ts[i];
+ const char *mode_str;
+
+ mode_str = get_value_string(e1inp_ts_type_names, ts->type);
+
+ vty_out(vty, " line %u ts %u mode %s%s",
+ lnr, ts->num, mode_str, VTY_NEWLINE);
}
}