tbf: Add name() method and put the buf into the tbf
Currently tbf_name() must not be used twice in a printf statement
with different TBFs, since the same baffer will be used for each.
This commit puts the text buffer into struct gprs_rlcmac_tbf to avoid
this problem.
Sponsored-by: On-Waves ehf
diff --git a/src/tbf.h b/src/tbf.h
index 1bea31d..29959b9 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -117,6 +117,8 @@
void set_state(enum gprs_rlcmac_tbf_state new_state);
const char *state_name() const;
+ const char *name() const;
+
struct msgb *create_dl_ass(uint32_t fn);
struct msgb *create_ul_ass(uint32_t fn);
@@ -226,6 +228,9 @@
int extract_tlli(const uint8_t *data, const size_t len);
static const char *tbf_state_name[6];
+
+private:
+ mutable char m_name_buf[60];
};