Table of Contents

1  Preface

1.1  Legal Statements

1.2  Additional Resources

1.2.1  WEB Sites

1.2.2  Mailing Lists

1.3  Conventions Used in this Document

2  YumaPro Doxygen Browser

2.1.1  Online Version

2.1.2  Local Version

2.1.3  Install doxygen

2.1.4  Doxygen Group Structure

2.1.5  Example Doxygen Headers

3  SDK QuickStart

3.1  Get the YANG Modules Ready

3.2  Generate the Instrumentation Code Stubs

3.2.1  SIL

3.2.2  SIL Bundle

3.2.3  SIL-SA

3.2.4  SIL-SA Bundle

3.3  Fill in the Instrumentation Code Stubs

4  Software Overview

4.1  Introduction

4.1.1  Intended Audience

4.1.2  What does YumaPro Do?

4.1.3  What is a YumaPro Root?

4.1.4  Searching YumaPro Roots

4.1.5  What is a SIL?

4.1.6  SIL Variants

4.1.7  Auto-generated SIL Files

4.1.8  Basic Development Steps

4.2  YumaPro Source Files

4.2.1  src/ncx Directory

4.2.2  src/platform Directory

4.2.3  src/agt Directory

4.2.4  src/mgr Directory

4.2.5  src/subsys-pro Directory

4.2.6  src/netconfd-pro Directory

4.2.7  src/yangcli-pro Directory

4.2.8  src/yangdiff-pro Directory

4.2.9  src/yangdump-pro Directory

4.2.10  src/yangdump-sdk Directory

4.2.11  src/ydump Directory

4.2.12  src/ypwatcher Directory

4.2.13  src/ypgnmi Directory

4.3  Server Design

4.3.1  YANG Native Operation

4.3.2  YANG Object Tree

4.3.3  YANG Data Tree

4.3.4  Service Layering

4.3.5  Session Control Block

4.3.6  Server Message Flows

4.3.7  Main ncxserver Loop

4.3.8  SIL Callback Functions

4.4  Server Initialization

4.4.1  Set the Server Profile

4.4.2  Bootstrap CLI and Load Core YANG Modules

4.4.3  External System Init Phase I : Pre CLI

4.4.4  Load CLI Parameters

4.4.5  Load Main Configuration File

4.4.6  Load Secondary Configuration Files

4.4.7  Configuration Parameter Activation

4.4.8  External System Init Phase I : Post CLI

4.4.9  Load SIL Libraries and Invoke Phase I Callbacks

4.4.10  External System Init Phase II : Pre-Load

4.4.11  Load <running> Configuration

4.4.12  Invoke SIL Phase II Callbacks

4.4.13  External System Init Phase II : Post-Load

4.4.14  Initialize SIL-SA Subsystems

4.4.15  Server Ready

4.5  Server Operation

4.5.1  Ypwatcher processing

4.5.2  Loading Modules and SIL Code

4.5.3  Core Module Initialization

4.5.4  Startup Configuration Processing

4.5.5  Process an Incoming <rpc> Request

4.5.6  Edit the Database

4.5.7  Save the Database

4.6  Built-in Server Modules

4.6.1  iana-crypt-hash.yang

4.6.2  ietf-datastores.yang

4.6.3  ietf-inet-types.yang

4.6.4  ietf-origin.yang

4.6.5  ietf-netconf.yang

4.6.6  ietf-netconf-acm.yang

4.6.7  ietf-netconf-nmda.yang

4.6.8  ietf-netconf-monitoring.yang

4.6.9  ietf-netconf-notifications.yang

4.6.10  ietf-netconf-partial-lock.yang

4.6.11  ietf-netconf-with-defaults.yang

4.6.12  ietf-restconf.yang

4.6.13  ietf-restconf-monitoring.yang

4.6.14  ietf-yang-library.yang

4.6.15  ietf-yang-patch.yang

4.6.16  ietf-yang-types.yang

4.6.17  nc-notifications.yang

4.6.18  netconfd-pro.yang

4.6.19  notifications.yang

4.6.20  yang-data-ext.yang

4.6.21  yuma-app-common.yang

4.6.22    yuma-ncx.yang

