It is good to get a response to my question, and even in the face of seeming
simplicity.  However, as we should all know, the call to the function

  netsnmp_table_set_multi_add_default_row

creates the row, as a default.  We can see the initialisation, specified by
the call generated by the mib2c compiler, by viewing this extract:

=======================
  Extract start
=======================
netsnmp_table_set_multi_add_default_row(
  table_set,
  COLUMN_DOT11STATIONID, ASN_OCTET_STR, 1, NULL, 0, 
  COLUMN_DOT11MEDIUMOCCUPANCYLIMIT, ASN_INTEGER, 1, NULL, 0,                   
                         
  COLUMN_DOT11CFPOLLABLE, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11CFPPERIOD, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11CFPMAXDURATION, ASN_INTEGER,   1, NULL, 0,
  COLUMN_DOT11AUTHENTICATIONRESPONSETIMEOUT, ASN_UNSIGNED, 1, NULL, 0,
  COLUMN_DOT11PRIVACYOPTIONIMPLEMENTED, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11POWERMANAGEMENTMODE, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11DESIREDSSID, ASN_OCTET_STR, 1, NULL, 0,                        
  COLUMN_DOT11DESIREDBSSTYPE, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11OPERATIONALRATESET, ASN_OCTET_STR, 1, NULL, 0,
  COLUMN_DOT11BEACONPERIOD, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11DTIMPERIOD, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11ASSOCIATIONRESPONSETIMEOUT, ASN_UNSIGNED, 1, NULL, 0,
  COLUMN_DOT11DISASSOCIATEREASON, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11DISASSOCIATESTATION, ASN_OCTET_STR, 0, NULL, 0,
  COLUMN_DOT11DEAUTHENTICATEREASON, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11DEAUTHENTICATESTATION, ASN_OCTET_STR, 0, NULL, 0,
  COLUMN_DOT11AUTHENTICATEFAILSTATUS, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11AUTHENTICATEFAILSTATION, ASN_OCTET_STR, 0, NULL, 0,
  COLUMN_DOT11MULTIDOMAINCAPABILITYIMPLEMENTED, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11MULTIDOMAINCAPABILITYENABLED, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11COUNTRYSTRING, ASN_OCTET_STR, 0, NULL, 0,
  0);
                                                                               
                                                               
=======================
  Extract stop
=======================

Sure, the row is populated with null data but, as stated in the online
documentation:

 void netsnmp_table_set_multi_add_default_row(va_dcl)           
        
  adds multiple data column definitions to each row.

  Functionally, this is a wrapper around calling
    netsnmp_table_set_add_default_row repeatedly for you.

and

 int netsnmp_table_set_add_default_row(
                 netsnmp_table_data_set * table_set,
                           unsigned int   column,
                                    int   type,
                                    int   writable,
                                   void * default_value,
                                 size_t   default_value_len
                                      )

  adds a new default row to a table_set.

  Arguments should be the table_set, column number, variable
  type and finally a 1 if it is allowed to be writable, or a
  0 if not. If the default_value field is not NULL, it will
  be used to populate new valuse in that column fro newly
  created rows. It is copied into the storage template (free
  your calling argument).

Note: "If the default_value field is not NULL, it will be used..."

By obvious extension, if the value of the field is NULL, then the
field will be populated with the NULL value.  In any case, one should
expect that a row is created and populated in accordance with the
parameters supplied to the function in question.  Further, one should
expect it to be available, such as for browing with the walk tool, as
a default.  Does that not seem like the definition of the word default?
BTW - The spelling errors are as found in the online documentation.

Moreover, the initialisation that I use is shown in this extract:

=======================
  Extract start
=======================
DEBUGMSGTL(("initialize_table_dot11StationConfigTable",
            "adding column types to table dot11StationConfigTable\n"));

