aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
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
commitb77c697c0b86a17870da5dda8f0f17007f5e35b4 (patch)
treedef9f69143d11d6241895f037b63bd2dea70e9c6 /openbsc/include
parent799e0c92c640db7e0418cc90eff6326898c1e147 (diff)
[gprs] fully integrate VTY configuration into Gb proxy
The Gb-proxy is now fully configured by config file / VTY
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/gb_proxy.h37
-rw-r--r--openbsc/include/openbsc/gprs_ns.h49
2 files changed, 75 insertions, 11 deletions
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h
new file mode 100644
index 000000000..8194d2a8b
--- /dev/null
+++ b/openbsc/include/openbsc/gb_proxy.h
@@ -0,0 +1,37 @@
+#ifndef _GB_PROXY_H
+#define _GB_PROXY_H
+
+#include <sys/types.h>
+
+#include <osmocore/msgb.h>
+
+#include <openbsc/gprs_ns.h>
+
+struct gbproxy_config {
+ /* parsed from config file */
+ u_int32_t nsip_listen_ip;
+ u_int16_t nsip_listen_port;
+
+ u_int32_t nsip_sgsn_ip;
+ u_int16_t nsip_sgsn_port;
+
+ u_int16_t nsip_sgsn_nsei;
+ u_int16_t nsip_sgsn_nsvci;
+
+ /* misc */
+ struct gprs_ns_inst *nsi;
+};
+
+
+/* gb_proxy_vty .c */
+
+int gbproxy_vty_init(void);
+int gbproxy_parse_config(const char *config_file, struct gbproxy_config *cfg);
+
+
+/* gb_proxy.c */
+
+/* Main input function for Gb proxy */
+int gbprox_rcvmsg(struct msgb *msg, struct gprs_nsvc *nsvc, uint16_t ns_bvci);
+
+#endif
diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/openbsc/gprs_ns.h
index dd10d3339..ca02c4b5d 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