nat: Use libctrl and add command forwarding to osmo-bsc
Passes commands beginning with "bsc.<num>" to the bsc that is
responsible for LAC <num>.
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 97fa4fe..97c0a1c 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -67,6 +67,24 @@
};
/*
+ * Pending command entry
+ */
+struct bsc_cmd_list {
+ struct llist_head list_entry;
+
+ struct osmo_timer_list timeout;
+
+ /* The NATed ID used on the bsc_con*/
+ int nat_id;
+
+ /* The control connection from which the command originated */
+ struct ctrl_connection *ccon;
+
+ /* The command from the control connection */
+ struct ctrl_cmd *cmd;
+};
+
+/*
* Per BSC data structure
*/
struct bsc_connection {
@@ -94,6 +112,10 @@
int max_endpoints;
int last_endpoint;
+ /* track the pending commands for this BSC */
+ struct llist_head cmd_pending;
+ int last_id;
+
/* a back pointer */
struct bsc_nat *nat;
};