../_images/logo.png

YumaPro Source Code Guide

YumaPro Source Files

This section describes the files that are contained in the YumaPro Source Code packages.

Some YumaPro binary packages install H files and example source code:

  • The server C include files are copied into /usr/include/yumapro

  • The example program sources is installed in /usr/share/yumapro/src

The following table lists the files that are included within the netconf/src directory.

Note that not all of these source directories are included in every ‘yumapro’ source package.

Directory

Description

agt

Server implementation modules

combo-app

Example subsystem application using DB-API and SIL-SA services

db-api

Subsystem DB-API service support

db-api-app

Example subsystem application using DB-API service

mgr

Client implementation support

ncx

Core support for YANG, XPath, XML, JSON

netconfd-pro

YumaPro netconfd-pro application (main server)

platform

Platform definition files (H and Makefile support)

restconf

YumaPro restconf application (FastCGI thin client to transfer external HTTP(S) connection to internal netconfd-pro socket using RESTCONF protocol

sil-sa

Subsystem SIL-SA service support

sil-sa-app

Example subsystem application using SIL-SA service

subsys-pro

YumaPro netconf-subsystem-pro application (thin client to transfer external connection to internal netconfd-pro socket)

support-save-app

Internal application to decode XML file from get-support-save

yang-api

YumaPro yang-api application (FastCGI thin client to transfer external HTTP(S) connection to internal netconfd-pro socket using YANG-API protocol

yangcli-pro

YumaPro yangcli-pro application (NETCONF client)

yangdiff-pro

YumaPro yangdiff-pro application (YANG Semantic Compare)

yangdump-pro

YumaPro yangdump-pro application (YANG Compiler)

yangdump-sdk

YumaPro yangdump-sdk application (YANG Compiler with code generation support)

ycli

Client and server YANG based CLI support

ycontrol

Subsystem YControl protocol handler

ydump

YANG compiler support

ypgnmi

YumaPro ypgnmi-app application (GO subsystem application to transfer external gNMI requests to internal netconfd-pro socket)

ypgrpc

YumaPro ypgrpc-go-app application (GO subsystem application to host gRPC server and communicate with netconfd-pro socket)

yp-ha-app

Application to control the YP-HA mode for the local server

yp-shell

YumaPro yp-shell application (server version of YANG based CLI with direct connection to main server)

ypwatcher

YumaPro ypwatcher application (server state monitoring program)

src/ncx Directory

This directory contains the code that is used to build the 'libyumapro_ncx.so' binary shared library that is used by all YumaPro Tools programs.

It handles many of the core NETCONF/YANG data structure support, including all of the YANG/YIN, XML, and XPath processing. The following table describes the purpose of each file. Refer to the actual include file (E.g., 'ncx.h' in /usr/include/yumapro for more details on each external function in each C source module.

src/ncx C Modules

b64

Encoding and decoding the YANG binary data type.

blob

Encoding and decoding the SQL BLOB data type.

bobhash

Implementation of the BOB hash function.

cap

NETCONF capability definitions and support functions

cfg

NETCONF database data structures and configuration locking support.

cli

CLI parameter parsing data driven by YANG definitions.

conf

Text .conf file encoding and decoding, data driven by YANG definitions.

def_reg

Hash-driven definition registry for quick lookup support of some data structures. Contains back-pointers to the actual data.

dlq

Double linked queue support

errmgr_dict

Fast lookup data structures for -error message data

errmsg

Custom error message handling

ext

YANG extension data structure support

getbulk

Getbulk data structure support

getcb

Server Get Callback support

grp

YANG grouping data structure support

heapchk

Heap debugging support

help

Automatic help text, data-driven by YANG definitions

ipaddr_typ

Canonical handler for IP address data types

json_parse

Parse a token chain as JSON Text support, as defined in RFC 4627

json_wr

JSON Output support

libncx

This is a wrapper for all NCX Library functions. Include individual H files instead to save compile time.

log

System logging support

log_syslog

SYSLOG Logging support

log_util

Logging Utilities

log_vendor_extern

Vendor Specific Logging API

log_vendor

Vendor Specific Logging support

ncx_appinfo

YumaPro Netconf Extensions (NCX) support

ncxconst

YumaPro common constants

ncx_feature

YANG feature and if-feature statement data structure support

ncx

YANG module data structure support, and some utilities

ncx_list

Support for the ncx_list_t data structure, used for YANG bits and ncx:xsdlist data types.

ncx_nmda

Support for NMDA data structures and data types

ncxmod

File Management: Controls finding and searching for YANG/YIN files, data files, and script files

ncx_num

YumaPro ncx_num_t data structure support. Used for processing value nodes and XPath numbers.

ncx_str

YumaPro string support.

ncxtypes

YumaPro common types

obj

YumaPro object obj_template_t data structure access

obj_dict

Unused experimental YANG Hash support for object identification

obj_errmsg

Object specific custom error message support

obj_help

Automated object help support used with help module

op

NETCONF operations definitions and support functions

plock_cb

Partial Lock Control Block support

plock

Partial Lock support

rpc_err

NETCONF <rpc-error> data structures and support functions.

rpc

NETCONF <rpc> and <rpc-reply> data structures and support functions

runstack

Script execution stack support for yangcli-pro-pro scripts

send_buff

NETCONF send buffer function

ses

NETCONF session data structures and session access functions

ses_msg

Message buffering support for NETCONF sessions

status_enum

Return Status data type

status

Error code definitions and error support functions

thd

POSIX Threads support

tk

Token chain data structures used for parsing YANG, XPath and other syntaxes.

top

Top-level XML node registration support. The <rpc> and <hello> elements are registered by the server. The <hello>, <rpc-reply> , and <notification> elements are registered by the client.

tstamp

Time and date stamp support functions

typ

YANG typedef data structures and access functions

typ_userdef

User-defined data types (callback support)

val

YumaPro value tree data structures and access functions

val_child

Support for the val_value_t data structure. child_hdrQ for NCX_BT_LIST and NCX_BT_CONTAINER

val_tree

AVL Tree storage of YANG List Data support

val_unique

YANG unique-stmt support

val_util

High-level utilities for some common SIL tasks related to the value tree.

var

User variable support, used by yangcli-pro-pro and XPath

version

Hardwired release train version ID

xml_msg

XML message data structures and support functions

xmlns

XML Namespace registry

xml_util

XML parse and utility functions

xml_val

High level support functions for constructing XML-ready val_value_t data structures

xml_wr

XML output support functions and access-control protected message generation support

xpath1

XPath 1.0 implementation

xpath1_cmp

Xpath 1.0 search support; Compare support

xpath1_fn

Xpath 1.0 search support; XPath function library

xpath1_aio

Xpath 1.0 search support fort All In One GET2 callbacks

xpath1_get2

XPath 1.0 distributed data support via GET2 callbacks

xpath1_pred

Xpath 1.0 search support; predicate support

xpath1_res

Xpath 1.0 search support; XPath result support

xpath

XPath data structures and support functions

xpath_wr

Support for generating XPath expression content within an XML instance document

xpath_yang

Special YANG XPath construct support, such as path expressions and instance identifiers

yangapi

YANG-API/RESTCONF protocols support

yangconst

YANG constants

yang

YANG definitions and general support functions

yang_data

rc:yang-data extension support

yang_ext

YANG parsing and validation of the extension statement

yang_feature

Support for YANG Feature and if-feature statements

yang_grp

YANG parsing and validation of the grouping statement

yang_hash

YANG Hash support functions (unused)

yang_obj

YANG parsing and validation of the rpc, notification, and data definition statements

yang_parse

Top level YANG parse and validation support

yang_patch

YANG Patch support

yang_typ

YANG typedef and type statement support

yin

YANG to YIN mapping definitions

yinyang

YIN to YANG translation

ypgnmi

YP-GNMI protocol support

src/platform Directory

This directory contains platform support include files and Makefile support files. It is used by all YumaPro C modules to provide an insulating layer between YumaPro programs and the hardware platform that is used.

Note

For memory management, all YumaPro programs use macros instead of 'malloc' and 'free' functions directly.

  • Use 'm__getMem' or 'm__getObj' instead of 'malloc'

  • Use 'm__free' instead of 'free'

src/platform Files

curversion.h

File generated during the build process to get the SVNVERSION number

platform.profile

Included by Makefiles for build support

platform.profile.cmn

Included by Makefiles for build support

platform.profile.depend

Included by Makefiles for dependency generation support

procdefs.h

Platform definitions. Contains basic data types and macros used throughout the YumaPro code. All C files include this file before any other YumaPro files.

setversion.sh

Shell script to generate the curversion.h file

src/agt Directory

This directory contains the NETCONF server implementation and built-in module SIL code.

The following table describes the C modules contained in this directory:

src/agt C Modules

agt

Server initialization and cleanup control points. Also contains the agt_profile_t data structure.

agt_acm_extern

External ACM API support

agt_acm

NETCONF access control implementation. Wrapper for 3 different ACM models: IETF, Yuma, and External (vendor provided)

agt_acm_ietf

IETF NACM (RFC 6536) support

agt_acm_yuma

Yuma NACM support (unused and not supported)

agt_action

Support for the YANG 1.1 action-stmt

agt_audit

Audit log support

agt_callhome

CallHome protocol support

agt_cap

Server capabilities. Generates the server <capabilities> element content.

agt_cb

SIL callback support functions.

agt_cfg

Configuration Edit Transaction support

agt_cli

Server CLI and .conf file control functions.

agt_commit_complete

Commit Complete Callback support

agt_conf

Nested config file support

agt_connect

Handles the internal <ncx-connect> message sent from the netconf-subsystem-pro to the netconfd-pro server.

agt_crypt

Crypt-hash data type support

agt_curl

libcurl support for <url> parameter

agt_db_api

Handles the DB-API service (messages to/from subsystem)

agt_db_lock

Distributed DB-Lock feature support

agt_get2

Second generation GET support

agt_getbulk

GETBULK support

agt_hello

Handles the incoming client <hello> message and generates the server <hello> message.

agt_hook_util

NETCONF Server Set/Transaction Hook utility functions. This file contains functions to support validation of callbacks and some supplemental functions.

agt_ietf_notif

NETCONF Base notifications (RFC 6470)

agt_json_parse

JSON Input support for YANG-API/RESTCONF protocols

agt_library

Setup the server in the library mode

agt_modtags

Module tags support

agt_ncchd

OpenSSH connect support for CallHome protocol

agt_ncx

NETCONF protocol operation implementation. Contains the yuma-netconf module SIL callback functions.

agt_ncx_load

NETCONF Server load / unload operations support

agt_ncxserver

Implements the ncxserver loop, handling the IO between the server NETCONF sessions and the netconf-subsystem-pro thin client program.

agt_nmda

NMDA module initialization and cleanup

agt_not

NETCONF Notifications implementation. Contains the notifications and nc-notifications modules SIL callback functions.

agt_openssl

Support for NETCONF over TLS protocol

agt_owner

Configuration Owner support tracks client user names associated with configuration changes

agt_plock

Partial Lock (RFC 5717) support

agt_profile

Server Profile support allows

agt_restcmn

YANG-API/RESTCONF protocols common handler

agt_restconf

RESTCONF protocol handler

agt_rpc

NETCONF RPC operation handler

agt_rpcerr

NETCONF <rpc-error> generation

agt_ses

NETCONF session support and implementation of the YumaPro Session extensions. Contains the yuma-mysession module SIL callback functions.

agt_signal

Server signal handling support

agt_sil

Handles SIL-SA service (messages to/from subsystem) for distributed remote transactions

agt_sil_lib

Dynamic library management for SIL and SIL-SA libraries

agt_sil_profile

Handles agt_profile initialization on SIL-SA subsystems

agt_state

Standard NETCONF monitoring implementation. Contains the ietf-netconf-monitoring SIL callback functions.

agt_sys

Server system monitoring and notification generation. Contains the yuma-system module SIL callback functions.

agt_templates

Support for yumaworks-templates modules

agt_time_filter

Supports yuma-time-filter module for efficient retrieval based on last-modified timestamp of the datastore (or data node)

agt_timer

SIL periodic timer callback support functions

agt_top

Server registration and dispatch of top-level XML messages

agt_tree

Subtree filtering implementation

agt_tree_get2

Support for Get2 callback data retrieval

agt_util

SIL callback utilities

agt_val

Server validation, and commit support for NETCONF database operations

agt_val_parse

Incoming <rpc> and <config> content parse and complete YANG constraint validation

agt_val_rollback

Rollback support for NETCONF database operations

agt_val_silcall

NETCONF Server database callback handler. SIL callback code

agt_val_unload

Unload module support

agt_xml

Server XML processing interface to ncx/xml_util functions

agt_xpath

XPath filtering implementation

agt_yangapi_edit

YANG-API/RESTCONF datastore editing support

agt_yangapi

YANG-API protocol handler

agt_yangapi_reply

YANG-API/RESTCONF response message handler

agt_yangpatch

YANG-PATCH Edit Handler for HA/RESTCONF/NETCONF

agt_ycontrol

YControl Subsystem Message handler

agt_ypcoap

CoAP (RFC 7252) Support

agt_ypgnmi

YP-GNMI protocol support

agt_ypgnmi_get

YP-GNMI protocol GET operation support

agt_ypgnmi_not

YP-GNMI protocol notification support

agt_ypgnmi_set

YP-GNMI protocol SET operation support

agt_ypgrpc

YP-GRPC protocol support

agt_ypgrpc_state

YP-GRPC monitoring implementation. Contains the yumaworks-grpc-mon SIL callback functions.

agt_yp_ha

High Availability module (YP-HA)

agt_yp_ha_active

High Availability module (YP-HA). HA Active Mode

agt_yp_ha_standby

High Availability module (YP-HA). HA Standby Mode

agt_ypsnmp

SNMP Protocol support

agt_ypsnmp_agentx

SNMP Protocol Agent-X support

agt_ypsnmp_not

SNMP Protocol Notification support

agt_ypsnmp_sec

SNMP Protocol Security support

agt_ypsnmp_util

SNMP Protocol utilities

ietf-netconf-nmda

NMDA protocol operations for NETCONF protocol

u_yumaworks_event_ filter

Supports yumaworks-event-filter module for disabling specific notification types (User module)

u_yumaworks_templates

Supports yumaworks-templates module for template-driven configuration (User module)

y_yumaworks_event_ filter

Supports yumaworks-event-filter module for disabling specific notification types (Yumapro module)

y_yumaworks_event_ filter

Supports yumaworks-event-filter module for disabling specific notification types (Yumapro module)

src/mgr Directory

This module contains the NETCONF client support code. It handles all the basic NETCONF details so a simple internal API can be used by NETCONF applications such as yangcli-pro.

The following table describes the C modules contained in this directory:

src/mgr C++ Modules

c-api-devices

yp-client APIs for client device configuration

c-api-session

yp-client APIs for client session management

c-api-users

yp-client APIs for client user configuration

libmgr

Include most of the mgr libraries from 1 H file

mgr

Client initialization and cleanup control points. Also contains manager session control block data structure support functions.

mgr_callhome

Client support for NETCONF CallHome sessions

mgr_cap

Generate the client NETCONF <capabilities> element content

mgr_coap

CoAP message handler

mgr_hello

Handles the incoming server <hello> message and generates the client <hello> message.

mgr_http

HTTP message handler

mgr_io

Handles SSH server IO support for client NETCONF sessions

mgr_load

Load external file variables into the system

mgr_not

Handles incoming server <notification> messages

mgr_rpc

Generate <rpc> messages going to the NETCONF server and process incoming <rpc-reply> messages from the NETCONF server.

mgr_ses

Handles all aspects of client NETCONF sessions.

mgr_signal

Client signal handler

mgr_top

Client registration and dispatch of top-level XML messages

mgr_val_parse

Incoming <rpc-reply>, <notification>, and <config> content parse and complete YANG constraint validation.

mgr_xml

Client XML processing interface to 'ncx/xml_util' functions

src/subsys-pro Directory

This directory contains the netconf-subsystem-pro program. This is a thin-client application that just transfers input and output between the SSH server and the NETCONF server. The main C source modules are called 'netconf-subsystem' and 'subsystem'. This is a stand-alone binary that is part of some yumapro packages. It is installed in the /usr/sbin/ directory.

src/netconfd-pro Directory

This directory contains the netconfd-pro program, which implements the NETCONF server. It contains one C module called netconfd-pro, which defines the NETCONF server 'main' function. This is a stand-alone binary that is part of some binary packages. It is installed in the /usr/sbin/ directory.

src/yangcli-pro Directory

This directory contains the yangcli-pro program, which is the YumaPro NETCONF client program. This is a stand-alone binary that is part of the 'yumapro-client' and other packages. It is installed in the /usr/bin/ directory.

src/yangdiff-pro Directory

This directory contains the yangdiff-pro program, which is the YumaPro YANG module compare program. This is a stand-alone binary that is part of the 'yumapro-client' and other packages. It is installed in the /usr/bin/ directory.

The following table describes the C modules contained in this directory:

src/yangdiff-pro

yangdiff-pro

YANG module semantic compare program

yangdiff-pro_grp

Implements semantic diff for YANG grouping statement

yangdiff-pro_obj

Implements semantic diff for YANG data definition statements

yangdiff-pro_typ

Implements semantic diff for YANG typedef and type statements

yangdiff-pro_util

Utilities used by the other yangdiff-pro C modules

src/yangdump-pro Directory

This directory contains the yangdump-pro program, which is the YumaPro YANG compiler program. This is a stand-alone binary program. The source code is included in the YumaPro SDK Complete license. It is installed in the /usr/bin/ directory.

Note

The yangdump-pro and yangdump-sdk programs are the same starting in the 21.10-4 release.

src/yangdump-sdk Directory

This directory contains the yangdump-sdk program, which is the YumaPro YANG compiler program with code generation support. This is a stand-alone binary program. The source code is included in the YumaPro SDK Complete license. It is installed in the /usr/bin/ directory.

src/ydump Directory

This directory contains some library files to support the yangdump-pro program, which is the YumaPro YANG compiler program. This is a static library linked with that program. The source code is included in the YumaPro SDK Complete license.

The following table describes the C modules contained in this directory:

src/ydump C Modules

c

Implements SIL C file generation

c_util

Utilities used for SIL code generation

cyang

Handle C/H file conversion (access from ydump)

h

Implements SIL H file generation

html

Implements YANG to HTML translation

sql

Implements SQL generation for YANG module WEB Docs

xsd

Implements YANG to XSD translation

xsd_typ

Implements YANG typedef/type statement to XSD simpleType and complexType statements

xsd_util

XSD conversion utilities

xsd_yang

YANG to XSD translation utilities

yangdump_util

Utilities used by all yangdump-pro C modules

yangstats

YANG module statistics support

yangyin

Implements YANG to YIN translation

ydump

Main library entry point

src/ypwatcher Directory

This directory contains the ypwatcher program, which is the YumaPro server's state monitoring program. This is a stand-alone binary program. The source code is included in the YumaPro SDK Complete license. It is installed in the /usr/bin/ directory.

src/ypgnmi Directory

This directory contains the ypgnmi-app program, which is the YumaPro gNMI application. This is a stand-alone binary program. It is installed in the /usr/bin/ directory.

The following table lists the files that are included within the 'netconf/src/ypgnmi' directory.

Directory

Description

gnmi

gNMI server handling, utility functions and functions to deal with the messages

gnmi_connect

gNMI server code that responsible for the gNMI client to the netconfd-pro server communication

message_handler

Auto-generated gostruct representation of the yumaworks-yp-gnmi.yang file. Used for message handling

netconfd_connect

Handler for the netconfd-pro connection with ypgnmi-app

utils

Generic utility functions

ycontrol

Utilities to handle the netconfd-pro YControl messages and connections

The ypgnmi-app.go program is a subsystem application that provides connectivity between the netconfd-pro server and gNMI clients.

src/ypgrpc Directory

This directory contains the yumapro-grpc program, which is the YumaPro gRPC application. This is a stand-alone binary program. It is installed in the /usr/bin/ directory.

The following table lists the files that are included within the 'netconf/src/ypgrpc' directory.

Directory

Description

cli

Handle the CLI parameters for ypgrpc-go-app application

credentials

Package credentials loads certificates and validates user credentials.

examples

Stub code example for Proto files (helloworld and example Protos)

log

Handle the Logging for ypgrpc-go-app application

message_handler

Auto-generated gostruct representation of the yumaworks-yp-grpc.yang file. Used for message handling

netconfd_connect

Handler for the netconfd-pro connection with ypgrpc-go-app

proto

Proto Files handling, parsing, search and storing

utils

Generic utility functions

ycontrol

Utilities to handle the netconfd-pro YControl messages and connections

The 'ypgrpc-go-app.go' program is a main application that provides gRPC server functionality, connectivity to the netconfd-pro server and stub code gRPC Services callback handling.

Yocto Introduction

This document is intended for software developers using the YumaPro SDK and multi-protocol server in custom embedded Linux platforms by using the Yocto Project and its BitBake recipes. It covers the setup and basic steps required to build the software. The reader should be familiar with the Yocto Project.

Yocto Linux

The Yocto Linux development system allows custom Linux variants to be created in an automated, controlled manner.

Yocto Home Page

The build-time and run-time information needed to build an entire Linux platform for an embedded system is managed as metadata within Yocto.

OpenEmbedded Home Page

Yocto Features Supported by the YumaPro Server:

  • Makefiles have been updated to fully support bitbake environment variables for cross-compiler use

  • dropbear SSH server integration

  • openSSH SSH server integration

  • system deamon integration

  • lighttpd WEB server integration

  • net-snmp integration for SNMP protocol support

  • base-files integration for yp-shell integration and user management

This version of the YumaPro for Yocto Linux package supports Yocto starting with version 2.3 (Pyro) of the Yocto Linux development system. The recipe “core-image-minimal” is used as the base for YumaPro server integration.

  • The complete YumaPro server can be built for Yocto Linux to provide YANG-based NETCONF, RESTCONF, SNMP, and CLI management interfaces.

  • The YumaPro functionality is specified in a layer named “meta-yumapro”.

There are two variants (called recipes) of the server supported at this time:

  • netconfd-pro-iot: Server for IoT platforms, based on yumapro-core source tarball

  • netconfd-pro-sdn: Server for SDN platforms, based on yumapro-server source tarball

These recipes can be customized as needed. It is expected that specific board support packages (BSPs) will be selected by a vendor according to project requirements.

The meta-yumapro package contains the recipes and other data files to allow a Yocto cross-compile image to be created. All makefiles have been updated so that the variables used by bitbake are supported for correct cross-compile development.

IoT vs. SDN Recipe Differences

There are two example server recipes provided. These can be used directly or adapted for use in a yocto build environment. The following table summarizes the differences between these recipes.

SSH Server for NETCONF and yp-shell

dropbear

openssh

WEB Server for RESTCONF

lighttpd

lighttpd

YControl Protocol

Not Supported

Supported

DB-API Protocol

Not Supported

Supported

SIL-SA Protocol

Not Supported

Supported

YP-HA Protocol

Not Supported

Supported

Static Build

Supported

Not Supported

Yocto Build Host Software

The build host tools need to be setup before the server can be built.

  • The yumapro layer is designed to work with the Yocto 2.3 release (Pyro) or later.

  • The “pyro” and “master” branches of the Poky project have been tested with the meta-yumapro layer.

The following diagram shows the directories that the user is expected to setup (in blue) and the directories that the supplied software will add.

../_images/yocto_file_tree.png

poky

Yocto installation of poky build system

build

Root of all build directories

conf

Build configuration directory. Edit local.conf and bblayers.conf

tmp

Root of all bitbake generated build files

meta-*

Several opensource layer directories

meta-yumapro

Root of the yumapro layer bitbake files

recipes-server

Root directory for all yumapro server recipes

netconfd-pro

Root directory of all netconfd-pro recipes (IoT and SDN)

The netconfd-pro-iot and netconfd-pro-sdn recipes are designed to integrate with certain open source recipes, in order to automatically produce a system image with a running system, upon first boot.

The following recipes are used by the yumapro server recipes:

  • base-files: Used to add yp-shell to /etc/shells

  • dropbear: Used to integrate netconfd-pro-iot support into dropbear and configure boot-time parameters

  • openssh: Used to configure netconfd-pro-sdn boot-time parameters into OpenSSH

  • lighttpd: Used to configure RESTCONF server boot-time parameters for lighttpd WEB server

  • net-snmp: Used to integrate SNMP protocol support and configure boot-time SNMP parameters

Setup Yocto Linux

These instructions do not override the Yocto documentation.

This document is not a yocto tutorial. Refer to the Yocto documentation for details on using the Yocto and bitbake software.

Yocto Project Quick Start Guide

Yocto Project Mega Manual

Yocto Project Developer Manual

Building your own recipe:

Bitbake User Manual

Install Yocto

Follow the instructions in the Yocto Quick Start guide.

Example Ubuntu Install.

1a) install dependencies
  > sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
     xz-utils debianutils iputils-ping libsdl1.2-dev xterm

1b) Install poky
   > git clone git://git.yoctoproject.org/poky
   > cd poky
   [Should be on branch ‘master’]

1c) add meta-webserver
   > git clone git://git.openembedded.org/meta-openembedded

