Implementing tables with fewer source files - SNMP

This is a discussion on Implementing tables with fewer source files - SNMP ; I'm writing an agent, and found that mib2c using the mib for dummies config makes about 12 source files for each table I implement. I modify a few lines of the autogenerated code, and add it to my makefile. I'd ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Implementing tables with fewer source files

  1. Implementing tables with fewer source files

    I'm writing an agent, and found that mib2c using the mib for dummies
    config makes about 12 source files for each table I implement. I
    modify a few lines of the autogenerated code, and add it to my
    makefile. I'd really like to make my agent somewhat smaller (i.e. less
    code) -- can I do that? I realize it might not be particularly simple,
    and I can live with having to do some reading, but I'd like pointers.
    Thanks in advance.

    - eggyknap

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    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/...net-snmp-users


  2. Re: Implementing tables with fewer source files

    >>>>> On Fri, 29 Aug 2008 13:47:25 -0600, eggyknap said:

    e> I'm writing an agent, and found that mib2c using the mib for dummies
    e> config makes about 12 source files for each table I implement. I
    e> modify a few lines of the autogenerated code, and add it to my
    e> makefile. I'd really like to make my agent somewhat smaller (i.e. less
    e> code) -- can I do that? I realize it might not be particularly simple,
    e> and I can live with having to do some reading, but I'd like pointers.
    e> Thanks in advance.

    You might check out some of the other output styles of mib2c. The
    iterator mechanisms, for instance, probably produce the smallest amount
    of code. The MFD stuff produces a lot of extra comments and
    compartmentalized functions for you to fill in, which makes the code
    "look" larger.
    --
    Wes Hardaker
    Sparta, Inc.

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    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/...net-snmp-users


  3. Re: Implementing tables with fewer source files

    On Tue, Sep 2, 2008 at 5:39 PM, Wes Hardaker
    wrote:
    >>>>>> On Fri, 29 Aug 2008 13:47:25 -0600, eggyknap said:

    >
    > e> I'm writing an agent, and found that mib2c using the mib for dummies
    > e> config makes about 12 source files for each table I implement. I
    > e> modify a few lines of the autogenerated code, and add it to my
    > e> makefile. I'd really like to make my agent somewhat smaller (i.e. less
    > e> code) -- can I do that? I realize it might not be particularly simple,
    > e> and I can live with having to do some reading, but I'd like pointers.
    > e> Thanks in advance.
    >
    > You might check out some of the other output styles of mib2c. The
    > iterator mechanisms, for instance, probably produce the smallest amount
    > of code. The MFD stuff produces a lot of extra comments and
    > compartmentalized functions for you to fill in, which makes the code
    > "look" larger.


    I'll do that. Looking smaller is certainly something, and certainly a
    simple count of source files isn't a great way of figuring code size.
    Admittedly, though, I'd hoped for code that *really was* smaller. It
    seems that despite the fact that each table is structured uniquely,
    each of the tables should share almost all the code. I guess that's
    probably possible, if I wanted to rewrite net-snmp with that as my
    highest priority

    - Josh

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    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/...net-snmp-users


  4. Re: Implementing tables with fewer source files

    2008/9/3 Joshua Tolley :
    > Admittedly, though, I'd hoped for code that *really was* smaller. It
    > seems that despite the fact that each table is structured uniquely,
    > each of the tables should share almost all the code.


    Most of the other table helpers would do precisely that.

    The MfD framework has a significantly different aim - it's
    designed to provide code specifically tailored to a particular
    table, and hide as much of the "standard" processing as possible.
    The table implementor can concentrate on a number of very
    tightly focused routines for individual column objects, without
    having to worry at all about how they might be used.
    But the standard processing code is effectively duplicated for
    each table independently.


    Most of the other mib2c table configs generate a single code file,
    containing both the column-specific code and a certain amount
    of standard processing code. But they tend to make greater
    use of shared table helpers, so there is more re-used code
    than in the MfD framework.

    Wes tends to recommend the iterator helper, I've a preference
    for the container-based 'tdata' approach. But there are a number
    of MIB modules implemented using a variety of table mechanisms.
    Have a play with the mib2c.*.conf files, and look at some of the
    existing modules, and see which you prefer.

    Dave

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    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/...net-snmp-users


  5. Re: Implementing tables with fewer source files

    >>>>> On Wed, 3 Sep 2008 08:09:05 +0100, "Dave Shield" said:

    DS> Wes tends to recommend the iterator helper, I've a preference
    DS> for the container-based 'tdata' approach. But there are a number
    DS> of MIB modules implemented using a variety of table mechanisms.
    DS> Have a play with the mib2c.*.conf files, and look at some of the
    DS> existing modules, and see which you prefer.

    Actually, that's not true... I recommend the iterator for external data
    sources and tdata for internal or "keep a copy of it" sources.
    --
    Wes Hardaker
    Sparta, Inc.

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    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/...net-snmp-users


+ Reply to Thread