Skip to content

Instantly share code, notes, and snippets.

View rwestphal's full-sized avatar

Renato Westphal rwestphal

View GitHub Profile
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <err.h>
#include <libyang/libyang.h>
static struct ly_ctx *ly_ctx;
# +---------+
# | |
# | RT1 |
# | 1.1.1.1 |
# | |
# +---------+
# |rt1-eth0 (.1)
# |
# |10.0.1.0/24
# |
# +---------+ +---------+
# | | global | |
# | |rt1-eth0 rt2-eth0| |
# | +-------------------+ |
# | | 10.0.0.0/24 | |
# | | | |
# | | VRF RED | |
# | |rt1-eth1 rt2-eth1| |
# | RT1 +-------------------+ RT2 |
# | | 10.0.1.0/24 | |
ripd# conf t
ripd(config)# router rip
ripd(config-router)# network eth2
ripd(config-router)# show configuration candidate changes
@@ -14,6 +14,7 @@
distance 25 172.16.1.0/24
network eth0
network eth1
+ network eth2
redistribute ospf metric 3
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <err.h>
static int nb_db_init(void)
{
#ifdef HAVE_CONFIG_ROLLBACKS
int ret;
ret = db_execute(
" \
BEGIN TRANSACTION; \
CREATE TABLE IF NOT EXISTS TRANSACTIONS( \
ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \
int nb_db_set_max_transactions(unsigned int max)
{
#ifdef HAVE_CONFIG_ROLLBACKS
int ret;
/*
* Delete old entries if necessary and update the SQL trigger that
* auto-deletes old entries.
*/
ret = db_execute(
# +---------+
# | |
# | RT1 |
# | 1.1.1.1 |
# | |
# +---------+
# |rt1-eth0 (.1)
# |
# |10.0.1.0/24
# |
# +---------+
# | |
# | RT1 |
# | 1.1.1.1 |-lo1 (2001:db8:1000::1/128)
# | |
# +---------+
# |rt1-eth0 (.1)
# |
# |10.0.1.0/24
# |2001:DB8:1::/64
module frr-deviations-ietf-rip {
yang-version 1.1;
namespace "http://frrouting.org/yang/frr-deviations-ietf-rip";
prefix frr-deviations-ietf-rip;
import ietf-routing {
prefix ietf-routing;
}
import ietf-rip {