diff options
author | Luca Melette <luca@srlabs.de> | 2012-05-03 02:21:08 +0200 |
---|---|---|
committer | Luca Melette <luca@srlabs.de> | 2012-05-03 02:21:08 +0200 |
commit | 1e9d9f4c080e283298a2dce2e48019428914fa10 (patch) | |
tree | c793b796b4f795277a5311916c5af1037fe8120a /src/shared/libosmocore/include/osmocom/core | |
parent | 1fc5ab1d396b91e7983e8529208aa1cd21d9629c (diff) | |
parent | 186fefcc76294e69c367b2eb8796bb824927248d (diff) |
Merge branch 'master' into luca/gsmmap
Introduced code for DSP auto-reset in error conditions
Disabled by default US bands (not working yet)
Diffstat (limited to 'src/shared/libosmocore/include/osmocom/core')
-rw-r--r-- | src/shared/libosmocore/include/osmocom/core/gsmtap.h | 12 | ||||
-rw-r--r-- | src/shared/libosmocore/include/osmocom/core/msgb.h | 26 | ||||
-rw-r--r-- | src/shared/libosmocore/include/osmocom/core/socket.h | 1 |
3 files changed, 37 insertions, 2 deletions
diff --git a/src/shared/libosmocore/include/osmocom/core/gsmtap.h b/src/shared/libosmocore/include/osmocom/core/gsmtap.h index dbc3d314..a4e5d420 100644 --- a/src/shared/libosmocore/include/osmocom/core/gsmtap.h +++ b/src/shared/libosmocore/include/osmocom/core/gsmtap.h @@ -77,11 +77,19 @@ #define GSMTAP_CHANNEL_SDCCH8 0x08 #define GSMTAP_CHANNEL_TCH_F 0x09 #define GSMTAP_CHANNEL_TCH_H 0x0a -#define GSMTAP_CHANNEL_CBCH51 0x0b +#define GSMTAP_CHANNEL_PACCH 0x0b #define GSMTAP_CHANNEL_CBCH52 0x0c #define GSMTAP_CHANNEL_PDCH 0x0d #define GSMTAP_CHANNEL_PTCCH 0x0e -#define GSMTAP_CHANNEL_PACCH 0x0f +#define GSMTAP_CHANNEL_CBCH51 0x0f + +/* GPRS Coding Scheme CS1..4 */ +#define GSMTAP_GPRS_CS_BASE 0x20 +#define GSMTAP_GPRS_CS(N) (GSMTAP_GPRS_CS_BASE + N) +/* (E) GPRS Coding Scheme MCS0..9 */ +#define GSMTAP_GPRS_MCS_BASE 0x30 +#define GSMTAP_GPRS_MCS(N) (GSMTAP_GPRS_MCS_BASE + N) + #define GSMTAP_CHANNEL_ACCH 0x80 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ diff --git a/src/shared/libosmocore/include/osmocom/core/msgb.h b/src/shared/libosmocore/include/osmocom/core/msgb.h index 9f46e6c6..e465ec2b 100644 --- a/src/shared/libosmocore/include/osmocom/core/msgb.h +++ b/src/shared/libosmocore/include/osmocom/core/msgb.h @@ -312,6 +312,32 @@ static inline void msgb_reserve(struct msgb *msg, int len) msg->tail += len; } +/*! \brief Trim the msgb to a given absolute length + * \param[in] msg message buffer + * \param[in] len new total length of buffer + * \returns 0 in case of success, negative in case of error + */ +static inline int msgb_trim(struct msgb *msg, int len) +{ + if (len > msg->data_len) + return -1; + + msg->len = len; + msg->tail = msg->data + len; + + return 0; +} + +/*! \brief Trim the msgb to a given layer3 length + * \pram[in] msg message buffer + * \param[in] l3len new layer3 length + * \returns 0 in case of success, negative in case of error + */ +static inline int msgb_l3trim(struct msgb *msg, int l3len) +{ + return msgb_trim(msg, (msg->l3h - msg->data) + l3len); +} + /*! \brief Allocate message buffer with specified headroom * \param[in] size size in bytes, including headroom * \param[in] headroom headroom in bytes diff --git a/src/shared/libosmocore/include/osmocom/core/socket.h b/src/shared/libosmocore/include/osmocom/core/socket.h index c5288dfc..88214632 100644 --- a/src/shared/libosmocore/include/osmocom/core/socket.h +++ b/src/shared/libosmocore/include/osmocom/core/socket.h @@ -12,6 +12,7 @@ #include <stdint.h> struct sockaddr; +struct osmo_fd; /* flags for osmo_sock_init. */ #define OSMO_SOCK_F_CONNECT (1 << 0) |