Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8670181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:39:09+00:00 2026-06-12T18:39:09+00:00

I am learning net-snmp code-base. To parsing MIB. In parse.c and parse.h code keeps

  • 0

I am learning net-snmp code-base. To parsing MIB.

In parse.c and parse.h code keeps a hash bucket. (indexed bucket (tree list)).
There is also a tree structure, Which contains a next pointer pointing to Next node in hashed list of names.

struct tree{  
    .
    .
    struct tree    *next;       // Next node in hashed list of names 
    int             modid;     // The module containing this node 
}

I printed the MIB,

SNMP-FRAMEWORK-MIB:snmpFrameworkMIB(10) type=24 Next-> ‘ ipSystemStatsHCOctetGroup ipSystemStatsOutFragReqds ifStackGroup2 ifOutErrors ‘

I couldn’t understand what is the relation among the name of objects appears after Next-> ?

What is the criteria on the basis of which object names are together? The Code is unclear to me at this point.

What is modid? Its value not equal to module OID!

NOTE: For purely traversing purpose in MIB-tree there is *child, *parent & *peer are given! Also modid is not part of OID.

A Data-Structure named ‘module compatability’ in parse.h:

struct module_compatability {
        const char     *old_module;
        const char     *new_module;
        const char     *tag;    /* NULL implies unconditional replacement,
                                 * otherwise node identifier or prefix */
        size_t          tag_len;        /* 0 implies exact match (or unconditional) */
        struct module_compatability *next;      /* linked list */
    };

What is the use of this structure? Compatible in What sense ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:39:10+00:00Added an answer on June 12, 2026 at 6:39 pm

    I am also working with Net-snmp from quite a some time, i am sharing my observation with you .
    May be this will help you.

    1. struct tree *next;

    struct tree    * next; /* Next node in hashed list of names */   
    

    Net-snmp feature provides query by ‘name’ of module,
    Object When the queried object name (string) is of ASCII, i.e.

    $ snmptranslate -On -IR bundleSize  
      -   
      -  
      .1.3.6.1.4.1.26149.2.1.2.2.1.9  
    

    It has a hash-table(internal) data-structure ‘bucket’ of size 128.

    Hash Function:

    name_hash(str*) - return some of ASCII value. 
    

    Then this hash value is passed into a macro NBUCKET(x) – returns index (0-127).
    The collision is resoled by chaining as follows. bucket[i]->next->next->next……..


    The code for this is present in parse.c —

    tree->next and 'bucket' are managed in following way:

     tp->hash = name_hash(tp->name); // Fist find hash value as some of ASCII
     b = BUCKET(tp->hash);           // map hash value into (0-127)
     if (buckets[b])                 // check for collision 
         tp->next = buckets[b];     // collision is resolved ny chan chain 
     buckets[b] = tp;           // new coming node become first node in chain
    

    2. int modid;

    • The module containing this node.
      • There is a linked list of type ‘struct module’
      • modid is sequence number in linked-list of a module.
      • sequence number start with 0.
      • modid= number at which module started read
      • a function defined in parse.h ‘find_module(int modid)’ return node address
        stores the information about module.

    A Data-Structure named ‘module compatability’ in parse.h:

    This is an array of structre 'module compatability' use to store compatible 
    basic MIB name (RFC's defined).   
    
    const char     *old_module;   // snmp-v1  
    const char     *new_module;   // snmp-v2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning Asp.net MVC 3. Just wondering, is there any way to define
I am learning ASP.NET MVC and Entity Framework Code First, LINQ by creating a
I'm still learning ASP.NET and I often see code like this throughout parts of
I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and
I am learning ASP.NET MVC now a days and I have found that most
I am learning ASP.NET and would like to know what are the must have
I am just learning ASP.NET c# and trying to incorporate best practices into my
I'm learning asp.net mvc and found something interesting: It seems that I can't explicitly
I am learning ADO.NET entity framework. This is my first example. The datagrid seems
I am learning ASP.Net. I have a dynamically created ImageButton that I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.