diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-08-06 19:20:38 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-08-06 19:20:38 +0200 |
commit | b90288c8caba5cc77c26332650a5739ac9cf2e86 (patch) | |
tree | dd78038f9437c1875cf0fe38f074c975fc173c67 /openbsc/include/openbsc | |
parent | e211da49b98162cbf9653da7b80e30634f2b1637 (diff) | |
parent | 67ce073110b390997fd08c69b44c6b5d9f6a3cef (diff) |
Merge branch 'master' into proxyproxy
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r-- | openbsc/include/openbsc/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/include/openbsc/abis_nm.h | 9 | ||||
-rw-r--r-- | openbsc/include/openbsc/abis_rsl.h | 16 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_04_08.h | 46 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 12 | ||||
-rw-r--r-- | openbsc/include/openbsc/mncc.h | 13 | ||||
-rw-r--r-- | openbsc/include/openbsc/rtp_proxy.h | 70 |
7 files changed, 148 insertions, 20 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 86f056d26..adef573e5 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -2,4 +2,4 @@ noinst_HEADERS = abis_nm.h abis_rsl.h debug.h db.h gsm_04_08.h gsm_data.h \ gsm_subscriber.h linuxlist.h msgb.h select.h tlv.h gsm_04_11.h \ timer.h misdn.h chan_alloc.h telnet_interface.h paging.h \ subchan_demux.h trau_frame.h e1_input.h trau_mux.h signal.h \ - gsm_utils.h ipaccess.h rs232.h openbscdefines.h + gsm_utils.h ipaccess.h rs232.h openbscdefines.h rtp_proxy.h diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index 47baafb55..3dc553144 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -482,6 +482,12 @@ enum abis_nm_chan_comb { NM_CHANC_BCCH = 0x06, NM_CHANC_BCCH_CBCH = 0x07, NM_CHANC_SDCCH_CBCH = 0x08, + /* ip.access */ + NM_CHANC_IPAC_bPDCH = 0x0b, /* PBCCH + PCCCH + PDTCH/F + PACCH/F + PTCCH/F */ + NM_CHANC_IPAC_cPDCH = 0x0c, /* PBCCH + PDTCH/F + PACCH/F + PTCCH/F */ + NM_CHANC_IPAC_PDCH = 0x0d, /* PDTCH/F + PACCH/F + PTCCH/F */ + NM_CHANC_IPAC_TCHFull_PDCH = 0x80, + NM_CHANC_IPAC_TCHFull_TCHHalf = 0x81, }; /* Section 9.4.16: Event Type */ @@ -672,6 +678,9 @@ int abis_nm_software_load_status(struct gsm_bts *bts); int abis_nm_software_activate(struct gsm_bts *bts, const char *fname, gsm_cbfn *cbfn, void *cb_data); +int abis_nm_conn_mdrop_link(struct gsm_bts *bts, u_int8_t e1_port0, u_int8_t ts0, + u_int8_t e1_port1, u_int8_t ts1); + /* Siemens / BS-11 specific */ int abis_nm_bs11_reset_resource(struct gsm_bts *bts); int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin); diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index 9e4d59078..201c77fbc 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -266,16 +266,23 @@ struct rsl_ie_chan_mode { } __attribute__ ((packed)); #define RSL_CMOD_DTXu 0x01 /* uplink */ #define RSL_CMOD_DTXd 0x02 /* downlink */ -#define RSL_CMOD_SPD_SPEECH 0x01 -#define RSL_CMOD_SPD_DATA 0x02 -#define RSL_CMOD_SPD_SIGN 0x03 +enum rsl_cmod_spd { + RSL_CMOD_SPD_SPEECH = 0x01, + RSL_CMOD_SPD_DATA = 0x02, + RSL_CMOD_SPD_SIGN = 0x03, +}; #define RSL_CMOD_CRT_SDCCH 0x01 #define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */ #define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */ /* FIXME: More CRT types */ +/* Speech */ #define RSL_CMOD_SP_GSM1 0x01 #define RSL_CMOD_SP_GSM2 0x11 #define RSL_CMOD_SP_GSM3 0x21 +/* Data */ +#define RSL_CMOD_SP_NT_14k5 0x58 +#define RSL_CMOD_SP_NT_12k0 0x50 +#define RSL_CMOD_SP_NT_6k0 0x51 /* Chapter 9.3.5 */ struct rsl_ie_chan_ident { @@ -326,6 +333,7 @@ struct rsl_ie_chan_ident { #define RSL_ERR_TALKER_ACC_FAIL 0x03 #define RSL_ERR_OM_INTERVENTION 0x07 #define RSL_ERR_NORMAL_UNSPEC 0x0f +#define RSL_ERR_T_MSRFPCI_EXP 0x18 /* resource unavailable */ #define RSL_ERR_EQUIPMENT_FAIL 0x20 #define RSL_ERR_RR_UNAVAIL 0x21 @@ -459,7 +467,7 @@ int rsl_chan_activate(struct gsm_bts_trx *trx, u_int8_t chan_nr, u_int8_t bs_power, u_int8_t ms_power, u_int8_t ta); int rsl_chan_activate_lchan(struct gsm_lchan *lchan, u_int8_t act_type, - u_int8_t ta, u_int8_t mode); + u_int8_t ta); int rsl_chan_mode_modify_req(struct gsm_lchan *ts); int rsl_paging_cmd(struct gsm_bts *bts, u_int8_t paging_group, u_int8_t len, u_int8_t *ms_ident, u_int8_t chan_needed); diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h index 2ed95f326..c93540b14 100644 --- a/openbsc/include/openbsc/gsm_04_08.h +++ b/openbsc/include/openbsc/gsm_04_08.h @@ -48,14 +48,16 @@ struct gsm48_chan_mode_modify { u_int8_t mode; } __attribute__ ((packed)); -#define GSM48_CMODE_SIGN 0x00 -#define GSM48_CMODE_SPEECH_V1 0x01 -#define GSM48_CMODE_SPEECH_EFR 0x21 -#define GSM48_CMODE_SPEECH_AMR 0x41 -#define GSM48_CMODE_DATA_14k5 0x0f -#define GSM48_CMODE_DATA_12k0 0x03 -#define GSM48_CMODE_DATA_6k0 0x0b -#define GSM48_CMODE_DATA_3k6 0x23 +enum gsm48_chan_mode { + GSM48_CMODE_SIGN = 0x00, + GSM48_CMODE_SPEECH_V1 = 0x01, + GSM48_CMODE_SPEECH_EFR = 0x21, + GSM48_CMODE_SPEECH_AMR = 0x41, + GSM48_CMODE_DATA_14k5 = 0x0f, + GSM48_CMODE_DATA_12k0 = 0x03, + GSM48_CMODE_DATA_6k0 = 0x0b, + GSM48_CMODE_DATA_3k6 = 0x23, +}; /* Chapter 9.1.18 */ struct gsm48_imm_ass { @@ -642,6 +644,34 @@ enum chreq_type { #define SBIT(a) (1 << a) #define ALL_STATES 0xffffffff +/* GSM 04.08 Bearer Capability: Information Transfer Capability */ +enum gsm48_bcap_itcap { + GSM48_BCAP_ITCAP_SPEECH = 0, + GSM48_BCAP_ITCAP_UNR_DIG_INF = 1, + GSM48_BCAP_ITCAP_3k1_AUDIO = 2, + GSM48_BCAP_ITCAP_FAX_G3 = 3, + GSM48_BCAP_ITCAP_OTHER = 5, + GSM48_BCAP_ITCAP_RESERVED = 7, +}; + +/* GSM 04.08 Bearer Capability: Transfer Mode */ +enum gsm48_bcap_tmod { + GSM48_BCAP_TMOD_CIRCUIT = 0, + GSM48_BCAP_TMOD_PACKET = 1, +}; + +/* GSM 04.08 Bearer Capability: Coding Standard */ +enum gsm48_bcap_coding { + GSM48_BCAP_CODING_GSM_STD = 0, +}; + +/* GSM 04.08 Bearer Capability: Radio Channel Requirements */ +enum gsm48_bcap_rrq { + GSM48_BCAP_RRQ_FR_ONLY = 1, + GSM48_BCAP_RRQ_DUAL_HR = 2, + GSM48_BCAP_RRQ_DUAL_FR = 3, +}; + struct msgb; struct gsm_bts; struct gsm_subscriber; diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 5eac8a7d1..700eb73fa 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -41,6 +41,7 @@ enum gsm_chreq_reason_t { #include <openbsc/timer.h> #include <openbsc/gsm_04_08.h> +#include <openbsc/abis_rsl.h> #include <openbsc/mncc.h> #include <openbsc/tlv.h> @@ -53,6 +54,11 @@ enum gsm_chreq_reason_t { #define HARDCODED_TSC 7 #define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ +/* for multi-drop config */ +#define HARDCODED_BTS0_TS 1 +#define HARDCODED_BTS1_TS 6 +#define HARDCODED_BTS2_TS 11 + enum gsm_hooks { GSM_HOOK_NM_SWLOAD, GSM_HOOK_RR_PAGING, @@ -98,6 +104,7 @@ struct gsm_bts_link { struct gsm_lchan; struct gsm_subscriber; struct gsm_mncc; +struct rtp_socket; /* One transaction */ struct gsm_trans { @@ -164,8 +171,10 @@ struct gsm_lchan { u_int8_t nr; /* The logical channel type */ enum gsm_chan_t type; + /* RSL channel mode */ + enum rsl_cmod_spd rsl_cmode; /* If TCH, traffic channel mode */ - enum gsm_chan_t tch_mode; + enum gsm48_chan_mode tch_mode; /* Power levels for MS and BTS */ u_int8_t bs_power; u_int8_t ms_power; @@ -214,6 +223,7 @@ struct gsm_bts_trx_ts { u_int16_t bound_port; u_int8_t rtp_payload2; u_int16_t conn_id; + struct rtp_socket *rtp_socket; } abis_ip; struct gsm_lchan lchan[TS_MAX_LCHAN]; diff --git a/openbsc/include/openbsc/mncc.h b/openbsc/include/openbsc/mncc.h index 6aa191703..68d76abf8 100644 --- a/openbsc/include/openbsc/mncc.h +++ b/openbsc/include/openbsc/mncc.h @@ -108,13 +108,14 @@ struct gsm_call { #define MNCC_F_KEYPAD 0x1000 #define MNCC_F_SIGNAL 0x2000 +/* Expanded fields from GSM TS 04.08, Table 10.5.102 */ struct gsm_mncc_bearer_cap { - int transfer; - int mode; - int coding; - int radio; - int speech_ctm; - int speech_ver[8]; + int transfer; /* Information Transfer Capability */ + int mode; /* Transfer Mode */ + int coding; /* Coding Standard */ + int radio; /* Radio Channel Requirement */ + int speech_ctm; /* CTM text telephony indication */ + int speech_ver[8]; /* Speech version indication */ }; struct gsm_mncc_number { diff --git a/openbsc/include/openbsc/rtp_proxy.h b/openbsc/include/openbsc/rtp_proxy.h new file mode 100644 index 000000000..e9fc157cf --- /dev/null +++ b/openbsc/include/openbsc/rtp_proxy.h @@ -0,0 +1,70 @@ +#ifndef _RTP_PROXY_H +#define _RTP_PROXY_H + +/* RTP proxy handling for ip.access nanoBTS */ + +/* (C) 2009 by Harald Welte <laforge@gnumonks.org> + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + + +#include <netinet/in.h> + +#include <openbsc/linuxlist.h> +#include <openbsc/select.h> + +enum rtp_rx_action { + RTP_NONE, + RTP_PROXY, + RTP_RECV_UPSTREAM, +}; + +struct rtp_sub_socket { + struct sockaddr_in sin_local; + struct sockaddr_in sin_remote; + + struct bsc_fd bfd; + /* linked list of to-be-transmitted msgb's */ + struct llist_head tx_queue; +}; + +struct rtp_socket { + struct llist_head list; + + struct rtp_sub_socket rtp; + struct rtp_sub_socket rtcp; + + /* what should we do on receive? */ + enum rtp_rx_action rx_action; + union { + struct { + struct rtp_socket *other_sock; + } proxy; + struct { + void (*recv_cb)(struct msgb *msg); + } receive; + }; +}; + +struct rtp_socket *rtp_socket_create(void); +int rtp_socket_bind(struct rtp_socket *rs, u_int32_t ip); +int rtp_socket_connect(struct rtp_socket *rs, u_int32_t ip, u_int16_t port); +int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other); +int rtp_socket_free(struct rtp_socket *rs); + +#endif /* _RTP_PROXY_H */ |