Skip to content

Instantly share code, notes, and snippets.

View rwestphal's full-sized avatar

Renato Westphal rwestphal

View GitHub Profile
---
autogen:
layout:
#type: line
#size: 50
#type: ring
#size: 50
#include <stdlib.h>
#include <stdio.h>
#include <err.h>
#include <libyang/libyang.h>
#define YANG_SEARCH_PATH "/usr/local/share/yang/"
const LY_ERR module_callback(const char *mod_name, const char *mod_rev,
const char *submod_name, const char *submod_rev,
{
"ietf-interfaces:interfaces": {
"interface": [
{
"name": "eth-sw1",
"type": "iana-if-type:ethernetCsmacd",
"ietf-ip:ipv4": {},
"ietf-ip:ipv6": {}
},
{
#
# +---------+
# | |
# | RT1 |
# | 1.1.1.1 |
# | |
# +---------+
# |eth-sw1
# |
# |
#include <stdlib.h>
#include <stdio.h>
#include <err.h>
#include <libyang/libyang.h>
//#define YANG_SEARCH_PATH "/usr/local/share/yang/"
#define YANG_SEARCH_PATH "/mnt/renato/git/rust/yang2-rs/assets/yang/"
int main(int argc, char **argv)
# Dynamic topology
---
autogen:
layout:
type: ring
size: 10
ipv4:
# Dynamic topology
---
autogen:
layout:
type: grid
width: 5
height: 5
#
# +---------+
# | |
# | RT17 |
# +---------+ +----------+
# | | | |
# | +---------+ |
# | |
# | |
# +-----+---+ +----+----+
import pprint
import grpc
import frr_northbound_pb2 as frr_nb
import frr_northbound_pb2_grpc as frr_nb_grpc
from libyang import Context
from libyang import LibyangError
from libyang.data import DNode
#!/usr/bin/env ruby
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(this_dir, "ruby")
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
require "grpc"
require "frr-northbound_services_pb"
begin