Difference between revisions of "MFD:ifTable:mib2c"
(Created page with "== Running mib2c == The first step is to generate the code. Create a new directory somewhere and run: <table><tr><td width=20></td><td><td bgcolor=CCCCCC> ...") |
(No difference)
|
Revision as of 16:59, 13 July 2011
Running mib2c
The first step is to generate the code. Create a new directory somewhere and run:
$ <font color=blue>mib2c -c mfd-top.m2c ifXTable</font> writing to ifXTable.h | +-> Processing table ifXTable writing to - There are no defaults for ifXTable. Would you like to 1) Accept hard-coded defaults [DEFAULT] 2) Set defaults now Select your choice : <font color=blue>2</font> |
Notes: | ||
This table has writable columns. Do you want to generate code for writeable columns, or restrict the table to read-only? 1) generate code with writeable columns [DEFAULT] 2) generate code with read-only columns Select your choice : <font color=blue>[RETURN]</font> |
Notes: | ||
Writable tables sometimes have dependencies beteen columns or with other tables. If there are no dependencies in this table, you might want the extra code. 1) do not generate dependency code [DEFAULT] 2) generate dependency code Select your choice : <font color=blue>[RETURN]</font> |
Notes: | ||
Do you want to use an existing data structure for the USER context? 1) No, use netsnmp_data_list * [DEFAULT] 2) Yes, use my own structure Select your choice : <font color=blue>[RETURN]</font> |
Notes: | ||
Do you want to use an existing data structure for the DATA context? 1) No, use generated [DEFAULT] 2) Yes, use my own structure Select your choice : <font color=blue>2</font> Enter your DATA context : <font color=blue>netsnmp_interface_entry</font> |
Notes: | ||
Do you want to allocate your 'netsnmp_interface_entry', or embed it directly? 1) directly embed structure [DEFAULT] 2) dynamically allocate structure Select your choice : <font color=blue>2</font> |
Notes: | ||
Do you need to initialize elements in your 'netsnmp_interface_entry' when a new instance is created? 1) no, no initialization needed [DEFAULT] 2) yes, initilization is needed Select your choice : <font color=blue>[RETURN]</font> |
Notes: | ||
Which method would you like to use to gather data about available rows? 1) container-cached : [DEFAULT] This access method uses a netsnmp_container to keep track of the indexes (and data, usually) for each row. Thi method is best for: - Internal data (maintained by the agent) - External data (maintained by another process) which can be cached (minumum cache time is 1 second) 2) unsorted-external : This access method iterates over all of your data to find the row with the appropriate index. This method is best for - External data that cannot be cached. Select your choice : <font color=blue>[RETURN]</font> |
Notes: | ||
When accessing your data, is your data TRANSIENT? 1) Yes. My data is TRANSIENT (e.g. a pointer to a static buffer that my be overwritten during a request) and needs to be copied during processing. 2) Yes. My data is SEMI-TRANSIENT (e.g. an allocated pointer to a copy of the data). 3) No, my data is PERSISTENT (e.g. an allocated pointer to the actual data, which is under the agent's control) Select your choice [DEFAULT=1] : <font color=blue>2</font> |
Notes: | ||
Do you want example code to be generated? 1) generate example code [DEFAULT] 2) do not generate example code Select your choice : <font color=blue>2</font> </pre><td>
Notes: |
<a href="source/ifXTable.c">ifXTable.c</a> <a href="source/ifXTable_data_access.c">ifXTable_data_access.c</a> <a href="source/ifXTable_data_access.h">ifXTable_data_access.h</a> <a href="source/ifXTable_data_get.c">ifXTable_data_get.c</a> <a href="source/ifXTable_data_get.h">ifXTable_data_get.h</a> <a href="source/ifXTable_data_set.c">ifXTable_data_set.c</a> <a href="source/ifXTable_data_set.h">ifXTable_data_set.h</a> <a href="source/ifXTable_enums.h">ifXTable_enums.h</a> <a href="source/ifXTable.h">ifXTable.h</a> <a href="source/ifXTable_interface.c">ifXTable_interface.c</a> <a href="source/ifXTable_interface.h">ifXTable_interface.h</a> <a href="source/ifXTable_Makefile">ifXTable_Makefile</a> <a href="source/ifXTable_oids.h">ifXTable_oids.h</a> <a href="source/ifXTable-README-FIRST.txt">ifXTable-README-FIRST.txt</a> <a href="source/ifXTable-README-ifXTable.txt">ifXTable-README-ifXTable.txt</a> <a href="source/ifXTable_subagent.c">ifXTable_subagent.c</a> |
You should read ifXTable-README-FIRST.txt for a basic overview of MFD. The basic steps outlined in ifXTable-README-ifXTable.txt were used to write this tutorial.
<a href="structures.html">Next: data structures</a> <a href="mib2c.html">Back: running mib2c</a> | <a href="../index.html">Up: IF-MIB Tutorials</a>