dear sir,

I got your point. thanks for the clear analysis!

victor

> > thanks for the helpful reply.
> > This is what i use, i think you use a short form for
> > netsnmp_register_table_data_set(......)???  Right?
> 
> netsnmp_register_table_data_set() takes three parameters:
>    - netsnmp_handler_registration*
>    - netsnmp_table_data_set*
>    - netsnmp_table_registration_info*   (optional)
> 
> I've got into the habit of creating these structures,
> and passing them to the register call using separate
> statements - it made it easier to document.
> 
> The netsnmp_handler_registration* parameter handling
> wasn't relevant to the question you were asking, so
> I omitted it.  The fuller code would be something like:
> 
> > >    netsnmp_handler_registration *reg =
> > >        netsnmp_create_handler_registration(
> > >              "dtApInstWaveTable",
> > >              dtAIWT_handler,
> > >              dtAIWT_oid, OID_LENGTH(dtAIWT_oid),
> > >              HANDLER_CAN_RWRITE);
> > >    netsnmp_table_data_set *ds =
> > >        netsnmp_create_table_data_set( "dtApInstWaveTable" );
> > > +  ds->allow_creation = 1;
> > >    netsnmp_register_table_data_set( reg, dsinfo, NULL );
> 
> Your code just creates the netsnmp_handler_registration*
> parameter within the same statement as registering it.
> The effect is exactly the same  (apart from the error in
> your final parameter!)
> 
> That'd probably be clearer if your code was indented a bit
> more sensibly:
> 
> >     netsnmp_table_data_set *ds =
> >             netsnmp_create_table_data_set( "dtApInstWaveTable" );
> >     ds->allow_creation = 1;
> >     netsnmp_register_table_data_set(
> >         netsnmp_create_handler_registration(     // start
> >             "dtApInstWaveTable",
> >             table_handler,
> >             oid,
> >             oid_length,
> >             HANDLER_CAN_REWRITE),                // end
> >         ds, NULL);
> 
> Compare the code within the two lines marked, with the
> equivalent code above.
>    I'm also not convinced that using a (somewhat vague) variable
> name that matches a Net-SNMP type name is particularly sensible.
> But it's your code.
> 
> Dave
> 
> 



-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to