summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-01 11:28:43 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-04 07:20:42 +0200
commit1203de3993a7df15a01469492d8ea9179c763668 (patch)
treea1f8557b2ec72a9af28b256799ac346bb1d8dccc /openbsc
parent3771d09ec01581e50253dce4dc5ec0abba9a1e35 (diff)
[gprs] fully integrate VTY configuration into Gb proxy
The Gb-proxy is now fully configured by config file / VTY
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gprs_ns.h49
-rw-r--r--openbsc/src/gprs_ns.c29
2 files changed, 42 insertions, 36 deletions
diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h
index dd10d333..ca02c4b5 100644
--- a/openbsc/include/openbsc/gprs_ns.h
+++ b/openbsc/include/openbsc/gprs_ns.h
@@ -76,10 +76,46 @@ enum ns_cause {
/* Our Implementation */
#include <netinet/in.h>
+#include <osmocore/linuxlist.h>
+#include <osmocore/msgb.h>
+#include <osmocore/timer.h>
+#include <osmocore/select.h>
#define NSE_S_BLOCKED 0x0001
#define NSE_S_ALIVE 0x0002
+enum gprs_ns_ll {
+ GPRS_NS_LL_UDP,
+ GPRS_NS_LL_E1,
+};
+
+enum gprs_ns_evt {
+ GPRS_NS_EVT_UNIT_DATA,
+};
+
+struct gprs_nsvc;
+typedef int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
+ struct msgb *msg, u_int16_t bvci);
+
+/* An instance of the NS protocol stack */
+struct gprs_ns_inst {
+ /* callback to the user for incoming UNIT DATA IND */
+ gprs_ns_cb_t *cb;
+
+ /* linked lists of all NSVC in this instance */
+ struct llist_head gprs_nsvcs;
+
+ /* which link-layer are we based on? */
+ enum gprs_ns_ll ll;
+
+ union {
+ /* NS-over-IP specific bits */
+ struct {
+ struct bsc_fd fd;
+ } nsip;
+ };
+};
+
struct gprs_nsvc {
struct llist_head list;
struct gprs_ns_inst *nsi;
@@ -103,16 +139,6 @@ struct gprs_nsvc {
};
};
-
-struct gprs_ns_inst;
-
-enum gprs_ns_evt {
- GPRS_NS_EVT_UNIT_DATA,
-};
-
-typedef int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
- struct msgb *msg, u_int16_t bvci);
-
/* Create a new NS protocol instance */
struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb);
@@ -137,5 +163,6 @@ int nsip_listen(struct gprs_ns_inst *nsi, uint16_t udp_port);
/* Establish a connection (from the BSS) to the SGSN */
struct gprs_nsvc *nsip_connect(struct gprs_ns_inst *nsi,
- struct sockaddr_in *dest, uint16_t nsvci);
+ struct sockaddr_in *dest, uint16_t nsei,
+ uint16_t nsvci);
#endif
diff --git a/openbsc/src/gprs_ns.c b/openbsc/src/gprs_ns.c
index 3bb0bf94..18d189f5 100644
--- a/openbsc/src/gprs_ns.c
+++ b/openbsc/src/gprs_ns.c
@@ -72,30 +72,6 @@ static const struct tlv_definition ns_att_tlvdef = {
},
};
-enum gprs_ns_ll {
- GPRS_NS_LL_UDP,
- GPRS_NS_LL_E1,
-};
-
-/* An instance of the NS protocol stack */
-struct gprs_ns_inst {
- /* callback to the user for incoming UNIT DATA IND */
- gprs_ns_cb_t *cb;
-
- /* linked lists of all NSVC in this instance */
- struct llist_head gprs_nsvcs;
-
- /* which link-layer are we based on? */
- enum gprs_ns_ll ll;
-
- union {
- /* NS-over-IP specific bits */
- struct {
- struct bsc_fd fd;
- } nsip;
- };
-};
-
/* Lookup struct gprs_nsvc based on NSVCI */
static struct gprs_nsvc *nsvc_by_nsvci(struct gprs_ns_inst *nsi,
u_int16_t nsvci)
@@ -565,7 +541,8 @@ int nsip_listen(struct gprs_ns_inst *nsi, uint16_t udp_port)
/* Establish a connection (from the BSS) to the SGSN */
struct gprs_nsvc *nsip_connect(struct gprs_ns_inst *nsi,
- struct sockaddr_in *dest, uint16_t nsvci)
+ struct sockaddr_in *dest, uint16_t nsei,
+ uint16_t nsvci)
{
struct gprs_nsvc *nsvc;
@@ -574,6 +551,8 @@ struct gprs_nsvc *nsip_connect(struct gprs_ns_inst *nsi,
nsvc = nsvc_create(nsi, nsvci);
nsvc->ip.bts_addr = *dest;
}
+ nsvc->nsei = nsei;
+ nsvc->nsvci = nsvci;
nsvc->remote_end_is_sgsn = 1;
/* Initiate a RESET procedure */