1 extern int new_callref;
4 char debug[128]; /* debug info */
5 char openbsc_cfg[128]; /* openbsc config file */
6 char short_name[64]; /* short network name */
7 char long_name[64]; /* long network name */
8 char hlr[64]; /* database name */
9 int allow_all; /* accept unknown subscribers */
10 int keep_l2; /* keep layer 2 after exit */
11 char pcapfile[128]; /* open capture file for BS11 links */
12 int reject_cause; /* reject cause for unsubcribed IMSIs */
16 struct mncc_q_entry *next;
18 char data[0]; /* struct gsm_mncc */
22 void *network; /* OpenBSC network handle */
23 struct gsm_conf conf; /* gsm.conf options */
24 int gsm_sock; /* loopback interface GSM side */
25 int gsm_port; /* loopback interface port number */
27 struct lcr_fd mncc_lfd; /* Unix domain socket to OpenBSC MNCC */
28 struct mncc_q_entry *mncc_q_hd;
29 struct mncc_q_entry *mncc_q_tail;
32 extern struct lcr_gsm *gsm;
35 class Pgsm : public PmISDN
38 Pgsm(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode);
41 void *p_m_g_instance; /* pointer to network/ms instance */
42 unsigned int p_m_g_callref; /* ref by OpenBSC/Osmocom-BB */
43 struct lcr_work p_m_g_delete; /* timer for audio transmission */
44 unsigned int p_m_g_mode; /* data/transparent mode */
45 int p_m_g_gsm_b_sock; /* gsm bchannel socket */
46 struct lcr_fd p_m_g_gsm_b_fd; /* event node */
47 int p_m_g_gsm_b_index; /* gsm bchannel socket index to use */
48 int p_m_g_gsm_b_active; /* gsm bchannel socket is activated */
49 struct lcr_msg *p_m_g_notify_pending; /* queue for NOTIFY if not connected */
50 void *p_m_g_encoder, *p_m_g_decoder; /* gsm handle */
51 signed short p_m_g_rxdata[160]; /* receive audio buffer */
52 int p_m_g_rxpos; /* position in audio buffer 0..159 */
53 int p_m_g_tch_connected; /* indicates if audio is connected */
55 void bchannel_close(void);
56 int bchannel_open(int index);
57 void bchannel_receive(struct mISDNhead *hh, unsigned char *data, int len);
58 void bchannel_send(unsigned int prim, unsigned int id, unsigned char *data, int len);
60 void frame_send(void *_frame);
61 void frame_receive(void *_frame);
63 int hunt_bchannel(void);
64 void call_conf_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *gsm);
65 void call_proc_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
66 void alert_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
67 void setup_cnf(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
68 void setup_compl_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
69 void disc_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
70 void rel_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
71 void notify_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc *mncc);
72 void message_notify(unsigned int epoint_id, int message_id, union parameter *param);
73 void message_alerting(unsigned int epoint_id, int message_id, union parameter *param);
74 void message_connect(unsigned int epoint_id, int message_id, union parameter *param);
75 void message_disconnect(unsigned int epoint_id, int message_id, union parameter *param);
76 void message_release(unsigned int epoint_id, int message_id, union parameter *param);
77 int message_epoint(unsigned int epoint_id, int message_id, union parameter *param);
80 struct gsm_mncc *create_mncc(int msg_type, unsigned int callref);
81 int send_and_free_mncc(void *instance, unsigned int msg_type, void *data);
82 void gsm_trace_header(struct mISDNport *mISDNport, class PmISDN *port, unsigned int msg_type, int direction);
84 int gsm_conf(struct gsm_conf *gsm_conf, char *conf_error);
89 int mncc_send(struct gsm_network *instance, int msg_type, void *data);