Setup Build Configuration

Starting in the 'poky' directory, source the environment file to enable bitbake.

Then cd to the “conf” directory and edit the configuration files.

> source oe-init-build-env

build> cd conf

build/conf>

Edit local.conf:

  1. Enable a target platform. The default is the i586 architecture on the qemu86 virtual target. Refer to the Yocto Quick start guide to enable different targets and board support packages (BSPs).

  2. Add the netconfd-pro server recipe to the image. Choose eithernetconfd-pro-iotornetconfd-pro-sdn, but not both. Example for netconfd-pro-sdn:

IMAGE_INSTALL_append = " netconfd-pro-sdn"

Starting with the Hardknott release(3.3) of OpenEmbedded, bitbake is using a new variable override syntax. For Hardknott and later releases, the netconfd-pro server recipe should be added like this:

IMAGE_INSTALL:append = " netconfd-pro-sdn"

Edit bblayers.conf:

  1. Enable layers needed to build the desired Yocto Linux system variants. The following example shows the layers needed for all variants of the netconfd-pro server. The file locations will be different depending on your Yocto installation location.

BBLAYERS ?= " \
  /home/andy/swdev/poky/meta \
  /home/andy/swdev/poky/meta-poky \
  /home/andy/swdev/poky/meta-yocto-bsp \
  /home/andy/swdev/poky/meta-openembedded/meta-oe \
  /home/andy/swdev/poky/meta-openembedded/meta-python \
  /home/andy/swdev/poky/meta-openembedded/meta-networking \
  /home/andy/swdev/poky/meta-openembedded/meta-webserver \
  /home/andy/swdev/poky/meta-yumapro \
"

