libgb: Use library SS_L_NS instead lf local SS_NS

which removes some further dependencies of libgb to openbsc internal
code and data.
This commit is contained in:
Harald Welte 2012-06-16 16:40:42 +08:00
parent 605ac5d1e7
commit 4fcdd76073
4 changed files with 17 additions and 7 deletions

View File

@ -203,7 +203,7 @@ struct gprs_nsvc {
};
/* Create a new NS protocol instance */
struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb);
struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb, void *ctx);
/* Destroy a NS protocol instance */
void gprs_ns_destroy(struct gprs_ns_inst *nsi);
@ -246,6 +246,18 @@ static inline struct msgb *gprs_ns_msgb_alloc(void)
return msgb_alloc_headroom(NS_ALLOC_SIZE, NS_ALLOC_HEADROOM, "GPRS/NS");
}
enum signal_ns {
S_NS_RESET,
S_NS_BLOCK,
S_NS_UNBLOCK,
S_NS_ALIVE_EXP, /* Tns-alive expired more than N times */
};
struct ns_signal_data {
struct gprs_nsvc *nsvc;
uint8_t cause;
};
/*! }@ */
#endif

View File

@ -33,7 +33,6 @@
#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_04_08_gprs.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gprs/gprs_ns.h>

View File

@ -74,12 +74,12 @@
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/signal.h>
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gprs/gprs_ns_frgre.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
static const struct tlv_definition ns_att_tlvdef = {
.def = {
@ -201,7 +201,7 @@ static void ns_osmo_signal_dispatch(struct gprs_nsvc *nsvc, unsigned int signal,
nssd.nsvc = nsvc;
nssd.cause = cause;
osmo_signal_dispatch(SS_NS, signal, &nssd);
osmo_signal_dispatch(SS_L_NS, signal, &nssd);
}
/* Section 10.3.2, Table 13 */
@ -893,9 +893,9 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
* \param[in] cb Call-back function for incoming BSSGP data
* \returns dynamically allocated gprs_ns_inst
*/
struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb)
struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb, void *ctx)
{
struct gprs_ns_inst *nsi = talloc_zero(tall_bsc_ctx, struct gprs_ns_inst);
struct gprs_ns_inst *nsi = talloc_zero(ctx, struct gprs_ns_inst);
nsi->cb = cb;
INIT_LLIST_HEAD(&nsi->gprs_nsvcs);

View File

@ -42,7 +42,6 @@
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
#include <openbsc/vty.h>
static struct gprs_ns_inst *vty_nsi = NULL;