2 * Routines for SNMP (simple network management protocol)
5 * $Id: packet-snmp.c,v 1.3 1999/06/12 04:17:19 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@unicom.net>
9 * Copyright 1998 Didier Jorand
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #if defined(HAVE_UCD_SNMP_SNMP_H)
33 #define WITH_SNMP_UCD 1
34 #elif defined(HAVE_SNMP_SNMP_H)
35 #define WITH_SNMP_CMU 1
38 #if defined(WITH_SNMP_CMU) || defined(WITH_SNMP_UCD)
44 #ifdef HAVE_SYS_TYPES_H
45 # include <sys/types.h>
48 #ifdef HAVE_NETINET_IN_H
49 # include <netinet/in.h>
55 #define in_addr_t u_int
58 /* should be defined only if supported in ucd-snmp */
59 #define OPAQUE_SPECIAL_TYPES 1
60 #include <ucd-snmp/asn1.h>
61 #include <ucd-snmp/snmp.h>
62 #include <ucd-snmp/snmp_api.h>
63 #include <ucd-snmp/snmp_impl.h>
64 #include <ucd-snmp/mib.h>
66 typedef long SNMP_INT;
67 typedef unsigned long SNMP_UINT;
68 #define OID_FORMAT_STRING "%ld"
69 #define OID_FORMAT_STRING1 ".%ld"
73 #include <snmp/snmp.h>
74 #include <snmp/snmp_impl.h>
78 #define MAX_NAME_LEN SNMP_MAX_LEN
81 #define SNMP_MSG_GET GET_REQ_MSG
82 #define SNMP_MSG_GETNEXT GETNEXT_REQ_MSG
83 #define SNMP_MSG_RESPONSE GET_RSP_MSG
84 #define SNMP_MSG_SET SET_REQ_MSG
85 #define SNMP_MSG_TRAP TRP_REQ_MSG
87 #ifdef GETBULK_REQ_MSG
88 #define SNMP_MSG_GETBULK GETBULK_REQ_MSG
90 #define SNMP_MSG_GETBULK SNMP_PDU_GETBULK
94 #define SNMP_MSG_INFORM INFORM_REQ_MSG
96 #define SNMP_MSG_INFORM SNMP_PDU_INFORM
100 #define SNMP_MSG_TRAP2 TRP2_REQ_MSG
102 #define SNMP_MSG_TRAP2 SNMP_PDU_V2TRAP
106 #define SNMP_MSG_REPORT REPORT_MSG
108 #define SNMP_MSG_REPORT SNMP_PDU_REPORT
112 #ifndef SNMP_VERSION_2c
113 #define SNMP_VERSION_2c 1
115 #ifndef SNMP_VERSION_2u
116 #define SNMP_VERSION_2u 2
118 #ifndef SNMP_VERSION_3
119 #define SNMP_VERSION_3 3
122 #ifdef SNMP_TRAP_AUTHENTICATIONFAILURE
123 #define SNMP_TRAP_AUTHFAIL SNMP_TRAP_AUTHENTICATIONFAILURE
126 #ifndef COMMUNITY_MAX_LEN
127 #define COMMUNITY_MAX_LEN 256
131 #define ASN_INTEGER SMI_INTEGER
133 #ifndef ASN_OCTET_STR
134 #define ASN_OCTET_STR SMI_STRING
136 #ifndef ASN_OBJECT_ID
137 #define ASN_OBJECT_ID SMI_OBJID
140 #define ASN_NULL SMI_NULLOBJ
143 #ifndef ASN_IPADDRESS
145 #define ASN_IPADDRESS IPADDRESS
147 #define ASN_IPADDRESS SMI_IPADDRESS
153 #define ASN_COUNTER COUNTER
155 #define ASN_COUNTER SMI_COUNTER32
161 #define ASN_GAUGE GAUGE
163 #define ASN_GAUGE SMI_GAUGE32
167 #ifndef ASN_TIMETICKS
169 #define ASN_TIMETICKS TIMETICKS
171 #define ASN_TIMETICKS SMI_TIMETICKS
177 #define ASN_OPAQUE OPAQUE
179 #define ASN_OPAQUE SMI_OPAQUE
183 #ifndef ASN_COUNTER64
185 #define ASN_COUNTER64 COUNTER64
187 #define ASN_COUNTER64 SMI_COUNTER64
192 /* historic: should not be used! */
193 #define ASN_UINTEGER (ASN_APPLICATION | 7)
196 /* historic: should not be used! */
197 #define ASN_NSAP (ASN_APPLICATION | 5)
199 #ifndef SNMP_NOSUCHOBJECT
200 #define SNMP_NOSUCHOBJECT SMI_NOSUCHOBJECT
202 #ifndef SNMP_NOSUCHINSTANCE
203 #define SNMP_NOSUCHINSTANCE SMI_NOSUCHINSTANCE
205 #ifndef SNMP_ENDOFMIBVIEW
206 #define SNMP_ENDOFMIBVIEW SMI_ENDOFMIBVIEW
210 typedef int SNMP_INT;
211 typedef unsigned int SNMP_UINT;
212 #define OID_FORMAT_STRING "%d"
213 #define OID_FORMAT_STRING1 ".%d"
217 static const value_string versions[] = {
218 { SNMP_VERSION_1, "VERSION 1" },
219 { SNMP_VERSION_2c, "VERSION 2C" },
220 { SNMP_VERSION_2u, "VERSION 2U" },
221 { SNMP_VERSION_3, "VERSION 3" },
225 static const value_string pdu_types[] = {
226 { SNMP_MSG_GET, "GET" },
227 { SNMP_MSG_GETNEXT, "GET-NEXT" },
228 { SNMP_MSG_SET, "SET" },
229 { SNMP_MSG_RESPONSE, "RESPONSE" },
230 { SNMP_MSG_TRAP, "TRAP-V1" },
231 { SNMP_MSG_GETBULK, "GETBULK" },
232 { SNMP_MSG_INFORM, "INFORM" },
233 { SNMP_MSG_TRAP2, "TRAP-V2" },
234 { SNMP_MSG_REPORT, "REPORT" },
238 static const value_string error_statuses[] = {
239 { SNMP_ERR_NOERROR, "NO ERROR" },
240 { SNMP_ERR_TOOBIG, "ERROR: TOOBIG" },
241 { SNMP_ERR_NOSUCHNAME, "ERROR: NO SUCH NAME" },
242 { SNMP_ERR_BADVALUE, "ERROR: BAD VALUE" },
243 { SNMP_ERR_READONLY, "ERROR: READ ONLY" },
244 { SNMP_ERR_GENERR, "ERROR: GENERIC ERROR" },
245 { SNMP_ERR_NOACCESS, "ERROR: NO ACCESS" },
246 { SNMP_ERR_WRONGTYPE, "ERROR: WRONG TYPE" },
247 { SNMP_ERR_WRONGLENGTH, "ERROR: WRONG LENGTH" },
248 { SNMP_ERR_WRONGENCODING, "ERROR: WRONG ENCODING" },
249 { SNMP_ERR_WRONGVALUE, "ERROR: WRONG VALUE" },
250 { SNMP_ERR_NOCREATION, "ERROR: NO CREATION" },
251 { SNMP_ERR_INCONSISTENTVALUE, "ERROR: INCONSISTENT VALUE" },
252 { SNMP_ERR_RESOURCEUNAVAILABLE, "ERROR: RESOURCE UNAVAILABLE" },
253 { SNMP_ERR_COMMITFAILED, "ERROR: COMMIT FAILED" },
254 { SNMP_ERR_UNDOFAILED, "ERROR: UNDO FAILED" },
255 { SNMP_ERR_AUTHORIZATIONERROR, "ERROR: AUTHORIZATION ERROR" },
256 { SNMP_ERR_NOTWRITABLE, "ERROR: NOT WRITABLE" },
257 { SNMP_ERR_INCONSISTENTNAME, "ERROR: INCONSISTENT NAME" },
261 static const value_string trap_types[] = {
262 { SNMP_TRAP_COLDSTART, "COLD START" },
263 { SNMP_TRAP_WARMSTART, "WARM START" },
264 { SNMP_TRAP_LINKDOWN, "LINK DOWN" },
265 { SNMP_TRAP_LINKUP, "LINK UP" },
266 { SNMP_TRAP_AUTHFAIL, "AUTHENTICATION FAILED" },
267 { SNMP_TRAP_EGPNEIGHBORLOSS, "EGP NEIGHBORLOSS" },
268 { SNMP_TRAP_ENTERPRISESPECIFIC, "ENTERPRISE SPECIFIC" },
273 dissect_snmp_error(const u_char *pd, int offset, frame_data *fd,
274 proto_tree *tree, const char *message)
276 if (check_col(fd, COL_INFO))
277 col_add_str(fd, COL_INFO, message);
279 dissect_data(pd, offset, fd, tree);
283 dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
285 int length=fd->pkt_len-offset;
286 u_char *data, *tmp_data;
288 int all_length, header_length;
289 u_char type, pdu_type;
291 SNMP_INT request_id, error_status, error_index;
292 int request_id_length, error_status_length, error_index_length;
295 u_char community[COMMUNITY_MAX_LEN];
296 int community_length = COMMUNITY_MAX_LEN;
298 oid enterprise[MAX_NAME_LEN];
299 int enterprise_length;
300 SNMP_INT trap_type, specific_type;
304 oid vb_name[MAX_NAME_LEN];
308 char vb_string[MAX_NAME_LEN*6]; /* TBC */
309 char vb_string2[2048]; /* TBC */
311 SNMP_INT vb_integer_value;
312 SNMP_UINT vb_unsigned_value;
314 struct counter64 vb_counter64_value;
316 oid vb_oid_value[MAX_NAME_LEN];
317 int vb_oid_value_length;
318 unsigned char vb_string_value[128];
319 int vb_string_value_length;
321 float vb_float_value;
322 double vb_double_value;
327 char *pdu_type_string;
329 proto_tree *snmp_tree=NULL;
330 proto_item *item=NULL;
332 if (check_col(fd, COL_PROTOCOL))
333 col_add_str(fd, COL_PROTOCOL, "SNMP");
335 /* NOTE: we have to parse the message piece by piece, since the
336 * capture length may be less than the message length: a 'global'
337 * parsing is likely to fail.
341 /* parse the SNMP header */
342 if(NULL == asn_parse_header( &pd[offset], &length, &type)) {
343 dissect_snmp_error(pd, offset, fd, tree,
344 "Couldn't parse SNMP header");
348 if (type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)) {
349 dissect_snmp_error(pd, offset, fd, tree, "Not an SNMP PDU");
353 /* authenticates message */
354 length=fd->pkt_len-offset;
355 header_length=length;
356 data = snmp_comstr_parse(&pd[offset], &length, community, &community_length,&version);
358 dissect_snmp_error(pd, offset, fd, tree,
359 "Couldn't parse authentication");
364 /* initialize length variables */
365 /* length=fd->pkt_len-offset; */
366 header_length=length;
368 /* parse the SNMP header */
369 data = asn_parse_header( &pd[offset], &length, &type);
371 dissect_snmp_error(pd, offset, fd, tree,
372 "Couldn't parse SNMP header");
376 if (type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)) {
377 dissect_snmp_error(pd, offset, fd, tree, "Not an SNMP PDU");
381 data = asn_parse_int(data, &length, &type, &version, sizeof(SNMP_INT));
383 dissect_snmp_error(pd, offset, fd, tree,
384 "Couldn't parse SNMP version number");
387 data = asn_parse_string(data, &length, &type, community, &community_length);
389 dissect_snmp_error(pd, offset, fd, tree,
390 "Couldn't parse SNMP community");
393 community[community_length] = '\0';
396 header_length-=length;
397 /* printf("Community is %s, version is %d (header length is %d)\n", community, version, header_length); */
398 if(version != SNMP_VERSION_1) {
399 dissect_snmp_error(pd, offset, fd, tree,
400 "Non-version-1 SNMP PDU");
404 pdu_type_length=length;
405 data = asn_parse_header(data, &length, &pdu_type);
407 dissect_snmp_error(pd, offset, fd, tree,
408 "Couldn't parse PDU type");
411 pdu_type_length-=length;
412 /* printf("pdu type is %#x (length is %d)\n", type, pdu_type_length); */
414 /* get the fields in the PDU preceeding the variable-bindings sequence */
415 if (pdu_type != SNMP_MSG_TRAP) {
418 request_id_length=length;
419 data = asn_parse_int(data, &length, &type, &request_id, sizeof(request_id));
421 dissect_snmp_error(pd, offset, fd, tree,
422 "Couldn't parse request ID");
425 request_id_length-=length;
426 /* printf("request id is %#lx (length is %d)\n", request_id, request_id_length); */
428 /* error status (getbulk non-repeaters) */
429 error_status_length=length;
430 data = asn_parse_int(data, &length, &type, &error_status, sizeof(error_status));
432 dissect_snmp_error(pd, offset, fd, tree,
433 "Couldn't parse error status");
436 error_status_length-=length;
438 /* error index (getbulk max-repetitions) */
439 error_index_length=length;
440 data = asn_parse_int(data, &length, &type, &error_index, sizeof(error_index));
442 dissect_snmp_error(pd, offset, fd, tree,
443 "Couldn't parse error index");
446 error_index_length-=length;
448 pdu_type_string = val_to_str(pdu_type, pdu_types,
449 "Unknown PDU type %#x");
450 if (check_col(fd, COL_INFO))
451 col_add_str(fd, COL_INFO, pdu_type_string);
453 /* all_length=header_length+pdu_type_length+request_id_length+error_status_length+error_index_length; */
454 all_length=fd->pkt_len-offset;
455 item = proto_tree_add_item(tree, offset, all_length, "Simple Network Management Protocol");
456 snmp_tree = proto_tree_new();
457 proto_item_add_subtree(item, snmp_tree, ETT_SNMP);
458 proto_tree_add_item(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x"));
459 offset+=header_length;
460 proto_tree_add_item(snmp_tree, offset, pdu_type_length, "%s", pdu_type_string);
461 offset+=pdu_type_length;
462 proto_tree_add_item(snmp_tree, offset, request_id_length, "Request Id.: %#x", (unsigned int)request_id);
463 offset+=request_id_length;
464 proto_tree_add_item(snmp_tree, offset, error_status_length, "Error Status: %s", val_to_str(error_status, error_statuses, "Unknown (%d)"));
465 offset+=error_status_length;
466 proto_tree_add_item(snmp_tree, offset, error_index_length, "Error Index: %d", (int)error_index);
467 offset+=error_index_length;
469 offset+=header_length;
470 offset+=pdu_type_length;
471 offset+=request_id_length;
472 offset+=error_status_length;
473 offset+=error_index_length;
477 /* an SNMPv1 trap PDU */
478 pdu_type_string = val_to_str(pdu_type, pdu_types,
479 "Unknown PDU type %#x");
480 if (check_col(fd, COL_INFO))
481 col_add_str(fd, COL_INFO, pdu_type_string);
483 all_length=fd->pkt_len-offset;
484 item = proto_tree_add_item(tree, offset, all_length, "Simple Network Management Protocol");
485 snmp_tree = proto_tree_new();
486 proto_item_add_subtree(item, snmp_tree, ETT_SNMP);
487 proto_tree_add_item(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x"));
488 offset+=header_length;
489 proto_tree_add_item(snmp_tree, offset, pdu_type_length, "Pdu type: %s", pdu_type_string);
490 offset+=pdu_type_length;
492 offset+=header_length;
493 offset+=pdu_type_length;
497 enterprise_length = MAX_NAME_LEN;
499 data = asn_parse_objid(data, &length, &type, enterprise, &enterprise_length);
501 dissect_snmp_error(pd, offset, fd, tree,
502 "Couldn't parse enterprise OID");
507 sprintf(vb_string, OID_FORMAT_STRING, enterprise[0]);
508 for(i=1; i<enterprise_length;i++) {
509 sprintf(tmp_string, OID_FORMAT_STRING1, enterprise[i]);
510 strcat(vb_string,tmp_string);
513 proto_tree_add_item(snmp_tree, offset, tmp_length, "Enterprise: %s", vb_string);
518 vb_string_value_length = 4;
520 data = asn_parse_string(data, &length, &type, vb_string_value, &vb_string_value_length);
522 dissect_snmp_error(pd, offset, fd, tree,
523 "Couldn't parse agent address");
528 proto_tree_add_item(snmp_tree, offset, tmp_length, "Agent address: %d.%d.%d.%d",
529 vb_string_value[0],vb_string_value[1],vb_string_value[2],vb_string_value[3]);
535 data = asn_parse_int(data, &length, &type, &trap_type, sizeof(trap_type));
537 dissect_snmp_error(pd, offset, fd, tree,
538 "Couldn't parse trap type");
543 proto_tree_add_item(snmp_tree, offset, tmp_length, "Trap type: %s", val_to_str(trap_type, trap_types, "Unknown (%d)"));
549 data = asn_parse_int(data, &length, &type, &specific_type, sizeof(specific_type));
551 dissect_snmp_error(pd, offset, fd, tree,
552 "Couldn't parse specific trap type");
557 proto_tree_add_item(snmp_tree, offset, tmp_length, "Specific trap type: %ld (%#lx)", (long)specific_type, (long)specific_type);
563 data = asn_parse_unsigned_int(data, &length, &type, ×tamp, sizeof(timestamp));
565 dissect_snmp_error(pd, offset, fd, tree,
566 "Couldn't parse time stamp");
571 proto_tree_add_item(snmp_tree, offset, tmp_length, "Timestamp: %lu", (unsigned long)timestamp);
576 /* variable bindings */
577 /* get header for variable-bindings sequence */
579 data = asn_parse_header(data, &length, &type);
581 dissect_snmp_error(pd, offset, fd, tree,
582 "Couldn't variable-bindings header");
586 if (type != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR)) {
587 dissect_snmp_error(pd, offset, fd, tree,
588 "Bad type for variable-bindings header");
592 /* printf("VB header: offset is %d; length is %d.\n", offset, tmp_length); */
594 /* loop on variable bindings */
598 /* printf("VB index is %d (offset=%d; length=%d).\n", vb_index, offset, length); */
602 data = asn_parse_header(data, &tmp_length, &type);
604 dissect_snmp_error(pd, offset, fd, tree,
605 "Couldn't parse variable-binding header");
608 if (type != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR)) {
609 dissect_snmp_error(pd, offset, fd, tree,
610 "Bad type for variable-binding header");
613 tmp_length=(int)(data-tmp_data);
617 /* parse object identifier */
618 vb_name_length=MAX_NAME_LEN;
620 data = asn_parse_objid(data, &length, &type, vb_name, &vb_name_length);
622 dissect_snmp_error(pd, offset, fd, tree,
623 "No object-identifier for variable-binding");
627 if (type != (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID)) {
628 dissect_snmp_error(pd, offset, fd, tree,
629 "Bad type for variable-binding");
635 sprintf(vb_string, OID_FORMAT_STRING, vb_name[0]);
636 for(i=1; i<vb_name_length;i++) {
637 sprintf(tmp_string, OID_FORMAT_STRING1, vb_name[i]);
638 strcat(vb_string,tmp_string);
641 sprint_objid(vb_string2, vb_name, vb_name_length);
643 proto_tree_add_item(snmp_tree, offset, tmp_length, "Object identifier %d: %s (%s)", vb_index, vb_string, vb_string2);
647 /* parse the type of the object */
649 if (NULL == asn_parse_header(data, &tmp_length, &vb_type)){
650 dissect_snmp_error(pd, offset, fd, tree,
651 "Bad type for variable-binding value");
655 /* parse the value */
659 data=asn_parse_null(data, &length, &type);
662 dissect_snmp_error(pd, offset, fd, tree,
663 "Couldn't parse null value");
667 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: NULL");
674 data=asn_parse_int(data, &length, &type, &vb_integer_value, sizeof(vb_integer_value));
677 dissect_snmp_error(pd, offset, fd, tree,
678 "Couldn't parse integer value");
682 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <i> %ld (%#lx)", (long)vb_integer_value, (long)vb_integer_value);
692 data=asn_parse_unsigned_int(data, &length, &type, &vb_unsigned_value, sizeof(vb_unsigned_value));
695 dissect_snmp_error(pd, offset, fd, tree,
696 "Couldn't parse unsigned value");
700 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <u> %lu (%#lx)", (unsigned long)vb_unsigned_value, (unsigned long)vb_unsigned_value);
706 /* only ucd support 64bits types */
708 #ifdef OPAQUE_SPECIAL_TYPES
709 case ASN_OPAQUE_COUNTER64:
711 #endif /* OPAQUE_SPECIAL_TYPES */
713 data=asn_parse_unsigned_int64(data, &length, &type, &vb_counter64_value, sizeof(vb_counter64_value));
716 dissect_snmp_error(pd, offset, fd, tree,
717 "Couldn't parse counter64 value");
721 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <i64> %lu:%lu (%#lx:%lx)",
722 vb_counter64_value.high,
723 vb_counter64_value.low,
724 vb_counter64_value.high,
725 vb_counter64_value.low);
729 #endif /* WITH_SNMP_UCD */
732 vb_oid_value_length = MAX_NAME_LEN;
734 data=asn_parse_objid(data, &length, &type, vb_oid_value, &vb_oid_value_length);
737 dissect_snmp_error(pd, offset, fd, tree,
738 "Couldn't parse OID value");
742 sprintf(vb_string, OID_FORMAT_STRING, vb_oid_value[0]);
743 for(i=1; i<vb_oid_value_length;i++) {
744 sprintf(tmp_string, OID_FORMAT_STRING1, vb_oid_value[i]);
745 strcat(vb_string,tmp_string);
747 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <oid> %s", vb_string);
755 vb_string_value_length=128;
757 data=asn_parse_string(data, &length, &type, vb_string_value, &vb_string_value_length);
760 dissect_snmp_error(pd, offset, fd, tree,
761 "Couldn't parse octet string value");
765 vb_string_value[vb_string_value_length]=0;
766 /* if some characters are not printable, display the string as
768 for(i=0; i<vb_string_value_length; i++) {
769 if(!(isprint(vb_string_value[i]) || isspace(vb_string_value[i]))) break;
771 if(i<vb_string_value_length) {
772 sprintf(vb_string, "%03d", (int)vb_string_value[0]);
773 for(i=1; i<vb_string_value_length; i++) {
774 sprintf(tmp_string, ".%03d", (int)vb_string_value[i]);
775 strcat(vb_string,tmp_string);
777 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <str> %s", vb_string);
779 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <str> %s", vb_string_value);
785 #ifdef OPAQUE_SPECIAL_TYPES
788 data=asn_parse_signed_int64(data, &length, &type, &vb_counter64_value, sizeof(vb_counter64_value));
791 dissect_snmp_error(pd, offset, fd, tree,
792 "Couldn't parse integer64 value");
796 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <i64> %ld:%lu (%#lx:%lx)",
797 vb_counter64_value.high,
798 vb_counter64_value.low,
799 vb_counter64_value.high,
800 vb_counter64_value.low);
806 case ASN_OPAQUE_FLOAT:
808 data=asn_parse_float(data, &length, &type,&vb_float_value, sizeof(vb_float_value));
811 dissect_snmp_error(pd, offset, fd, tree,
812 "Couldn't parse float value");
816 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <f> %f", (double)vb_float_value);
821 case ASN_OPAQUE_DOUBLE:
823 data=asn_parse_double(data, &length, &type,&vb_double_value, sizeof(vb_double_value));
826 dissect_snmp_error(pd, offset, fd, tree,
827 "Couldn't parse double value");
831 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <d> %f", vb_double_value);
835 #endif /* OPAQUE_SPECIAL_TYPES */
837 case SNMP_NOSUCHOBJECT:
839 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <err> no such object");
842 case SNMP_NOSUCHINSTANCE:
844 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <err> no such instance");
847 case SNMP_ENDOFMIBVIEW:
849 proto_tree_add_item(snmp_tree, offset, tmp_length, "Value: <err> end of mib view");
854 dissect_snmp_error(pd, offset, fd, tree,
855 "Unsupported type for variable-binding value");
861 #endif /* WITH_SNMP: CMU or UCD */