aboutsummaryrefslogtreecommitdiffstats
path: root/asn1.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-12-10 09:49:29 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>1999-12-10 09:49:29 +0000
commit0a61c9874f382e26f07c887374aa1ba94885e354 (patch)
treee300df163d0a52bcba7f8d4824e87fd72acb4900 /asn1.c
parentccfc5372cbbe15febb5c5adfd3f05be56b2c48e3 (diff)
Make the SNMP dissector use the ASN.1 code, rather than the SNMP library
code, to dissect SNMP PDUs; use the SNMP library code only to translate OIDs into strings. Put into the ASN.1 code an annoying hack to cope with the fact that UCD SNMP makes an OID out of "u_long"s whilst CMU SNMP makes it out of "u_int"s - have the ASN.1 code make it out of "subid_t"s, and typedef "subid_t" appropriately depending on the SNMP library you have. Eventually, we should be able to use "libsmi" instead of a full-blown SNMP library, and thus possibly work around various aggravations with the SNMP libraries. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1280 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1.c')
-rw-r--r--asn1.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/asn1.c b/asn1.c
index d36d9ee31e..28e7bfccce 100644
--- a/asn1.c
+++ b/asn1.c
@@ -1,7 +1,7 @@
/* asn1.c
* Routines for ASN.1 BER dissection
*
- * $Id: asn1.c,v 1.1 1999/12/05 07:47:44 guy Exp $
+ * $Id: asn1.c,v 1.2 1999/12/10 09:49:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -27,7 +27,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
-int debug_level;
/*
* MODULE INFORMATION
@@ -58,6 +57,14 @@ int debug_level;
* definite and indefinite encodings.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
#include <glib.h>
#include "asn1.h"
@@ -710,7 +717,7 @@ done:
* SYNOPSIS: int asn1_subid_decode
* (
* ASN1_SCK *asn1,
- * guint32 *subid
+ * subid_t *subid
* )
* DESCRIPTION: Decodes Sub Identifier.
* Parameters:
@@ -719,7 +726,7 @@ done:
* RETURNS: ASN1_ERR value (ASN1_ERR_NOERROR on success)
*/
int
-asn1_subid_decode ( ASN1_SCK *asn1, guint32 *subid)
+asn1_subid_decode ( ASN1_SCK *asn1, subid_t *subid)
{
int ret;
guchar ch;
@@ -741,7 +748,7 @@ asn1_subid_decode ( ASN1_SCK *asn1, guint32 *subid)
* (
* ASN1_SCK *asn1,
* int enc_len,
- * guintew **oid,
+ * subid_t **oid,
* guint *len
* )
* DESCRIPTION: Decodes value portion of Object Identifier.
@@ -753,13 +760,13 @@ asn1_subid_decode ( ASN1_SCK *asn1, guint32 *subid)
* RETURNS: ASN1_ERR value (ASN1_ERR_NOERROR on success)
*/
int
-asn1_oid_value_decode ( ASN1_SCK *asn1, int enc_len, guint32 **oid, guint *len)
+asn1_oid_value_decode ( ASN1_SCK *asn1, int enc_len, subid_t **oid, guint *len)
{
int ret;
const guchar *eoc;
- guint32 subid;
+ subid_t subid;
guint size;
- guint32 *optr;
+ subid_t *optr;
eoc = asn1->pointer + enc_len;
size = eoc - asn1->pointer + 1;
@@ -805,7 +812,7 @@ asn1_oid_value_decode ( ASN1_SCK *asn1, int enc_len, guint32 **oid, guint *len)
* SYNOPSIS: int asn1_oid_decode
* (
* ASN1_SCK *asn1,
- * guint32 **oid,
+ * subid_t **oid,
* guint *len,
* guint *nbytes
* )
@@ -818,7 +825,7 @@ asn1_oid_value_decode ( ASN1_SCK *asn1, int enc_len, guint32 **oid, guint *len)
* RETURNS: ASN1_ERR value (ASN1_ERR_NOERROR on success)
*/
int
-asn1_oid_decode ( ASN1_SCK *asn1, guint32 **oid, guint *len, guint *nbytes)
+asn1_oid_decode ( ASN1_SCK *asn1, subid_t **oid, guint *len, guint *nbytes)
{
int ret;
const guchar *start;