aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-09-11 15:18:13 +0200
committerHarald Welte <laforge@osmocom.org>2020-09-20 11:55:14 +0200
commit9e137aff1d8b0891219b6766c935f710ceab9676 (patch)
tree57625f62ff82de36011961ecd6e75e3f7e0bdb50 /include
parentead2e020f00c1d7b9831668114cd6852d570c481 (diff)
make sure a given timeslot can only be opened once (by default)
Align the behavior of osmo-e1d with that of DAHDI: If a timeslot is opened once, it cannot be opened again by anyone until it is closed by the current owner. This way we'd have the same failure semantics in DAHDI vs. osmo-e1d, which is very useful in case of misconfiguration when osmo-bsc + osmo-mgw would "fight" over a timeslot. Add a osmo_e1dp_client_ts_open_force() function that allows to override and get back the original behavior. Closes: OS#4654 Change-Id: Ib25adf827ec41e74de15e0e4fdcfc9bcc9a32e58
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/e1d/proto.h3
-rw-r--r--include/osmocom/e1d/proto_clnt.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocom/e1d/proto.h b/include/osmocom/e1d/proto.h
index 5628e31..6457f14 100644
--- a/include/osmocom/e1d/proto.h
+++ b/include/osmocom/e1d/proto.h
@@ -81,6 +81,8 @@ enum osmo_e1dp_ts_mode {
E1DP_TSMODE_HDLCFCS = 0x11,
};
+/* osmo_e1dp_ts_config.flags */
+#define E1DP_TS_OPEN_F_FORCE 0x80
/* the idea here is to use the first byte as a version number, to prevent incompatible
* clients from connecting to e1d */
@@ -118,6 +120,7 @@ struct osmo_e1dp_line_info {
struct osmo_e1dp_ts_config {
uint8_t mode;
+ uint8_t flags;
uint16_t read_bufsize;
} __attribute__((packed));
diff --git a/include/osmocom/e1d/proto_clnt.h b/include/osmocom/e1d/proto_clnt.h
index 5a4f965..1473716 100644
--- a/include/osmocom/e1d/proto_clnt.h
+++ b/include/osmocom/e1d/proto_clnt.h
@@ -46,3 +46,6 @@ int osmo_e1dp_client_line_config(struct osmo_e1dp_client *clnt,
int osmo_e1dp_client_ts_open(struct osmo_e1dp_client *clnt,
uint8_t intf, uint8_t line, uint8_t ts,
enum osmo_e1dp_ts_mode mode, uint16_t read_bufsize);
+int osmo_e1dp_client_ts_open_force(struct osmo_e1dp_client *clnt,
+ uint8_t intf, uint8_t line, uint8_t ts,
+ enum osmo_e1dp_ts_mode mode, uint16_t read_bufsize);