aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty_interface_layer3.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-14 17:59:53 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-14 18:05:41 +0200
commit197dea95ff55acd86d5800f5a1cf7e339b24064d (patch)
treea59916e0882b4fc876c331e3d58e76d4c4585c08 /openbsc/src/vty_interface_layer3.c
parentd94d6a02d5e50c7d4b4bcddcb59ffdad23d7757b (diff)
VTY: Introduce common code to add 'description' to objects like BTS
There is now an option to add a human-readable description to objects that are configured in the VTY.
Diffstat (limited to 'openbsc/src/vty_interface_layer3.c')
-rw-r--r--openbsc/src/vty_interface_layer3.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/openbsc/src/vty_interface_layer3.c b/openbsc/src/vty_interface_layer3.c
index 1b2adbbc7..029f0c4ab 100644
--- a/openbsc/src/vty_interface_layer3.c
+++ b/openbsc/src/vty_interface_layer3.c
@@ -56,23 +56,6 @@ static int dummy_config_write(struct vty *v)
return CMD_SUCCESS;
}
-static struct buffer *argv_to_buffer(int argc, const char *argv[], int base)
-{
- struct buffer *b = buffer_new(NULL, 1024);
- int i;
-
- if (!b)
- return NULL;
-
- for (i = base; i < argc; i++) {
- buffer_putstr(b, argv[i]);
- buffer_putc(b, ' ');
- }
- buffer_putc(b, '\0');
-
- return b;
-}
-
static int hexparse(const char *str, u_int8_t *b, int max_len)
{
@@ -308,7 +291,7 @@ DEFUN(subscriber_send_sms,
argv[0], argv[1], VTY_NEWLINE);
return CMD_WARNING;
}
- b = argv_to_buffer(argc, argv, 2);
+ b = vty_argv_to_buffer(argc, argv, 2);
rc = _send_sms_buffer(subscr, b, 0);
buffer_free(b);
@@ -332,7 +315,7 @@ DEFUN(subscriber_silent_sms,
return CMD_WARNING;
}
- b = argv_to_buffer(argc, argv, 2);
+ b = vty_argv_to_buffer(argc, argv, 2);
rc = _send_sms_buffer(subscr, b, 64);
buffer_free(b);