meta-yumapro Layer

The meta-yumapro tarball contains “yumapro” layer files required to build, install, and integrate a multi-protocol server for Yocto Linux.

Installation

Tarball Naming Conventions

The filename structure of the tarball file is as follows:

meta-yumapro-<version>.gz

Example Filename:

meta-yumapro-21.10-3.tar.gz

Extract to the poky Directory

The files need to be extracted to the poky directory so subtrees can be integrated into the build environment for the server.

Extraction Example:

> cd poky
> tar xvf meta-yumapro-21.10-3.tar.gz

Creates a directory named meta-yumapro in the current directory.

Configuration

The only recipes supported at this time are “netconfd-pro-iot” and “netconfd-pro-sdn”. The configuration files for these recipes are located in the directory poky/meta-yumapro/recipes-server/netconfd-pro. There are several features that can be enabled or disabled by uncommenting or commenting a set of directives.

The set of recipe files:

  • netconfd-pro.inc: common recipe file

  • netconfd-pro-iot.inc: IoT configuration recipe file

  • netconfd-pro-sdn.inc: SDN configuration recipe file

  • netconfd-pro-iot_17.10.bb: IoT configuration main recipe file for 17.10 release train

  • netconfd-pro-sdn_17.10.bb: SDN configuration main recipe file for 17.10 release train

