diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2010-10-24 12:05:12 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2010-10-24 12:05:12 +0200 |
commit | ff37a753e3eb78c5c969fa02b181d1256c2bbaeb (patch) | |
tree | ae54b6e1713d61a0c545e2564b2c5b6356f9fe04 /src/shared/libosmocore/include | |
parent | a481e65bf0eea2fe201e77d007e6bfe78cb9aed9 (diff) | |
parent | dc0ebdfbdf3b1a381754c6ef4a59b0354eba7705 (diff) |
Merge commit 'dc0ebdfbdf3b1a381754c6ef4a59b0354eba7705'
Diffstat (limited to 'src/shared/libosmocore/include')
-rw-r--r-- | src/shared/libosmocore/include/osmocom/codec/codec.h | 19 | ||||
-rw-r--r-- | src/shared/libosmocore/include/osmocore/Makefile.am | 2 | ||||
-rw-r--r-- | src/shared/libosmocore/include/osmocore/gsm0480.h | 26 | ||||
-rw-r--r-- | src/shared/libosmocore/include/osmocore/msgb.h | 5 | ||||
-rw-r--r-- | src/shared/libosmocore/include/osmocore/msgfile.h | 49 |
5 files changed, 100 insertions, 1 deletions
diff --git a/src/shared/libosmocore/include/osmocom/codec/codec.h b/src/shared/libosmocore/include/osmocom/codec/codec.h new file mode 100644 index 00000000..82013e55 --- /dev/null +++ b/src/shared/libosmocore/include/osmocom/codec/codec.h @@ -0,0 +1,19 @@ +#ifndef _OSMOCOM_CODEC_H +#define _OSMOCOM_CODEC_H + +#include <stdint.h> + +extern uint16_t gsm610_bitorder[]; /* FR */ +extern uint16_t gsm620_bitorder[]; /* HR */ +extern uint16_t gsm660_bitorder[]; /* EFR */ + +extern uint16_t gsm690_12_2_bitorder[]; /* AMR 12.2 kbits */ +extern uint16_t gsm690_10_2_bitorder[]; /* AMR 10.2 kbits */ +extern uint16_t gsm690_7_95_bitorder[]; /* AMR 7.95 kbits */ +extern uint16_t gsm690_7_4_bitorder[]; /* AMR 7.4 kbits */ +extern uint16_t gsm690_6_7_bitorder[]; /* AMR 6.7 kbits */ +extern uint16_t gsm690_5_9_bitorder[]; /* AMR 5.9 kbits */ +extern uint16_t gsm690_5_15_bitorder[]; /* AMR 5.15 kbits */ +extern uint16_t gsm690_4_75_bitorder[]; /* AMR 4.75 kbits */ + +#endif /* _OSMOCOM_CODEC_H */ diff --git a/src/shared/libosmocore/include/osmocore/Makefile.am b/src/shared/libosmocore/include/osmocore/Makefile.am index c8b614f6..2efaa96b 100644 --- a/src/shared/libosmocore/include/osmocore/Makefile.am +++ b/src/shared/libosmocore/include/osmocore/Makefile.am @@ -2,7 +2,7 @@ osmocore_HEADERS = signal.h linuxlist.h timer.h select.h msgb.h \ tlv.h bitvec.h comp128.h statistics.h gsm_utils.h utils.h \ gsmtap.h write_queue.h rsl.h gsm48.h rxlev_stat.h mncc.h \ gsm48_ie.h logging.h gsm0808.h rate_ctr.h gsmtap_util.h \ - plugin.h crc16.h panic.h process.h + plugin.h crc16.h panic.h process.h gsm0480.h msgfile.h if ENABLE_TALLOC osmocore_HEADERS += talloc.h diff --git a/src/shared/libosmocore/include/osmocore/gsm0480.h b/src/shared/libosmocore/include/osmocore/gsm0480.h new file mode 100644 index 00000000..b504332e --- /dev/null +++ b/src/shared/libosmocore/include/osmocore/gsm0480.h @@ -0,0 +1,26 @@ +#ifndef gsm0480_h +#define gsm0480_h + +#include "msgb.h" +#include "protocol/gsm_04_08.h" +#include "protocol/gsm_04_80.h" + +#define MAX_LEN_USSD_STRING 31 + +struct ussd_request { + char text[MAX_LEN_USSD_STRING + 1]; + uint8_t transaction_id; + uint8_t invoke_id; +}; + +int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, + struct ussd_request *request); + +struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); +struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); +struct msgb *gsm0480_create_notifySS(const char *text); + +int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); +int gsm0480_wrap_facility(struct msgb *msg); + +#endif diff --git a/src/shared/libosmocore/include/osmocore/msgb.h b/src/shared/libosmocore/include/osmocore/msgb.h index 354c5d88..395c7c2c 100644 --- a/src/shared/libosmocore/include/osmocore/msgb.h +++ b/src/shared/libosmocore/include/osmocore/msgb.h @@ -187,4 +187,9 @@ static inline struct msgb *msgb_alloc_headroom(int size, int headroom, return msg; } +/* non inline functions to ease binding */ +uint8_t *msgb_data(const struct msgb *msg); +uint16_t msgb_length(const struct msgb *msg); + + #endif /* _MSGB_H */ diff --git a/src/shared/libosmocore/include/osmocore/msgfile.h b/src/shared/libosmocore/include/osmocore/msgfile.h new file mode 100644 index 00000000..92caa9fc --- /dev/null +++ b/src/shared/libosmocore/include/osmocore/msgfile.h @@ -0,0 +1,49 @@ +/* + * (C) 2010 by Holger Hans Peter Freyther + * (C) 2010 by On-Waves + * 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. + * + */ + +#ifndef MSG_FILE_H +#define MSG_FILE_H + +#include "linuxlist.h" + +/** + * One message in the list. + */ +struct msg_entry { + struct llist_head list; + + /* number for everyone to use */ + int nr; + + /* data from the file */ + char *mcc; + char *mnc; + char *option; + char *text; +}; + +struct msg_entries { + struct llist_head entry; +}; + +struct msg_entries *msg_entry_parse(void *ctx, const char *filename); + +#endif |