4.6.23  yuma-mysession.yang

4.6.24  yuma-netconf.yang

4.6.25  yuma-system.yang

4.6.26  yuma-time-filter.yang

4.6.27  yuma-types.yang

4.6.28  yumaworks-agt-profile.yang

4.6.29  yumaworks-app-common.yang

4.6.30  yumaworks-attrs.yang

4.6.31  yumaworks-config-change.yang

4.6.32  yumaworks-db-api.yang

4.6.33  yumaworks-event-filter.yang

4.6.34  yumaworks-extensions.yang

4.6.35  yumaworks-getbulk.yang

4.6.36  yumaworks-ids.yang

4.6.37  yumaworks-internal.yang

4.6.38  yumaworks-mgr-common.yang

4.6.39  yumaworks-opsmgr.yang

4.6.40  yumaworks-restconf-commit.yang

4.6.41  yumaworks-restconf.yang

4.6.42  yumaworks-server.yang

4.6.43  yumaworks-sesmgr.yang

4.6.44  yumaworks-sil-sa.yang

4.6.45  yumaworks-support-save.yang

4.6.46  yumaworks-system.yang

4.6.47  yumaworks-templates.yang

4.6.48  yumaworks-term-msg.yang

4.6.49  yumaworks-test.yang

4.6.50  yumaworks-types.yang

4.6.51  yumaworks-yang-api.yang

4.6.52  yumaworks-yangmap.yang

4.6.53  yumaworks-ycontrol.yang

4.6.54  yumaworks-yp-gnmi.yang

4.6.55  yumaworks-yp-ha.yang

4.7  Optional Server Modules

4.7.1  yuma-arp.yang

4.7.2  yuma-proc.yang

4.7.3  yuma-interfaces.yang

4.7.4  ietf-restconf-monitoring.yang

5  YANG Objects and Data Nodes

5.1  Object Definition Tree

5.1.1  Object Node Types

5.1.2  Object Node Template (obj_template_t)

5.1.3  obj_template_t Access Functions

5.2  Data Tree

5.2.1  Child Data Nodes

5.2.2  Data Node Types

5.2.3  YumaPro Data Node Edit Variables (val_editvars_t)

5.2.4  YumaPro Data Nodes (val_value_t)

5.2.5  YumaPro Data Nodes (Extra) (val_extra_t)

5.2.6  val_value_t Access Macros

5.2.7  val_value_t Access Functions

5.2.8  SIL Utility Functions

6   SIL External Interface

6.1  Stage 1 Initialization

6.2  Stage 2 Initialization

6.3  Cleanup

7  SIL Callback Interface

7.1  Configuration Initialization

7.1.1  Validation Phase

7.1.2  Apply Phase

7.1.3  Commit/Rollback Phase

7.2  Configuration Replay

7.2.1  Timer Callback to Check System

7.2.2  SIL Callbacks

7.2.3  Configuration Replay Callbacks

7.2.4  Configuration Replay Cookie

7.3  Error Handling

7.3.1  <rpc-error> Contents

7.3.2  SET_ERROR

7.3.3  agt_record_error

7.3.4  agt_record_error_errinfo

7.3.5  agt_record_warning

7.3.6  Adding <error-info> Data to an Error Response

7.4  RPC Operation Interface

7.4.1  RPC Callback Template

7.4.2  RPC Callback Initialization

7.4.3  RPC Message Header

7.4.4  SIL Support Functions For RPC Operations

7.4.5  RPC Validate Callback Function

7.4.6  RPC Invoke Callback Function

7.4.7  RPC Data Output Handling

7.4.8  RPC Post Reply Callback Function

7.5  YANG 1.1 Action Interface

7.5.1  Action Callback Template

7.5.2  Action Callback Initialization

7.5.3  Action Message Header

7.5.4  SIL Support Functions For YANG Actions

7.5.5  Action Validate Callback Function

7.5.6  Action Invoke Callback Function

7.5.7  Action Data Output Handling

7.6  Database Operations

7.6.1  EDIT2 Callbacks

7.6.2  SIL-SA EDIT2 Callbacks

7.6.3  Database Template (cfg_template_t)

7.6.4  Database Access Functions

