]> git.pld-linux.org Git - packages/tcpdump.git/blob - tcpdump-libsmi.patch
- release 2,
[packages/tcpdump.git] / tcpdump-libsmi.patch
1 ; From: Bill Fenner <fenner@research.att.com>
2 ; Subject: Re: libsmi 0.2.6 && tcpdump from cvs
3 ;
4 ;Care to try these diffs?  I didn't see any documentation on the API
5 ;change so I mostly just looked around for similar-looking functions.
6 ;It at least compiles now.  (Juergen, can you look these over?)
7 ;
8 ;  Bill
9 ;
10 Index: print-snmp.c
11 ===================================================================
12 RCS file: /tcpdump/master/tcpdump/print-snmp.c,v
13 retrieving revision 1.42
14 diff -u -r1.42 print-snmp.c
15 --- print-snmp.c        2000/10/06 05:54:51     1.42
16 +++ print-snmp.c        2000/11/04 20:43:09
17 @@ -947,25 +947,18 @@
18          SmiRange *smiRange;
19         int ok = 1;
20  
21 -       for (smiRange = smiGetFirstRange(smiType->module, smiType->name);
22 +       for (smiRange = smiGetFirstRange(smiType);
23              smiRange;
24              smiRange = smiGetNextRange(smiRange)) {
25  
26             ok = smi_check_a_range(smiType, smiRange, elem);
27 -           
28 -           if (ok) {
29 -               smiFreeRange(smiRange);
30 -               break;
31 -           }
32         }
33  
34 -       if (ok && smiType->parentmodule && smiType->parentname) {
35 +       if (ok) {
36             SmiType *parentType;
37 -           parentType = smiGetType(smiType->parentmodule,
38 -                                   smiType->parentname);
39 +           parentType = smiGetParentType(smiType);
40             if (parentType) {
41                 ok = smi_check_range(parentType, elem);
42 -               smiFreeType(parentType);
43             }
44         }
45  
46 @@ -985,7 +978,7 @@
47                 return NULL;
48         }
49         if (vflag) {
50 -               fputs(smiNode->module, stdout);
51 +               fputs(smiGetNodeModule(smiNode)->name, stdout);
52                 fputs("::", stdout);
53         }
54         fputs(smiNode->name, stdout);
55 @@ -1026,17 +1019,17 @@
56             && smiNode->access == SMI_ACCESS_NOT_ACCESSIBLE) {
57             fputs("[noAccess]", stdout);
58         }
59 -
60 -       if (! smi_check_type(smiNode->basetype, elem->type)) {
61 -           fputs("[wrongType]", stdout);
62 -       }
63  
64 -       smiType = smiGetType(smiNode->typemodule, smiNode->typename);
65 +       smiType = smiGetNodeType(smiNode);
66         if (! smiType) {
67             asn1_print(elem);
68             return;
69         }
70  
71 +       if (! smi_check_type(smiType->basetype, elem->type)) {
72 +           fputs("[wrongType]", stdout);
73 +       }
74 +
75         if (! smi_check_range(smiType, elem)) {
76             fputs("[wrongLength]", stdout);
77         }
78 @@ -1051,15 +1044,14 @@
79         
80         switch (elem->type) {
81         case BE_OID:
82 -               if (smiNode->basetype == SMI_BASETYPE_BITS
83 -                   && smiNode->typemodule && smiNode->typename) {
84 +               if (smiType->basetype == SMI_BASETYPE_BITS) {
85                         /* print bit labels */
86                 } else {
87                         smi_decode_oid(elem, oid, &oidlen);
88                         smiNode = smiGetNodeByOID(oidlen, oid);
89                         if (smiNode) {
90                                 if (vflag) {
91 -                                       fputs(smiNode->module, stdout);
92 +                                       fputs(smiGetNodeModule(smiNode)->name, stdout);
93                                         fputs("::", stdout);
94                                 }
95                                 fputs(smiNode->name, stdout);
96 @@ -1075,10 +1067,8 @@
97                 break;
98  
99         case BE_INT:
100 -               if (smiNode->basetype == SMI_BASETYPE_ENUM
101 -                   && smiNode->typemodule && smiNode->typename) {
102 -                       for (nn = smiGetFirstNamedNumber(smiNode->typemodule,
103 -                                                        smiNode->typename);
104 +               if (smiType->basetype == SMI_BASETYPE_ENUM) {
105 +                       for (nn = smiGetFirstNamedNumber(smiType);
106                              nn;
107                              nn = smiGetNextNamedNumber(nn)) {
108                                  if (nn->value.value.integer32
109 @@ -1096,10 +1086,6 @@
110         if (! done) {
111                 asn1_print(elem);
112         }
113 -
114 -       if (smiType) {
115 -               smiFreeType(smiType);
116 -       }
117  }
118  #endif
119  
120 @@ -1215,7 +1201,6 @@
121                         if (elem.type != BE_NULL) {
122  #ifdef LIBSMI
123                                 smi_print_value(smiNode, pduid, &elem);
124 -                               smiFreeNode(smiNode);
125  #else
126                                 asn1_print(&elem);
127  #endif
128
This page took 0.04838 seconds and 3 git commands to generate.