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:
parent
8645e101da
commit
a6a20b4ff6
|
@ -41,7 +41,6 @@ enum signal_subsystems {
|
||||||
SS_SUBSCR,
|
SS_SUBSCR,
|
||||||
SS_SCALL,
|
SS_SCALL,
|
||||||
SS_CHALLOC,
|
SS_CHALLOC,
|
||||||
SS_NS,
|
|
||||||
SS_IPAC_NWL,
|
SS_IPAC_NWL,
|
||||||
SS_RF,
|
SS_RF,
|
||||||
SS_MSC,
|
SS_MSC,
|
||||||
|
@ -215,18 +214,6 @@ struct lchan_signal_data {
|
||||||
struct gsm_meas_rep *mr;
|
struct gsm_meas_rep *mr;
|
||||||
};
|
};
|
||||||
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* MSC signals */
|
/* MSC signals */
|
||||||
enum signal_msc {
|
enum signal_msc {
|
||||||
S_MSC_LOST,
|
S_MSC_LOST,
|
||||||
|
|
|
@ -203,7 +203,7 @@ struct gprs_nsvc {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Create a new NS protocol instance */
|
/* 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 */
|
/* Destroy a NS protocol instance */
|
||||||
void gprs_ns_destroy(struct gprs_ns_inst *nsi);
|
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");
|
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
|
#endif
|
||||||
|
|
|
@ -596,7 +596,7 @@ int gbprox_signal(unsigned int subsys, unsigned int signal,
|
||||||
struct gprs_nsvc *nsvc = nssd->nsvc;
|
struct gprs_nsvc *nsvc = nssd->nsvc;
|
||||||
struct gbprox_peer *peer;
|
struct gbprox_peer *peer;
|
||||||
|
|
||||||
if (subsys != SS_NS)
|
if (subsys != SS_L_NS)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (signal == S_NS_RESET && nsvc->nsei == gbcfg.nsip_sgsn_nsei) {
|
if (signal == S_NS_RESET && nsvc->nsei == gbcfg.nsip_sgsn_nsei) {
|
||||||
|
|
|
@ -236,7 +236,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
gbcfg.nsi = bssgp_nsi;
|
gbcfg.nsi = bssgp_nsi;
|
||||||
gprs_ns_vty_init(bssgp_nsi);
|
gprs_ns_vty_init(bssgp_nsi);
|
||||||
osmo_signal_register_handler(SS_NS, &gbprox_signal, NULL);
|
osmo_signal_register_handler(SS_L_NS, &gbprox_signal, NULL);
|
||||||
|
|
||||||
rc = gbproxy_parse_config(config_file, &gbcfg);
|
rc = gbproxy_parse_config(config_file, &gbcfg);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -239,7 +239,7 @@ int main(int argc, char **argv)
|
||||||
gprs_bssgp_vty_init();
|
gprs_bssgp_vty_init();
|
||||||
gprs_llc_vty_init();
|
gprs_llc_vty_init();
|
||||||
gprs_sndcp_vty_init();
|
gprs_sndcp_vty_init();
|
||||||
/* FIXME: register signal handler for SS_NS */
|
/* FIXME: register signal handler for SS_L_NS */
|
||||||
|
|
||||||
rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg);
|
rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <osmocom/core/rate_ctr.h>
|
#include <osmocom/core/rate_ctr.h>
|
||||||
|
|
||||||
#include <openbsc/debug.h>
|
#include <openbsc/debug.h>
|
||||||
#include <openbsc/gsm_04_08_gprs.h>
|
|
||||||
|
|
||||||
#include <osmocom/gprs/gprs_bssgp.h>
|
#include <osmocom/gprs/gprs_bssgp.h>
|
||||||
#include <osmocom/gprs/gprs_ns.h>
|
#include <osmocom/gprs/gprs_ns.h>
|
||||||
|
|
|
@ -74,12 +74,12 @@
|
||||||
#include <osmocom/core/select.h>
|
#include <osmocom/core/select.h>
|
||||||
#include <osmocom/core/rate_ctr.h>
|
#include <osmocom/core/rate_ctr.h>
|
||||||
#include <osmocom/core/socket.h>
|
#include <osmocom/core/socket.h>
|
||||||
|
#include <osmocom/core/signal.h>
|
||||||
#include <osmocom/gprs/gprs_ns.h>
|
#include <osmocom/gprs/gprs_ns.h>
|
||||||
#include <osmocom/gprs/gprs_bssgp.h>
|
#include <osmocom/gprs/gprs_bssgp.h>
|
||||||
#include <osmocom/gprs/gprs_ns_frgre.h>
|
#include <osmocom/gprs/gprs_ns_frgre.h>
|
||||||
|
|
||||||
#include <openbsc/debug.h>
|
#include <openbsc/debug.h>
|
||||||
#include <openbsc/signal.h>
|
|
||||||
|
|
||||||
static const struct tlv_definition ns_att_tlvdef = {
|
static const struct tlv_definition ns_att_tlvdef = {
|
||||||
.def = {
|
.def = {
|
||||||
|
@ -201,7 +201,7 @@ static void ns_osmo_signal_dispatch(struct gprs_nsvc *nsvc, unsigned int signal,
|
||||||
nssd.nsvc = nsvc;
|
nssd.nsvc = nsvc;
|
||||||
nssd.cause = cause;
|
nssd.cause = cause;
|
||||||
|
|
||||||
osmo_signal_dispatch(SS_NS, signal, &nssd);
|
osmo_signal_dispatch(SS_L_NS, signal, &nssd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Section 10.3.2, Table 13 */
|
/* 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
|
* \param[in] cb Call-back function for incoming BSSGP data
|
||||||
* \returns dynamically allocated gprs_ns_inst
|
* \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;
|
nsi->cb = cb;
|
||||||
INIT_LLIST_HEAD(&nsi->gprs_nsvcs);
|
INIT_LLIST_HEAD(&nsi->gprs_nsvcs);
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
|
|
||||||
#include <openbsc/gsm_data.h>
|
#include <openbsc/gsm_data.h>
|
||||||
#include <openbsc/debug.h>
|
#include <openbsc/debug.h>
|
||||||
#include <openbsc/signal.h>
|
|
||||||
#include <openbsc/vty.h>
|
#include <openbsc/vty.h>
|
||||||
|
|
||||||
static struct gprs_ns_inst *vty_nsi = NULL;
|
static struct gprs_ns_inst *vty_nsi = NULL;
|
||||||
|
|
Loading…
Reference in New Issue