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  SDK QuickStart

2.1  Get the YANG Modules Ready

2.2  Generate the Instrumentation Code Stubs

2.2.1  SIL

2.2.2  SIL Bundle

2.2.3  SIL-SA

2.2.4  SIL-SA Bundle

2.3  Fill in the Instrumentation Code Stubs

3  Software Overview

3.1  Introduction

3.1.1  Intended Audience

3.1.2  What does YumaPro Do?

3.1.3  What is a YumaPro Root?

3.1.4  Searching YumaPro Roots

3.1.5  What is a SIL?

3.1.6  SIL Variants

3.1.7  Auto-generated SIL Files

3.1.8  Basic Development Steps

3.2  YumaPro Source Files

3.2.1  src/ncx Directory

3.2.2  src/platform Directory

3.2.3  src/agt Directory

3.2.4  src/mgr Directory

3.2.5  src/subsys-pro Directory

3.2.6  src/netconfd-pro Directory

3.2.7  src/yangcli-pro Directory

3.2.8  src/yangdiff-pro Directory

3.2.9  src/yangdump-pro Directory

3.2.10  src/yangdump-sdk Directory

3.2.11  src/ydump Directory

3.2.12  src/ypwatcher Directory

3.2.13  src/ypgnmi Directory

3.3  Server Design

3.3.1  YANG Native Operation

3.3.2  YANG Object Tree

3.3.3  YANG Data Tree

3.3.4  Service Layering

3.3.5  Session Control Block

3.3.6  Server Message Flows

3.3.7  Main ncxserver Loop

3.3.8  SIL Callback Functions

3.4  Server Initialization

3.4.1  Set the Server Profile

3.4.2  Bootstrap CLI and Load Core YANG Modules

3.4.3  External System Init Phase I : Pre CLI

3.4.4  Load CLI Parameters

3.4.5  Load Main Configuration File

3.4.6  Load Secondary Configuration Files

3.4.7  Configuration Parameter Activation

3.4.8  External System Init Phase I : Post CLI

3.4.9  Load SIL Libraries and Invoke Phase I Callbacks

3.4.10  External System Init Phase II : Pre-Load

3.4.11  Load <running> Configuration

3.4.12  Invoke SIL Phase II Callbacks

3.4.13  External System Init Phase II : Post-Load

3.4.14  Initialize SIL-SA Subsystems

3.4.15  Server Ready

3.5  Server Operation

3.5.1  Ypwatcher processing

3.5.2  Loading Modules and SIL Code

3.5.3  Core Module Initialization

3.5.4  Startup Configuration Processing

3.5.5  Process an Incoming <rpc> Request

3.5.6  Edit the Database

3.5.7  Save the Database

3.6  Built-in Server Modules

3.6.1  iana-crypt-hash.yang

3.6.2  ietf-datastores.yang

3.6.3  ietf-inet-types.yang

3.6.4  ietf-origin.yang

3.6.5  ietf-netconf.yang

3.6.6  ietf-netconf-acm.yang

3.6.7  ietf-netconf-nmda.yang

3.6.8  ietf-netconf-monitoring.yang

3.6.9  ietf-netconf-notifications.yang

3.6.10  ietf-netconf-partial-lock.yang

3.6.11  ietf-netconf-with-defaults.yang

3.6.12  ietf-restconf.yang

3.6.13  ietf-restconf-monitoring.yang

3.6.14  ietf-yang-library.yang

3.6.15  ietf-yang-patch.yang

3.6.16  ietf-yang-types.yang

3.6.17  nc-notifications.yang

3.6.18  netconfd-pro.yang

3.6.19  notifications.yang

3.6.20  yang-data-ext.yang

3.6.21  yuma-app-common.yang

3.6.22    yuma-ncx.yang

3.6.23  yuma-mysession.yang

3.6.24  yuma-netconf.yang

3.6.25  yuma-system.yang

3.6.26  yuma-time-filter.yang

