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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
# snmp.cnf
# snmp conformation file
# $Id$
#.PDU
SMUX-PDUs
#.NO_EMIT
#.TYPE_RENAME
#.FIELD_RENAME
Messagev2u/datav2u/plaintext v2u_plaintext
BulkPDU/request-id bulkPDU_request-id
#.FN_BODY PDUs/get-request
gint8 class;
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
if(!implicit_tag){
/* XXX asn2eth can not yet handle tagged assignment yes so this
* XXX is some conformance file magic to work around that bug
*/
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index);
#.FN_BODY PDUs/get-next-request
gint8 class;
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
if(!implicit_tag){
/* XXX asn2eth can not yet handle tagged assignment yes so this
* XXX is some conformance file magic to work around that bug
*/
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index);
#.FN_BODY PDUs/get-response
gint8 class;
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
if(!implicit_tag){
/* XXX asn2eth can not yet handle tagged assignment yes so this
* XXX is some conformance file magic to work around that bug
*/
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index);
#.FN_BODY PDUs/set-request
gint8 class;
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
if(!implicit_tag){
/* XXX asn2eth can not yet handle tagged assignment yes so this
* XXX is some conformance file magic to work around that bug
*/
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
offset = dissect_snmp_PDU(TRUE, tvb, offset, pinfo, tree, hf_index);
#.FN_BODY PDUs/trap
gint8 class;
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
if(!implicit_tag){
/* XXX asn2eth can not yet handle tagged assignment yes so this
* XXX is some conformance file magic to work around that bug
*/
offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
offset = get_ber_length(tree, tvb, offset, &len1, &ind_field);
}
offset = dissect_snmp_Trap_PDU(TRUE, tvb, offset, pinfo, tree, hf_index);
#.FN_PARS HeaderData/msgSecurityModel
VAL_PTR = &MsgSecurityModel
#.FN_BODY SNMPv3Message/msgSecurityParameters
switch(MsgSecurityModel){
case SNMP_SEC_USM: /* 3 */
offset = dissect_snmp_UsmSecurityParameters(FALSE, tvb, offset+2, pinfo, tree, -1);
break;
case SNMP_SEC_ANY: /* 0 */
case SNMP_SEC_V1: /* 1 */
case SNMP_SEC_V2C: /* 2 */
default:
%(DEFAULT_BODY)s
break;
}
#.FN_PARS SnmpEngineID
VAL_PTR = ¶meter_tvb
#.FN_BODY SnmpEngineID
tvbuff_t *parameter_tvb = NULL;
proto_tree *engineid_tree = NULL;
proto_item *item = NULL;
%(DEFAULT_BODY)s
if (parameter_tvb)
dissect_snmp_engineid(tree, parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
#.FN_PARS HeaderData/msgFlags
VAL_PTR = ¶meter_tvb
#.FN_BODY HeaderData/msgFlags
tvbuff_t *parameter_tvb = NULL;
%(DEFAULT_BODY)s
if (parameter_tvb){
proto_tree_add_item(tree, hf_snmp_v3_flags_report, parameter_tvb, 0, 1, FALSE);
proto_tree_add_item(tree, hf_snmp_v3_flags_crypt, parameter_tvb, 0, 1, FALSE);
proto_tree_add_item(tree, hf_snmp_v3_flags_auth, parameter_tvb, 0, 1, FALSE);
}
#.FN_PARS ObjectName
VAL_PTR = &oid_tvb
#.FN_BODY String-value
guint length;
snmp_variable_decode(tvb, tree, pinfo, oid_tvb, offset, &length, NULL);
offset = offset + length;
#.TYPE_ATTR
IpAddress TYPE = FT_IPv4 DISPLAY = BASE_NONE STRINGS = NULL
Message/community TYPE = FT_STRING DISPLAY = BASE_HEX STRINGS = NULL
HeaderData/msgSecurityModel TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(sec_models)
UsmSecurityParameters/msgUserName TYPE = FT_STRING DISPLAY = BASE_HEX STRINGS = NULL
#.END
|