summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-07-12 18:17:01 +0200
committerHarald Welte <laforge@gnumonks.org>2012-07-12 18:17:01 +0200
commitfba93ac5565dd665b233040e8c61438b736dff34 (patch)
tree86166b21e0b3730cd9f51502dd7d9f459410c721
parent68de8ae0a159ee96914032733164c9fbf90d7253 (diff)
ganc_data: add linked list to connect objects
the peer needs a reference to a sccp connection, and the network needs to have a list of peers and a list of mscs.
-rw-r--r--openbsc/src/osmo-ganc/ganc_data.c3
-rw-r--r--openbsc/src/osmo-ganc/ganc_data.h15
2 files changed, 17 insertions, 1 deletions
diff --git a/openbsc/src/osmo-ganc/ganc_data.c b/openbsc/src/osmo-ganc/ganc_data.c
index 4566ff1..fbae3be 100644
--- a/openbsc/src/osmo-ganc/ganc_data.c
+++ b/openbsc/src/osmo-ganc/ganc_data.c
@@ -31,4 +31,7 @@ void ganc_net_init(struct ganc_net *net)
net->timer[TU4002] = 5; /* seconds */
net->timer[TU4003] = 5;
net->timer[T3212] = 1; /* 6 minutes */
+
+ INIT_LLIST_HEAD(&net->mscs);
+ INIT_LLIST_HEAD(&net->peers);
}
diff --git a/openbsc/src/osmo-ganc/ganc_data.h b/openbsc/src/osmo-ganc/ganc_data.h
index fe7d3c4..58b77a7 100644
--- a/openbsc/src/osmo-ganc/ganc_data.h
+++ b/openbsc/src/osmo-ganc/ganc_data.h
@@ -31,7 +31,7 @@ enum ganc_state {
};
struct gan_peer {
- struct llist_head list; /* list of all peers */
+ struct llist_head entry; /* list of all peers */
struct osmo_conn *conn; /* TCP connection */
struct ganc_bts *bts; /* BTS to which we belong */
@@ -44,6 +44,9 @@ struct gan_peer {
unsigned int len;
uint8_t *val;
} cm3;
+
+ /* bsc structures */
+ struct osmo_bsc_sccp_con *sccp_con;
};
struct ganc_net {
@@ -57,6 +60,12 @@ struct ganc_net {
struct {
int mode;
} gprs;
+
+ /* msc configuration */
+ struct llist_head mscs;
+
+ /* list of all peers */
+ struct llist_head peers;
};
struct ganc_bts {
@@ -73,4 +82,8 @@ void ganc_bts_init(struct ganc_bts *bts, struct ganc_net *net);
extern struct ganc_bts *g_ganc_bts;
+struct osmo_msc_data *ganc_msc_data_find(struct ganc_net *net, int nr);
+struct osmo_msc_data *ganc_msc_data_alloc(struct ganc_net *net, int nr);
+
+
#endif