path: root/include/osmocom/vty
diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2020-05-14 16:51:26 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2020-05-18 13:55:08 +0200
commitcf70aa0c40c574c32b832454f725cc37459c5d8d (patch)
tree99e46a3c95995ff4a23f638ad9bce17f87992391 /include/osmocom/vty
parent22630e68279525fd9684c8016f7443a8aba1f2a5 (diff)
enable vty xml dumping to stdout
Allow dumping the VTY XML reference (for generating manuals) to a normal FILE* stream instead of a vty output buffer. We currently generate the VTY reference by starting the client program, connecting to the VTY telnet and dumping the reference. That is weirdly convoluted, especially since there has to be a valid config file that successfully starts up a minimal set of external links before the reference can be generated. IMO we should have dumped the XML reference to stdout from the start, and never to a VTY session. With this patch, it is trivial to generate the XML VTY reference by a commandline switch. The client program will set up the entire VTY, and immediately after parsing the cmdline options but before parsing a config file, just dumps the reference and doesn't even start establishing local ports. That would allow generating the XML reference on the fly during the build process of the manuals, without the need of a docker container or somesuch. A first implementation of such a commandline switch is `osmo-bsc -X`, added in I316efedb2c1652791434ecf14a1e261367cd2fb7 This patch jumps through a bit of a hoop to still allow dumping to a VTY buffer without code dup, to still allow dumping the XML reference through telnet VTY, until all our programs have implemented an -X switch (TM). Change-Id: Ic74bbdb6dc5ea05f03c791cc70184861e39cd492
Diffstat (limited to 'include/osmocom/vty')
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h
index d63dbdef..88490f79 100644
--- a/include/osmocom/vty/command.h
+++ b/include/osmocom/vty/command.h
@@ -401,4 +401,6 @@ void print_version(int print_copyright);
extern void *tall_vty_cmd_ctx;
+int vty_dump_xml_ref(FILE *stream);
/*! @} */