summaryrefslogtreecommitdiff
path: root/include/gsmd
diff options
context:
space:
mode:
Diffstat (limited to 'include/gsmd')
-rw-r--r--include/gsmd/extrsp.h45
-rw-r--r--include/gsmd/gsmd.h2
-rw-r--r--include/gsmd/talloc.h1
3 files changed, 48 insertions, 0 deletions
diff --git a/include/gsmd/extrsp.h b/include/gsmd/extrsp.h
new file mode 100644
index 0000000..1f6e6a5
--- /dev/null
+++ b/include/gsmd/extrsp.h
@@ -0,0 +1,45 @@
+#ifndef _GSMD_EXTRSP_H
+#define _GSMD_EXTRSP_H
+
+/* how many tokens (CSV items) can an extended response have, max */
+#define GSM_EXTRSP_MAX_TOKENS 16
+
+/* how many individual sub-ranges can one range contain */
+#define GSM_EXTRSP_MAX_RANGES 16
+
+
+struct gsm_extrsp_range_item {
+ int min;
+ int max;
+};
+
+enum gsm_extrsp_tok_type {
+ GSMD_ECMD_RTT_NONE,
+ GSMD_ECMD_RTT_EMPTY,
+ GSMD_ECMD_RTT_NUMERIC,
+ GSMD_ECMD_RTT_STRING,
+ GSMD_ECMD_RTT_RANGE,
+};
+
+struct gsm_extrsp_tok {
+ enum gsm_extrsp_tok_type type;
+ union {
+ struct {
+ struct gsm_extrsp_range_item item[GSM_EXTRSP_MAX_RANGES];
+ int num_items;
+ } range;
+ char string[64];
+ int numeric;
+ } u;
+};
+
+struct gsm_extrsp {
+ unsigned int num_tokens;
+ struct gsm_extrsp_tok tokens[GSM_EXTRSP_MAX_TOKENS];
+};
+
+extern int extrsp_supports(const struct gsm_extrsp *er, int index, int value);
+extern struct gsm_extrsp *extrsp_parse(const void *ctx, const char *input);
+extern void extrsp_dump(const struct gsm_extrsp *er);
+
+#endif
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
index 9f865a0..044f65d 100644
--- a/include/gsmd/gsmd.h
+++ b/include/gsmd/gsmd.h
@@ -66,6 +66,8 @@ struct gsmd {
struct llist_head busy_atcmds; /* our busy gsmd_atcmds */
struct gsmd_vendor_plugin *vendorpl;
struct gsmd_device_state dev_state;
+
+ struct llist_head operators; /* cached list of operator names */
};
struct gsmd_user {
diff --git a/include/gsmd/talloc.h b/include/gsmd/talloc.h
index 2cfd61a..7f4e925 100644
--- a/include/gsmd/talloc.h
+++ b/include/gsmd/talloc.h
@@ -26,6 +26,7 @@
/* nfsim additions */
#include <stdarg.h>
+#include <stdio.h>
/* this is only needed for compatibility with the old talloc */
typedef void TALLOC_CTX;
personal git repositories of Harald Welte. Your mileage may vary