Imported Upstream version 0.4.8
[platform/upstream/libsmi.git] / test / dumps / netsnmp / if-mib-agt-stub.c
1 /*
2  * This C file has been generated by smidump 0.4.2-pre1.
3  * It is intended to be used with the NET-SNMP agent library.
4  *
5  * This C file is derived from the IF-MIB module.
6  *
7  * $Id: if-mib-agt-stub.c 1606 2003-12-01 12:24:15Z strauss $
8  */
9
10 #include <stdio.h>
11 #include <string.h>
12 #include <malloc.h>
13
14 #include "if-mib.h"
15
16 #include <ucd-snmp/asn1.h>
17 #include <ucd-snmp/snmp.h>
18 #include <ucd-snmp/snmp_api.h>
19 #include <ucd-snmp/snmp_impl.h>
20 #include <ucd-snmp/snmp_vars.h>
21
22 /*
23  * Forward declaration of read methods for groups of scalars and tables:
24  */
25
26 static unsigned char *
27 read_interfaces_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
28 static unsigned char *
29 read_ifEntry_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
30 static unsigned char *
31 read_ifMIBObjects_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
32 static unsigned char *
33 read_ifXEntry_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
34 static unsigned char *
35 read_ifStackEntry_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
36 static unsigned char *
37 read_ifTestEntry_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
38 static unsigned char *
39 read_ifRcvAddressEntry_stub(struct variable *, oid *, size_t *, int, size_t *, WriteMethod **);
40
41 /*
42  * Forward declaration of write methods for writable objects:
43  */
44
45 static int
46 write_ifAdminStatus_stub(int, u_char *, u_char, int, u_char *, oid *, int);
47 static int
48 write_ifLinkUpDownTrapEnable_stub(int, u_char *, u_char, int, u_char *, oid *, int);
49 static int
50 write_ifPromiscuousMode_stub(int, u_char *, u_char, int, u_char *, oid *, int);
51 static int
52 write_ifAlias_stub(int, u_char *, u_char, int, u_char *, oid *, int);
53 static int
54 write_ifStackStatus_stub(int, u_char *, u_char, int, u_char *, oid *, int);
55 static int
56 write_ifTestId_stub(int, u_char *, u_char, int, u_char *, oid *, int);
57 static int
58 write_ifTestStatus_stub(int, u_char *, u_char, int, u_char *, oid *, int);
59 static int
60 write_ifTestType_stub(int, u_char *, u_char, int, u_char *, oid *, int);
61 static int
62 write_ifTestOwner_stub(int, u_char *, u_char, int, u_char *, oid *, int);
63 static int
64 write_ifRcvAddressStatus_stub(int, u_char *, u_char, int, u_char *, oid *, int);
65 static int
66 write_ifRcvAddressType_stub(int, u_char *, u_char, int, u_char *, oid *, int);
67
68 /*
69  * Definitions of tags that are used internally to read/write
70  * the selected object type. These tags should be unique.
71  */
72
73 #define IFNUMBER                         1
74
75 static oid interfaces_base[] = {1, 3, 6, 1, 2, 1, 2};
76
77 struct variable interfaces_variables[] = {
78     { IFNUMBER, ASN_INTEGER, RONLY, read_interfaces_stub, 1, {1} },
79 };
80
81 #define IFINDEX                          1
82 #define IFDESCR                          2
83 #define IFTYPE                           3
84 #define IFMTU                            4
85 #define IFSPEED                          5
86 #define IFPHYSADDRESS                    6
87 #define IFADMINSTATUS                    7
88 #define IFOPERSTATUS                     8
89 #define IFLASTCHANGE                     9
90 #define IFINOCTETS                       10
91 #define IFINUCASTPKTS                    11
92 #define IFINNUCASTPKTS                   12
93 #define IFINDISCARDS                     13
94 #define IFINERRORS                       14
95 #define IFINUNKNOWNPROTOS                15
96 #define IFOUTOCTETS                      16
97 #define IFOUTUCASTPKTS                   17
98 #define IFOUTNUCASTPKTS                  18
99 #define IFOUTDISCARDS                    19
100 #define IFOUTERRORS                      20
101 #define IFOUTQLEN                        21
102 #define IFSPECIFIC                       22
103
104 static oid ifEntry_base[] = {1, 3, 6, 1, 2, 1, 2, 2, 1};
105
106 struct variable ifEntry_variables[] = {
107     { IFINDEX, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {1} },
108     { IFDESCR, ASN_OCTET_STR, RONLY, read_ifEntry_stub, 1, {2} },
109     { IFTYPE, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {3} },
110     { IFMTU, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {4} },
111     { IFSPEED, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {5} },
112     { IFPHYSADDRESS, ASN_OCTET_STR, RONLY, read_ifEntry_stub, 1, {6} },
113     { IFADMINSTATUS, ASN_INTEGER, RWRITE, read_ifEntry_stub, 1, {7} },
114     { IFOPERSTATUS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {8} },
115     { IFLASTCHANGE, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {9} },
116     { IFINOCTETS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {10} },
117     { IFINUCASTPKTS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {11} },
118     { IFINNUCASTPKTS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {12} },
119     { IFINDISCARDS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {13} },
120     { IFINERRORS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {14} },
121     { IFINUNKNOWNPROTOS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {15} },
122     { IFOUTOCTETS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {16} },
123     { IFOUTUCASTPKTS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {17} },
124     { IFOUTNUCASTPKTS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {18} },
125     { IFOUTDISCARDS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {19} },
126     { IFOUTERRORS, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {20} },
127     { IFOUTQLEN, ASN_INTEGER, RONLY, read_ifEntry_stub, 1, {21} },
128     { IFSPECIFIC, ASN_OBJECT_ID, RONLY, read_ifEntry_stub, 1, {22} },
129 };
130
131 #define IFTABLELASTCHANGE                5
132 #define IFSTACKLASTCHANGE                6
133
134 static oid ifMIBObjects_base[] = {1, 3, 6, 1, 2, 1, 31, 1};
135
136 struct variable ifMIBObjects_variables[] = {
137     { IFTABLELASTCHANGE, ASN_INTEGER, RONLY, read_ifMIBObjects_stub, 1, {5} },
138     { IFSTACKLASTCHANGE, ASN_INTEGER, RONLY, read_ifMIBObjects_stub, 1, {6} },
139 };
140
141 #define IFNAME                           1
142 #define IFINMULTICASTPKTS                2
143 #define IFINBROADCASTPKTS                3
144 #define IFOUTMULTICASTPKTS               4
145 #define IFOUTBROADCASTPKTS               5
146 #define IFHCINOCTETS                     6
147 #define IFHCINUCASTPKTS                  7
148 #define IFHCINMULTICASTPKTS              8
149 #define IFHCINBROADCASTPKTS              9
150 #define IFHCOUTOCTETS                    10
151 #define IFHCOUTUCASTPKTS                 11
152 #define IFHCOUTMULTICASTPKTS             12
153 #define IFHCOUTBROADCASTPKTS             13
154 #define IFLINKUPDOWNTRAPENABLE           14
155 #define IFHIGHSPEED                      15
156 #define IFPROMISCUOUSMODE                16
157 #define IFCONNECTORPRESENT               17
158 #define IFALIAS                          18
159 #define IFCOUNTERDISCONTINUITYTIME       19
160
161 static oid ifXEntry_base[] = {1, 3, 6, 1, 2, 1, 31, 1, 1, 1};
162
163 struct variable ifXEntry_variables[] = {
164     { IFNAME, ASN_OCTET_STR, RONLY, read_ifXEntry_stub, 1, {1} },
165     { IFINMULTICASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {2} },
166     { IFINBROADCASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {3} },
167     { IFOUTMULTICASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {4} },
168     { IFOUTBROADCASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {5} },
169     { IFHCINOCTETS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {6} },
170     { IFHCINUCASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {7} },
171     { IFHCINMULTICASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {8} },
172     { IFHCINBROADCASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {9} },
173     { IFHCOUTOCTETS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {10} },
174     { IFHCOUTUCASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {11} },
175     { IFHCOUTMULTICASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {12} },
176     { IFHCOUTBROADCASTPKTS, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {13} },
177     { IFLINKUPDOWNTRAPENABLE, ASN_INTEGER, RWRITE, read_ifXEntry_stub, 1, {14} },
178     { IFHIGHSPEED, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {15} },
179     { IFPROMISCUOUSMODE, ASN_INTEGER, RWRITE, read_ifXEntry_stub, 1, {16} },
180     { IFCONNECTORPRESENT, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {17} },
181     { IFALIAS, ASN_OCTET_STR, RWRITE, read_ifXEntry_stub, 1, {18} },
182     { IFCOUNTERDISCONTINUITYTIME, ASN_INTEGER, RONLY, read_ifXEntry_stub, 1, {19} },
183 };
184
185 #define IFSTACKSTATUS                    3
186
187 static oid ifStackEntry_base[] = {1, 3, 6, 1, 2, 1, 31, 1, 2, 1};
188
189 struct variable ifStackEntry_variables[] = {
190     { IFSTACKSTATUS, ASN_INTEGER, RWRITE, read_ifStackEntry_stub, 1, {3} },
191 };
192
193 #define IFTESTID                         1
194 #define IFTESTSTATUS                     2
195 #define IFTESTTYPE                       3
196 #define IFTESTRESULT                     4
197 #define IFTESTCODE                       5
198 #define IFTESTOWNER                      6
199
200 static oid ifTestEntry_base[] = {1, 3, 6, 1, 2, 1, 31, 1, 3, 1};
201
202 struct variable ifTestEntry_variables[] = {
203     { IFTESTID, ASN_INTEGER, RWRITE, read_ifTestEntry_stub, 1, {1} },
204     { IFTESTSTATUS, ASN_INTEGER, RWRITE, read_ifTestEntry_stub, 1, {2} },
205     { IFTESTTYPE, ASN_OBJECT_ID, RWRITE, read_ifTestEntry_stub, 1, {3} },
206     { IFTESTRESULT, ASN_INTEGER, RONLY, read_ifTestEntry_stub, 1, {4} },
207     { IFTESTCODE, ASN_OBJECT_ID, RONLY, read_ifTestEntry_stub, 1, {5} },
208     { IFTESTOWNER, ASN_OCTET_STR, RWRITE, read_ifTestEntry_stub, 1, {6} },
209 };
210
211 #define IFRCVADDRESSSTATUS               2
212 #define IFRCVADDRESSTYPE                 3
213
214 static oid ifRcvAddressEntry_base[] = {1, 3, 6, 1, 2, 1, 31, 1, 4, 1};
215
216 struct variable ifRcvAddressEntry_variables[] = {
217     { IFRCVADDRESSSTATUS, ASN_INTEGER, RWRITE, read_ifRcvAddressEntry_stub, 1, {2} },
218     { IFRCVADDRESSTYPE, ASN_INTEGER, RWRITE, read_ifRcvAddressEntry_stub, 1, {3} },
219 };
220
221
222
223 /*
224  * Registration functions for the various MIB groups.
225  */
226
227 int register_interfaces()
228 {
229     return register_mib("interfaces",
230          interfaces_variables,
231          sizeof(struct variable),
232          sizeof(interfaces_variables)/sizeof(struct variable),
233          interfaces_base,
234          sizeof(interfaces_base)/sizeof(oid));
235 };
236
237
238 int register_ifEntry()
239 {
240     return register_mib("ifEntry",
241          ifEntry_variables,
242          sizeof(struct variable),
243          sizeof(ifEntry_variables)/sizeof(struct variable),
244          ifEntry_base,
245          sizeof(ifEntry_base)/sizeof(oid));
246 };
247
248
249 int register_ifMIBObjects()
250 {
251     return register_mib("ifMIBObjects",
252          ifMIBObjects_variables,
253          sizeof(struct variable),
254          sizeof(ifMIBObjects_variables)/sizeof(struct variable),
255          ifMIBObjects_base,
256          sizeof(ifMIBObjects_base)/sizeof(oid));
257 };
258
259
260 int register_ifXEntry()
261 {
262     return register_mib("ifXEntry",
263          ifXEntry_variables,
264          sizeof(struct variable),
265          sizeof(ifXEntry_variables)/sizeof(struct variable),
266          ifXEntry_base,
267          sizeof(ifXEntry_base)/sizeof(oid));
268 };
269
270
271 int register_ifStackEntry()
272 {
273     return register_mib("ifStackEntry",
274          ifStackEntry_variables,
275          sizeof(struct variable),
276          sizeof(ifStackEntry_variables)/sizeof(struct variable),
277          ifStackEntry_base,
278          sizeof(ifStackEntry_base)/sizeof(oid));
279 };
280
281
282 int register_ifTestEntry()
283 {
284     return register_mib("ifTestEntry",
285          ifTestEntry_variables,
286          sizeof(struct variable),
287          sizeof(ifTestEntry_variables)/sizeof(struct variable),
288          ifTestEntry_base,
289          sizeof(ifTestEntry_base)/sizeof(oid));
290 };
291
292
293 int register_ifRcvAddressEntry()
294 {
295     return register_mib("ifRcvAddressEntry",
296          ifRcvAddressEntry_variables,
297          sizeof(struct variable),
298          sizeof(ifRcvAddressEntry_variables)/sizeof(struct variable),
299          ifRcvAddressEntry_base,
300          sizeof(ifRcvAddressEntry_base)/sizeof(oid));
301 };
302
303
304 /*
305  * Read methods for groups of scalars and tables:
306  */
307
308 static unsigned char *
309 read_interfaces_stub(struct variable *vp,
310     oid     *name,
311     size_t  *length,
312     int     exact,
313     size_t  *var_len,
314     WriteMethod **write_method)
315 {
316     static interfaces_t interfaces;
317
318     /* check whether the instance identifier is valid */
319
320     if (header_generic(vp, name, length, exact, var_len,
321                        write_method) == MATCH_FAILED) {
322         return NULL;
323     }
324
325     /* call the user supplied function to retrieve values */
326
327     read_interfaces(&interfaces);
328
329     /* return the current value of the variable */
330
331     switch (vp->magic) {
332
333     case IFNUMBER:
334         return (unsigned char *) &interfaces.ifNumber;
335
336     default:
337          ERROR_MSG("");
338     }
339
340     return NULL;
341 }
342
343 static unsigned char *
344 read_ifEntry_stub(struct variable *vp,
345     oid     *name,
346     size_t  *length,
347     int     exact,
348     size_t  *var_len,
349     WriteMethod **write_method)
350 {
351     static ifEntry_t ifEntry;
352
353     /* call the user supplied function to retrieve values */
354
355     read_ifEntry(&ifEntry);
356
357     /* return the current value of the variable */
358
359     switch (vp->magic) {
360
361     case IFINDEX:
362         return (unsigned char *) &ifEntry.ifIndex;
363
364     case IFDESCR:
365         *var_len = ifEntry._ifDescrLength;
366         return (unsigned char *) ifEntry.ifDescr;
367
368     case IFTYPE:
369         return (unsigned char *) &ifEntry.ifType;
370
371     case IFMTU:
372         return (unsigned char *) &ifEntry.ifMtu;
373
374     case IFSPEED:
375         return (unsigned char *) &ifEntry.ifSpeed;
376
377     case IFPHYSADDRESS:
378         *var_len = ifEntry._ifPhysAddressLength;
379         return (unsigned char *) ifEntry.ifPhysAddress;
380
381     case IFADMINSTATUS:
382         return (unsigned char *) &ifEntry.ifAdminStatus;
383
384     case IFOPERSTATUS:
385         return (unsigned char *) &ifEntry.ifOperStatus;
386
387     case IFLASTCHANGE:
388         return (unsigned char *) &ifEntry.ifLastChange;
389
390     case IFINOCTETS:
391         return (unsigned char *) &ifEntry.ifInOctets;
392
393     case IFINUCASTPKTS:
394         return (unsigned char *) &ifEntry.ifInUcastPkts;
395
396     case IFINNUCASTPKTS:
397         return (unsigned char *) &ifEntry.ifInNUcastPkts;
398
399     case IFINDISCARDS:
400         return (unsigned char *) &ifEntry.ifInDiscards;
401
402     case IFINERRORS:
403         return (unsigned char *) &ifEntry.ifInErrors;
404
405     case IFINUNKNOWNPROTOS:
406         return (unsigned char *) &ifEntry.ifInUnknownProtos;
407
408     case IFOUTOCTETS:
409         return (unsigned char *) &ifEntry.ifOutOctets;
410
411     case IFOUTUCASTPKTS:
412         return (unsigned char *) &ifEntry.ifOutUcastPkts;
413
414     case IFOUTNUCASTPKTS:
415         return (unsigned char *) &ifEntry.ifOutNUcastPkts;
416
417     case IFOUTDISCARDS:
418         return (unsigned char *) &ifEntry.ifOutDiscards;
419
420     case IFOUTERRORS:
421         return (unsigned char *) &ifEntry.ifOutErrors;
422
423     case IFOUTQLEN:
424         return (unsigned char *) &ifEntry.ifOutQLen;
425
426     case IFSPECIFIC:
427         *var_len = ifEntry._ifSpecificLength;
428         return (unsigned char *) ifEntry.ifSpecific;
429
430     default:
431          ERROR_MSG("");
432     }
433
434     return NULL;
435 }
436
437 static unsigned char *
438 read_ifMIBObjects_stub(struct variable *vp,
439     oid     *name,
440     size_t  *length,
441     int     exact,
442     size_t  *var_len,
443     WriteMethod **write_method)
444 {
445     static ifMIBObjects_t ifMIBObjects;
446
447     /* call the user supplied function to retrieve values */
448
449     read_ifMIBObjects(&ifMIBObjects);
450
451     /* return the current value of the variable */
452
453     switch (vp->magic) {
454
455     case IFTABLELASTCHANGE:
456         return (unsigned char *) &ifMIBObjects.ifTableLastChange;
457
458     case IFSTACKLASTCHANGE:
459         return (unsigned char *) &ifMIBObjects.ifStackLastChange;
460
461     default:
462          ERROR_MSG("");
463     }
464
465     return NULL;
466 }
467
468 static unsigned char *
469 read_ifXEntry_stub(struct variable *vp,
470     oid     *name,
471     size_t  *length,
472     int     exact,
473     size_t  *var_len,
474     WriteMethod **write_method)
475 {
476     static ifXEntry_t ifXEntry;
477
478     /* call the user supplied function to retrieve values */
479
480     read_ifXEntry(&ifXEntry);
481
482     /* return the current value of the variable */
483
484     switch (vp->magic) {
485
486     case IFNAME:
487         *var_len = ifXEntry._ifNameLength;
488         return (unsigned char *) ifXEntry.ifName;
489
490     case IFINMULTICASTPKTS:
491         return (unsigned char *) &ifXEntry.ifInMulticastPkts;
492
493     case IFINBROADCASTPKTS:
494         return (unsigned char *) &ifXEntry.ifInBroadcastPkts;
495
496     case IFOUTMULTICASTPKTS:
497         return (unsigned char *) &ifXEntry.ifOutMulticastPkts;
498
499     case IFOUTBROADCASTPKTS:
500         return (unsigned char *) &ifXEntry.ifOutBroadcastPkts;
501
502     case IFHCINOCTETS:
503         /* add code to return the value here */
504
505     case IFHCINUCASTPKTS:
506         /* add code to return the value here */
507
508     case IFHCINMULTICASTPKTS:
509         /* add code to return the value here */
510
511     case IFHCINBROADCASTPKTS:
512         /* add code to return the value here */
513
514     case IFHCOUTOCTETS:
515         /* add code to return the value here */
516
517     case IFHCOUTUCASTPKTS:
518         /* add code to return the value here */
519
520     case IFHCOUTMULTICASTPKTS:
521         /* add code to return the value here */
522
523     case IFHCOUTBROADCASTPKTS:
524         /* add code to return the value here */
525
526     case IFLINKUPDOWNTRAPENABLE:
527         return (unsigned char *) &ifXEntry.ifLinkUpDownTrapEnable;
528
529     case IFHIGHSPEED:
530         return (unsigned char *) &ifXEntry.ifHighSpeed;
531
532     case IFPROMISCUOUSMODE:
533         return (unsigned char *) &ifXEntry.ifPromiscuousMode;
534
535     case IFCONNECTORPRESENT:
536         return (unsigned char *) &ifXEntry.ifConnectorPresent;
537
538     case IFALIAS:
539         *var_len = ifXEntry._ifAliasLength;
540         return (unsigned char *) ifXEntry.ifAlias;
541
542     case IFCOUNTERDISCONTINUITYTIME:
543         return (unsigned char *) &ifXEntry.ifCounterDiscontinuityTime;
544
545     default:
546          ERROR_MSG("");
547     }
548
549     return NULL;
550 }
551
552 static unsigned char *
553 read_ifStackEntry_stub(struct variable *vp,
554     oid     *name,
555     size_t  *length,
556     int     exact,
557     size_t  *var_len,
558     WriteMethod **write_method)
559 {
560     static ifStackEntry_t ifStackEntry;
561
562     /* call the user supplied function to retrieve values */
563
564     read_ifStackEntry(&ifStackEntry);
565
566     /* return the current value of the variable */
567
568     switch (vp->magic) {
569
570     case IFSTACKSTATUS:
571         return (unsigned char *) &ifStackEntry.ifStackStatus;
572
573     default:
574          ERROR_MSG("");
575     }
576
577     return NULL;
578 }
579
580 static unsigned char *
581 read_ifTestEntry_stub(struct variable *vp,
582     oid     *name,
583     size_t  *length,
584     int     exact,
585     size_t  *var_len,
586     WriteMethod **write_method)
587 {
588     static ifTestEntry_t ifTestEntry;
589
590     /* call the user supplied function to retrieve values */
591
592     read_ifTestEntry(&ifTestEntry);
593
594     /* return the current value of the variable */
595
596     switch (vp->magic) {
597
598     case IFTESTID:
599         return (unsigned char *) &ifTestEntry.ifTestId;
600
601     case IFTESTSTATUS:
602         return (unsigned char *) &ifTestEntry.ifTestStatus;
603
604     case IFTESTTYPE:
605         *var_len = ifTestEntry._ifTestTypeLength;
606         return (unsigned char *) ifTestEntry.ifTestType;
607
608     case IFTESTRESULT:
609         return (unsigned char *) &ifTestEntry.ifTestResult;
610
611     case IFTESTCODE:
612         *var_len = ifTestEntry._ifTestCodeLength;
613         return (unsigned char *) ifTestEntry.ifTestCode;
614
615     case IFTESTOWNER:
616         *var_len = ifTestEntry._ifTestOwnerLength;
617         return (unsigned char *) ifTestEntry.ifTestOwner;
618
619     default:
620          ERROR_MSG("");
621     }
622
623     return NULL;
624 }
625
626 static unsigned char *
627 read_ifRcvAddressEntry_stub(struct variable *vp,
628     oid     *name,
629     size_t  *length,
630     int     exact,
631     size_t  *var_len,
632     WriteMethod **write_method)
633 {
634     static ifRcvAddressEntry_t ifRcvAddressEntry;
635
636     /* call the user supplied function to retrieve values */
637
638     read_ifRcvAddressEntry(&ifRcvAddressEntry);
639
640     /* return the current value of the variable */
641
642     switch (vp->magic) {
643
644     case IFRCVADDRESSSTATUS:
645         return (unsigned char *) &ifRcvAddressEntry.ifRcvAddressStatus;
646
647     case IFRCVADDRESSTYPE:
648         return (unsigned char *) &ifRcvAddressEntry.ifRcvAddressType;
649
650     default:
651          ERROR_MSG("");
652     }
653
654     return NULL;
655 }
656
657
658 /*
659  * Forward declaration of write methods for writable objects:
660  */
661
662 static int
663 write_ifAdminStatus_stub(int action,
664     u_char   *var_val,
665     u_char   var_val_type,
666     int      var_val_len,
667     u_char   *statP,
668     oid      *name,
669     int      name_len)
670 {
671     return SNMP_ERR_NOERROR;
672 }
673
674 static int
675 write_ifLinkUpDownTrapEnable_stub(int action,
676     u_char   *var_val,
677     u_char   var_val_type,
678     int      var_val_len,
679     u_char   *statP,
680     oid      *name,
681     int      name_len)
682 {
683     return SNMP_ERR_NOERROR;
684 }
685
686 static int
687 write_ifPromiscuousMode_stub(int action,
688     u_char   *var_val,
689     u_char   var_val_type,
690     int      var_val_len,
691     u_char   *statP,
692     oid      *name,
693     int      name_len)
694 {
695     return SNMP_ERR_NOERROR;
696 }
697
698 static int
699 write_ifAlias_stub(int action,
700     u_char   *var_val,
701     u_char   var_val_type,
702     int      var_val_len,
703     u_char   *statP,
704     oid      *name,
705     int      name_len)
706 {
707     return SNMP_ERR_NOERROR;
708 }
709
710 static int
711 write_ifStackStatus_stub(int action,
712     u_char   *var_val,
713     u_char   var_val_type,
714     int      var_val_len,
715     u_char   *statP,
716     oid      *name,
717     int      name_len)
718 {
719     return SNMP_ERR_NOERROR;
720 }
721
722 static int
723 write_ifTestId_stub(int action,
724     u_char   *var_val,
725     u_char   var_val_type,
726     int      var_val_len,
727     u_char   *statP,
728     oid      *name,
729     int      name_len)
730 {
731     return SNMP_ERR_NOERROR;
732 }
733
734 static int
735 write_ifTestStatus_stub(int action,
736     u_char   *var_val,
737     u_char   var_val_type,
738     int      var_val_len,
739     u_char   *statP,
740     oid      *name,
741     int      name_len)
742 {
743     return SNMP_ERR_NOERROR;
744 }
745
746 static int
747 write_ifTestType_stub(int action,
748     u_char   *var_val,
749     u_char   var_val_type,
750     int      var_val_len,
751     u_char   *statP,
752     oid      *name,
753     int      name_len)
754 {
755     return SNMP_ERR_NOERROR;
756 }
757
758 static int
759 write_ifTestOwner_stub(int action,
760     u_char   *var_val,
761     u_char   var_val_type,
762     int      var_val_len,
763     u_char   *statP,
764     oid      *name,
765     int      name_len)
766 {
767     return SNMP_ERR_NOERROR;
768 }
769
770 static int
771 write_ifRcvAddressStatus_stub(int action,
772     u_char   *var_val,
773     u_char   var_val_type,
774     int      var_val_len,
775     u_char   *statP,
776     oid      *name,
777     int      name_len)
778 {
779     return SNMP_ERR_NOERROR;
780 }
781
782 static int
783 write_ifRcvAddressType_stub(int action,
784     u_char   *var_val,
785     u_char   var_val_type,
786     int      var_val_len,
787     u_char   *statP,
788     oid      *name,
789     int      name_len)
790 {
791     return SNMP_ERR_NOERROR;
792 }
793
794