3.6.27  yuma-types.yang

3.6.28  yumaworks-agt-profile.yang

3.6.29  yumaworks-app-common.yang

3.6.30  yumaworks-attrs.yang

3.6.31  yumaworks-config-change.yang

3.6.32  yumaworks-db-api.yang

3.6.33  yumaworks-event-filter.yang

3.6.34  yumaworks-extensions.yang

3.6.35  yumaworks-getbulk.yang

3.6.36  yumaworks-ids.yang

3.6.37  yumaworks-internal.yang

3.6.38  yumaworks-mgr-common.yang

3.6.39  yumaworks-opsmgr.yang

3.6.40  yumaworks-restconf-commit.yang

3.6.41  yumaworks-restconf.yang

3.6.42  yumaworks-server.yang

3.6.43  yumaworks-sesmgr.yang

3.6.44  yumaworks-sil-sa.yang

3.6.45  yumaworks-support-save.yang

3.6.46  yumaworks-system.yang

3.6.47  yumaworks-templates.yang

3.6.48  yumaworks-term-msg.yang

3.6.49  yumaworks-test.yang

3.6.50  yumaworks-types.yang

3.6.51  yumaworks-yang-api.yang

3.6.52  yumaworks-yangmap.yang

3.6.53  yumaworks-ycontrol.yang

3.6.54  yumaworks-yp-gnmi.yang

3.6.55  yumaworks-yp-ha.yang

3.7  Optional Server Modules

3.7.1  yuma-arp.yang

3.7.2  yuma-proc.yang

3.7.3  yuma-interfaces.yang

3.7.4  ietf-restconf-monitoring.yang

4  YANG Objects and Data Nodes

4.1  Object Definition Tree

4.1.1  Object Node Types

4.1.2  Object Node Template (obj_template_t)

4.1.3  obj_template_t Access Functions

4.2  Data Tree

4.2.1  Child Data Nodes

4.2.2  Data Node Types

4.2.3  YumaPro Data Node Edit Variables (val_editvars_t)

4.2.4  YumaPro Data Nodes (val_value_t)

4.2.5  YumaPro Data Nodes (Extra) (val_extra_t)

4.2.6  val_value_t Access Macros

4.2.7  val_value_t Access Functions

4.2.8  SIL Utility Functions

5   SIL External Interface

5.1  Stage 1 Initialization

5.2  Stage 2 Initialization

5.3  Cleanup

6  SIL Callback Interface

6.1  Configuration Initialization

6.1.1  Validation Phase

6.1.2  Apply Phase

6.1.3  Commit/Rollback Phase

6.2  Configuration Replay

6.2.1  Timer Callback to Check System

6.2.2  SIL Callbacks

6.2.3  Configuration Replay Callbacks

6.2.4  Configuration Replay Cookie

6.3  Error Handling

6.3.1  <rpc-error> Contents

6.3.2  SET_ERROR

6.3.3  agt_record_error

6.3.4  agt_record_error_errinfo

6.3.5  agt_record_warning

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

6.4  RPC Operation Interface

6.4.1  RPC Callback Template

6.4.2  RPC Callback Initialization

6.4.3  RPC Message Header

6.4.4  SIL Support Functions For RPC Operations

6.4.5  RPC Validate Callback Function

6.4.6  RPC Invoke Callback Function

6.4.7  RPC Data Output Handling

6.4.8  RPC Post Reply Callback Function

6.5  YANG 1.1 Action Interface

6.5.1  Action Callback Template

6.5.2  Action Callback Initialization

6.5.3  Action Message Header

6.5.4  SIL Support Functions For YANG Actions

6.5.5  Action Validate Callback Function

6.5.6  Action Invoke Callback Function

6.5.7  Action Data Output Handling

6.6  Database Operations

6.6.1  EDIT2 Callbacks

6.6.2  SIL-SA EDIT2 Callbacks

6.6.3  Database Template (cfg_template_t)

