Baby steps

From Net-SNMP Wiki
Jump to: navigation, search
Net-SNMP MIB Helper
Baby Steps
Documentation: doxygen API
Code: agent/helpers/baby_steps.c
Other Helpers: Agent Helpers

The baby_steps module is designed to break SET processing within the agent into small manageable steps. Thus consistency can be checked for various types of data checks to ensure the transaction is valid before proceeding to the next step.

It is described by it's ascii diagram in the agent/helpers/baby_steps.c source file:

   /*
    ***********************************************************************
    * Baby Steps Flow Chart (2004.06.05)                                  *
    *                                                                     *
    * +--------------+    +================+    U = unconditional path    *
    * |optional state|    ||required state||    S = path for success      *
    * +--------------+    +================+    E = path for error        *
    ***********************************************************************
    *
    *                        +--------------+
    *                        |     pre      |
    *                        |   request    |
    *                        +--------------+
    *                               | U
    * +-------------+        +==============+
    * |    row    |f|<-------||  object    ||
    * |  create   |1|      E ||  lookup    ||
    * +-------------+        +==============+
    *     E |   | S                 | S
    *       |   +------------------>|
    *       |                +==============+
    *       |              E ||   check    ||
    *       |<---------------||   values   ||
    *       |                +==============+
    *       |                       | S
    *       |                +==============+
    *       |       +<-------||   undo     ||
    *       |       |      E ||   setup    ||
    *       |       |        +==============+
    *       |       |               | S
    *       |       |        +==============+
    *       |       |        ||    set     ||-------------------------->+
    *       |       |        ||   value    || E                         |
    *       |       |        +==============+                           |
    *       |       |               | S                                 |
    *       |       |        +--------------+                           |
    *       |       |        |    check     |-------------------------->|
    *       |       |        |  consistency | E                         |
    *       |       |        +--------------+                           |
    *       |       |               | S                                 |
    *       |       |        +==============+         +==============+  |
    *       |       |        ||   commit   ||-------->||     undo   ||  |
    *       |       |        ||            || E       ||    commit  ||  |
    *       |       |        +==============+         +==============+  |
    *       |       |               | S                     U |<--------+
    *       |       |        +--------------+         +==============+
    *       |       |        | irreversible |         ||    undo    ||
    *       |       |        |    commit    |         ||     set    ||
    *       |       |        +--------------+         +==============+
    *       |       |               | U                     U |
    *       |       +-------------->|<------------------------+
    *       |                +==============+
    *       |                ||   undo     ||
    *       |                ||  cleanup   ||
    *       |                +==============+
    *       +---------------------->| U
    *                               |
    *                          (err && f1)------------------->+
    *                               |                         |
    *                        +--------------+         +--------------+
    *                        |    post      |<--------|      row     |
    *                        |   request    |       U |    release   |
    *                        +--------------+         +--------------+
    *
    */