aboutsummaryrefslogtreecommitdiffstats
path: root/src/ctrl
AgeCommit message (Collapse)AuthorFilesLines
2016-11-26ctrl_cmd_parse: Make coverity FORWARD_NULL happyHarald Welte1-0/+1
The 'strtok_r' function requires passing a NULL as the first parameter on subsequent calls in order to ensure the code picks up where it left off on a previous call. However, Coverity doesn't quite realize this and points out that if a NULL was passed in as the third argument it would result in a possible NULL deref because the strtok_r function will assign the third argument to the first in the call is NULL. Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Fixes: Coverity CID 135186
2016-10-12Add function to send TRAP over Control InterfaceMax1-0/+21
Change-Id: Ic0b8d88c4f5c4d42c3f8fb754f8eabf049c9e388 Related: OS#1646
2016-09-23log CTRL bind address and portNeels Hofmeyr1-0/+3
Log 'CTRL at 1.2.3.4 5678' from ctrl_interface_setup*. All callers can now drop any extra 'CTRL at 1.2.3.4 5678' logging. Change-Id: If449d0514e3d0cc1b346d7452194d931aa090166
2016-09-19remove unused local variable in get_rate_ctr()Neels Hofmeyr1-1/+1
Unused after 22886d9e320ecf734d2827d825a191b977f70d2c "Fix retrieving rate_ctr over control interface" Change-Id: Ib5411da80c4eb4f905a5ed87c60477eca2cdff42
2016-09-19remove unused function get_rate_ctr_group()Neels Hofmeyr1-37/+0
Unused after 22886d9e320ecf734d2827d825a191b977f70d2c "Fix retrieving rate_ctr over control interface" Change-Id: I405367ef6ba5833957778a79dd398ce5ea29307e
2016-06-14Fix retrieving rate_ctr over control interfaceMax1-13/+7
Allow getting either particular counter (e. g. rate_ctr.per_hour.e1inp.0.hdlc.abort) or entire rate counter group for a given index (e. g. rate_ctr.per_hour.e1inp.0). Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Fixes: OS#1730 Reviewed-on: https://gerrit.osmocom.org/274 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-02-25vty: add ctrl section for Control interface bind addressNeels Hofmeyr2-0/+92
This may seem like overkill for a mere const char * config item, but it makes the Control interface VTY commands reusable in any main() scope (inspired by libosmo-abis' VTY config). Add API functions ctrl_vty_init() and ctrl_vty_get_bind_addr(), in new files src/ctrl/control_vty.c and include/osmocom/ctrl/control_vty.h, compiled and/or installed dependent on ENABLE_VTY. Using these functions allows configuring a static const char* with the VTY commands ctrl bind A.B.C.D which callers shall subsequently use to bind the Control interface to a specific local interface address, by passing the return value of ctrl_vty_get_bind_addr() to control_interface_setup(). Add CTRL_NODE to enum node_type, "eating" RESERVED4_NODE to heed that comment on avoiding ABI changes.
2016-02-25add ctrl_interface_setup_dynip() for bind addressNeels Hofmeyr1-1/+9
Make the ctrl interface bind address configurable, so that it may be made available on other addresses than 127.0.0.1. The specific aim is to allow running multiple osmo-nitbs alongside each other (commits in openbsc follow).
2015-12-05remove our internal copy of talloc, use system libtallocHarald Welte1-2/+2
Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
2015-04-05ctrl: Avoid accessing cmd_desc->command out of boundsHolger Hans Peter Freyther1-1/+1
We check that the amount of commands is not more than we have but we don't check it the other way. It appears that the vector is allowed to be bigger than the amount of commands. So we match a prefix of a longer command depending on the installation order.
2015-03-18libctrl: Include config.h so we can include netinet/tcp.hHolger Hans Peter Freyther1-0/+2
In e15ac060e7ae78d4c3569d7fc9071bcf49807e05 we tried to fix the nuttx build but we never included "netinet/tcp.h" after it and the compiler warned about the unused "on" parameter which we didn't notice because of the other warnings... Include config.h so we can see if there is a tcp.h and then include it.
2015-01-18ctrl: Link to libraries we use symbols fromHolger Hans Peter Freyther1-1/+4
Fixes: dpkg-shlibdeps: warning: symbol vector_free used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_set used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_set_index used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol tall_vty_vec_ctx used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol ipa_msg_recv_buffered used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol cmd_free_strvec used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_lookup used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_lookup_ensure used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol cmd_make_strvec used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_init used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries
2014-12-04fix libosmocore build for NuttX targetHarald Welte1-2/+6
this fixes some compilation issues with libosmocore under NuttX, particularly as some #defines are missing or some header files are slightly different.
2014-09-25misc: Look into the build directory for generated filesHolger Hans Peter Freyther1-1/+1
the bits/crc files are not inside the sourcedirectory but will end in the build directory. Go and look there as well. This somehow doesn't fail with make distcheck but when building for Yocto Dizzy.
2014-08-24libctrl: Add support for 'deferred control commands'Harald Welte2-0/+77
Sometimes a control interface command cannot be processed and responded immediately, but we need to process it asynchronously. In order to support this, we introduce the 'ctrl_cmd_def', which represents such a deferred command. It is created by the service implementing the command using ctrl_cmd_def_make(), and a response is later sent using ctrl_cmd_def_send(). ctrl_cmd_def_is_zombie() must be called to handle the case where the control connection has disconnected/died between receiving the command and sending the response.
2014-08-21ctrl: Attempt fix the build on FreeBSD and add include fileHolger Hans Peter Freyther1-0/+1
IPPROTO_TCP is defined in netinet/in.h. Include it and hope the build is fixed for FreeBSD.
2014-08-21rename controlif_setup() to ctrl_interface_setup()Harald Welte1-2/+2
which means that all control interface related functions now have the common ctrl_ prefix.
2014-08-21libctrl: Make two internal helper functions staticHarald Welte1-2/+2
2014-08-21libctrl: Move bulk of control node lookup inti libosmoctrlHarald Welte1-3/+127
The control interface user now only has to register a very short node lookup function callback. This function is optional, and only required if hierarchical command lookup should be supported.
2014-08-21libctrl: remove 'struct gsm_network' referencesHarald Welte1-4/+4
libctrl doesn't need any knowledge about the type of the user-private data that it gets passed upon setup time and includes on callbacks.
2014-08-21libctrl: adopt to recent ipaccess/ipa naming changeHarald Welte1-2/+3
2014-08-21libctrl: autotools build system integrationHarald Welte1-5/+10
Now we actually build the recently-imported libctrl
2014-08-21libctrl: Add DLCTRL as logging context for the control interfaceHarald Welte2-28/+28
... and make libctrl code use it
2014-08-21libctrl: Avoid using external tall_bsc_ctxHarald Welte1-6/+6
Instead of using one flat talloc context (and one that is specific to openbsc), we should attach the objects to whatever parent context they are being used in.
2014-08-21libctrl: remove openbsc headers, convert from make_sock to libosmocoreHarald Welte2-19/+9
2014-08-21libctrl: Remove reference to 'DNAT' in favor of 'DCTRL'Harald Welte1-1/+1
2014-08-21libctr: rename/move control interface to libosmocore naming schemeHarald Welte3-0/+1071