netsnmp_table_set_multi_add_default_row(
  table_set,
  COLUMN_DOT11STATIONID,ASN_OCTET_STR,1,"00:00:b7:c2:59:0a",
strlen("00:00:b7:c2:59:0a"), 
  COLUMN_DOT11MEDIUMOCCUPANCYLIMIT, ASN_INTEGER, 1, 127, 0,                    
                        
  COLUMN_DOT11CFPOLLABLE, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11CFPPERIOD, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11CFPMAXDURATION, ASN_INTEGER,   1, NULL, 0,
  COLUMN_DOT11AUTHENTICATIONRESPONSETIMEOUT, ASN_UNSIGNED,  1, NULL, 0,
  COLUMN_DOT11PRIVACYOPTIONIMPLEMENTED, ASN_INTEGER,   0, NULL, 0,
  COLUMN_DOT11POWERMANAGEMENTMODE, ASN_INTEGER,   1, NULL, 0,
  COLUMN_DOT11DESIREDSSID, ASN_OCTET_STR, 1, "Buckley", strlen("Buckley"),     
                  
  COLUMN_DOT11DESIREDBSSTYPE, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11OPERATIONALRATESET, ASN_OCTET_STR, 1, NULL, 0,
  COLUMN_DOT11BEACONPERIOD, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11DTIMPERIOD, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11ASSOCIATIONRESPONSETIMEOUT, ASN_UNSIGNED, 1, NULL, 0,
  COLUMN_DOT11DISASSOCIATEREASON, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11DISASSOCIATESTATION, ASN_OCTET_STR, 0, NULL, 0,
  COLUMN_DOT11DEAUTHENTICATEREASON, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11DEAUTHENTICATESTATION, ASN_OCTET_STR, 0, NULL, 0,
  COLUMN_DOT11AUTHENTICATEFAILSTATUS, ASN_INTEGER, 0, NULL, 0,
  COLUMN_DOT11AUTHENTICATEFAILSTATION, ASN_OCTET_STR, 0, NULL, 0,
  COLUMN_DOT11MULTIDOMAINCAPABILITYIMPLEMENTED, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11MULTIDOMAINCAPABILITYENABLED, ASN_INTEGER, 1, NULL, 0,
  COLUMN_DOT11COUNTRYSTRING, ASN_OCTET_STR, 0, NULL, 0,
  0);
                                                                               
                                                                
DEBUGMSGTL(("initialize_table_dot11StationConfigTable",
            "after call netsnmp_table_set_multi_add_default_row()\n"));
=======================
  Extract stop
=======================

So, at the very least, I ought to be able to get one row from the table
listed in the output of the walk.  Instead, this is what I get:

=======================
  Extract start
=======================
[EMAIL PROTECTED] net-snmp-5.2.rc4]# ./agent/.libs/snmpd -c
/usr/local/share/snmp/snmpd.conf -C -d -D -Lf /var/log/snmpd52rc4.log
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1
iso.2.840.10036.3.1.1.0 = STRING: "RTID"
SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.4.20-31.9 #1 Tue
Apr 13 18:04:23 EDT 2004 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (2417) 0:00:24.17
SNMPv2-MIB::sysContact.0 = STRING: WRBuckley
SNMPv2-MIB::sysName.0 = STRING: localhost.localdomain
SNMPv2-MIB::sysLocation.0 = STRING: "RealNet HQ"
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (77) 0:00:00.77
SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
[EMAIL PROTECTED] net-snmp-5.2.rc4]# ls -al ./agent/.libs/snmpd
-rwxr-xr-x    1 root     root       102442 Nov 23 14:55 ./agent/.libs/snmpd
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1.2.840.10036.1.1.0.1
iso.2.840.10036.1.1.0.1 = No Such Object available on this agent at this OID
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1.2.840.10036.1.1.1.0.1
iso.2.840.10036.1.1.1.0.1 = No Such Object available on this agent at this OID
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1.2.840.10036.1.1.1
iso.2.840.10036.1.1.1 = No Such Object available on this agent at this OID
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1.2.840.10036.1.1
iso.2.840.10036.1.1 = No Such Object available on this agent at this OID
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1.2.840.10036.1.1.1
iso.2.840.10036.1.1.1 = No Such Object available on this agent at this OID
[EMAIL PROTECTED] net-snmp-5.2.rc4]# /usr/local/bin/snmpwalk -v 2c -c public2
localhost .1.2.840.10036.1.1.0
iso.2.840.10036.1.1.0 = No Such Object available on this agent at this OID
=======================
  Extract stop
=======================

>From the debug output in the log file, we have

=======================
  Extract start