Cross Compilation Support

The YumaPro code can be cross-compiled on many different platforms.

This section will be expanded over time as internal documentation is converted to user documentation.

KnowledgeBase FAQs For Source Code Usage

YumaPro README

  • Last Updated: 2022-02-25

Pre-Build steps:

- set netconf/src/platform/platform.profile details if needed
   - see procdefs.h in this directory for common H defs
   - CFLAGS and other make details are here

- To build:
      > cd to the yumapro top directory
      > make [Build Variables]
      > sudo make [Buiald Variables] install

Build Notes

To build all default components (shared libs) on Linux, this will build all default components and install it in the default locations:

  • make [FLAGS]

  • [sudo] make [FLAGS] install

For example, to build all default components (shared libs) on Fedora, 64-bit:

  • make LIB64=1

  • [sudo] make LIB64=1 install

For example, to build all default components (shared libs) except /usr/lib/yuma/libtoaster.so

  • make NOTOASTER=1

  • [sudo] make NOTOASTER=1 install

External file dependencies (for netconfd, optional):

  • /etc/services

  • /etc/ssh/sshd_config

  • /etc/apache2/sites-available/yang-api.conf

  • /etc/apache2/sites-available/restconf.conf

  • a2ensite yang-api

  • a2ensite restconf

  • a2enmod fcgi

  • SELinux config to allow access to port 830

Default Installed Programs:

  • /usr/bin/db-api-app [WITH_DB_API]

  • /usr/bin/yangcli-pro

  • /usr/bin/yangdump-pro

  • /usr/bin/yangdump-sdk

  • /usr/bin/yangdiff-pro

  • /usr/bin/ypcontrol

  • /usr/bin/ypwatcher

  • /usr/bin/yp-shell [WITH_CLI]

  • /usr/bin/yp-ha-app [WITH_YP_HA]

  • /usr/sbin/netconfd-pro

  • /usr/sbin/netconf-subsystem-pro

  • /usr/sbin/restconf [WITH_RESTCONF]

  • /usr/sbin/yang-api [WITH_YANGAPI]

