Convert YANG to MIB model

Revision as of 07:56, 21 January 2013 by Hoangle (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


YANG2SMI is an extensible output plugin for pyang. This plugin can be used to generate MIB model from YANG data models.

Step to convert YANG to MIB model: 1. You need an installation of pyang: 1.1 cd <SAFplus-Management-Framework>/3rdparty 1.2 make pyang

2. Add the YANG2SMI plugin to your existing pyang installation. This may be done in one of the following three ways:

2.1. Add <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to <SAFplus-Management-Framework>/3rdparty/pyang/plugins, 2.2. Add the location of <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to the $PYANG_PLUGINPATH environment variable, or 2.3. Use the --plugindir option of pyang each time you want to use YANG2SMI


3. Change directory to <SAFplus-Management-Framework>/3rdparty/pyang and launch pyang with specific yang2smi output format, YANG module file, OID root module and MIB model file.

For example, to generate the network.yang to NETWORK.MIB , type:

$./bin/pyang -f yang2smi network.yang --yang2smi-oid=99840 -o NETWORK.MIB