=======================
trace: should_init(): mib_modules.c, 127:
mib_init: initializing: ieee802dot11_tables
trace: init_ieee802dot11_tables(): dot11/ieee802dot11_tables.c, 1201:
init_ieee802dot11_tables: initialising the tables by calling initialisation 
routines
trace: initialize_table_dot11StationConfigTable(): dot11/ieee802dot11_tables.c, 
24:
initialize_table_dot11StationConfigTable: adding indexes to table
dot11StationConfigTable
trace: initialize_table_dot11StationConfigTable(): dot11/ieee802dot11_tables.c, 
30:
initialize_table_dot11StationConfigTable: adding column types to table
dot11StationConfigTable
trace: initialize_table_dot11StationConfigTable(): dot11/ieee802dot11_tables.c, 
60:
initialize_table_dot11StationConfigTable: after call
netsnmp_table_set_multi_add_default_row()
trace: netsnmp_inject_handler_before(): agent_handler.c, 337:
handler:inject: injecting netsnmp_table_data_set before dot11StationConfigTable
trace: netsnmp_inject_handler_before(): agent_handler.c, 337:
handler:inject: injecting table_data before netsnmp_table_data_set
trace: netsnmp_inject_handler_before(): agent_handler.c, 337:
handler:inject: injecting table before table_data
trace: netsnmp_register_handler(): agent_handler.c, 212:
handler::register: Registering dot11StationConfigTable
(::table::table_data::netsnmp_table_data_set::dot11StationConfigTable) at
iso.2.840.10036.1.1
trace: netsnmp_inject_handler_before(): agent_handler.c, 337:
handler:inject: injecting bulk_to_next before table
trace: netsnmp_register_mib(): agent_registry.c, 587:
register_mib: registering "dot11StationConfigTable" at iso.2.840.10036.1.1
trace: netsnmp_subtree_find_first(): agent_registry.c, 156:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 160:
subtree: found one for: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 156:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 160:
subtree: found one for: ""
trace: snmp_call_callbacks(): callback.c, 205:
callback: START calling callbacks for maj=1 min=1
trace: snmp_call_callbacks(): callback.c, 231:
callback: END calling callbacks for maj=1 min=1 (0 called)
trace: initialize_table_dot11StationConfigTable(): dot11/ieee802dot11_tables.c, 
75:
initialize_table_dot11StationConfigTable: after call
netsnmp_register_table_data_set()
trace: initialize_table_dot11AuthenticationAlgorithmsTable():
dot11/ieee802dot11_tables.c, 166:
=======================
  Extract stop
=======================

As you can see, the debug messages that surround the call to the default
row initialisation handler are both printed in the output, so the agent
is not failing to start.  BTW - for numeric fields, the length should be
zero.  Yet, this is not stated explicitly in the documentation.

Finally, we see the servicing of the walks in this extract from the log
file:

=======================
  Extract start
=======================
trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1872:
snmp_agent: tp->start iso.2.840.10036.1.1, tp->end iso.2.840.10036.1.2,
trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1892:
verbose:asp: asp 0x80c6c08 reqinfo 0x80d5b48 assigned to request
trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1899:
verbose:asp: asp 0x80c6c08 reqinfo 0x80d5b48 assigned to request
trace: netsnmp_call_handlers(): agent_handler.c, 498:
handler:calling: main handler bulk_to_next
trace: netsnmp_call_handler(): agent_handler.c, 418:
handler:calling: calling handler bulk_to_next for mode GETNEXT
trace: netsnmp_call_handler(): agent_handler.c, 426:
handler:returned: handler bulk_to_next returned 0
trace: netsnmp_call_handler(): agent_handler.c, 418:
handler:calling: calling handler table for mode GETNEXT
trace: table_helper_handler(): table.c, 184:
helper:table:req: Got request for handler table: base oid:iso.2.840.10036.1.1
ccitt.1
trace: table_helper_handler(): table.c, 472:
helper:table:   no column/index in request
trace: table_helper_handler(): table.c, 494:
helper:table:   looking for 1 indexes
trace: table_helper_handler(): table.c, 503:
helper:table:   oid indexes not complete: iso.2.840.10036.1.1
trace: table_helper_handler(): table.c, 548:
helper:table:results:   found 0 indexes
trace: table_helper_handler(): table.c, 556:
helper:table:results:   column: 1, indexes: 0trace: sprint_realloc_by_type():
mib.c, 1975:
output: sprint_by_type, type 2
   index: type=2(02), value=INTEGER: 0