6.6.4  Database Access Functions

6.6.5  Database Callback Initialization and Cleanup

6.6.6  Example SIL Database Edit Callback Function

6.6.7  EDIT2 Callback Function Example

6.6.8 SIL-SA EDIT2 Callback Function Example

6.6.9  Database Edit Validate Callback Phase

6.6.10  Database Edit Apply Callback Phase

6.6.11  Database Edit Commit Callback Phase

6.6.12  Database Edit Rollback Callback Phase

6.6.13  Database Virtual Node Get Callback Function

6.6.14  Getting the Current Transaction ID

6.6.15  Finding Data Nodes with XPath

6.6.16  Determining if a Value Node is Set

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

6.7  Database Editing with In-Transaction APIs

6.7.1  Set-Hook Callback

6.7.2  Set Hook Callback Examples

6.7.3  SIL-SA Set-Hook Callback

6.7.4  SIL-SA Set Hook Callback Examples

6.7.5  Post Set Hook Callback

6.7.6  SIL-SA Post Set Hook Callback

6.7.7  Transaction-Hook Callback

6.7.8  Transaction Hook Callback Examples

6.7.9  SIL-SA Transaction-Hook Callback

6.7.10  Transaction Hook Callback Examples

6.7.11  Transaction Start Callback

6.7.12  Transaction Start Callback Examples

6.7.13  SIL-SA Transaction Start Callback

6.7.14  SIL-SA Transaction Start Callback Examples

6.7.15  Transaction Complete Callback

6.7.16  Transaction Complete Callback Examples

6.7.17  Transaction Complete SA Callback

6.7.18  SIL-SA Transaction Complete Callback Examples

6.7.19  Set Order Hook Callback

6.7.20  Set Order Hook Callback Examples

6.7.21  Add Edit API

6.7.22  Add Edit Extended API

6.7.23  Add Edit Maximum API

6.7.24  SIL-SA Add Edit API

6.7.25  Get Data API

6.7.26  SIL-SA Get Data API

6.7.27  Startup Hook Callback

6.7.28   Startup Hook Callback Example

6.7.29  Validate Complete Callback

6.7.30  Validate Complete Callback Examples

6.7.31  Apply Complete Callback

6.7.32  Apply Complete Callback Examples

6.7.33  Commit Complete Callback

6.7.34  Commit Complete Callback Examples

6.7.35  Rollback Complete Callback

6.7.36  Dynamic Default Hook Callback

6.8  Notifications

6.8.1  Notification Send Function

6.8.2  Notification Send Function Variants

6.9  Operational Data

6.9.1  Get2 Object Template Based Operational Data

6.9.2  GETBULK Support

6.9.3  Example get2 callbacks

6.9.4  All In One GET2 Callback

6.9.5  AIO List Example

6.9.6  AIO Container Example

6.9.7  All In One GET2 Callbacks with XML/JSON buffers

6.9.8  Static Operational Data

Example Static Node Creation

6.9.9  Virtual Operational Data

Get Callback Template

Get Callback Example

6.10  Periodic Timer Service

6.10.1  Timer Callback Function

6.10.2  Timer Access Functions

6.10.3  Example Timer Callback Function

6.11  Terminal Diagnostic Messages

7  Network Management Datastore Architecture (NMDA)

7.1  NMDA Support

7.2  Instrumentation Changes for NMDA

7.3  Example NMDA GET2 Function

8  Server Callback Examples

8.1  YANG

8.2  Edit Operations

8.2.1  Create an XPO container

8.2.2  Create a Profile

8.2.3  Create a Stream Connection

8.2.4  Delete an XPO Container

8.2.5  Delete a Profile

8.2.6  Delete a Stream Connection

9  Development Environment

9.1  Programs and Libraries Needed

9.2  SIL Shared Libraries

9.2.1  SIL Library Names

9.2.2  SIL Library Location

9.2.3  make_sil_dir_pro

9.2.4  make_sil_bundle