7.6.5  Database Callback Initialization and Cleanup

7.6.6  Example SIL Database Edit Callback Function

7.6.7  EDIT2 Callback Function Example

7.6.8 SIL-SA EDIT2 Callback Function Example

7.6.9  Database Edit Validate Callback Phase

7.6.10  Database Edit Apply Callback Phase

7.6.11  Database Edit Commit Callback Phase

7.6.12  Database Edit Rollback Callback Phase

7.6.13  Database Virtual Node Get Callback Function

7.6.14  Getting the Current Transaction ID

7.6.15  Finding Data Nodes with XPath

7.6.16  Determining if a Value Node is Set

7.6.17  Determining if the SIL Callback is the Deepest for the Edit

7.7  Database Editing with In-Transaction APIs

7.7.1  Set-Hook Callback

7.7.2  Set Hook Callback Examples

7.7.3  SIL-SA Set-Hook Callback

7.7.4  SIL-SA Set Hook Callback Examples

7.7.5  Post Set Hook Callback

7.7.6  SIL-SA Post Set Hook Callback

7.7.7  Transaction Hook Callback

7.7.8  Transaction Hook Callback Examples

7.7.9  SIL-SA Transaction Hook Callback

7.7.10  SIL-SA Transaction Hook Callback Examples

7.7.11  Transaction Start Callback

7.7.12  Transaction Start Callback Examples

7.7.13  SIL-SA Transaction Start Callback

7.7.14  SIL-SA Transaction Start Callback Examples

7.7.15  Transaction Complete Callback

7.7.16  Transaction Complete Callback Examples

7.7.17  SIL-SA Transaction Complete Callback

7.7.18  SIL-SA Transaction Complete Callback Examples

7.7.19  Set Order Hook Callback

7.7.20  Set Order Hook Callback Examples

7.7.21  Add Edit API

7.7.22  Add Edit Extended API

7.7.23  Add Edit Maximum API

7.7.24  SIL-SA Add Edit API

7.7.25  Get Data API

7.7.26  SIL-SA Get Data API

7.7.27  Startup Hook Callback

7.7.28   Startup Hook Callback Example

7.7.29  Validate Complete Callback

7.7.30  Validate Complete Callback Examples

7.7.31  Apply Complete Callback

7.7.32  Apply Complete Callback Examples

7.7.33  Commit Complete Callback

7.7.34  Commit Complete Callback Examples

7.7.35  Rollback Complete Callback

7.7.36  Dynamic Default Hook Callback

7.8  Notifications

7.8.1  Notification Send Function

7.8.2  Notification Send Function Variants

7.8.3  Event Stream Callback Functions

7.9  Operational Data

7.9.1  Get2 Object Template Based Operational Data

7.9.2  GETBULK Support

7.9.3  Example get2 callbacks

7.9.4  All In One GET2 Callback

7.9.5  AIO List Example

7.9.6  AIO Container Example

7.9.7  All In One GET2 Callbacks with XML/JSON buffers

7.9.8  Static Operational Data

Example Static Node Creation

7.9.9  Virtual Operational Data

Get Callback Template

Get Callback Example

7.10  Periodic Timer Service

7.10.1  Timer Callback Function

7.10.2  Timer Access Functions

7.10.3  Example Timer Callback Function

7.11  Terminal Diagnostic Messages

8  Network Management Datastore Architecture (NMDA)

8.1  NMDA Support

8.2  Instrumentation Changes for NMDA

8.3  Example NMDA GET2 Function

9  Server Callback Examples

9.1  YANG

9.2  Edit Operations

9.2.1  Create an XPO container

9.2.2  Create a Profile

9.2.3  Create a Stream Connection

9.2.4  Delete an XPO Container

9.2.5  Delete a Profile

9.2.6  Delete a Stream Connection

10  Development Environment

10.1  Programs and Libraries Needed

10.2  SIL Shared Libraries

10.2.1  SIL Library Names

10.2.2  SIL Library Location

10.2.3  make_sil_dir_pro

10.2.4  make_sil_bundle

10.2.5  Building SIL Libraries

10.3  SIL-SA Libraries

10.3.1  SIL-SA Library Names

10.3.2  SIL-SA Library Location