trace: netsnmp_call_handler(): agent_handler.c, 418:
handler:calling: calling handler table_data for mode GETNEXT
trace: netsnmp_data_list_add_node(): data_list.c, 106:
data_list: adding key 'table_data_table'
trace: netsnmp_call_handler(): agent_handler.c, 426:
handler:returned: handler table_data returned 0
trace: netsnmp_call_handler(): agent_handler.c, 418:
handler:calling: calling handler netsnmp_table_data_set for mode GETNEXT
trace: netsnmp_table_data_set_helper_handler(): table_dataset.c, 438:
netsnmp_table_data_set: handler starting
trace: netsnmp_call_handler(): agent_handler.c, 426:
handler:returned: handler netsnmp_table_data_set returned 0
trace: netsnmp_call_handler(): agent_handler.c, 418:
handler:calling: calling handler dot11StationConfigTable for mode GETNEXT
trace: netsnmp_call_handler(): agent_handler.c, 426:
handler:returned: handler dot11StationConfigTable returned 0
trace: netsnmp_call_handler(): agent_handler.c, 426:
handler:returned: handler table returned 0
trace: handle_getnext_loop(): snmp_agent.c, 2805:
results: getnext results, before next pass:
trace: handle_getnext_loop(): snmp_agent.c, 2808:
results:        trace: sprint_realloc_by_type(): mib.c, 1975:
output: sprint_by_type, type 5
iso.2.840.10036.1.1 = NULL
trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1810:
snmp_agent: add_vb_to_cache(0x80c6c08, 1, iso.2.840.10036.1.1, 0x8053af8)
trace: snmp_call_callbacks(): callback.c, 205:
callback: START calling callbacks for maj=1 min=12
trace: snmp_call_callbacks(): callback.c, 219:
callback: calling a callback for maj=1 min=12
trace: vacm_in_view(): mibgroup/mibII/vacm_conf.c, 708:
mibII/vacm_vars: vacm_in_view: ver=1, community=public2
trace: netsnmp_udp_getSecName(): snmpUDPDomain.c, 1030:
netsnmp_udp_getSecName: resolve <"public2", 0x0100007f>
trace: netsnmp_udp_getSecName(): snmpUDPDomain.c, 1035:
netsnmp_udp_getSecName: compare <"public2", 0x00000000/0x00000000>... SUCCESS
trace: netsnmp_subtree_find_first(): agent_registry.c, 156:
subtree: looking for subtree for context: ""
trace: netsnmp_subtree_find_first(): agent_registry.c, 160:
subtree: found one for: ""
trace: vacm_in_view(): mibgroup/mibII/vacm_conf.c, 835:
mibII/vacm_vars: vacm_in_view: sn=realnetuser, gn=realnetgroup, vn=fullview
trace: vacm_checkSubtree(): vacm.c, 526:
vacm:checkSubtree: , included
trace: snmp_call_callbacks(): callback.c, 231:
callback: END calling callbacks for maj=1 min=12 (1 called)
trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1872:
snmp_agent: tp->start iso.2.840.10036.1.2, tp->end iso.2.840.10036.1.3,
trace: netsnmp_add_varbind_to_cache(): snmp_agent.c, 1892:
=======================
  Extract stop
=======================

I do notice the suspicious line

  oid indexes not complete: iso.2.840.10036.1.1

but, hey, the ifIndex is imported from MIB-II (RFC1213), it is defined as
being of type INTEGER, and it is not an element of the table entry in the
802dot11 MIB.

So, what am I missing.  I am perfectly willing to accept the occurance of
a cockpit error on my part.  For instance, is it the presentation of the
OIDs in my walk command?  I don't think so but, I am not typically the
person who actually uses the agents that I write.  It seems to me that a
walk should list every OID recognised, regardless of its content.  If the
rows of a table are empty, they should still be displayed, and displayed
showing the emptiness of such rows.

If you are going to tell me about the function

  netsnmp_table_row_add_index

then tell me where the documentation for this function exists.  Also, tell
me why the index cannot be *completed* as part of the operation of the
function

  netsnmp_table_set_multi_add_default_row

I argue that the default row should mean the row indexed by 1, in this case.

WRB

---- Original message ----
>Date: Tue, 23 Nov 2004 19:24:32 -0500
>From: Robert Story (Users) <[EMAIL PROTECTED]>  
>Subject: Re: WRB - Data-set Table Implementation - browsing behavior.  
>To: <[EMAIL PROTECTED]>
>Cc: NetSNMPUsers <[EMAIL PROTECTED]>
>
>On Mon, 22 Nov 2004 13:35:22 -0800 [EMAIL PROTECTED] wrote:
>WC> In a similar fashion, I have added the .c and .h filed produced by the
>WC> mib2c compiler for the tables of the 802dot11 MIB.  I made no code changes,
>WC> save the file name and associated references, as complained of in my
>WC> earlier post titled "WRB - Big problems adding 802dot11 to snmpd" and as
>WC> suggested above. I added the table code to the configuration, compiled and
>WC> started the daemon, and used the same *snmpwalk* command as given above. 
>WC> The output of my walk did not change.
>
>Did you add data to the tables? If you didn't add rows, there is nothing to
>walk.
>
>-- 
>Robert Story; NET-SNMP Junkie
>Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>  
>Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>
>
>You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to