libosmogsm  0.9.6.20171026
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
tlv.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdint.h>
4 #include <string.h>
5 
6 #include <osmocom/core/msgb.h>
9 
14 /* Terminology / wording
15  tag length value (in bits)
16 
17  V - - 8
18  LV - 8 N * 8
19  TLV 8 8 N * 8
20  TL16V 8 16 N * 8
21  TLV16 8 8 N * 16
22  TvLV 8 8/16 N * 8
23  vTvLV 8/16 8/16 N * 8
24  T16LV 16 8 N * 8
25 */
26 
28 #define LV_GROSS_LEN(x) (x+1)
29 
30 #define TLV_GROSS_LEN(x) (x+2)
31 
32 #define TLV16_GROSS_LEN(x) ((2*x)+2)
33 
34 #define TL16V_GROSS_LEN(x) (x+3)
35 
36 #define L16TV_GROSS_LEN(x) (x+3)
37 
38 #define T16LV_GROSS_LEN(x) (x+3)
39 
41 #define TVLV_MAX_ONEBYTE 0x7f
42 
44 static inline uint16_t TVLV_GROSS_LEN(uint16_t len)
45 {
46  if (len <= TVLV_MAX_ONEBYTE)
47  return TLV_GROSS_LEN(len);
48  else
49  return TL16V_GROSS_LEN(len);
50 }
51 
53 static inline uint16_t VTVL_GAN_GROSS_LEN(uint16_t tag, uint16_t len)
54 {
55  uint16_t ret = 2;
56 
57  if (tag > TVLV_MAX_ONEBYTE)
58  ret++;
59 
60  if (len > TVLV_MAX_ONEBYTE)
61  ret++;
62 
63  return ret;
64 }
65 
67 static inline uint16_t VTVLV_GAN_GROSS_LEN(uint16_t tag, uint16_t len)
68 {
69  uint16_t ret;
70 
71  if (len <= TVLV_MAX_ONEBYTE)
72  ret = TLV_GROSS_LEN(len);
73  else
74  ret = TL16V_GROSS_LEN(len);
75 
76  if (tag > TVLV_MAX_ONEBYTE)
77  ret += 1;
78 
79  return ret;
80 }
81 
82 /* TLV generation */
83 
85 static inline uint8_t *lv_put(uint8_t *buf, uint8_t len,
86  const uint8_t *val)
87 {
88  *buf++ = len;
89  memcpy(buf, val, len);
90  return buf + len;
91 }
92 
94 static inline uint8_t *tlv_put(uint8_t *buf, uint8_t tag, uint8_t len,
95  const uint8_t *val)
96 {
97  *buf++ = tag;
98  *buf++ = len;
99  memcpy(buf, val, len);
100  return buf + len;
101 }
102 
104 static inline uint8_t *tlv16_put(uint8_t *buf, uint8_t tag, uint8_t len,
105  const uint16_t *val)
106 {
107  *buf++ = tag;
108  *buf++ = len;
109  memcpy(buf, val, len*2);
110  return buf + len*2;
111 }
112 
114 static inline uint8_t *tl16v_put(uint8_t *buf, uint8_t tag, uint16_t len,
115  const uint8_t *val)
116 {
117  *buf++ = tag;
118  *buf++ = len >> 8;
119  *buf++ = len & 0xff;
120  memcpy(buf, val, len);
121  return buf + len*2;
122 }
123 
125 static inline uint8_t *t16lv_put(uint8_t *buf, uint16_t tag, uint8_t len,
126  const uint8_t *val)
127 {
128  *buf++ = tag >> 8;
129  *buf++ = tag & 0xff;
130  *buf++ = len;
131  memcpy(buf, val, len);
132  return buf + len + 2;
133 }
134 
136 static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len,
137  const uint8_t *val)
138 {
139  uint8_t *ret;
140 
141  if (len <= TVLV_MAX_ONEBYTE) {
142  ret = tlv_put(buf, tag, len, val);
143  buf[1] |= 0x80;
144  } else
145  ret = tl16v_put(buf, tag, len, val);
146 
147  return ret;
148 }
149 
151 static inline uint8_t *vt_gan_put(uint8_t *buf, uint16_t tag)
152 {
153  if (tag > TVLV_MAX_ONEBYTE) {
154  /* two-byte TAG */
155  *buf++ = 0x80 | (tag >> 8);
156  *buf++ = (tag & 0xff);
157  } else
158  *buf++ = tag;
159 
160  return buf;
161 }
162 
163 /* put (append) vTvL (GAN) field (tag + length)*/
164 static inline uint8_t *vtvl_gan_put(uint8_t *buf, uint16_t tag, uint16_t len)
165 {
166  uint8_t *ret;
167 
168  ret = vt_gan_put(buf, tag);
169  return vt_gan_put(ret, len);
170 }
171 
172 /* put (append) vTvLV (GAN) field (tag + length + val) */
173 static inline uint8_t *vtvlv_gan_put(uint8_t *buf, uint16_t tag, uint16_t len,
174  const uint8_t *val)
175 {
176  uint8_t *ret;
177 
178  ret = vtvl_gan_put(buf, tag, len );
179 
180  memcpy(ret, val, len);
181  ret = buf + len;
182 
183  return ret;
184 }
185 
187 static inline uint8_t *msgb_tlv16_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint16_t *val)
188 {
189  uint8_t *buf = msgb_put(msg, TLV16_GROSS_LEN(len));
190  return tlv16_put(buf, tag, len, val);
191 }
192 
194 static inline uint8_t *msgb_tl16v_put(struct msgb *msg, uint8_t tag, uint16_t len,
195  const uint8_t *val)
196 {
197  uint8_t *buf = msgb_put(msg, TL16V_GROSS_LEN(len));
198  return tl16v_put(buf, tag, len, val);
199 }
200 
201 static inline uint8_t *msgb_t16lv_put(struct msgb *msg, uint16_t tag, uint8_t len, const uint8_t *val)
202 {
203  uint8_t *buf = msgb_put(msg, T16LV_GROSS_LEN(len));
204  return t16lv_put(buf, tag, len, val);
205 }
206 
208 static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len,
209  const uint8_t *val)
210 {
211  uint8_t *buf = msgb_put(msg, TVLV_GROSS_LEN(len));
212  return tvlv_put(buf, tag, len, val);
213 }
214 
216 static inline uint8_t *msgb_vtvlv_gan_put(struct msgb *msg, uint16_t tag,
217  uint16_t len, const uint8_t *val)
218 {
219  uint8_t *buf = msgb_put(msg, VTVLV_GAN_GROSS_LEN(tag, len));
220  return vtvlv_gan_put(buf, tag, len, val);
221 }
222 
224 static inline uint8_t *msgb_l16tv_put(struct msgb *msg, uint16_t len, uint8_t tag,
225  const uint8_t *val)
226 {
227  uint8_t *buf = msgb_put(msg, L16TV_GROSS_LEN(len));
228 
229  *buf++ = len >> 8;
230  *buf++ = len & 0xff;
231  *buf++ = tag;
232  memcpy(buf, val, len);
233  return buf + len;
234 }
235 
237 static inline uint8_t *v_put(uint8_t *buf, uint8_t val)
238 {
239  *buf++ = val;
240  return buf;
241 }
242 
244 static inline uint8_t *tv_put(uint8_t *buf, uint8_t tag,
245  uint8_t val)
246 {
247  *buf++ = tag;
248  *buf++ = val;
249  return buf;
250 }
251 
253 static inline uint8_t *tv_fixed_put(uint8_t *buf, uint8_t tag,
254  unsigned int len, const uint8_t *val)
255 {
256  *buf++ = tag;
257  memcpy(buf, val, len);
258  return buf + len;
259 }
260 
266 static inline uint8_t *tv16_put(uint8_t *buf, uint8_t tag,
267  uint16_t val)
268 {
269  *buf++ = tag;
270  *buf++ = val >> 8;
271  *buf++ = val & 0xff;
272  return buf;
273 }
274 
277 static inline uint8_t *msgb_lv_put(struct msgb *msg, uint8_t len, const uint8_t *val)
278 {
279  uint8_t *buf = msgb_put(msg, LV_GROSS_LEN(len));
280  return lv_put(buf, len, val);
281 }
282 
285 static inline uint8_t *msgb_tlv_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
286 {
287  uint8_t *buf = msgb_put(msg, TLV_GROSS_LEN(len));
288  return tlv_put(buf, tag, len, val);
289 }
290 
293 static inline uint8_t *msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
294 {
295  uint8_t *buf = msgb_put(msg, 2);
296  return tv_put(buf, tag, val);
297 }
298 
301 static inline uint8_t *msgb_tv_fixed_put(struct msgb *msg, uint8_t tag,
302  unsigned int len, const uint8_t *val)
303 {
304  uint8_t *buf = msgb_put(msg, 1+len);
305  return tv_fixed_put(buf, tag, len, val);
306 }
307 
310 static inline uint8_t *msgb_v_put(struct msgb *msg, uint8_t val)
311 {
312  uint8_t *buf = msgb_put(msg, 1);
313  return v_put(buf, val);
314 }
315 
318 static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
319 {
320  uint8_t *buf = msgb_put(msg, 3);
321  return tv16_put(buf, tag, val);
322 }
323 
326 static inline uint8_t *msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
327 {
328  uint8_t *buf = msgb_push(msg, TLV_GROSS_LEN(len));
329  tlv_put(buf, tag, len, val);
330  return buf;
331 }
332 
335 static inline uint8_t *msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val)
336 {
337  uint8_t *buf = msgb_push(msg, 2);
338  tv_put(buf, tag, val);
339  return buf;
340 }
341 
344 static inline uint8_t *msgb_tv16_push(struct msgb *msg, uint8_t tag, uint16_t val)
345 {
346  uint8_t *buf = msgb_push(msg, 3);
347  tv16_put(buf, tag, val);
348  return buf;
349 }
350 
353 static inline uint8_t *msgb_tvlv_push(struct msgb *msg, uint8_t tag, uint16_t len,
354  const uint8_t *val)
355 {
356  uint8_t *buf = msgb_push(msg, TVLV_GROSS_LEN(len));
357  tvlv_put(buf, tag, len, val);
358  return buf;
359 }
360 
361 /* push (prepend) a vTvL header to a \ref msgb
362  */
363 static inline uint8_t *msgb_vtvl_gan_push(struct msgb *msg, uint16_t tag,
364  uint16_t len)
365 {
366  uint8_t *buf = msgb_push(msg, VTVL_GAN_GROSS_LEN(tag, len));
367  vtvl_gan_put(buf, tag, len);
368  return buf;
369 }
370 
371 
372 static inline uint8_t *msgb_vtvlv_gan_push(struct msgb *msg, uint16_t tag,
373  uint16_t len, const uint8_t *val)
374 {
375  uint8_t *buf = msgb_push(msg, VTVLV_GAN_GROSS_LEN(tag, len));
376  vtvlv_gan_put(buf, tag, len, val);
377  return buf;
378 }
379 
380 /* TLV parsing */
381 
383 struct tlv_p_entry {
384  uint16_t len;
385  const uint8_t *val;
386 };
387 
389 enum tlv_type {
399 };
400 
402 struct tlv_def {
403  enum tlv_type type;
404  uint8_t fixed_len;
405 };
406 
409  struct tlv_def def[256];
410 };
411 
413 struct tlv_parsed {
414  struct tlv_p_entry lv[256];
415 };
416 
417 extern struct tlv_definition tvlv_att_def;
418 extern struct tlv_definition vtvlv_gan_att_def;
419 
420 int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
421  const struct tlv_definition *def,
422  const uint8_t *buf, int buf_len);
423 int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
424  const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2);
425 /* take a master (src) tlv def and fill up all empty slots in 'dst' */
426 void tlv_def_patch(struct tlv_definition *dst, const struct tlv_definition *src);
427 
428 #define TLVP_PRESENT(x, y) ((x)->lv[y].val)
429 #define TLVP_LEN(x, y) (x)->lv[y].len
430 #define TLVP_VAL(x, y) (x)->lv[y].val
431 
432 #define TLVP_PRES_LEN(tp, tag, min_len) \
433  (TLVP_PRESENT(tp, tag) && TLVP_LEN(tp, tag) >= min_len)
434 
440 static inline uint16_t tlvp_val16_unal(const struct tlv_parsed *tp, int pos)
441 {
442  uint16_t res;
443  memcpy(&res, TLVP_VAL(tp, pos), sizeof(res));
444  return res;
445 }
446 
452 static inline uint32_t tlvp_val32_unal(const struct tlv_parsed *tp, int pos)
453 {
454  uint32_t res;
455  memcpy(&res, TLVP_VAL(tp, pos), sizeof(res));
456  return res;
457 }
458 
464 static inline uint16_t tlvp_val16be(const struct tlv_parsed *tp, int pos)
465 {
466  return osmo_load16be(TLVP_VAL(tp, pos));
467 }
468 
474 static inline uint32_t tlvp_val32be(const struct tlv_parsed *tp, int pos)
475 {
476  return osmo_load32be(TLVP_VAL(tp, pos));
477 }
478 
479 
480 struct tlv_parsed *osmo_tlvp_copy(const struct tlv_parsed *tp_orig, void *ctx);
481 int osmo_tlvp_merge(struct tlv_parsed *dst, const struct tlv_parsed *src);
482 int osmo_shift_v_fixed(uint8_t **data, size_t *data_len,
483  size_t len, uint8_t **value);
484 int osmo_match_shift_tv_fixed(uint8_t **data, size_t *data_len,
485  uint8_t tag, size_t len, uint8_t **value);
486 int osmo_shift_tlv(uint8_t **data, size_t *data_len,
487  uint8_t *tag, uint8_t **value, size_t *value_len);
488 int osmo_match_shift_tlv(uint8_t **data, size_t *data_len,
489  uint8_t tag, uint8_t **value, size_t *value_len);
490 int osmo_shift_lv(uint8_t **data, size_t *data_len,
491  uint8_t **value, size_t *value_len);
492 
static uint8_t * msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val)
push (prepend) a TV field to a Message buffers
Definition: tlv.h:335
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
static uint16_t VTVLV_GAN_GROSS_LEN(uint16_t tag, uint16_t len)
gross length of vTvLV (tag+len+val)
Definition: tlv.h:67
static uint16_t tlvp_val16be(const struct tlv_parsed *tp, int pos)
Retrieve (possibly unaligned) TLV element and convert to host byte order.
Definition: tlv.h:464
static uint8_t * msgb_tv16_push(struct msgb *msg, uint8_t tag, uint16_t val)
push (prepend) a TV16 field to a Message buffers
Definition: tlv.h:344
static uint8_t * tv_put(uint8_t *buf, uint8_t tag, uint8_t val)
put (append) a TV field
Definition: tlv.h:244
static uint8_t * msgb_l16tv_put(struct msgb *msg, uint16_t len, uint8_t tag, const uint8_t *val)
put (append) a L16TV field to Message buffers
Definition: tlv.h:224
uint16_t len
length
Definition: tlv.h:384
int osmo_shift_v_fixed(uint8_t **data, size_t *data_len, size_t len, uint8_t **value)
Advance the data pointer, subtract length and assign value pointer.
Definition: tlv_parser.c:311
static uint8_t * msgb_tlv16_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint16_t *val)
put (append) a TLV16 field to Message buffers
Definition: tlv.h:187
static uint8_t * msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
put (append) a TV field to a Message buffers
Definition: tlv.h:293
int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val, const struct tlv_definition *def, const uint8_t *buf, int buf_len)
Parse a single TLV encoded IE.
Definition: tlv_parser.c:129
struct tlv_definition tvlv_att_def
Definition: tlv_parser.c:45
static uint8_t * msgb_tvlv_push(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val)
push (prepend) a TvLV field to a Message buffers
Definition: tlv.h:353
static uint32_t tlvp_val32be(const struct tlv_parsed *tp, int pos)
Retrieve (possibly unaligned) TLV element and convert to host byte order.
Definition: tlv.h:474
int osmo_match_shift_tv_fixed(uint8_t **data, size_t *data_len, uint8_t tag, size_t len, uint8_t **value)
Match tag, check length and assign value pointer.
Definition: tlv_parser.c:339
static uint16_t TVLV_GROSS_LEN(uint16_t len)
gross length of a TVLV type field
Definition: tlv.h:44
static uint8_t * vt_gan_put(uint8_t *buf, uint16_t tag)
put (append) a variable-length tag or variable-length length *
Definition: tlv.h:151
static uint8_t * tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len, const uint8_t *val)
put (append) a TvLV field
Definition: tlv.h:136
static uint8_t * lv_put(uint8_t *buf, uint8_t len, const uint8_t *val)
put (append) a LV field
Definition: tlv.h:85
static uint8_t * msgb_vtvl_gan_push(struct msgb *msg, uint16_t tag, uint16_t len)
Definition: tlv.h:363
int osmo_shift_tlv(uint8_t **data, size_t *data_len, uint8_t *tag, uint8_t **value, size_t *value_len)
Extract TLV and advance data pointer + subtract length.
Definition: tlv_parser.c:405
Entry in a TLV parser array.
Definition: tlv.h:383
#define TLV_GROSS_LEN(x)
gross length of a TLV type field
Definition: tlv.h:30
struct tlv_p_entry lv[256]
Definition: tlv.h:414
tag-value (8bit)
Definition: tlv.h:393
static uint8_t * tv_fixed_put(uint8_t *buf, uint8_t tag, unsigned int len, const uint8_t *val)
put (append) a TVfixed field
Definition: tlv.h:253
#define TL16V_GROSS_LEN(x)
gross length of a TL16V type field
Definition: tlv.h:34
no type
Definition: tlv.h:390
#define TVLV_MAX_ONEBYTE
maximum length of TLV of one byte length
Definition: tlv.h:41
static uint8_t * msgb_vtvlv_gan_put(struct msgb *msg, uint16_t tag, uint16_t len, const uint8_t *val)
put (append) a vTvLV field to Message buffers
Definition: tlv.h:216
static uint16_t VTVL_GAN_GROSS_LEN(uint16_t tag, uint16_t len)
gross length of vTvL header (tag+len)
Definition: tlv.h:53
static uint8_t * msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
put (append) a TV16 field to a Message buffers
Definition: tlv.h:318
#define TLV16_GROSS_LEN(x)
gross length of a TLV16 type field
Definition: tlv.h:32
Definition of a single IE (Information Element)
Definition: tlv.h:402
#define L16TV_GROSS_LEN(x)
gross length of a L16TV type field
Definition: tlv.h:36
static uint8_t * tl16v_put(uint8_t *buf, uint8_t tag, uint16_t len, const uint8_t *val)
put (append) a TL16V field
Definition: tlv.h:114
struct tlv_def def[256]
Definition: tlv.h:409
static unsigned char * msgb_push(struct msgb *msgb, unsigned int len)
static uint8_t * msgb_tlv_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
put (append) a TLV field to a Message buffers
Definition: tlv.h:285
enum tlv_type type
TLV type.
Definition: tlv.h:403
static uint8_t * tv16_put(uint8_t *buf, uint8_t tag, uint16_t val)
put (append) a TV16 field
Definition: tlv.h:266
static uint16_t tlvp_val16_unal(const struct tlv_parsed *tp, int pos)
Align given TLV element with 16 bit value to an even address.
Definition: tlv.h:440
static uint8_t * tlv16_put(uint8_t *buf, uint8_t tag, uint8_t len, const uint16_t *val)
put (append) a TLV16 field
Definition: tlv.h:104
uint8_t res
int osmo_shift_lv(uint8_t **data, size_t *data_len, uint8_t **value, size_t *value_len)
Extract LV and advance data pointer + subtract length.
Definition: tlv_parser.c:445
tag-length-value
Definition: tlv.h:394
static uint8_t * msgb_tv_fixed_put(struct msgb *msg, uint8_t tag, unsigned int len, const uint8_t *val)
put (append) a TVfixed field to a Message buffers
Definition: tlv.h:301
int osmo_match_shift_tlv(uint8_t **data, size_t *data_len, uint8_t tag, uint8_t **value, size_t *value_len)
Verify TLV header and advance data / subtract length.
Definition: tlv_parser.c:377
static uint8_t * vtvl_gan_put(uint8_t *buf, uint16_t tag, uint16_t len)
Definition: tlv.h:164
uint8_t len
Definition: gsm_04_11.h:434
tlv_type
TLV type.
Definition: tlv.h:389
static uint8_t * v_put(uint8_t *buf, uint8_t val)
put (append) a V field
Definition: tlv.h:237
static uint8_t * msgb_tl16v_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val)
put (append) a TL16V field to Message buffers
Definition: tlv.h:194
variable-length tag, variable-length length
Definition: tlv.h:398
tag, 16 bit length, value
Definition: tlv.h:395
struct tlv_parsed * osmo_tlvp_copy(const struct tlv_parsed *tp_orig, void *ctx)
Copy tlv_parsed using given talloc context.
Definition: tlv_parser.c:66
#define T16LV_GROSS_LEN(x)
gross length of a T16LV type field
Definition: tlv.h:38
result of the TLV parser
Definition: tlv.h:413
static uint8_t * t16lv_put(uint8_t *buf, uint16_t tag, uint8_t len, const uint8_t *val)
put (append) a TL16V field
Definition: tlv.h:125
static uint8_t * tlv_put(uint8_t *buf, uint8_t tag, uint8_t len, const uint8_t *val)
put (append) a TLV field
Definition: tlv.h:94
uint8_t fixed_len
length in case of TLV_TYPE_FIXED
Definition: tlv.h:404
fixed-length value-only
Definition: tlv.h:391
void tlv_def_patch(struct tlv_definition *dst, const struct tlv_definition *src)
take a master (src) tlvdev and fill up all empty slots in 'dst'
Definition: tlv_parser.c:282
static uint8_t * msgb_vtvlv_gan_push(struct msgb *msg, uint16_t tag, uint16_t len, const uint8_t *val)
Definition: tlv.h:372
static uint32_t tlvp_val32_unal(const struct tlv_parsed *tp, int pos)
Align given TLV element with 32 bit value to an address that is a multiple of 4.
Definition: tlv.h:452
Definition of All 256 IE / TLV.
Definition: tlv.h:408
int osmo_tlvp_merge(struct tlv_parsed *dst, const struct tlv_parsed *src)
Merge all tlv_parsed attributes of 'src' into 'dst'.
Definition: tlv_parser.c:101
static uint8_t * msgb_v_put(struct msgb *msg, uint8_t val)
put (append) a V field to a Message buffers
Definition: tlv.h:310
int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2)
Parse an entire buffer of TLV encoded Information Elements.
Definition: tlv_parser.c:229
#define LV_GROSS_LEN(x)
gross length of a LV type field
Definition: tlv.h:28
tag-only
Definition: tlv.h:392
tag, variable length, value
Definition: tlv.h:396
const uint8_t * val
pointer to value
Definition: tlv.h:385
#define TLVP_VAL(x, y)
Definition: tlv.h:430
static uint8_t * vtvlv_gan_put(uint8_t *buf, uint16_t tag, uint16_t len, const uint8_t *val)
Definition: tlv.h:173
static uint8_t * msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
push (prepend) a TLV field to a Message buffers
Definition: tlv.h:326
struct tlv_definition vtvlv_gan_att_def
Definition: tlv_parser.c:46
uint8_t data[0]
message payload data
Definition: gsm_03_41.h:108
static uint8_t * msgb_lv_put(struct msgb *msg, uint8_t len, const uint8_t *val)
put (append) a LV field to a Message buffers
Definition: tlv.h:277
static uint8_t * msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val)
put (append) a TvLV field to Message buffers
Definition: tlv.h:208
tag and value (both 4 bit) in 1 byte
Definition: tlv.h:397
static uint8_t * msgb_t16lv_put(struct msgb *msg, uint16_t tag, uint8_t len, const uint8_t *val)
Definition: tlv.h:201