This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
ASN to AS-SET mapping: | |
AS4200000011 -> AS-A1 | |
AS4200000021 -> AS-B1 | |
AS4200000022 -> AS-B2 | |
AS4200000023 -> AS-B3 | |
AS4200000031 -> AS-C1 | |
AS4200000032 -> AS-C2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> // uint*_t | |
#include <stdio.h> // perror(), printf() | |
#include <stdlib.h> // memcpy, posix_memalign() | |
#include <string.h> // malloc() | |
#include <time.h> // clock_t, CLOCKS_PER_SEC | |
#include <unistd.h> // getpagesize() | |
static inline void memcpy_aligned(void *to, const void *from, size_t len) { | |
if (len <= 64) { | |
memcpy(to, from, 64); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not all functions are referenced below are called, that is intentional to verify that they are not being called. | |
// Provide timestamps: | |
function print_ts() { | |
ts = gettimeofday_us(); | |
printf("[%10d.%06d] ", ts/1000000, ts%1000000); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Kills all iptables rules and unloads all iptables/netfilter related | |
# kernel modules. | |
# | |
# From: https://github.com/netoptimizer/network-testing/blob/master/bin/netfilter_unload_modules.sh | |
# Author: Jesper Dangaard Brouer <[email protected]> | |
# Trick so, program can be run as normal user, will just use "sudo" | |
if [ "$EUID" -ne 0 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code from https://github.com/cisco-grpc-connection-libs/ios-xr-grpc-python/blob/master/examples/grpc_cfg.py | |
from grpc.framework.interfaces.face.face import AbortionError | |
import json | |
from time import sleep | |
import sys | |
sys.path.insert(0, '../') | |
from lib.cisco_grpc_client import CiscoGRPCClient |