[GPRS] BSSGP: expose more internal structures / API
diff --git a/openbsc/src/gprs/gprs_bssgp.c b/openbsc/src/gprs/gprs_bssgp.c
index f6b02ba..b9c3c78 100644
--- a/openbsc/src/gprs/gprs_bssgp.c
+++ b/openbsc/src/gprs/gprs_bssgp.c
@@ -58,37 +58,14 @@
.ctr_desc = bssgp_ctr_description,
};
-#define BVC_S_BLOCKED 0x0001
-
-/* The per-BTS context that we keep on the SGSN side of the BSSGP link */
-struct bssgp_bvc_ctx {
- struct llist_head list;
-
- /* parsed RA ID and Cell ID of the remote BTS */
- struct gprs_ra_id ra_id;
- uint16_t cell_id;
-
- /* NSEI and BVCI of underlying Gb link. Together they
- * uniquely identify a link to a BTS (5.4.4) */
- uint16_t bvci;
- uint16_t nsei;
-
- uint32_t state;
-
- struct rate_ctr_group *ctrg;
-
- /* we might want to add this as a shortcut later, avoiding the NSVC
- * lookup for every packet, similar to a routing cache */
- //struct gprs_nsvc *nsvc;
-};
-static LLIST_HEAD(bts_ctxts);
+LLIST_HEAD(bssgp_bvc_ctxts);
/* Find a BTS Context based on parsed RA ID and Cell ID */
struct bssgp_bvc_ctx *btsctx_by_raid_cid(const struct gprs_ra_id *raid, uint16_t cid)
{
struct bssgp_bvc_ctx *bctx;
- llist_for_each_entry(bctx, &bts_ctxts, list) {
+ llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) {
if (!memcmp(&bctx->ra_id, raid, sizeof(bctx->ra_id)) &&
bctx->cell_id == cid)
return bctx;
@@ -101,7 +78,7 @@
{
struct bssgp_bvc_ctx *bctx;
- llist_for_each_entry(bctx, &bts_ctxts, list) {
+ llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) {
if (bctx->nsei == nsei && bctx->bvci == bvci)
return bctx;
}
@@ -120,7 +97,7 @@
/* FIXME: BVCI is not unique, only BVCI+NSEI ?!? */
ctx->ctrg = rate_ctr_group_alloc(ctx, &bssgp_ctrg_desc, bvci);
- llist_add(&ctx->list, &bts_ctxts);
+ llist_add(&ctx->list, &bssgp_bvc_ctxts);
return ctx;
}