Skip to content

Instantly share code, notes, and snippets.

View rwestphal's full-sized avatar

Renato Westphal rwestphal

View GitHub Profile
#
# +---------+
# | |
# | 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
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <err.h>
#include <assert.h>
#include <arpa/inet.h>
#include <stdbool.h>
#include <libyang/libyang.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <err.h>
#include <libyang/libyang.h>
static struct ly_ctx *ly_ctx;
static struct lyd_node *running, *candidate;
# +-------+ +-------+ +-------+
# | | | | | |
# | HOST1 | | HOST2 | | HOST3 |
# | | | | | |
# +---+---+ +---+---+ +---+---+
# | | |
# |fd00:10:1::/64 | |
# +-----+ +------+ fd00:20:1::/64|
# | |fd00:10:2::/64 |
# | | |