diff options
Diffstat (limited to 'src/shared/libosmocore/include')
9 files changed, 70 insertions, 6 deletions
diff --git a/src/shared/libosmocore/include/osmocom/core/Makefile.am b/src/shared/libosmocore/include/osmocom/core/Makefile.am index 3c30362c..1ef37693 100644 --- a/src/shared/libosmocore/include/osmocom/core/Makefile.am +++ b/src/shared/libosmocore/include/osmocom/core/Makefile.am @@ -1,6 +1,6 @@ osmocore_HEADERS = signal.h linuxlist.h timer.h select.h msgb.h bits.h \ bitvec.h statistics.h utils.h socket.h \ - gsmtap.h write_queue.h \ + gsmtap.h write_queue.h prim.h \ logging.h rate_ctr.h gsmtap_util.h \ plugin.h crc16.h panic.h process.h msgfile.h \ backtrace.h conv.h application.h diff --git a/src/shared/libosmocore/include/osmocom/core/prim.h b/src/shared/libosmocore/include/osmocom/core/prim.h new file mode 100644 index 00000000..e892c62c --- /dev/null +++ b/src/shared/libosmocore/include/osmocom/core/prim.h @@ -0,0 +1,38 @@ +#ifndef OSMO_PRIMITIVE_H +#define OSMO_PRIMITIVE_H + +#include <stdint.h> +#include <osmocom/core/msgb.h> + +enum osmo_prim_operation { + PRIM_OP_REQUEST, + PRIM_OP_RESPONSE, + PRIM_OP_INDICATION, + PRIM_OP_CONFIRM, +}; + +#define _SAP_GSM_SHIFT 24 + +#define _SAP_GSM_BASE (0x01 << _SAP_GSM_SHIFT) +#define _SAP_TETRA_BASE (0x02 << _SAP_GSM_SHIFT) + +struct osmo_prim_hdr { + unsigned int sap; + unsigned int primitive; + enum osmo_prim_operation operation; + struct msgb *msg; /* message containing associated data */ +}; + +static inline void +osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, + unsigned int primitive, enum osmo_prim_operation operation, + struct msgb *msg) +{ + oph->sap = sap; + oph->primitive = primitive; + oph->operation = operation; + oph->msg = msg; +} + +typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx); +#endif diff --git a/src/shared/libosmocore/include/osmocom/core/socket.h b/src/shared/libosmocore/include/osmocom/core/socket.h index b2601c76..612b12c8 100644 --- a/src/shared/libosmocore/include/osmocom/core/socket.h +++ b/src/shared/libosmocore/include/osmocom/core/socket.h @@ -5,14 +5,19 @@ struct sockaddr; +/* flags for osmo_sock_init. */ +#define OSMO_SOCK_F_CONNECT (1 << 0) +#define OSMO_SOCK_F_BIND (1 << 1) +#define OSMO_SOCK_F_NONBLOCK (1 << 2) + int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, - const char *host, uint16_t port, int connect0_bind1); + const char *host, uint16_t port, unsigned int flags); int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, - const char *host, uint16_t port, int connect0_bind1); + const char *host, uint16_t port, unsigned int flags); int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type, - uint8_t proto, int connect0_bind1); + uint8_t proto, unsigned int flags); /* determine if the given address is a local address */ int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen); diff --git a/src/shared/libosmocore/include/osmocom/gsm/Makefile.am b/src/shared/libosmocore/include/osmocom/gsm/Makefile.am index 547933ec..aa7b1a9a 100644 --- a/src/shared/libosmocore/include/osmocom/gsm/Makefile.am +++ b/src/shared/libosmocore/include/osmocom/gsm/Makefile.am @@ -1,6 +1,6 @@ osmogsm_HEADERS = a5.h comp128.h gsm0808.h gsm48_ie.h mncc.h rxlev_stat.h \ gsm0480.h gsm48.h gsm_utils.h rsl.h tlv.h abis_nm.h \ - sysinfo.h + sysinfo.h prim.h SUBDIRS = protocol diff --git a/src/shared/libosmocore/include/osmocom/gsm/abis_nm.h b/src/shared/libosmocore/include/osmocom/gsm/abis_nm.h index dcc8d4bb..3f5335e2 100644 --- a/src/shared/libosmocore/include/osmocom/gsm/abis_nm.h +++ b/src/shared/libosmocore/include/osmocom/gsm/abis_nm.h @@ -2,8 +2,12 @@ #define _OSMO_GSM_ABIS_NM_H #include <osmocom/gsm/tlv.h> +#include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/protocol/gsm_12_21.h> +enum abis_nm_msgtype; +enum gsm_phys_chan_config; + const enum abis_nm_msgtype abis_nm_reports[4]; const enum abis_nm_msgtype abis_nm_no_ack_nack[3]; const enum abis_nm_msgtype abis_nm_sw_load_msgs[9]; diff --git a/src/shared/libosmocore/include/osmocom/gsm/prim.h b/src/shared/libosmocore/include/osmocom/gsm/prim.h new file mode 100644 index 00000000..95cbb120 --- /dev/null +++ b/src/shared/libosmocore/include/osmocom/gsm/prim.h @@ -0,0 +1,13 @@ +#ifndef OSMO_GSM_PRIM_H +#define OSMO_GSM_PRIM_H + +#include <osmocom/core/prim.h> + +/* enumeration of GSM related SAPs */ +enum osmo_gsm_sap { + SAP_GSM_PH = _SAP_GSM_BASE, + SAP_GSM_DL, + SAP_GSM_MDL, +}; + +#endif diff --git a/src/shared/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h b/src/shared/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h index 74a4083b..9b641b34 100644 --- a/src/shared/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/src/shared/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h @@ -426,7 +426,7 @@ struct rsl_ie_chan_ident { #define RSL_SYSTEM_INFO_5bis 0x0d #define RSL_SYSTEM_INFO_5ter 0x0e #define RSL_SYSTEM_INFO_10 0x0f -#define REL_EXT_MEAS_ORDER 0x47 +#define RSL_EXT_MEAS_ORDER 0x47 #define RSL_MEAS_INFO 0x48 #define RSL_SYSTEM_INFO_13 0x28 #define RSL_SYSTEM_INFO_2quater 0x29 diff --git a/src/shared/libosmocore/include/osmocom/gsm/rsl.h b/src/shared/libosmocore/include/osmocom/gsm/rsl.h index 7e46330f..2eb045f2 100644 --- a/src/shared/libosmocore/include/osmocom/gsm/rsl.h +++ b/src/shared/libosmocore/include/osmocom/gsm/rsl.h @@ -23,6 +23,7 @@ const char *rsl_chan_nr_str(uint8_t chan_nr); const char *rsl_err_name(uint8_t err); const char *rsl_rlm_cause_name(uint8_t err); +const char *rsl_msg_name(uint8_t err); /* Section 3.3.2.3 TS 05.02. I think this looks like a table */ int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); diff --git a/src/shared/libosmocore/include/osmocom/gsm/sysinfo.h b/src/shared/libosmocore/include/osmocom/gsm/sysinfo.h index a66f3f19..b808d6f9 100644 --- a/src/shared/libosmocore/include/osmocom/gsm/sysinfo.h +++ b/src/shared/libosmocore/include/osmocom/gsm/sysinfo.h @@ -1,6 +1,7 @@ #ifndef _OSMO_GSM_SYSINFO_H #define _OSMO_GSM_SYSINFO_H +#include <osmocom/core/utils.h> #include <osmocom/gsm/protocol/gsm_04_08.h> enum osmo_sysinfo_type { @@ -26,6 +27,8 @@ enum osmo_sysinfo_type { SYSINFO_TYPE_2quater, SYSINFO_TYPE_5bis, SYSINFO_TYPE_5ter, + SYSINFO_TYPE_EMO, + SYSINFO_TYPE_MEAS_INFO, /* FIXME all the various bis and ter */ _MAX_SYSINFO_TYPE }; |