Convert YANG to MIB model

Introduction

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

Step to convert YANG to MIB model:

  1. You need an installation of pyang:
    1. cd <SAFplus-Management-Framework>/3rdparty
    2. make pyang
  2. Add the YANG2SMI plugin to your existing pyang installation. This may be done in one of the following three ways:
    1. Add <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to <SAFplus-Management-Framework>/3rdparty/pyang/pyang/plugins,
    2. Add the location of <SAFplus-Management-Framework>/model/src/extras/pyplugin/yang2smi.py to the $PYANG_PLUGINPATH environment variable, or
    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:

root@desktop:/# source env.sh;./bin/pyang -f yang2smi network.yang --yang2smi-oid=99840 -o NETWORK.MIB