9.2.5  Building SIL Libraries

9.3  SIL-SA Libraries

9.3.1  SIL-SA Library Names

9.3.2  SIL-SA Library Location

9.3.3  make_sil_sa_dir

9.4  SIL-SA Bundles

9.4.1  make_sil_sa_bundle

9.5   Static SIL-SA Libraries

9.5.1  Static SIL-SA Library Example

9.6  SIL Makefile

9.6.1  Target Platforms

9.6.2  Build Targets

9.6.3  Command Line Build Options

9.6.4  Example SIL Makefile

9.7  Controlling SIL Behavior

9.7.1  SIL Invocation Order (sil-priority)

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

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

9.7.4  Suppress leafref Validation

10  YControl Subsystem

10.1  YControl API Functions

10.1.1  Initialization and Cleanup

10.1.2  Runtime Functions

10.2  YControl Message Structure

10.2.1  yumaworks-ycontrol YANG Module

11  SIL-SA Subsystem

11.1  Example SIL-SA Application

11.2  SIL-SA Message Format

11.2.1  SIL-SA Registration Message Flow

11.2.2  Server Edit Transaction Message Flow

11.2.3  yumaworks-sil-sa YANG Module

12  DB-API Subsystem

12.1  DB-API Interface Functions

12.1.1  Filtered Retrieval Example

12.1.2  Subsystem RPC Request Example

12.1.3  Subsystem Action Request Example

12.2  DB-API Messages

13  YumaPro gNMI Subsystem

13.1  gNMI Client to Netconfd-pro Processing

13.1.1  Ypgnmi-app Processing

13.2  Ypgnmi-app Message Format

13.2.1  Ypgnmi-app Registration Message Flow

13.2.2  Yumaworks-yp-gnmi YANG Module

13.3  Netconfd-pro Processing

13.4  gNMI Service definition

13.4.1  gNMI GetRequest

13.4.2  gNMI SetRequest

13.4.3  gNMI JSON_ietf_val

13.4.4  gNMI Error Messages

14  Automation Control

14.1  YANG Parser Object Template APIs

14.1.1  Object Template User Flags

14.1.2  Object Template Callback API

14.1.3  YANG Object template Callback Usage Example

14.2  YANG Parser Extension Statement APIs

14.2.1  YANG Extension Handler Callback

14.2.2 Usage Example

14.3  Abstract YANG Data APIs

14.3.1  rc:yang-data

14.3.2  yd:augment-yang-data

14.4  SIL Language Extension Access Functions

14.5  Built-in YANG Language Extensions

14.5.1  ncx:abstract

14.5.2  ywx:alt-name

14.5.3  ncx:cli

14.5.4  ywx:cli-text-block

14.5.5  ywx:datapath

14.5.6  nacm:default-deny-all

14.5.7  nacm:default-deny-write

14.5.8  ncx:default-parm

14.5.9  ncx:default-parm-equals-ok

14.5.10  ywx:get-filter-element-attributes

14.5.11  ywx:exclusive-rpc

14.5.12  ywx:help

14.5.13  ncx:hidden

14.5.14  ncx:metadata

14.5.15  ncx:no-duplicates

14.5.16  ncx:password

14.5.17  ncx:qname

14.5.18  oc-ext:regexp-posix

14.5.19  ncx:root

14.5.20  ywx:rpc-root

14.5.21  ncx:schema-instance

14.5.22  nacm:secure

14.5.23  ncx:sil-aio-get2

14.5.24  ncx:sil-delete-children-first

14.5.25  ywx:sil-force-replace-replay

14.5.26  ywx:sil-force-replay

14.5.27  ywx:sil-priority

14.5.28  ywx:sil-test-get-when

14.5.29  ywx:urlpath

14.5.30  ncx:user-write

14.5.31  nacm:very-secure

14.5.32  ncx:xpath

14.5.33  ywx:xpath-operational-ok

14.5.34  ncx:xsdlist