10.3.3  make_sil_sa_dir

10.4  SIL-SA Bundles

10.4.1  make_sil_sa_bundle

10.5   Static SIL-SA Libraries

10.5.1  Static SIL-SA Library Example

10.6  SIL Makefile

10.6.1  Target Platforms

10.6.2  Build Targets

10.6.3  Command Line Build Options

10.6.4  Example SIL Makefile

10.7  Controlling SIL Behavior

10.7.1  SIL Invocation Order (sil-priority)

10.7.2  Reverse SIL priority for delete operations (--sil-prio-reverse-for-deletes)

10.7.3  Deletion of Child Nodes (sil-delete-children-first)

10.7.4  Suppress leafref Validation

10.8 Short Names for SIL and SIL-SA Code Generation

10.8.1  CLI Parameters

10.8.2 Short Name Summary

10.8.3 Constants

10.8.4 Function and Variable Names

11  YControl Subsystem

11.1  YControl API Functions

11.1.1  Initialization and Cleanup

11.1.2  Runtime Functions

11.2  YControl Message Structure

11.2.1  yumaworks-ycontrol YANG Module

12  SIL-SA Subsystem

12.1  Example SIL-SA Application

12.2  SIL-SA Message Format

12.2.1  SIL-SA Registration Message Flow

12.2.2  Server Edit Transaction Message Flow

12.2.3  yumaworks-sil-sa YANG Module

13  DB-API Subsystem

13.1  DB-API Interface Functions

13.1.1  Filtered Retrieval Example

13.1.2  Subsystem RPC Request Example

13.1.3  Subsystem Action Request Example

13.2  DB-API Messages

14  YumaPro gNMI Subsystem

14.1  gNMI Client to Netconfd-pro Processing

14.1.1  Ypgnmi-app Processing

14.2  Ypgnmi-app Message Format

14.2.1  Ypgnmi-app Registration Message Flow

14.2.2  Yumaworks-yp-gnmi YANG Module

14.3  Netconfd-pro Processing

14.4  gNMI Service definition

14.4.1  gNMI GetRequest

14.4.2  gNMI SetRequest

14.4.3  gNMI JSON_ietf_val

14.4.4  gNMI Error Messages

15  Automation Control

15.1  YANG Parser Object Template APIs

15.1.1  Object Template User Flags

15.1.2  Object Template Callback API

15.1.3  YANG Object template Callback Usage Example

15.2  YANG Parser Extension Statement APIs

15.2.1  YANG Extension Handler Callback

15.2.2 Usage Example

15.3  Abstract YANG Data APIs

15.3.1  rc:yang-data

15.3.2  yd:augment-yang-data

15.4  SIL Language Extension Access Functions

15.5  Built-in YANG Language Extensions

15.5.1  ncx:abstract

15.5.2  ywx:alt-name

15.5.3  ncx:cli

15.5.4  ywx:cli-text-block

15.5.5  ywx:datapath

15.5.6  nacm:default-deny-all

15.5.7  nacm:default-deny-write

15.5.8  ncx:default-parm

15.5.9  ncx:default-parm-equals-ok

15.5.10  ywx:get-filter-element-attributes

15.5.11  ywx:exclusive-rpc

15.5.12  ywx:help

15.5.13  ncx:hidden

15.5.14  ncx:metadata

15.5.15  ncx:no-duplicates

15.5.16  ncx:password

15.5.17  ncx:qname

15.5.18  oc-ext:openconfig-hashed-value

15.5.19  oc-ext:regexp-posix

15.5.20  ncx:root

15.5.21  ywx:rpc-root

15.5.22  ncx:schema-instance

15.5.23  nacm:secure

15.5.24  ncx:sil-aio-get2

15.5.25  ncx:sil-delete-children-first

15.5.26  ywx:sil-force-replace-replay

15.5.27  ywx:sil-force-replay

15.5.28  ywx:sil-priority

15.5.29  ywx:sil-test-get-when

15.5.30  ywx:urlpath

15.5.31  ncx:user-write

15.5.32  nacm:very-secure

15.5.33  ncx:xpath

15.5.34  ywx:xpath-operational-ok

15.5.35  ncx:xsdlist