aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-13 22:45:02 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-13 22:45:02 +0100
commita02085dab073dbc1d204d1f2698b53605267e07b (patch)
tree5d061c7a3f29adec5c3fd765d1594218929347ea /openbsc
parenta8e6a652ca50f269a739df2b7e915de5b49f63e0 (diff)
OM2000: Allow configuration of CON from VTY
However, we have no code that generates the OM2K CON List attribute.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h3
-rw-r--r--openbsc/src/abis_om2000_vty.c93
-rw-r--r--openbsc/src/gsm_data.c1
3 files changed, 95 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index e3cefe12..a9f9e5e6 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -581,6 +581,9 @@ struct gsm_bts {
struct {
struct llist_head conn_groups;
} is;
+ struct {
+ struct llist_head conn_groups;
+ } con;
} rbs2000;
};
diff --git a/openbsc/src/abis_om2000_vty.c b/openbsc/src/abis_om2000_vty.c
index c88e8de0..b77f470a 100644
--- a/openbsc/src/abis_om2000_vty.c
+++ b/openbsc/src/abis_om2000_vty.c
@@ -227,6 +227,95 @@ DEFUN(om2k_test, om2k_test_cmd,
return CMD_SUCCESS;
}
+struct con_conn_group {
+ struct llist_head list;
+
+ uint8_t cg;
+ uint16_t ccp;
+ uint8_t tag;
+ uint8_t tei;
+};
+
+static void add_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp,
+ uint8_t tag, uint8_t tei)
+{
+ struct con_conn_group *ent = talloc_zero(bts, struct con_conn_group);
+
+ ent->cg = cg;
+ ent->ccp = ccp;
+ ent->tag = tag;
+ ent->tei = tei;
+
+ llist_add(&ent->list, &bts->rbs2000.con.conn_groups);
+}
+
+static int del_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp,
+ uint8_t tag, uint8_t tei)
+{
+ struct con_conn_group *grp, *grp2;
+
+ llist_for_each_entry_safe(grp, grp2, &bts->rbs2000.con.conn_groups, list) {
+ if (grp->cg == cg && grp->ccp == ccp && grp->tag == tag
+ && grp->tei == tei) {
+ llist_del(&grp->list);
+ talloc_free(grp);
+ return 0;
+ }
+ }
+ return -ENOENT;
+}
+
+#define CON_LIST_HELP "CON connetiton list\n" \
+ "Add entry to CON list\n" \
+ "Delete entry from CON list\n" \
+ "Connection Group Number\n" \
+ "CON Connection Point\n" \
+
+DEFUN(om2k_con_list_dec, om2k_con_list_dec_cmd,
+ "con-connection-list (add|del) <1-255> <0-1023> deconcentrated",
+ CON_LIST_HELP "De-concentrated in/outlet\n")
+{
+ struct oml_node_state *oms = vty->index;
+ struct gsm_bts *bts = oms->bts;
+ uint8_t cg = atoi(argv[1]);
+ uint16_t ccp = atoi(argv[2]);
+
+ if (!strcmp(argv[0], "add"))
+ add_con_list(bts, cg, ccp, 0, 0xff);
+ else {
+ if (del_con_list(bts, cg, ccp, 0, 0xff) < 0) {
+ vty_out(vty, "%% No matching CON list entry%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ }
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(om2k_con_list_tei, om2k_con_list_tei_cmd,
+ "con-connection-list (add|del) <1-255> <0-1023> tei <0-63>",
+ CON_LIST_HELP "Concentrated in/outlet with TEI\n" "TEI Number\n")
+{
+ struct oml_node_state *oms = vty->index;
+ struct gsm_bts *bts = oms->bts;
+ uint8_t cg = atoi(argv[1]);
+ uint16_t ccp = atoi(argv[2]);
+ uint8_t tei = atoi(argv[3]);
+
+ if (!strcmp(argv[0], "add"))
+ add_con_list(bts, cg, ccp, cg, tei);
+ else {
+ if (del_con_list(bts, cg, ccp, cg, tei) < 0) {
+ vty_out(vty, "%% No matching CON list entry%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ }
+
+ return CMD_SUCCESS;
+}
+
static void om2k_fill_is_conn_grp(struct om2k_is_conn_grp *grp, uint16_t icp1,
uint16_t icp2, uint8_t cont_idx)
{
@@ -333,8 +422,8 @@ int abis_om2k_vty_init(void)
install_element(OM2K_NODE, &om2k_test_cmd);
install_element(OM2K_NODE, &om2k_is_conf_req_cmd);
install_element(OM2K_NODE, &om2k_is_conn_list_cmd);
-
- //install_element(BTS_NODE, &om2k_is_conn_list_cmd);
+ install_element(OM2K_NODE, &om2k_con_list_dec_cmd);
+ install_element(OM2K_NODE, &om2k_con_list_tei_cmd);
return 0;
}
diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c
index 395339e4..3a532203 100644
--- a/openbsc/src/gsm_data.c
+++ b/openbsc/src/gsm_data.c
@@ -578,6 +578,7 @@ int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type)
break;
case GSM_BTS_TYPE_RBS2000:
INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups);
+ INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups);
break;
}