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