mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-03 05:23:43 +00:00
define mncc_recv_cb_t to avoid code dup
Put mncc_recv_cb_t in common_cs.h to avoid header include complications: if placing right above struct gsm_network, one must include gsm_data.h to use mncc_recv_cb_t as function parameter in a header, which will include gsm_data_shared.h, which will include common_cs.h (future knowledge). Since I will need to use mncc_recv_cb_t in common_cs.h, including gsm_data.h from there would introduce an #include loop. Avoid that and define mncc_recv_cb_t in common_cs.h to begin with. Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
#ifndef _BSS_H_
|
#ifndef _BSS_H_
|
||||||
#define _BSS_H_
|
#define _BSS_H_
|
||||||
|
|
||||||
struct gsm_network;
|
#include <openbsc/gsm_data.h>
|
||||||
|
|
||||||
struct msgb;
|
struct msgb;
|
||||||
|
|
||||||
/* start and stop network */
|
/* start and stop network */
|
||||||
extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file);
|
extern int bsc_bootstrap_network(mncc_recv_cb_t mncc_recv, const char *cfg_file);
|
||||||
extern int bsc_shutdown_net(struct gsm_network *net);
|
extern int bsc_shutdown_net(struct gsm_network *net);
|
||||||
|
|
||||||
/* register all supported BTS */
|
/* register all supported BTS */
|
||||||
|
|||||||
@@ -1 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
struct msgb;
|
||||||
|
struct gsm_network;
|
||||||
|
|
||||||
|
typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <osmocom/crypt/auth.h>
|
#include <osmocom/crypt/auth.h>
|
||||||
|
|
||||||
#include <openbsc/rest_octets.h>
|
#include <openbsc/rest_octets.h>
|
||||||
|
#include <openbsc/common_cs.h>
|
||||||
|
|
||||||
/** annotations for msgb ownership */
|
/** annotations for msgb ownership */
|
||||||
#define __uses
|
#define __uses
|
||||||
@@ -308,7 +309,7 @@ struct gsm_network {
|
|||||||
|
|
||||||
/* layer 4 */
|
/* layer 4 */
|
||||||
struct mncc_sock_state *mncc_state;
|
struct mncc_sock_state *mncc_state;
|
||||||
int (*mncc_recv) (struct gsm_network *net, struct msgb *msg);
|
mncc_recv_cb_t mncc_recv;
|
||||||
struct llist_head upqueue;
|
struct llist_head upqueue;
|
||||||
struct llist_head trans_list;
|
struct llist_head trans_list;
|
||||||
struct bsc_api *bsc_api;
|
struct bsc_api *bsc_api;
|
||||||
@@ -417,7 +418,7 @@ extern void talloc_ctx_init(void *ctx_root);
|
|||||||
struct gsm_network *gsm_network_init(void *ctx,
|
struct gsm_network *gsm_network_init(void *ctx,
|
||||||
uint16_t country_code,
|
uint16_t country_code,
|
||||||
uint16_t network_code,
|
uint16_t network_code,
|
||||||
int (*mncc_recv)(struct gsm_network *, struct msgb *));
|
mncc_recv_cb_t mncc_recv);
|
||||||
|
|
||||||
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
|
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
|
||||||
|
|
||||||
|
|||||||
@@ -475,8 +475,7 @@ static int bootstrap_bts(struct gsm_bts *bts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *),
|
int bsc_bootstrap_network(mncc_recv_cb_t mncc_recv, const char *config_file)
|
||||||
const char *config_file)
|
|
||||||
{
|
{
|
||||||
struct gsm_bts *bts;
|
struct gsm_bts *bts;
|
||||||
int rc;
|
int rc;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
struct gsm_network *gsm_network_init(void *ctx,
|
struct gsm_network *gsm_network_init(void *ctx,
|
||||||
uint16_t country_code,
|
uint16_t country_code,
|
||||||
uint16_t network_code,
|
uint16_t network_code,
|
||||||
int (*mncc_recv)(struct gsm_network *, struct msgb *))
|
mncc_recv_cb_t mncc_recv)
|
||||||
{
|
{
|
||||||
struct gsm_network *net;
|
struct gsm_network *net;
|
||||||
const char *default_regexp = ".*";
|
const char *default_regexp = ".*";
|
||||||
|
|||||||
Reference in New Issue
Block a user