mirror of https://gerrit.osmocom.org/libosmocore
sim: Only one default_decode() function for all card types
This commit is contained in:
parent
171c5b1ec7
commit
30115dbd72
|
@ -46,17 +46,6 @@ static const struct osim_card_sw *isim_card_sws[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static int default_decode(struct osim_decoded_data *dd,
|
||||
const struct osim_file_desc *desc,
|
||||
int len, uint8_t *data)
|
||||
{
|
||||
struct osim_decoded_element *elem;
|
||||
|
||||
elem = element_alloc(dd, "Unknown Payload", ELEM_T_BYTES, ELEM_REPR_HEX);
|
||||
elem->u.buf = talloc_memdup(elem, data, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* TS 31.103 Version 11.2.0 Release 11 / Chapoter 4.2 */
|
||||
static const struct osim_file_desc isim_ef_in_adf_isim[] = {
|
||||
EF_TRANSP_N(0x6F02, 0x02, "EF.IMPI", 0, 1, 256,
|
||||
|
|
|
@ -135,19 +135,6 @@ static int elp_decode(struct osim_decoded_data *dd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int default_decode(struct osim_decoded_data *dd,
|
||||
const struct osim_file_desc *desc,
|
||||
int len, uint8_t *data)
|
||||
{
|
||||
struct osim_decoded_element *elem;
|
||||
|
||||
elem = element_alloc(dd, "Unknown Payload", ELEM_T_BYTES, ELEM_REPR_HEX);
|
||||
elem->u.buf = talloc_memdup(elem, data, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* 10.3.1 */
|
||||
int gsm_lp_decode(struct osim_decoded_data *dd,
|
||||
const struct osim_file_desc *desc,
|
||||
|
|
|
@ -52,19 +52,6 @@ static const struct osim_card_sw *usim_card_sws[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
|
||||
static int default_decode(struct osim_decoded_data *dd,
|
||||
const struct osim_file_desc *desc,
|
||||
int len, uint8_t *data)
|
||||
{
|
||||
struct osim_decoded_element *elem;
|
||||
|
||||
elem = element_alloc(dd, "Unknown Payload", ELEM_T_BYTES, ELEM_REPR_HEX);
|
||||
elem->u.buf = talloc_memdup(elem, data, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TS 102 221 Chapter 13.1 */
|
||||
static const struct osim_file_desc uicc_ef_in_mf[] = {
|
||||
EF_LIN_FIX_N(0x2f00, SFI_NONE, "EF.DIR", 0, 1, 32,
|
||||
|
|
|
@ -290,3 +290,15 @@ enum osim_card_sw_class osim_sw_class(const struct osim_card_profile *cp,
|
|||
|
||||
return csw->class;
|
||||
}
|
||||
|
||||
int default_decode(struct osim_decoded_data *dd,
|
||||
const struct osim_file_desc *desc,
|
||||
int len, uint8_t *data)
|
||||
{
|
||||
struct osim_decoded_element *elem;
|
||||
|
||||
elem = element_alloc(dd, "Unknown Payload", ELEM_T_BYTES, ELEM_REPR_HEX);
|
||||
elem->u.buf = talloc_memdup(elem, data, len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,9 @@ element_alloc_sub(struct osim_decoded_element *ee, const char *name,
|
|||
|
||||
extern const struct osim_card_sw ts102221_uicc_sw[0];
|
||||
|
||||
int default_decode(struct osim_decoded_data *dd,
|
||||
const struct osim_file_desc *desc,
|
||||
int len, uint8_t *data);
|
||||
|
||||
void add_filedesc(struct osim_file_desc *root, const struct osim_file_desc *in, int num);
|
||||
struct osim_file_desc *alloc_df(void *ctx, uint16_t fid, const char *name);
|
||||
|
|
Loading…
Reference in New Issue