aboutsummaryrefslogtreecommitdiffstats
path: root/libosmocore/include
diff options
context:
space:
mode:
Diffstat (limited to 'libosmocore/include')
-rw-r--r--libosmocore/include/osmocore/bitvec.h2
-rw-r--r--libosmocore/include/osmocore/comp128.h12
-rw-r--r--libosmocore/include/osmocore/gsm_utils.h12
-rw-r--r--libosmocore/include/osmocore/msgb.h12
-rw-r--r--libosmocore/include/osmocore/tlv.h102
5 files changed, 70 insertions, 70 deletions
diff --git a/libosmocore/include/osmocore/bitvec.h b/libosmocore/include/osmocore/bitvec.h
index b35aebf16..11cb01ea5 100644
--- a/libosmocore/include/osmocore/bitvec.h
+++ b/libosmocore/include/osmocore/bitvec.h
@@ -36,7 +36,7 @@ enum bit_value {
struct bitvec {
unsigned int cur_bit; /* curser to the next unused bit */
unsigned int data_len; /* length of data array in bytes */
- u_int8_t *data; /* pointer to data array */
+ uint8_t *data; /* pointer to data array */
};
/* check if the bit is 0 or 1 for a given position inside a bitvec */
diff --git a/libosmocore/include/osmocore/comp128.h b/libosmocore/include/osmocore/comp128.h
index 691ade54b..c37808f0f 100644
--- a/libosmocore/include/osmocore/comp128.h
+++ b/libosmocore/include/osmocore/comp128.h
@@ -7,16 +7,16 @@
#ifndef __COMP128_H__
#define __COMP128_H__
-#include <sys/types.h>
+#include <stdint.h>
/*
* Performs the COMP128 algorithm (used as A3/A8)
- * ki : u_int8_t [16]
- * srand : u_int8_t [16]
- * sres : u_int8_t [4]
- * kc : u_int8_t [8]
+ * ki : uint8_t [16]
+ * srand : uint8_t [16]
+ * sres : uint8_t [4]
+ * kc : uint8_t [8]
*/
-void comp128(u_int8_t *ki, u_int8_t *srand, u_int8_t *sres, u_int8_t *kc);
+void comp128(uint8_t *ki, uint8_t *srand, uint8_t *sres, uint8_t *kc);
#endif /* __COMP128_H__ */
diff --git a/libosmocore/include/osmocore/gsm_utils.h b/libosmocore/include/osmocore/gsm_utils.h
index c770cc900..57521ac7e 100644
--- a/libosmocore/include/osmocore/gsm_utils.h
+++ b/libosmocore/include/osmocore/gsm_utils.h
@@ -25,7 +25,7 @@
#ifndef GSM_UTILS_H
#define GSM_UTILS_H
-#include <sys/types.h>
+#include <stdint.h>
enum gsm_band {
GSM_BAND_850 = 1,
@@ -38,15 +38,15 @@ enum gsm_band {
GSM_BAND_810 = 0x80,
};
-int gsm_7bit_decode(char *decoded, const u_int8_t *user_data, u_int8_t length);
-int gsm_7bit_encode(u_int8_t *result, const char *data);
+int gsm_7bit_decode(char *decoded, const uint8_t *user_data, uint8_t length);
+int gsm_7bit_encode(uint8_t *result, const char *data);
int ms_pwr_ctl_lvl(enum gsm_band band, unsigned int dbm);
-int ms_pwr_dbm(enum gsm_band band, u_int8_t lvl);
+int ms_pwr_dbm(enum gsm_band band, uint8_t lvl);
/* According to TS 08.05 Chapter 8.1.4 */
-int rxlev2dbm(u_int8_t rxlev);
-u_int8_t dbm2rxlev(int dbm);
+int rxlev2dbm(uint8_t rxlev);
+uint8_t dbm2rxlev(int dbm);
/* According to GSM 04.08 Chapter 10.5.2.29 */
static inline int rach_max_trans_val2raw(int val) { return (val >> 1) & 3; }
diff --git a/libosmocore/include/osmocore/msgb.h b/libosmocore/include/osmocore/msgb.h
index d0efc90b5..131f920ae 100644
--- a/libosmocore/include/osmocore/msgb.h
+++ b/libosmocore/include/osmocore/msgb.h
@@ -20,7 +20,7 @@
*
*/
-#include <sys/types.h>
+#include <stdint.h>
#include "linuxlist.h"
struct bts_link;
@@ -39,8 +39,8 @@ struct msgb {
unsigned char *l3h;
unsigned char *smsh;
- u_int16_t data_len;
- u_int16_t len;
+ uint16_t data_len;
+ uint16_t len;
unsigned char *head;
unsigned char *tail;
@@ -48,7 +48,7 @@ struct msgb {
unsigned char _data[0];
};
-extern struct msgb *msgb_alloc(u_int16_t size, const char *name);
+extern struct msgb *msgb_alloc(uint16_t size, const char *name);
extern void msgb_free(struct msgb *m);
extern void msgb_enqueue(struct llist_head *queue, struct msgb *msg);
extern struct msgb *msgb_dequeue(struct llist_head *queue);
@@ -60,12 +60,12 @@ extern void msgb_reset(struct msgb *m);
static inline unsigned int msgb_l2len(const struct msgb *msgb)
{
- return msgb->tail - (u_int8_t *)msgb_l2(msgb);
+ return msgb->tail - (uint8_t *)msgb_l2(msgb);
}
static inline unsigned int msgb_l3len(const struct msgb *msgb)
{
- return msgb->tail - (u_int8_t *)msgb_l3(msgb);
+ return msgb->tail - (uint8_t *)msgb_l3(msgb);
}
static inline unsigned int msgb_headlen(const struct msgb *msgb)
diff --git a/libosmocore/include/osmocore/tlv.h b/libosmocore/include/osmocore/tlv.h
index 4ae9f6c49..14c9910df 100644
--- a/libosmocore/include/osmocore/tlv.h
+++ b/libosmocore/include/osmocore/tlv.h
@@ -1,7 +1,7 @@
#ifndef _TLV_H
#define _TLV_H
-#include <sys/types.h>
+#include <stdint.h>
#include <string.h>
#include <osmocore/msgb.h>
@@ -26,7 +26,7 @@
#define TVLV_MAX_ONEBYTE 0x7f
-static inline u_int16_t TVLV_GROSS_LEN(u_int16_t len)
+static inline uint16_t TVLV_GROSS_LEN(uint16_t len)
{
if (len <= TVLV_MAX_ONEBYTE)
return TLV_GROSS_LEN(len);
@@ -36,16 +36,16 @@ static inline u_int16_t TVLV_GROSS_LEN(u_int16_t len)
/* TLV generation */
-static inline u_int8_t *lv_put(u_int8_t *buf, u_int8_t len,
- const u_int8_t *val)
+static inline uint8_t *lv_put(uint8_t *buf, uint8_t len,
+ const uint8_t *val)
{
*buf++ = len;
memcpy(buf, val, len);
return buf + len;
}
-static inline u_int8_t *tlv_put(u_int8_t *buf, u_int8_t tag, u_int8_t len,
- const u_int8_t *val)
+static inline uint8_t *tlv_put(uint8_t *buf, uint8_t tag, uint8_t len,
+ const uint8_t *val)
{
*buf++ = tag;
*buf++ = len;
@@ -53,8 +53,8 @@ static inline u_int8_t *tlv_put(u_int8_t *buf, u_int8_t tag, u_int8_t len,
return buf + len;
}
-static inline u_int8_t *tlv16_put(u_int8_t *buf, u_int8_t tag, u_int8_t len,
- const u_int16_t *val)
+static inline uint8_t *tlv16_put(uint8_t *buf, uint8_t tag, uint8_t len,
+ const uint16_t *val)
{
*buf++ = tag;
*buf++ = len;
@@ -62,8 +62,8 @@ static inline u_int8_t *tlv16_put(u_int8_t *buf, u_int8_t tag, u_int8_t len,
return buf + len*2;
}
-static inline u_int8_t *tl16v_put(u_int8_t *buf, u_int8_t tag, u_int16_t len,
- const u_int8_t *val)
+static inline uint8_t *tl16v_put(uint8_t *buf, uint8_t tag, uint16_t len,
+ const uint8_t *val)
{
*buf++ = tag;
*buf++ = len >> 8;
@@ -72,10 +72,10 @@ static inline u_int8_t *tl16v_put(u_int8_t *buf, u_int8_t tag, u_int16_t len,
return buf + len*2;
}
-static inline u_int8_t *tvlv_put(u_int8_t *buf, u_int8_t tag, u_int16_t len,
- const u_int8_t *val)
+static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len,
+ const uint8_t *val)
{
- u_int8_t *ret;
+ uint8_t *ret;
if (len <= TVLV_MAX_ONEBYTE) {
ret = tlv_put(buf, tag, len, val);
@@ -86,30 +86,30 @@ static inline u_int8_t *tvlv_put(u_int8_t *buf, u_int8_t tag, u_int16_t len,
return ret;
}
-static inline u_int8_t *msgb_tlv16_put(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int16_t *val)
+static inline uint8_t *msgb_tlv16_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint16_t *val)
{
- u_int8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len));
+ uint8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len));
return tlv16_put(buf, tag, len, val);
}
-static inline u_int8_t *msgb_tl16v_put(struct msgb *msg, u_int8_t tag, u_int16_t len,
- const u_int8_t *val)
+static inline uint8_t *msgb_tl16v_put(struct msgb *msg, uint8_t tag, uint16_t len,
+ const uint8_t *val)
{
- u_int8_t *buf = msgb_put(msg, TL16V_GROSS_LEN(len));
+ uint8_t *buf = msgb_put(msg, TL16V_GROSS_LEN(len));
return tl16v_put(buf, tag, len, val);
}
-static inline u_int8_t *msgb_tvlv_put(struct msgb *msg, u_int8_t tag, u_int16_t len,
- const u_int8_t *val)
+static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len,
+ const uint8_t *val)
{
- u_int8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len));
+ uint8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len));
return tvlv_put(buf, tag, len, val);
}
-static inline u_int8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, u_int8_t tag,
- const u_int8_t *val)
+static inline uint8_t *msgb_l16tv_put(struct msgb *msg, uint16_t len, uint8_t tag,
+ const uint8_t *val)
{
- u_int8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len));
+ uint8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len));
*buf++ = len >> 8;
*buf++ = len & 0xff;
@@ -118,14 +118,14 @@ static inline u_int8_t *msgb_l16tv_put(struct msgb *msg, u_int16_t len, u_int8_t
return buf + len;
}
-static inline u_int8_t *v_put(u_int8_t *buf, u_int8_t val)
+static inline uint8_t *v_put(uint8_t *buf, uint8_t val)
{
*buf++ = val;
return buf;
}
-static inline u_int8_t *tv_put(u_int8_t *buf, u_int8_t tag,
- u_int8_t val)
+static inline uint8_t *tv_put(uint8_t *buf, uint8_t tag,
+ uint8_t val)
{
*buf++ = tag;
*buf++ = val;
@@ -133,8 +133,8 @@ static inline u_int8_t *tv_put(u_int8_t *buf, u_int8_t tag,
}
/* 'val' is still in host byte order! */
-static inline u_int8_t *tv16_put(u_int8_t *buf, u_int8_t tag,
- u_int16_t val)
+static inline uint8_t *tv16_put(uint8_t *buf, uint8_t tag,
+ uint16_t val)
{
*buf++ = tag;
*buf++ = val >> 8;
@@ -142,59 +142,59 @@ static inline u_int8_t *tv16_put(u_int8_t *buf, u_int8_t tag,
return buf;
}
-static inline u_int8_t *msgb_lv_put(struct msgb *msg, u_int8_t len, const u_int8_t *val)
+static inline uint8_t *msgb_lv_put(struct msgb *msg, uint8_t len, const uint8_t *val)
{
- u_int8_t *buf = msgb_put(msg, LV_GROSS_LEN(len));
+ uint8_t *buf = msgb_put(msg, LV_GROSS_LEN(len));
return lv_put(buf, len, val);
}
-static inline u_int8_t *msgb_tlv_put(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int8_t *val)
+static inline uint8_t *msgb_tlv_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
{
- u_int8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len));
+ uint8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len));
return tlv_put(buf, tag, len, val);
}
-static inline u_int8_t *msgb_tv_put(struct msgb *msg, u_int8_t tag, u_int8_t val)
+static inline uint8_t *msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
{
- u_int8_t *buf = msgb_put(msg, 2);
+ uint8_t *buf = msgb_put(msg, 2);
return tv_put(buf, tag, val);
}
-static inline u_int8_t *msgb_v_put(struct msgb *msg, u_int8_t val)
+static inline uint8_t *msgb_v_put(struct msgb *msg, uint8_t val)
{
- u_int8_t *buf = msgb_put(msg, 1);
+ uint8_t *buf = msgb_put(msg, 1);
return v_put(buf, val);
}
-static inline u_int8_t *msgb_tv16_put(struct msgb *msg, u_int8_t tag, u_int16_t val)
+static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
{
- u_int8_t *buf = msgb_put(msg, 3);
+ uint8_t *buf = msgb_put(msg, 3);
return tv16_put(buf, tag, val);
}
-static inline u_int8_t *msgb_tlv_push(struct msgb *msg, u_int8_t tag, u_int8_t len, const u_int8_t *val)
+static inline uint8_t *msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
{
- u_int8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len));
+ uint8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len));
return tlv_put(buf, tag, len, val);
}
-static inline u_int8_t *msgb_tv_push(struct msgb *msg, u_int8_t tag, u_int8_t val)
+static inline uint8_t *msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val)
{
- u_int8_t *buf = msgb_push(msg, 2);
+ uint8_t *buf = msgb_push(msg, 2);
return tv_put(buf, tag, val);
}
-static inline u_int8_t *msgb_tv16_push(struct msgb *msg, u_int8_t tag, u_int16_t val)
+static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, uint16_t val)
{
- u_int8_t *buf = msgb_push(msg, 3);
+ uint8_t *buf = msgb_push(msg, 3);
return tv16_put(buf, tag, val);
}
/* TLV parsing */
struct tlv_p_entry {
- u_int16_t len;
- const u_int8_t *val;
+ uint16_t len;
+ const uint8_t *val;
};
enum tlv_type {
@@ -209,7 +209,7 @@ enum tlv_type {
struct tlv_def {
enum tlv_type type;
- u_int8_t fixed_len;
+ uint8_t fixed_len;
};
struct tlv_definition {
@@ -222,11 +222,11 @@ struct tlv_parsed {
extern struct tlv_definition tvlv_att_def;
-int tlv_parse_one(u_int8_t *o_tag, u_int16_t *o_len, const u_int8_t **o_val,
+int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
const struct tlv_definition *def,
- const u_int8_t *buf, int buf_len);
+ const uint8_t *buf, int buf_len);
int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
- const u_int8_t *buf, int buf_len, u_int8_t lv_tag, u_int8_t lv_tag2);
+ const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2);
/* take a master (src) tlvdev and fill up all empty slots in 'dst' */
void tlv_def_patch(struct tlv_definition *dst, const struct tlv_definition *src);