aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-05-03 14:22:12 +0200
committerHarald Welte <laforge@gnumonks.org>2014-10-26 19:09:23 +0100
commit1e0dfdad69fcb48d8bc134be4ddabc72d5dfc9e3 (patch)
tree95ea6b0f9e78f5cda7d1a196069c8a30d3142e63 /include
parentd83d29610a7c63a387fee77dbc2b18b19dc83b14 (diff)
sim: Add minimal/recommended size of file / record
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/sim/sim.h44
1 files changed, 29 insertions, 15 deletions
diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h
index 92b3b5a..7549df6 100644
--- a/include/osmocom/sim/sim.h
+++ b/include/osmocom/sim/sim.h
@@ -156,6 +156,13 @@ struct osim_file_desc {
unsigned int flags;
struct osim_file_ops ops;
+
+ struct {
+ size_t min; /*!< Minimum size of the file
+ (transparent) or record in
+ cyclic / linear file */
+ size_t rec; /*!< Recommended size */
+ } size;
};
struct osim_file {
@@ -165,7 +172,7 @@ struct osim_file {
struct osim_decoded_data *decoded_data;
};
-#define EF(pfid, pns, pflags, pnl, ptype, pdec, penc) \
+#define EF(pfid, pns, pflags, pnl, ptype, smin, srec, pdec, penc) \
{ \
.fid = pfid, \
.type = TYPE_EF, \
@@ -174,23 +181,30 @@ struct osim_file {
.long_name = pnl, \
.flags = pflags, \
.ops = { .encode = penc, .parse = pdec }, \
+ .size = { .min = smin, .rec = srec}, \
}
-#define EF_TRANSP(fid, ns, flags, nl, dec, enc) \
- EF(fid, ns, flags, nl, EF_TYPE_TRANSP, dec, enc)
-#define EF_TRANSP_N(fid, ns, flags, nl) \
- EF_TRANSP(fid, ns, flags, nl, &default_decode, NULL)
-
-#define EF_CYCLIC(fid, ns, flags, nl, dec, enc) \
- EF(fid, ns, flags, nl, EF_TYPE_RECORD_CYCLIC, dec, enc)
-#define EF_CYCLIC_N(fid, ns, flags, nl) \
- EF_CYCLIC(fid, ns, flags, nl, &default_decode, NULL)
-
-#define EF_LIN_FIX(fid, ns, flags, nl, dec, enc) \
- EF(fid, ns, flags, nl, EF_TYPE_RECORD_FIXED, dec, enc)
-#define EF_LIN_FIX_N(fid, ns, flags, nl) \
- EF_LIN_FIX(fid, ns, flags, nl, &default_decode, NULL)
+#define EF_TRANSP(fid, ns, flags, smin, srec, nl, dec, enc) \
+ EF(fid, ns, flags, nl, EF_TYPE_TRANSP, \
+ smin, srec, dec, enc)
+#define EF_TRANSP_N(fid, ns, flags, smin, srec, nl) \
+ EF_TRANSP(fid, ns, flags, smin, srec, \
+ nl, &default_decode, NULL)
+
+#define EF_CYCLIC(fid, ns, flags, smin, srec, nl, dec, enc) \
+ EF(fid, ns, flags, nl, EF_TYPE_RECORD_CYCLIC, \
+ smin, srec, dec, enc)
+#define EF_CYCLIC_N(fid, ns, flags, smin, srec, nl) \
+ EF_CYCLIC(fid, ns, flags, smin, srec, nl, \
+ &default_decode, NULL)
+
+#define EF_LIN_FIX(fid, ns, flags, smin, srec, nl, dec, enc) \
+ EF(fid, ns, flags, nl, EF_TYPE_RECORD_FIXED, \
+ smin, srec, dec, enc)
+#define EF_LIN_FIX_N(fid, sfi, ns, flags, smin, srec, nl) \
+ EF_LIN_FIX(fid, sfi, ns, flags, smin, srec, nl, \
+ &default_decode, NULL)
struct osim_file_desc *
osim_file_find_name(struct osim_file_desc *parent, const char *name);