1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# smrse.cnf
# SMRSE conformation file
#.MODULE_IMPORT
#.EXPORTS
#.NO_EMIT
SemiOctetString
#.END
#.PDU
#.TYPE_RENAME
#.FIELD_RENAME
#.FN_BODY SMS-Address/address-value/octet-format
char *strp,tmpstr[21];
guint32 i, start_offset;
gint8 ber_class;
bool pc, ind;
gint32 tag;
guint32 len;
static char n2a[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
start_offset=offset;
/* skip the tag and length */
offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
if(len>10){
len=10;
}
strp=tmpstr;
for(i=0;i<len;i++){
*strp++=n2a[tvb_get_guint8(tvb, offset)&0x0f];
*strp++=n2a[(tvb_get_guint8(tvb, offset)>>4)&0x0f];
offset++;
}
*strp=0;
proto_tree_add_string(tree, hf_smrse_Octet_Format, tvb, start_offset, offset-start_offset, tmpstr);
#.END
|