aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-28 18:37:07 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-28 18:37:07 +0200
commite211da49b98162cbf9653da7b80e30634f2b1637 (patch)
treeeb8d9954ccc3aac8436442e2c6bbb4a1564110e2 /openbsc/include/openbsc
parente51b2eaa0b9b5bfaaa3adb3c0f7ae0e567d5be10 (diff)
parentf4e79f24fcdabdfd81be5d3842b4bf4c05465db4 (diff)
Merge branch 'master' into proxy
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/abis_rsl.h13
-rw-r--r--openbsc/include/openbsc/db.h9
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h3
-rw-r--r--openbsc/include/openbsc/gsm_data.h35
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h9
-rw-r--r--openbsc/include/openbsc/signal.h1
-rw-r--r--openbsc/include/openbsc/transaction.h18
7 files changed, 65 insertions, 23 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 84a1697f8..9e4d59078 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -319,11 +319,14 @@ struct rsl_ie_chan_ident {
#define RSL_ERRCLS_PROTO_ERROR 0x60
#define RSL_ERRCLS_INTERWORKING 0x70
+/* normal event */
#define RSL_ERR_RADIO_IF_FAIL 0x00
#define RSL_ERR_RADIO_LINK_FAIL 0x01
#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
#define RSL_ERR_TALKER_ACC_FAIL 0x03
#define RSL_ERR_OM_INTERVENTION 0x07
+#define RSL_ERR_NORMAL_UNSPEC 0x0f
+/* resource unavailable */
#define RSL_ERR_EQUIPMENT_FAIL 0x20
#define RSL_ERR_RR_UNAVAIL 0x21
#define RSL_ERR_TERR_CH_FAIL 0x22
@@ -331,15 +334,19 @@ struct rsl_ie_chan_ident {
#define RSL_ERR_ACCH_OVERLOAD 0x24
#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
#define RSL_ERR_RES_UNAVAIL 0x2f
+/* service or option not available */
#define RSL_ERR_TRANSC_UNAVAIL 0x30
#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
+/* service or option not implemented */
#define RSL_ERR_ENCR_UNIMPL 0x40
-#define RSL_ERR_SEV_OPT_UNIMPL 0x4f
+#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
+/* invalid message */
#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
#define RSL_ERR_INVALID_MESSAGE 0x5f
+/* protocol error */
#define RSL_ERR_MSG_DISCR 0x60
#define RSL_ERR_MSG_TYPE 0x61
-#define RSL_ERR_MSG_SEQA 0x62
+#define RSL_ERR_MSG_SEQ 0x62
#define RSL_ERR_IE_ERROR 0x63
#define RSL_ERR_MAND_IE_ERROR 0x64
#define RSL_ERR_OPT_IE_ERROR 0x65
@@ -347,6 +354,7 @@ struct rsl_ie_chan_ident {
#define RSL_ERR_IE_LENGTH 0x67
#define RSL_ERR_IE_CONTENT 0x68
#define RSL_ERR_PROTO 0x6f
+/* interworking */
#define RSL_ERR_INTERWORKING 0x7f
/* Chapter 9.3.30 */
@@ -477,6 +485,7 @@ u_int8_t lchan2chan_nr(struct gsm_lchan *lchan);
/* to be provided by external code */
int abis_rsl_sendmsg(struct msgb *msg);
+int rsl_deact_sacch(struct gsm_lchan *lchan);
int rsl_chan_release(struct gsm_lchan *lchan);
/* BCCH related code */
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h
index 61a3ac47c..c9b72659e 100644
--- a/openbsc/include/openbsc/db.h
+++ b/openbsc/include/openbsc/db.h
@@ -31,14 +31,17 @@ int db_prepare();
int db_fini();
/* subscriber management */
-struct gsm_subscriber* db_create_subscriber(char *imsi);
-struct gsm_subscriber* db_get_subscriber(enum gsm_subscriber_field field, const char *subscr);
+struct gsm_subscriber* db_create_subscriber(struct gsm_network *net,
+ char *imsi);
+struct gsm_subscriber* db_get_subscriber(struct gsm_network *net,
+ enum gsm_subscriber_field field,
+ const char *subscr);
int db_sync_subscriber(struct gsm_subscriber* subscriber);
int db_subscriber_alloc_tmsi(struct gsm_subscriber* subscriber);
int db_subscriber_assoc_imei(struct gsm_subscriber* subscriber, char *imei);
/* SMS store-and-forward */
int db_sms_store(struct gsm_sms *sms);
-struct gsm_sms *db_sms_get_unsent(int min_id);
+struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, int min_id);
int db_sms_mark_sent(struct gsm_sms *sms);
#endif /* _DB_H */
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index 2fe23d1fc..2ed95f326 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -646,6 +646,7 @@ struct msgb;
struct gsm_bts;
struct gsm_subscriber;
struct gsm_network;
+struct gsm_trans;
/* config options controlling the behaviour of the lower leves */
void gsm0408_allow_everyone(int allow);
@@ -659,7 +660,7 @@ enum gsm_chreq_reason_t get_reason_by_chreq(struct gsm_bts *bts, u_int8_t ra);
int gsm48_tx_mm_info(struct gsm_lchan *lchan);
struct msgb *gsm48_msgb_alloc(void);
-int gsm48_sendmsg(struct msgb *msg);
+int gsm48_sendmsg(struct msgb *msg, struct gsm_trans *trans);
int generate_mid_from_tmsi(u_int8_t *buf, u_int32_t tmsi);
int gsm48_send_rr_release(struct gsm_lchan *lchan);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index de3f1f578..5eac8a7d1 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -104,29 +104,36 @@ struct gsm_trans {
/* Entry in list of all transactions */
struct llist_head entry;
- /* Network */
- struct gsm_network *network;
+ /* The protocol within which we live */
+ u_int8_t protocol;
/* The current transaction ID */
u_int8_t transaction_id;
- /* The LCHAN that we're part of */
- struct gsm_lchan *lchan;
-
- /* To whom we are allocated at the moment */
+ /* To whom we belong, unique identifier of remote MM entity */
struct gsm_subscriber *subscr;
- /* reference */
+ /* The LCHAN that we're currently using to transmit messages */
+ struct gsm_lchan *lchan;
+
+ /* reference from MNCC or other application */
u_int32_t callref;
- /* current call state */
- int state;
+ union {
+ struct {
+
+ /* current call state */
+ int state;
- /* current timer and message queue */
- int Tcurrent; /* current CC timer */
- int T308_second; /* used to send release again */
- struct timer_list cc_timer;
- struct gsm_mncc cc_msg; /* stores setup/disconnect/release message */
+ /* current timer and message queue */
+ int Tcurrent; /* current CC timer */
+ int T308_second; /* used to send release again */
+ struct timer_list timer;
+ struct gsm_mncc msg; /* stores setup/disconnect/release message */
+ } cc;
+ struct {
+ } sms;
+ };
};
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 4a2311555..00eeb3287 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -60,9 +60,12 @@ enum gsm_subscriber_update_reason {
struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
-struct gsm_subscriber *subscr_get_by_tmsi(const char *tmsi);
-struct gsm_subscriber *subscr_get_by_imsi(const char *imsi);
-struct gsm_subscriber *subscr_get_by_extension(const char *ext);
+struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
+ const char *tmsi);
+struct gsm_subscriber *subscr_get_by_imsi(struct gsm_network *net,
+ const char *imsi);
+struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,
+ const char *ext);
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason);
void subscr_put_channel(struct gsm_lchan *lchan);
void subscr_get_channel(struct gsm_subscriber *subscr,
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index b41182d67..2ce812d10 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -48,6 +48,7 @@ enum signal_paging {
/* SS_ABISIP signals */
enum signal_abisip {
S_ABISIP_BIND_ACK,
+ S_ABISIP_DISC_IND,
};
/* SS_NM signals */
diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h
new file mode 100644
index 000000000..1450dbca5
--- /dev/null
+++ b/openbsc/include/openbsc/transaction.h
@@ -0,0 +1,18 @@
+#ifndef _TRANSACT_H
+#define _TRANSACT_H
+
+#include <openbsc/gsm_data.h>
+#include <openbsc/gsm_subscriber.h>
+
+struct gsm_trans *trans_find_by_id(struct gsm_lchan *lchan, u_int8_t trans_id);
+struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
+ u_int32_t callref);
+
+struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
+ u_int8_t protocol, u_int8_t trans_id,
+ u_int32_t callref);
+void trans_free(struct gsm_trans *trans);
+
+int trans_assign_trans_id(struct gsm_subscriber *subscr,
+ u_int8_t protocol, u_int8_t ti_flag);
+#endif