aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libctrl
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2011-05-06 16:38:11 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-09-11 13:08:48 +0200
commit721f0325b53adeb46de1802ee16a56ed706da974 (patch)
treedd2d5b13e90ca954ad8e99f144d8b63d74441d05 /openbsc/src/libctrl
parent114a010c33a9e06f0187c3fb9a1dcdcb3ab1f9ea (diff)
libctrl: Add function ctrl_cmd_send_to_all
Sends a command to all ctrl connections except the one it originated from.
Diffstat (limited to 'openbsc/src/libctrl')
-rw-r--r--openbsc/src/libctrl/control_if.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/libctrl/control_if.c b/openbsc/src/libctrl/control_if.c
index f68cb809d..350e8e1ca 100644
--- a/openbsc/src/libctrl/control_if.c
+++ b/openbsc/src/libctrl/control_if.c
@@ -65,6 +65,21 @@
vector ctrl_node_vec;
+/* Send command to all */
+int ctrl_cmd_send_to_all(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd)
+{
+ struct ctrl_connection *ccon;
+ int ret = 0;
+
+ llist_for_each_entry(ccon, &ctrl->ccon_list, list_entry) {
+ if (ccon == cmd->ccon)
+ continue;
+ if (ctrl_cmd_send(&ccon->write_queue, cmd))
+ ret++;
+ }
+ return ret;
+}
+
int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd)
{
int ret;