and added files
[bcm963xx.git] / userapps / opensource / net-snmp / agent / mibgroup / notification / snmpNotifyFilterProfileTable.c
1 #ifdef BRCM_SNMP_MIB_SUPPORT
2 /*
3  * This file was generated by mib2c and is intended for use as
4  * a mib module for the ucd-snmp snmpd agent. 
5  */
6
7
8 /*
9  * This should always be included first before anything else 
10  */
11 #include <net-snmp/net-snmp-config.h>
12
13 #include <sys/types.h>
14 #if HAVE_WINSOCK_H
15 #include <winsock.h>
16 #endif
17 #if HAVE_STDLIB_H
18 #include <stdlib.h>
19 #endif
20 #if HAVE_STRING_H
21 #include <string.h>
22 #else
23 #include <strings.h>
24 #endif
25
26
27 /*
28  * minimal include directives 
29  */
30 #include <net-snmp/net-snmp-includes.h>
31 #include <net-snmp/agent/net-snmp-agent-includes.h>
32
33 #include "header_complex.h"
34 #include "snmpNotifyFilterProfileTable.h"
35
36
37 /*
38  * snmpNotifyFilterProfileTable_variables_oid:
39  *   this is the top level oid that we want to register under.  This
40  *   is essentially a prefix, with the suffix appearing in the
41  *   variable below.
42  */
43
44
45 oid             snmpNotifyFilterProfileTable_variables_oid[] =
46     { 1, 3, 6, 1, 6, 3, 13, 1, 2 };
47
48
49 /*
50  * variable2 snmpNotifyFilterProfileTable_variables:
51  *   this variable defines function callbacks and type return information 
52  *   for the snmpNotifyFilterProfileTable mib section 
53  */
54
55
56 struct variable2 snmpNotifyFilterProfileTable_variables[] = {
57     /*
58      * magic number        , variable type , ro/rw , callback fn  , L, oidsuffix 
59      */
60 #define   SNMPNOTIFYFILTERPROFILENAME  3
61     {SNMPNOTIFYFILTERPROFILENAME, ASN_OCTET_STR, RWRITE,
62      var_snmpNotifyFilterProfileTable, 2, {1, 1}},
63 #define   SNMPNOTIFYFILTERPROFILESTORTYPE  4
64     {SNMPNOTIFYFILTERPROFILESTORTYPE, ASN_INTEGER, RWRITE,
65      var_snmpNotifyFilterProfileTable, 2, {1, 2}},
66 #define   SNMPNOTIFYFILTERPROFILEROWSTATUS  5
67     {SNMPNOTIFYFILTERPROFILEROWSTATUS, ASN_INTEGER, RWRITE,
68      var_snmpNotifyFilterProfileTable, 2, {1, 3}},
69
70 };
71 /*
72  * (L = length of the oidsuffix) 
73  */
74
75
76 /*
77  * global storage of our data, saved in and configured by header_complex() 
78  */
79 static struct header_complex_index *snmpNotifyFilterProfileTableStorage =
80     NULL;
81
82
83
84
85 /*
86  * init_snmpNotifyFilterProfileTable():
87  *   Initialization routine.  This is called when the agent starts up.
88  *   At a minimum, registration of your variables should take place here.
89  */
90 void
91 init_snmpNotifyFilterProfileTable(void)
92 {
93     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "initializing...  "));
94
95
96     /*
97      * register ourselves with the agent to handle our mib tree 
98      */
99     REGISTER_MIB("snmpNotifyFilterProfileTable",
100                  snmpNotifyFilterProfileTable_variables, variable2,
101                  snmpNotifyFilterProfileTable_variables_oid);
102
103
104     /*
105      * register our config handler(s) to deal with registrations 
106      */
107     snmpd_register_config_handler("snmpNotifyFilterProfileTable",
108                                   parse_snmpNotifyFilterProfileTable, NULL,
109                                   NULL);
110
111
112
113
114     /*
115      * we need to be called back later to store our data 
116      */
117     snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
118                            store_snmpNotifyFilterProfileTable, NULL);
119
120
121     /*
122      * place any other initialization junk you need here 
123      */
124
125
126     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
127 }
128
129
130 /*
131  * snmpNotifyFilterProfileTable_add(): adds a structure node to our data set 
132  */
133 int
134 snmpNotifyFilterProfileTable_add(struct snmpNotifyFilterProfileTable_data
135                                  *thedata)
136 {
137     netsnmp_variable_list *vars = NULL;
138
139
140     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "adding data...  "));
141     /*
142      * add the index variables to the varbind list, which is 
143      * used by header_complex to index the data 
144      */
145
146     snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR,
147                               (u_char *) thedata->snmpTargetParamsName,
148                               thedata->snmpTargetParamsNameLen);
149
150     header_complex_add_data(&snmpNotifyFilterProfileTableStorage, vars,
151                             thedata);
152     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "registered an entry\n"));
153
154
155     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
156     return SNMPERR_SUCCESS;
157 }
158
159
160 /*
161  * parse_snmpNotifyFilterProfileTable():
162  *   parses .conf file entries needed to configure the mib.
163  */
164 void
165 parse_snmpNotifyFilterProfileTable(const char *token, char *line)
166 {
167     size_t          tmpint;
168     struct snmpNotifyFilterProfileTable_data *StorageTmp =
169         SNMP_MALLOC_STRUCT(snmpNotifyFilterProfileTable_data);
170
171     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "parsing config...  "));
172
173     if (StorageTmp == NULL) {
174         config_perror("malloc failure");
175         return;
176     }
177
178     line =
179         read_config_read_data(ASN_OCTET_STR, line,
180                               &StorageTmp->snmpTargetParamsName,
181                               &StorageTmp->snmpTargetParamsNameLen);
182     if (StorageTmp->snmpTargetParamsName == NULL) {
183         config_perror("invalid specification for snmpTargetParamsName");
184         return;
185     }
186
187     line =
188         read_config_read_data(ASN_OCTET_STR, line,
189                               &StorageTmp->snmpNotifyFilterProfileName,
190                               &StorageTmp->snmpNotifyFilterProfileNameLen);
191
192     line =
193         read_config_read_data(ASN_INTEGER, line,
194                               &StorageTmp->snmpNotifyFilterProfileStorType,
195                               &tmpint);
196
197     line =
198         read_config_read_data(ASN_INTEGER, line,
199                               &StorageTmp->
200                               snmpNotifyFilterProfileRowStatus, &tmpint);
201
202     snmpNotifyFilterProfileTable_add(StorageTmp);
203
204     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
205 }
206
207
208
209
210 /*
211  * store_snmpNotifyFilterProfileTable():
212  *   stores .conf file entries needed to configure the mib.
213  */
214 int
215 store_snmpNotifyFilterProfileTable(int majorID, int minorID,
216                                    void *serverarg, void *clientarg)
217 {
218     char            line[SNMP_MAXBUF];
219     char           *cptr;
220     size_t          tmpint;
221     struct snmpNotifyFilterProfileTable_data *StorageTmp;
222     struct header_complex_index *hcindex;
223
224
225     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "storing data...  "));
226
227     for (hcindex = snmpNotifyFilterProfileTableStorage; hcindex != NULL;
228          hcindex = hcindex->next) {
229         StorageTmp =
230             (struct snmpNotifyFilterProfileTable_data *) hcindex->data;
231
232         if (StorageTmp->snmpNotifyFilterProfileStorType == ST_NONVOLATILE) {
233
234             memset(line, 0, sizeof(line));
235             strcat(line, "snmpNotifyFilterProfileTable ");
236             cptr = line + strlen(line);
237
238             cptr =
239                 read_config_store_data(ASN_OCTET_STR, cptr,
240                                        &StorageTmp->snmpTargetParamsName,
241                                        &StorageTmp->
242                                        snmpTargetParamsNameLen);
243             cptr =
244                 read_config_store_data(ASN_OCTET_STR, cptr,
245                                        &StorageTmp->
246                                        snmpNotifyFilterProfileName,
247                                        &StorageTmp->
248                                        snmpNotifyFilterProfileNameLen);
249             cptr =
250                 read_config_store_data(ASN_INTEGER, cptr,
251                                        &StorageTmp->
252                                        snmpNotifyFilterProfileStorType,
253                                        &tmpint);
254             cptr =
255                 read_config_store_data(ASN_INTEGER, cptr,
256                                        &StorageTmp->
257                                        snmpNotifyFilterProfileRowStatus,
258                                        &tmpint);
259
260             snmpd_store_config(line);
261         }
262     }
263     DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
264     return 0;
265 }
266
267
268
269
270 /*
271  * var_snmpNotifyFilterProfileTable():
272  *   Handle this table separately from the scalar value case.
273  *   The workings of this are basically the same as for var_snmpNotifyFilterProfileTable above.
274  */
275 unsigned char  *
276 var_snmpNotifyFilterProfileTable(struct variable *vp,
277                                  oid * name,
278                                  size_t * length,
279                                  int exact,
280                                  size_t * var_len,
281                                  WriteMethod ** write_method)
282 {
283
284
285     struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
286
287
288     DEBUGMSGTL(("snmpNotifyFilterProfileTable",
289                 "var_snmpNotifyFilterProfileTable: Entering...  \n"));
290     /*
291      * this assumes you have registered all your data properly
292      */
293     if ((StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
294          header_complex((struct header_complex_index *)
295                         snmpNotifyFilterProfileTableStorage, vp, name,
296                         length, exact, var_len, write_method)) == NULL) {
297         if (vp->magic == SNMPNOTIFYFILTERPROFILEROWSTATUS)
298             *write_method = write_snmpNotifyFilterProfileRowStatus;
299         return NULL;
300     }
301
302     /*
303      * this is where we do the value assignments for the mib results.
304      */
305     switch (vp->magic) {
306
307     case SNMPNOTIFYFILTERPROFILENAME:
308         *write_method = write_snmpNotifyFilterProfileName;
309         *var_len = StorageTmp->snmpNotifyFilterProfileNameLen;
310         return (u_char *) StorageTmp->snmpNotifyFilterProfileName;
311
312     case SNMPNOTIFYFILTERPROFILESTORTYPE:
313         *write_method = write_snmpNotifyFilterProfileStorType;
314         *var_len = sizeof(StorageTmp->snmpNotifyFilterProfileStorType);
315         return (u_char *) & StorageTmp->snmpNotifyFilterProfileStorType;
316
317     case SNMPNOTIFYFILTERPROFILEROWSTATUS:
318         *write_method = write_snmpNotifyFilterProfileRowStatus;
319         *var_len = sizeof(StorageTmp->snmpNotifyFilterProfileRowStatus);
320         return (u_char *) & StorageTmp->snmpNotifyFilterProfileRowStatus;
321
322
323     default:
324         ERROR_MSG("");
325     }
326     return NULL;
327 }
328
329
330
331
332 int
333 write_snmpNotifyFilterProfileName(int action,
334                                   u_char * var_val,
335                                   u_char var_val_type,
336                                   size_t var_val_len,
337                                   u_char * statP,
338                                   oid * name, size_t name_len)
339 {
340     static char    *tmpvar;
341     struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
342     static size_t   tmplen;
343     size_t          newlen =
344         name_len -
345         (sizeof(snmpNotifyFilterProfileTable_variables_oid) / sizeof(oid) +
346          3 - 1);
347
348
349     DEBUGMSGTL(("snmpNotifyFilterProfileTable",
350                 "write_snmpNotifyFilterProfileName entering action=%d...  \n",
351                 action));
352     if ((StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
353          header_complex((struct header_complex_index *)
354                         snmpNotifyFilterProfileTableStorage, NULL,
355                         &name[sizeof
356                               (snmpNotifyFilterProfileTable_variables_oid)
357                               / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
358                         NULL)) == NULL)
359         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
360
361
362     switch (action) {
363     case RESERVE1:
364         if (var_val_type != ASN_OCTET_STR) {
365             fprintf(stderr,
366                     "write to snmpNotifyFilterProfileName not ASN_OCTET_STR\n");
367             return SNMP_ERR_WRONGTYPE;
368         }
369         break;
370
371
372     case RESERVE2:
373         /*
374          * memory reseveration, final preparation... 
375          */
376         break;
377
378
379     case FREE:
380         /*
381          * Release any resources that have been allocated 
382          */
383         break;
384
385
386     case ACTION:
387         /*
388          * The variable has been stored in string for
389          * you to use, and you have just been asked to do something with
390          * it.  Note that anything done here must be reversable in the UNDO case 
391          */
392         tmpvar = StorageTmp->snmpNotifyFilterProfileName;
393         tmplen = StorageTmp->snmpNotifyFilterProfileNameLen;
394         memdup((u_char **) & StorageTmp->snmpNotifyFilterProfileName,
395                var_val, var_val_len);
396         StorageTmp->snmpNotifyFilterProfileNameLen = var_val_len;
397         break;
398
399
400     case UNDO:
401         /*
402          * Back out any changes made in the ACTION case 
403          */
404         SNMP_FREE(StorageTmp->snmpNotifyFilterProfileName);
405         StorageTmp->snmpNotifyFilterProfileName = tmpvar;
406         StorageTmp->snmpNotifyFilterProfileNameLen = tmplen;
407         break;
408
409
410     case COMMIT:
411         /*
412          * Things are working well, so it's now safe to make the change
413          * permanently.  Make sure that anything done here can't fail! 
414          */
415         SNMP_FREE(tmpvar);
416         break;
417     }
418     return SNMP_ERR_NOERROR;
419 }
420
421
422
423 int
424 write_snmpNotifyFilterProfileStorType(int action,
425                                       u_char * var_val,
426                                       u_char var_val_type,
427                                       size_t var_val_len,
428                                       u_char * statP,
429                                       oid * name, size_t name_len)
430 {
431     static int      tmpvar;
432     struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
433     size_t          newlen =
434         name_len -
435         (sizeof(snmpNotifyFilterProfileTable_variables_oid) / sizeof(oid) +
436          3 - 1);
437
438
439     DEBUGMSGTL(("snmpNotifyFilterProfileTable",
440                 "write_snmpNotifyFilterProfileStorType entering action=%d...  \n",
441                 action));
442     if ((StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
443          header_complex((struct header_complex_index *)
444                         snmpNotifyFilterProfileTableStorage, NULL,
445                         &name[sizeof
446                               (snmpNotifyFilterProfileTable_variables_oid)
447                               / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
448                         NULL)) == NULL)
449         return SNMP_ERR_NOSUCHNAME;     /* remove if you support creation here */
450
451
452     switch (action) {
453     case RESERVE1:
454         if (var_val_type != ASN_INTEGER) {
455             fprintf(stderr,
456                     "write to snmpNotifyFilterProfileStorType not ASN_INTEGER\n");
457             return SNMP_ERR_WRONGTYPE;
458         }
459         break;
460
461
462     case RESERVE2:
463         /*
464          * memory reseveration, final preparation... 
465          */
466         break;
467
468
469     case FREE:
470         /*
471          * Release any resources that have been allocated 
472          */
473         break;
474
475
476     case ACTION:
477         /*
478          * The variable has been stored in long_ret for
479          * you to use, and you have just been asked to do something with
480          * it.  Note that anything done here must be reversable in the UNDO case 
481          */
482         tmpvar = StorageTmp->snmpNotifyFilterProfileStorType;
483         StorageTmp->snmpNotifyFilterProfileStorType = *((long *) var_val);
484         break;
485
486
487     case UNDO:
488         /*
489          * Back out any changes made in the ACTION case 
490          */
491         StorageTmp->snmpNotifyFilterProfileStorType = tmpvar;
492         break;
493
494
495     case COMMIT:
496         /*
497          * Things are working well, so it's now safe to make the change
498          * permanently.  Make sure that anything done here can't fail! 
499          */
500
501         break;
502     }
503     return SNMP_ERR_NOERROR;
504 }
505
506
507
508
509
510
511 int
512 write_snmpNotifyFilterProfileRowStatus(int action,
513                                        u_char * var_val,
514                                        u_char var_val_type,
515                                        size_t var_val_len,
516                                        u_char * statP,
517                                        oid * name, size_t name_len)
518 {
519     struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
520     static struct snmpNotifyFilterProfileTable_data *StorageNew,
521         *StorageDel;
522     size_t          newlen =
523         name_len -
524         (sizeof(snmpNotifyFilterProfileTable_variables_oid) / sizeof(oid) +
525          3 - 1);
526     static int      old_value;
527     int             set_value;
528     netsnmp_variable_list *vars;
529     struct header_complex_index *hciptr;
530
531
532     StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
533         header_complex((struct header_complex_index *)
534                        snmpNotifyFilterProfileTableStorage, NULL,
535                        &name[sizeof
536                              (snmpNotifyFilterProfileTable_variables_oid) /
537                              sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
538
539
540
541
542     if (var_val_type != ASN_INTEGER || var_val == NULL) {
543         fprintf(stderr,
544                 "write to snmpNotifyFilterProfileRowStatus not ASN_INTEGER\n");
545         return SNMP_ERR_WRONGTYPE;
546     }
547     set_value = *((long *) var_val);
548
549
550     /*
551      * check legal range, and notReady is reserved for us, not a user 
552      */
553     if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
554         return SNMP_ERR_INCONSISTENTVALUE;
555
556
557     switch (action) {
558     case RESERVE1:
559         /*
560          * stage one: test validity 
561          */
562         if (StorageTmp == NULL) {
563             /*
564              * create the row now? 
565              */
566
567
568             /*
569              * ditch illegal values now 
570              */
571             if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE)
572                 return SNMP_ERR_INCONSISTENTVALUE;
573
574         } else {
575             /*
576              * row exists.  Check for a valid state change 
577              */
578             if (set_value == RS_CREATEANDGO
579                 || set_value == RS_CREATEANDWAIT) {
580                 /*
581                  * can't create a row that exists 
582                  */
583                 return SNMP_ERR_INCONSISTENTVALUE;
584             }
585             /*
586              * XXX: interaction with row storage type needed 
587              */
588         }
589         break;
590
591
592
593
594     case RESERVE2:
595         /*
596          * memory reseveration, final preparation... 
597          */
598         if (StorageTmp == NULL &&
599             (set_value == RS_CREATEANDGO
600              || set_value == RS_CREATEANDWAIT)) {
601             /*
602              * creation 
603              */
604             vars = NULL;
605
606             snmp_varlist_add_variable(&vars, NULL, 0,
607                                       ASN_PRIV_IMPLIED_OCTET_STR, NULL, 0);
608
609             if (header_complex_parse_oid
610                 (&
611                  (name
612                   [sizeof(snmpNotifyFilterProfileTable_variables_oid) /
613                    sizeof(oid) + 2]), newlen, vars) != SNMPERR_SUCCESS) {
614                 snmp_free_var(vars);
615                 return SNMP_ERR_INCONSISTENTNAME;
616             }
617
618             StorageNew =
619                 SNMP_MALLOC_STRUCT(snmpNotifyFilterProfileTable_data);
620             memdup((u_char **) & (StorageNew->snmpTargetParamsName),
621                    vars->val.string, vars->val_len);
622             StorageNew->snmpTargetParamsNameLen = vars->val_len;
623             StorageNew->snmpNotifyFilterProfileStorType = ST_NONVOLATILE;
624
625             StorageNew->snmpNotifyFilterProfileRowStatus = set_value;
626             snmp_free_var(vars);
627         }
628
629
630         break;
631
632
633
634
635     case FREE:
636         /*
637          * XXX: free, zero vars 
638          */
639         /*
640          * Release any resources that have been allocated 
641          */
642         break;
643
644
645
646
647     case ACTION:
648         /*
649          * The variable has been stored in set_value for you to
650          * use, and you have just been asked to do something with
651          * it.  Note that anything done here must be reversable in
652          * the UNDO case 
653          */
654
655
656         if (StorageTmp == NULL &&
657             (set_value == RS_CREATEANDGO ||
658              set_value == RS_CREATEANDWAIT)) {
659             /*
660              * row creation, so add it 
661              */
662             if (StorageNew != NULL)
663                 snmpNotifyFilterProfileTable_add(StorageNew);
664             /*
665              * XXX: ack, and if it is NULL? 
666              */
667         } else if (set_value != RS_DESTROY) {
668             /*
669              * set the flag? 
670              */
671             old_value = StorageTmp->snmpNotifyFilterProfileRowStatus;
672             StorageTmp->snmpNotifyFilterProfileRowStatus =
673                 *((long *) var_val);
674         } else {
675             /*
676              * destroy...  extract it for now 
677              */
678             if (StorageTmp) {
679                 hciptr =
680                     header_complex_find_entry
681                     (snmpNotifyFilterProfileTableStorage, StorageTmp);
682                 StorageDel = (struct snmpNotifyFilterProfileTable_data *)
683                     header_complex_extract_entry((struct
684                                                   header_complex_index **)
685                                                  &snmpNotifyFilterProfileTableStorage,
686                                                  hciptr);
687             }
688
689         }
690         break;
691
692
693
694
695     case UNDO:
696         /*
697          * Back out any changes made in the ACTION case 
698          */
699         if (StorageTmp == NULL &&
700             (set_value == RS_CREATEANDGO ||
701              set_value == RS_CREATEANDWAIT)) {
702             /*
703              * row creation, so remove it again 
704              */
705             hciptr =
706                 header_complex_find_entry
707                 (snmpNotifyFilterProfileTableStorage, StorageNew);
708             StorageDel = (struct snmpNotifyFilterProfileTable_data *)
709                 header_complex_extract_entry((struct header_complex_index
710                                               **)
711                                              &snmpNotifyFilterProfileTableStorage,
712                                              hciptr);
713             /*
714              * XXX: free it 
715              */
716         } else if (StorageDel != NULL) {
717             /*
718              * row deletion, so add it again 
719              */
720             snmpNotifyFilterProfileTable_add(StorageDel);
721             StorageDel = NULL;
722         } else if (set_value != RS_DESTROY) {
723             StorageTmp->snmpNotifyFilterProfileRowStatus = old_value;
724         }
725         break;
726
727
728
729
730     case COMMIT:
731         /*
732          * Things are working well, so it's now safe to make the change
733          * permanently.  Make sure that anything done here can't fail! 
734          */
735         if (StorageDel != NULL) {
736             StorageDel = NULL;
737             /*
738              * XXX: free it, its dead 
739              */
740         }
741         if (StorageTmp
742             && StorageTmp->snmpNotifyFilterProfileRowStatus ==
743             RS_CREATEANDGO) {
744             StorageTmp->snmpNotifyFilterProfileRowStatus = RS_ACTIVE;
745         } else if (StorageTmp &&
746                    StorageTmp->snmpNotifyFilterProfileRowStatus ==
747                    RS_CREATEANDWAIT) {
748             StorageTmp->snmpNotifyFilterProfileRowStatus = RS_NOTINSERVICE;
749         }
750         break;
751     }
752     return SNMP_ERR_NOERROR;
753 }
754
755
756
757 char           *
758 get_FilterName(char *targetName, size_t targetName_len,
759                size_t * profileName_len)
760 {
761     netsnmp_variable_list *vars = NULL;
762     struct snmpNotifyFilterProfileTable_data *data;
763
764     /*
765      * put requested info into var structure 
766      */
767     snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR,
768                               (u_char *) targetName, targetName_len);
769
770     /*
771      * get the data from the header_complex storage 
772      */
773     data = (struct snmpNotifyFilterProfileTable_data *)
774         header_complex_get(snmpNotifyFilterProfileTableStorage, vars);
775
776     /*
777      * free search index 
778      */
779     snmp_free_var(vars);
780
781     /*
782      * return the requested information (if this row is active) 
783      */
784     if (data && data->snmpNotifyFilterProfileRowStatus == RS_ACTIVE) {
785         *profileName_len = data->snmpNotifyFilterProfileNameLen;
786         return data->snmpNotifyFilterProfileName;
787     }
788
789     *profileName_len = 0;
790     return NULL;
791 }
792
793 #endif /* BRCM_SNMP_MIB_SUPPORT */