diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2007-08-19 23:00:47 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2007-08-19 23:00:47 +0000 |
commit | a5efe69a793d0d0a126e90c342827774b7670044 (patch) | |
tree | 9198a063a4f03927965f0774be87212d56aca616 /asn1/snmp/snmp.cnf | |
parent | 696bcf8b2dd764bc57581c928a87af0fbc0465f3 (diff) | |
download | wireshark-a5efe69a793d0d0a126e90c342827774b7670044.tar.gz wireshark-a5efe69a793d0d0a126e90c342827774b7670044.tar.bz2 wireshark-a5efe69a793d0d0a126e90c342827774b7670044.zip |
Filtering on snmp variables starts to work so I put it there in case anyone wants to start playing with it. I'll leave the generated dissector in place and the rest off the Makefiles so that others are not bothered by this.
TODO:
- Global
- add libsmi to autoconf (I modified CFLAGS and LDADDs in the makefile.ams appending my own values, that's good only for me)
- have other users of oid_resolv.h get to use the new functions in oids.h
- add a menu item or preference setting for the smi_modules UAT ( the smi_modules file has one dquoted string per line with the name of each module to be loaded)
- SNMP
- put complete information in the labels of the VarBind Items
- add oids to COL_INFO
- negative testing (Well, testing in general)
- OIDS
- implement "ALL" modules
- some functions are not yet tested or implemented
I'll put a TO-DO list on the wiki for people (incl. me) to add more items
svn path=/trunk/; revision=22556
Diffstat (limited to 'asn1/snmp/snmp.cnf')
-rw-r--r-- | asn1/snmp/snmp.cnf | 83 |
1 files changed, 11 insertions, 72 deletions
diff --git a/asn1/snmp/snmp.cnf b/asn1/snmp/snmp.cnf index 7d75cf261d..486da745ef 100644 --- a/asn1/snmp/snmp.cnf +++ b/asn1/snmp/snmp.cnf @@ -12,9 +12,9 @@ GetNextRequest-PDU GetResponse-PDU SetRequest-PDU GetRequest-PDU -Gauge32 NotificationName SnmpEngineID +VarBind #.TYPE_RENAME @@ -221,6 +221,9 @@ gint pdu_type; expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU: %%s", error); + + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Failed to decrypt"); return offset; } else { @@ -233,10 +236,14 @@ gint pdu_type; expert_add_info_format(actx->pinfo, cause, PI_MALFORMED, PI_WARN, "Decrypted data not formated as expected"); + + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Decrypted data not formated as expected"); return offset; } + add_new_data_source(actx->pinfo, cleartext_tvb, "Decrypted ScopedPDU"); tvb_set_child_real_data_tvbuff(tvb, cleartext_tvb); @@ -244,6 +251,9 @@ gint pdu_type; decrypted_tree = proto_item_add_subtree(decrypted_item,ett_decrypted); dissect_snmp_ScopedPDU(FALSE, cleartext_tvb, 0, actx, decrypted_tree, -1); } + } else { + if (check_col(actx->pinfo->cinfo, COL_INFO)) + col_add_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: privKey Unknown"); } #.FN_BODY SNMPv3Message/msgSecurityParameters @@ -319,79 +329,8 @@ gint pdu_type; usm_p.authenticated = v3_flags & TH_AUTH ? TRUE : FALSE; } -#.FN_BODY VarBind - oid_tvb = NULL; - value_tvb = NULL; - %(DEFAULT_BODY)s - if (oid_tvb && value_tvb) { - next_tvb_add_string(&var_list, value_tvb, (snmp_var_in_tree) ? tree : NULL, - variable_oid_dissector_table, - oid_to_str(tvb_get_ptr(oid_tvb, 0, tvb_length(oid_tvb)), tvb_length(oid_tvb))); - } - -#.FN_PARS ObjectName - - VAL_PTR = &oid_tvb - -#.FN_BODY String-value - guint length; - - snmp_variable_decode(tvb, tree, actx, oid_tvb, offset, &length, &value_tvb); - offset = offset + length; - -#.FN_BODY Integer-value - guint length; - - snmp_variable_decode(tvb, tree, actx, oid_tvb, offset, &length, NULL); - offset = offset + length; - -#.FN_BODY ObjectID-value - guint length; - - snmp_variable_decode(tvb, tree, actx, oid_tvb, offset, &length, NULL); - offset = offset + length; - -#.FN_BODY Empty - guint length; - - snmp_variable_decode(tvb, tree, actx, oid_tvb, offset, &length, NULL); - offset = offset + length; - -#.FN_BODY NetworkAddress/internet - /* see http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1125 */ - guint32 len; - int cur_offset; - - cur_offset = get_ber_identifier(tvb, offset, NULL, NULL, NULL); - get_ber_length(NULL, tvb, cur_offset, &len, NULL); - - switch (len) { - case 4: offset = dissect_snmp_IpAddress(FALSE, tvb, offset, actx, tree, hf_snmp_internet); break; - case 16: offset = dissect_snmp_IpAddressIpv6(FALSE, tvb, offset, actx, tree, hf_snmp_internet_ipv6); break; - default: offset = dissect_snmp_IpAddressOther(FALSE, tvb, offset, actx, tree, hf_snmp_internet_other); break; - } - - if (len != 4) { - proto_item* pi = get_ber_last_created_item(); - proto_tree* pt = proto_item_add_subtree(pi,ett_internet); - /* - * It might be possible to do so, although the dissector should probably still put - * a complaint into the protocol tree ("not irritating Cisco by pointing out where - * they're violating the standard" is not a project goal for Wireshark :-)). - * -- Guy Harris - */ - pi = proto_tree_add_text(pt,tvb,cur_offset,len, - "The host that generated this packet is violating" - "the SNMP protocol definition and sends corrupt and invalid packets"); - PROTO_ITEM_SET_GENERATED(pi); - expert_add_info_format( actx->pinfo, pi, PI_MALFORMED, PI_ERROR, - "Corrupt and Invalid packet" ); - } - #.TYPE_ATTR -Counter64 TYPE = FT_UINT64 DISPLAY = BASE_DEC STRINGS = NULL -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 |