Default Installed Libraries:

  • /usr/lib/libyumapro_agt.so.MM.NN

  • /usr/lib/libyumapro_db-api.so.MM.NN [WITH_DB_API]

  • /usr/lib/libyumapro_mgr.so.MM.NN

  • /usr/lib/libyumapro_ncx.so.MM.NN

  • /usr/lib/libyumapro_sil-sa.so.MM.NN [WITH_SIL_SA]

  • /usr/lib/libyumapro_ycli.so.MM.NN

  • /usr/lib/libyumapro_ycontrol.so.MM.NN [WITH_YCONTROL]

  • /usr/lib/yumapro/libtoaster.so

  • /usr/lib/yumapro/libyp_system.so

  • /usr/lib/yumapro/libsil-error.so

Default Installed Libraries if LIB64=1:

  • /usr/lib64/...

Default Installed Additional Files:

/usr/share/doc/yumapro/* -- user documentation /etc/yumapro/* -- sample application config files /usr/share/yumapro/* -- root of all YumaPro static data files /usr/share/yumapro/modules/* -- root of default installed YANG modules /usr/man/man1/* -- man page files installed here

User-Specific Files

$HOME/.yumapro -- yangcli-pro and netconfd-pro files

YumaPro Package Variants:

# the docs are no longer split into several bundles for installation # Instead, 1 bundle for RPM and 1 for Debian are produced # # yumapro-doc # # BINARY PACKAGES # # yumapro-sdk ==> PACKAGE=DEVELOPER # yumapro-pthreads ==> PACKAGE=DEVELOPER PTHREADS=1 # yangcli-pro ==> PACKAGE=CLIENT # # NO LONGER USED # # yumapro ==> PACKAGE=USER # yumapro ==> PACKAGE=SERVER #

Build Variables:

BASIC

BASIC=1: build yumapro-sdk-basic package Used by YumaWorks packaging only. Do Not Use!

BITBAKE

BITBAKE=1: build for Yocto/bitbake environment.

  • Should set NO_LIBSSH2=1 and NO_LIBSSL=1 if building yp-shell.

  • Can also use STATIC=1 and STATIC_SERVER=1.

  • Do not use UCLINUX=1.

BUILD_LIBS_ONLY

BUILD_LIBS_ONLY=1: build only the libraries (static and or dynamic)

  • Do not build the SDK applications.

  • Do not use dl library in the yangcli_show_extern.cpp file

CENTOS

CENTOS5=1: build for the CentOS 5.10 platform.

  • Must also use LIB64=1 for x86_64 architecture.

CLANG

CLANG=1: use clang instead of gcc for the C compiler and use clang++ instead of g++ for the C++ compiler and linker

  • Default is to use gcc. Ignored if any of these flags set:

    • CROSS_TARGET

    • PACKAGE_BUILD

    • GPROFILE

CLANG_ASAN

CLANG_ASAN=1: use clang in LeakSanitizer mode; For debugging only; will force the compiler and linker to use clang and add flags such as -fsanitize=address

COVERITY

COVERITY=1: special flag used with MAC=1 to allow Coverity

  • Static Analysis tools to run on Ubuntu but build with MAC=1 compiler flags. DO NOT USE THIS FLAG FOR A REAL BUILD.

CROSS_TARGET

CROSS_TARGET=<string>: Define the prefix to use for a cross target toolchain.

  • Example CROSS_TARGET=arm-linux-gnueabi-

  • Note that cross compiling requires that the target architecture linker finds the correct external libraries such as libxml2

  • Do not use this parameter for uCLinux. Use UCLINUX=1

  • Do not use this parameter for Yocto. Use BITBAKE=1 instead

  • The tool names will be appended to the $(CROSS_TARGET) value if it is set. E.g. $(CROSS_TARGET)gcc will resolve to arm-linux-gnueabi-gcc

CYGWIN

CYGWIN=1: build on windows within cygwin environment (OBSOLETE! NOT SUPPORTED!)

DEBIAN

DEBIAN=1: set for Ubuntu packaging build; do not use in normal builds, Used by YumaWorks packaging only. Do Not Use!

DEBIAN_MAKE

DEBIAN_MAKE=1: set for ubuntu packaing build; do not use in normal builds; Indicates compile phase of build Used by YumaWorks packaging only. Do Not Use!

DEBUG

DEBUG=1: set to add gdb symbols instead of -O2; does not remove the #ifdef DEBUG function NULL pointer checks in external functions

DEBUG2

DEBUG2=1: set to enable extra debugging code; DEBUG=1 must also be set

DEBUG_LOG_TLS

DEBUG_LOG_TLS=1: set to enable output buffer tracing for netconfd-pro using WITH_OPENSSL=1 on a NETCONF over TLS session

  • This option may be a security risk since the raw buffer output is not pre-screened for passwords or other sensitive data

  • The log-level must be set to debug2 or higher for the buffer to be logged

DESTDIR

DESTDIR=string: set the debian target build (default NULL)

DOC

DOC=1: debian packaging build flag to build the yuma-doc package. Do not use in normal builds.

DOCDIR

DOCDIR=/path/to/docs: set to override the default location to install user manuals, which is $(PREFIX)/share/doc/yumapro with default prefix is /usr/share/doc/yumapro

ETC_PREFIX

ETC_PREFIX=string: set the top etc dir (after DESTDIR)

  • default: /etc

EVAL (INTERNAL)

EVAL=1: build the evaluation version of the YumaPro software Used by YumaWorks packaging only. Do Not Use!

  • The following server restrictions will apply:

    • 250 requests before error returned for every request

    • 10 sessions

EVERYTHING

EVERYTHING=1: build all optional code modules. This flag cannot be be used if DEBIAN=1 is set.

  • Do not use for packaging builds

Equivalent to:
  TIMER_MONO_CLOCK=1
  WITH_CALLHOME=1
  WITH_CLI=1
  WITH_CURL=1
  WITH_IETF_INTERFACES=1
  WITH_GET2_TEST=1
  WITH_GET3_TEST=1
  WITH_HOOKS_TEST=1
  WITH_HOOKS_TEST_SILSA=1
  WITH_LIB_SHOW=1
  WITH_LIB_SYSTEM=1
  WITH_OPENSSL=1
  WITH_RESTCONF=1
  WITH_SIL_ERROR=1
  WITH_SUPPORT_SAVE=1
  WITH_TEMPLATES=1
  WITH_YANGMAP=1
  WITH_YANG_PUSH=1
  WITH_YCONTROL=1
  WITH_YP_HA=1
  WITH_YUMA_ARP=1
  WITH_YUMA_INTERFACES=1
  WITH_YUMA_PROC=1

EXTRA_CFLAGS

EXTRA_CFLAGS=<string> : Additional compiler flags to add to the CFLAGS directive. It will be added to CPPFLAGS as well for C++ compilation

FREEBSD

FREEBSD=1: Build for a FreeBSD platform

FORCE_YUMA_HOME

FORCE_YUMA_HOME=1: use when building SIL libraries to link against a development version of yuma. The YUMA_HOME environment variable must be set, and it must point to the 'netconf' directory:

Bash example using 'mybranch':

export YUMA_HOME=/home/andy/swdev/yuma/trunk/branches/mybranch/netconf

The yuma include (H) files from $(YUMA_HOME)/src/* will be used instead of the system H files in /usr/include/yuma.

The libagt and libncx libraries from $(YUMA_HOME)/target/lib will be used instead of the system libraries in /usr/lib or /usr/lib64. The static versions (libagt.a and libncx.a) will be expected if STATIC=1 is also set. Otherwise the dynamic library versions will be expected instead.

FULL_STATIC

FULL_STATIC=1: solve linking problems forcing static versions of all external libraries (used only by debian package build) This is deprecated and no longer used in any packaging builds

GO_BIN

GO_BIN=<dirspec>: specify the $GOBIN variable dirspec to use when building YP-gNMI application. Default is $HOME/go/bin. Ignored if PACKAGE_BUILD=1 is also used.

GO_PATH

GO_PATH=<dirspec>: specify the $GOPATH variable dirspec to use when building YP-gNMI application. Default is $HOME/go. Ignored if PACKAGE_BUILD=1 is also used.

GPROFILE

GPROFILE=1: add -pg to the CFLAGS to enable GCC profiling The STATIC=1 option should also be used.

GUI_LOGGING

GUI_LOGGING=1: internal flag used to build libyumapro_ncx without the log_common and log_append functions so the Qt version of these functions can be used instead

HOST

HOST=string: standard make variable for cross-compile Must be set correctly together with CROSS_TARGET

Example:

make HOST=mips64-octeon-linux-gnu CROSS_TARGET=mips64-octeon-linux-gnu-

INC_PREFIX

INC_PREFIX=string: set the base string for the include path

  • The default is $(DESTDIR)$(INSTALL_PREFIX)/include

  • Used for cross-compiling to change the location for all built-in include file searches.

  • The USER_INC parameter can be used to inject -I directives into the compiler command.

  • The INC_PREFIX and USER_INC parameters can be used together.

INSTALL_PREFIX

INSTALL_PREFIX=string: set the top install dir (after DESTDIR)

  • default for all but MacOSX: /usr

  • default for MacOSX: /usr/local

LIB_PREFIX

LIB_PREFIX=string: set the base string for the library path for linking. The default is $(INSTALL_PREFIX)/lib

  • Used for cross-compiling to change the location for all built-in library searches.

  • The USER_LIB parameter can be used to inject -L directives into the linker command.

  • The LIB_PREFIX and USER_LIB parameters can be used together.

LIB64

LIB64=1: install and look for SIL libs in /usr/lib64/yuma instead of /usr/lib/yuma (used by FC14 64 bit)

MAC

MAC=1: set to compile for MacOsX

MANDIR

MANDIR=/path/to/man: set to override the default location to install man pages, which is $(PREFIX)/share/man/man.1 with default prefix is /usr/share/man/man.1

MCHECK

MCHECK=1: enables mcheck heap corruption checking

  • Used when getting heap corruption errors

  • Run mcheck(0) in the gdb debugger as needed.

MEMTRACE

MEMTRACE=1: enables mtrace debugging

  • Used when Memory leak error message printed upon exit.

  • Need to install glibc-utils for the 'mtrace' program.

  • Tools will generate an 'mtracefile' in the CWD.

  • Run mtrace /path/to/program ./mtracefile

MODULES

MODULES=1: used in debian build only to install just the YumaPro YANG Modules files for packaging

NETCONFD_LIB

NETCONFD_LIB=1: build the netconfd-pro server as a static library for uCLinux or BusyBox. The netconfd-pro code will be built as a static library instead of a stand-alone program.

  • Default target will be /usr/lib/libyumapro_netconfd-pro.a

NO_LIBSSH2

NO_LIBSSH2=1: removes libssh2 code from build; used for uCLinux which only supports yp-shell, not yangcli-pro This will remove NETCONF over SSH support from the mgr and ycli directories. Do not use if building yangcli-pro.

NO_LIBSSL

NO_LIBSSL=1: removes libssl code from build; used for uCLinux which only supports yp-shell, not yangcli-pro This will remove RESTCONF over SSL support from the mgr and ycli directories. Do not use if building yangcli-pro.

NO_LIBTECLA

NO_LIBTECLA=1: removes libtecla usage and linkage from from code for libyumapro_ycli. This is used when the libraries are built for the yuma-bench GUI code. Do not use unless the BUILD_LIBS_ONLY=1 flag is also used.

NO_SYSLOG

NO_SYSLOG=1: remove syslog support and includes of Linux syslog.h Windows does not have syslog so set this flag if also setting WINDOWS=1

NO_YPACK

NO_YPACK=1: do not use the YPACK macro to pack some structures This will cause more memory to be used, but may be needed if the target platform does not support it. YPACK is only used if __GNUC__ macro is set. Refer to netconf/src/platform/procdefs.h for details.

NOTOASTER

NOTOASTER=1: disables building the example toaster SIL

PACKAGE

PACKAGE=<pkgname>: set for Ubuntu packaging build;

  • Do not use in normal builds. Needed to pick the variant that is being installed in a dummy dir and packaged

  • Values:

    • CLIENT: used in debian build only to install just the yangcli-pro files for packaging

    • CLIENT2: used in debian build only to install just the yangcli-pro, yangdump-pro, and yangdiff-pro files for packaging

    • DOCS: used with DOC=1 debian build only to build the yumapro-docs package

    • DOCS2: used with DOC=1 debian build only to build the yumapro-client-docs package

    • COMPILER: used in debian build only to install just the yangdump-pro files for packaging

    • DEVELOPER: used in debian build only to install all of the YumaPro user binaries (including developer files)

    • SERVER: used in debian build only to install just the YumaPro Server files for packaging to run on an embedded system (NOT USED OR SUPPORTED)

    • TOOLS: used in debian build only to install all of the developer tools. Similar to DEVELOPER but does not install any server binaries.

    • USER: used in debian build only to install all of the YumaPro user binaries (no developer files) (NOT USED OR SUPPORTED)

PACKAGE_BUILD

PACKAGE_BUILD=1: set in debian and fedora packlaging scripts to indicate a packaging build is in progress.

PACKAGE_HOST_BUILD

PACKAGE_HOST_BUILD=1: set in debian and fedora packaging scripts by the host machine setting up the sources; Use with DOC=1. This sets up $HOME/Packaging/yuma_docs so the packaging builds have PDF and HTML files already made for the release

PREFIX

PREFIX=string: set the top install dir (after DESTDIR) default: /usr

!!! NO LONGER SUPPORTED OR USED !!!
!!! SEE INSTALL_PREFIX INSTEAD !!!

PRODUCTION

PRODUCTION=1: disables the --DDEBUG flag definition in compilation so all #ifdef DEBUG code is removed

PTHREADS

PTHREADS=1: generate a threaded version of the server. Adds '-pthread' to the gcc CFLAGS and links with the pthread library (see pthread.h).

RELEASE

RELEASE=N: sets the release number in the version string.

  • Used in package builds only

  • The version in a git build will be based on the git branch name

Example: RELEASE=6 for release train 21.10 -> 21.10-6

REMOVE_SCHEMA_AUG_LEAFS

REMOVE_SCHEMA_AUG_LEAFS=1: remove the 'conformance' and 'module-type' leafs from the /netconf-state/schemas/schema list. The deprecated leafs are added if --with-yumaworks-system is true. They will be removed from the 22.10 release train when the status is changed to obsolete.

SHLIB_NCX

SHLIB_NCX=1: used in debian build only to install just the YumaPro Server libncx files for packaging This is no longer used!

STATIC

STATIC=1:set to use static libraries such as libncx.a, instead of dynamic libraries like libncx.so

STATIC_LIBSYSTEM

STATIC_LIBSYSTEM=static-libspec

The relative or absolute filespec representing the static libyp_system library. Used when STATIC_SERVER=1. Used from the netconf/src/netconfd-pro directory.

Default: ../../../libsystem/lib/libyp_system-static.a

STATIC_SERVER

STATIC_SERVER=1:set to use force the server to not use any dynamic linked SIL code. The -dl linker option will not be used and the dlopen, dlclose type of SIL invocation will not be used. The server will expect the STATIC_LIBSYSTEM library to be available when netconfd-pro is linked

STATIC_SIL

STATIC_SIL=<string> This is used to link static SIL libraries into the netconfd-pro program, using the STATIC_SERVER=1 flag and optionally the NETCONFD_LIB=1 flag. See the README-STATIC-SIL.txt file for more details

STATIC_SILSA

STATIC_SILSA=<string>

This is used to link static SIL-SA libraries into the sil-sa-app or combo-app programs. See the README-STATIC-SILSA.txt file for more details

TEST

TEST=1: make will include the 'netconf/test' directory Run this command before make test, e.g. make TEST=1; make test; sudo make install Can be run from top or netconf directory

TIMER_MONO_CLOCK

TIMER_MONO_CLOCK=1: make will use clock_gettime() for server timers instead of time(). This also requires _POSIX_TIMERS and _POSIX_MONOTONIC_CLOCK be defined. The system clock can be changed by settimeofday() which can affect timers.

This option is enabled by EVERYTHING=1.

NOFLOAT

NOFLOAT=1: disable use of double and tgmath.h; XPath eval of complex numbers will cause invalid results; This option should not be used or XPath evaluations will not work correctly.

PIPE_RESTRICTED

PIPE_RESTRICTED=1: Affects yp-shell and yangcli-pro only; Causes the pipe command to be restricted to the sget, sget-config and show commands. Default is to allow pipe command on any command

UCLINUX

UCLINUX=1: build a small static server for the uCLinux OS.

The netconfd-pro, netconf-subsystem-pro, and yp-shell programs are supported. No distributed services are supported such as YP-HA, DB-API, SIL-SA. No ypwatcher support.

Need to use flags: STATIC=1 STATIC_SERVER=1 NO_LIBSSH2=1 NO_LIBSSL=1 This platform is not officially supported because the dropbear SSH performance is so slow that it is operationally unusable. If dropbear performance is ever improved this may change.

USE_WERROR

USE_WERROR=1: use -Werror in the compile process

Default is not to use -Werror.

USER_SERVER_INC

USER_SERVER_INC=string: specify some include directives (-I) to be added to the make command CINC variable. The flags apply to the server only.

This parameter is obsolete. Use USER_INC instead for cross-compiling.

USER_SERVER_LIB

USER_SERVER_LIB=string: specify some include directives (-L, -l) to be added to the netconfd-pro make command LIBS variable The flags apply to the netconfd-pro program only.

This parameter is obsolete. Use USER_LIB instead for cross-compiling.

USER_INC

USER_INC=string: specify some include directives (-I) to be added to the compile command. This is used to provide include files from a different location than the makefile would normally look.

The INC_PREFIX parameter is used to change the start directory for all built-in include searches. This parameter contains a space-separated string of -I directives. Quotes are needed if any whitespace is used.

Example USER_INC="-I$HOME/xcompile/inc -I$HOME/platform/include"

USER_LIB

USER_LIB=string: specify some library search directives to be added to the link command for all executable programs. This is often used when cross-compiling and libraries are needed from multiple locations.

This parameter contains a space-separated string of -L directives. Quotes are needed if any whitespace is used.

Example USER_LIB=-L$HOME/xcompile/lib

WEB_DIR

WEB_DIR=<dirspec>: Use the specified <dirspec> as directory when installing the yang-api and/or restconf programs directly into a WEB server sub-directory (non-production build)

Default is '$(DESTDIR)/var/www/yang-api'.

WEB_GROUP

WEB_GROUP=<name>: Use the specified <name> as the group name when installing the yang-api and/or restconf programs directly into a WEB server sub-directory (non-production build)

Default is 'www-data'.

WEB_USER

WEB_USER=<name>: Use the specified <name> as the user name when installing the yang-api and/or restconf programs directly into a WEB server sub-directory (non-production build)

Default is 'www-data'.

WINDOWS

WINDOWS=1: Select code for Windows QtCreator using MinGW 8.1.0

The make files in this project are not used. Instead qmake is used to generate the makefile. This flag is experimental and only used by the YumaBench GUI to build SDK libraries on Windows 10. This flag is not supported for external use at this time.

WINDOWS_PRINTF

WINDOWS_PRINTF=1: Select Windows printf formatting for size_t parameters. This is '%zu' for most compilers. The MinGW compiler for Qt on Windows will incorrectly generate a warning about an unknown format type. Use -Wno-format to suppress this warning. Qt APIs expect the format '%zu' and the GUI crashes if '%I64u' is used instead.

Do not use. Not supported at this time.

WITH_CALLHOME

WITH_CALLHOME=1: build the IETF Call-Home reverse connection support

Default is not to add this code. Included with EVERYTHING=1. Parts of Call-home may be patented by Juniper, Inc.

WITH_CLI

WITH_CLI=1: build the netconfd-pro server with the CLI protocol included.

Default is not to add this code.

WITH_COAP

WITH_COAP=1: build the netconfd-pro server with the CoAP protocol included. Default is not to add this code

This option is obsolete. CoAP over RESTCONF is obsolete and NOT SUPPORTED. DO NOT USE!

WITH_CURL

WITH_CURL=1: build the netconfd-pro server with libcurl support included.

Default is not to add this code

WITH_IETF_INTERFACES

WITH_IETF_INTERFACES=1: build the ietf-interfaces SIL code for the netconfd-pro server. Will also include the IF-MIB module if WITH_SNMP=1 is used as well.

Default is to build this module in package builds, but not other builds

WITH_GDB

WITH_GDB=1: add -ggdb3 to CFALGS even if DEBUG not set

Default is not to add this flag if DEBUG=1 not set

WITH_GET2_TEST

WITH_GET2_TEST=1: build the libget2-test library enable the SIL-SA library for the get2-test module

The server must be started with --module=get2-test and the sil-sa-app must be run for the distributed operational data test to work

WITH_GET3_TEST

WITH_GET3_TEST=1: build the libget3-test library enable the SIL-SA library for the get3-test module

The server must be started with --module=get3-test and the sil-sa-app must be run for the distributed operational data test to work

WITH_GNMI

WITH_GNMI=1: build the YP-gNMI protocol

  • Must also use WITH_YCONTROL=1 and WITH_RESTCONF=1

  • Will not work unless the YP-gNMI code is present

WITH_GRPC

WITH_GRPC=1: build the netconfd-pro server with the YP-gRPC protocol included.

Default is not to add this code.

WITH_HOOKS_TEST

WITH_HOOKS_TEST=1: build the libhooks-test directory to install the SIL code for the hooks-test YANG module

Not supported if STATIC=1 is used

WITH_HOOKS_TEST_SILSA

WITH_HOOKS_TEST_SILSA=1: build the libhooks-test-silsa directory to install the SIL-SA code for the hooks-test-silsa YANG module.

The server must be started with --module=hooks-test-silsa and the sil-sa-app must be run for the distributed Hook callbacks test to work.

WITH_LIB_SHOW

WITH_LIB_SHOW=1: add the libshow directory to the build This builds the example libyp_show.so library. Normally off in regular builds and always on in package builds.

WITH_LIB_SYSTEM

WITH_LIB_SYSTEM=1: add the libsystem directory to the build This builds the example yp-system directory. Normally off in regular builds and always on in package builds.

WITH_OPENSSL

WITH_OPENSSL=1: build the netconfd-pro server with OpenSSL library support for NETCONF over TLS protocol. Default is not to add this code.

WITH_RESTCONF

WITH_RESTCONF=1: build the netconfd-pro server with the RESTCONF protocol included. Default is not to add this code. If set will load ietf-restconf-monitoring module and enable SIL library for this module.

WITH_SIL_ERROR

WITH_SIL_ERROR=1: add the sil-error directory to the build This allows SIL errors to be easily generated during the specified SIL callback phase for different data node types. Used for developer testing to force corner-case transaction code to be invoked.

WITH_SNMP

WITH_SNMP=1: build the SNMP server protocol support. Requires that WITH_RESTCONF=1 also be used in the make commands.

WITH_SUPPORT_SAVE

WITH_SUPPORT_SAVE=1: build the yumawork-support-save module into the server. Used to add <get-support-save> operation does not cause any server problems.

WITH_SYSTEST_SIL

WITH_SYSTEST_SIL=1: build the test SIL libraries in the systest-sil directory. Used for regression testing to make sure code stub SIL does not cause any server problems. Ignored if PACKAGE_BUILD=1 is also used.

WITH_TEMPLATES

WITH_TEMPLATES=1: build the server code for the yumaworks-templates module, to support configuration templates.

WITH_YANG11

WITH_YANG11=1: Allow YANG 1.1 code to be enabled; Deprecated.

  • This flag MUST be set to 1 in the 16.10 release train.

  • This flag MUST NOT be set for the 14.04 or 15.10 release trains.

  • This flag is forced on starting in 16.10 and later.

WITH_YANGAPI

WITH_YANGAPI=1: build the netconfd-pro server with the YANG-API protocol included. Default is not to add this code This protocol is obsolete and not supported.

WITH_YANG_HASH

WITH_YANG_HASH=1: build the libdict module and add support for fast lookup via YANG Hash object dictionary (Experimental)

Obsolete and not supported.

WITH_YANG_PUSH

WITH_YANG_PUSH=1: build the YANG-PUSH functionality in the server for Push Telemetry support

WITH_YANGMAP

WITH_YANGMAP=1: build the agt_yangmap functionality for YANG model mapping feature. Used in yp-shell only.

WITH_YCONTROL

WITH_YCONTROL=1: build the netconfd-pro server with the YumaPro Control Protocol sub-system, plus ycontrol and sil-sa libraries. Used for distributed server instrumentation.

WITH_YP_HA

WITH_YP_HA=1: build the YP-HA server redundancy protocol support Requires that WITH_YCONTROL=1 also be used in the make commands.

WITH_YUMA_ARP

WITH_YUMA_ARP=1: build the libyuma-arp directory to install the SIL code for the yuma-arp YANG module.

Obsolete: do not use.

WITH_YUMA_INTERFACES

WITH_YUMA_INTERFACES=1: build the libyuma-interfaces directory to install the SIL code for the yuma-interfaces YANG module.

Obsolete: do not use.

WITH_YUMA_NACM

WITH_YUMA_NACM=1: build the agt_acm_nacm code and enable it in the agt_acm module.

This module is obsolete and not supported at all. Do not use!

WITH_YUMA_PROC

WITH_YUMA_PROC=1: build the libyuma-proc directory to install the SIL code for the yuma-proc YANG module.

XCODE

XCODE=<path>: specify the location of XCode usr/include directory Only relevant if MAC=1 also set.

Default:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/
   Developer/SDKs/MacOSX10.11.sdk/usr/include

YP_SYSROOT

YP_SYSROOT=<path-string> : specify the --sysroot parameter for the compiler and linker. The poath cannot have any whitespace in it.

Example:

YP_SYSROOT=/opt/SDK/sysroots/aarch64-xilinx-linux

Added to CFLAGS and CXXFLAGS:

    --sysroot=/opt/SDK/sysroots/aarch64-xilinx-linux

STATIC_SIL README

Overview

There are several ways to build the server binaries. The server source code is required to build server binaries.

  1. STATIC=1

  2. STATIC=1 STATIC_SERVER=1

  3. STATIC=1 STATIC_SERVER=1 NETCONFD_LIB=1

Mode 1: STATIC=1

In this mode, only the flag STATIC=1 is added. This will build and link the YumaPro libraries as static libraries instead of shared libraries.

The "dl" library will be used and "dlopen" will be used to load dynamic shared SIL libraries for libyp-system and all SIL libraries using the --module or --bundle parameter.

Mode 2: STATIC=1 STATIC_SERVER=1

In this mode, the 2 flags STATIC=1 and STATIC_SERVER=1 are used. This will build and link the YumaPro libraries as static libraries instead of shared libraries.

The "dl" library will not be used and "dlopen" will not be used. No dynamic shared libraries are possible at all. Instead static SIL libraries can be linked into the image using a customized Makefile (out of scope here).

The "agt_sil_lib_register_statlib" function can be used to easily integrate the static SIL into the server. With this approach, as many static SIL libraries can be loaded as you want, but they will only be used if enabled by the operator (e.g. --module or --bundle parameter).

The raw "init", "init2", and "cleanup" entry points for the static SIL library can also be invoked manually. This procedure is out of scope.

In this mode even the libyp-system library is expected to be statically linked. This is handled automatically by the Makefile, if the libsystem directory is used to build this library.

Mode 3: STATIC=1 STATIC_SERVER=1 NETCONFD_LIB=1

In this mode, the 3 flags STATIC=1 and STATIC_SERVER=1 and NETCONFD_LIB=1 are used. This mode is similar to mode 2, except the "netconfd_static.c" module is added to the netconfd-pro server. This module allows static SIL libraries to be easily integrated into the server without any changes to core server files.

The file netconf/src/netconfd-pro/netconfd_static.c can be renamed and used in a build, to make sure future releases do not overwrite your edits to this file. This module contains a callback function called "static_sil_cbfn". This can contain function calls to agt_sil_register_statlib for any number of static SIL libraries. The server will initialize the SIL registry in the correct order. The netconfd_main file will be linked with netconfd_static.c and other libraries to produce the netconfd-pro binary.

IMPORTANT info on Using Static SIL Libraries

  1. Assume a SIL library is setup

> make_sil_dir_pro test2

This could also be a bundle (make_sil_bundle)

  1. Build a static version of the SIL library

> cd test2 > make STATIC=1

  1. Copy the static library to a common directory if desired. This is not required but may make using the STATIC_SIL variable easier.

> cp lib/libtest2.a $HOME/sil/libtest2.a

  1. Use the macro STATIC_SIL when building netconfd-pro

Option 1: Change in Makefile:

STATIC_SIL=-L /home/andy/sil -ltest2

Option 2: set from command line:

> make STATIC_SIL='-L /home/andy/sil -ltest2'

Note that the -L part must be first and it must specify where the static libraries are located. One or more -l parts can follow. The -l parameter does not use the full name. Instead libtest2.a can be specified as -ltest2.

  1. Register the static library in the netconfd-pro program

Example from netconfd-pro/netconfd_static.c:

/* extern definitions for the 3 expected callbacks */
AGT_SIL_LIB_EXTERN(test2)

/* initialization hook to make STATIC_SIL libraries available
 * to the server.
 *
 * ncx_static_sil_cbfn_t
 *
 * See netconfd_static.c for details
 *
 * RETURNS:
 *   status
 *
 */
static status_t static_sil_cbfn (void)
{

    status_t res = NO_ERR;

    /* example: module=test2;
     * need to use in Makefile (example)
     * STATIC_SIL=-L /home/andy/sil -ltest2
     * The actual library names are not needed in this code
     */
    res =
        agt_sil_lib_register_statlib((const xmlChar *)"test2",
                                     y_test2_init,
                                     y_test2_init2,
                                     y_test2_cleanup);


    return res;

}  /* static_sil_cbfn */
  1. The SIL library will not be used unless the module or bundle is loaded.

    > netconfd-pro module=test2