THIS PAGE IS STILL UNDER CONSTRUCTION
mib2c generates template code which you must customize. So what happens when the confiugration file you chost is updated to fix a bug or add a new feature? Traditionally, you have had to manually merge the changes into your code, or merge your your customizations into a freshly generated code set. (see pseudo-algorithm for the manual steps needed).
The shell script mib2c-update is a wrapper around mib2c and other utilities to help you take advantage of updates to the configuration file you chose for your mib module without having
If all goes well, there might not be any conflicts. If you changed any configuration optione, or there were lots of changes to the configuration files, you may have to do quite a bit of manual patching.
 
 
mib2c-update does not take any commanline parameters.
All configuration is kept in the file .mib2c-updaterc
in
the directory where the code is generated. This configuration file
needs to contain two pieces of information: the table name, and the
mib2c configuration file to use. The format is pretty
basic:
# # example mib2c-update configuration file # # UPDATE_OID should contain the table for which code will be generated # UPDATE_OID=ipAddressTable # # UPDATE_CONF should contain the mib2c configuration file to be used # UPDATE_CONF=mib2c.mfd.conf |
Those are the only required options. If you want to pass additional
arguments to mib2c, you can set the options in
UPDATE_MIB2C_OPTS
:
UPDATE_MIB2C_OPTS="-q -f ipAddress" |
You can also configure the directories that mib2c-update will use to generate temporary code. The available options, and their defaults, are:
UPDATE_CURR=.
UPDATE_ORIG=.orig
UPDATE_NEW=.new
UPDATE_PATCH=.patch
UPDATE_MERGED=.merged
UPDATE_BACKUP=.backup
 
 
Note: if you are trying to use mib2c-update after the fact (i.e. you originally generated you code with mib2c directly, skip ahead to using mib2c-update retroactively.
The first run of mib2c-update is very easy. Simply create
your configuration file, .mib2c-updaterc
, as described
above, and then run mib2c-update. The temporary directories
will be created, and mib2c will be run to generate the
initial code.
... EXAMPLE RUN HERE ...
Once you have generated the code, I strongly recommend that you
check it in to a source code version control system, such as
CVS, Subversion, RCS, ClearCase or (shudder) Microsoft SourceSafe.
This will help you recover if a bug in mib2-update causes
any problems. Both the current
and original
directories should be put under version control.
 
 
If you are trying to use mib2c-update after the fact (i.e. you originally generated you code with mib2c directly), you have to do a little work to be able to use mib2c-update.
... TBD ...
 
 
If you want to manage the process manually, it goes something like this:
diff
to compare the unmodified template code to
your existing code, and save the output to create a patch of your changes.
diff
to compare the original template code to the
updated template code, and save the output to create a patch of the
configuration file changes.
Last modified: Wednesday, 01-Aug-2018 04:41:28 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.