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
// src/plugins/crypto_native/aes_gcm.c | |
static void test_aes_gcm() | |
{ | |
u8 src[32] = {0}, dst[32] = {0}, check[32] = {0}; | |
u8 aad[32] = {0}, iv[12] = {0}, tag[16] = {0}, key[32]; | |
aes_key_size_t ks = AES_KEY_256; | |
aes_gcm_key_data_t kd; | |
// prepare key |
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
handle SIGUSR1 nostop noprint pass | |
set print pretty on | |
define pvec | |
print *$arg0@vl($arg0) | |
end | |
document pvec | |
pvec - display all elements of vector. Takes vector as argument | |
*** WARNING - SEGV likely if you put in the wrong thing | |
end |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "bento/ubuntu-22.04" | |
config.vm.box_check_update = false | |
vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 8) | |
vmram=(ENV['VPP_VAGRANT_VMRAM'] || 12192) |
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
import sys | |
import logging | |
from os_ken.ofproto import ether, inet | |
from os_ken.lib.packet import ethernet | |
from os_ken.lib.packet import ipv4, ipv6 | |
from os_ken.lib.packet import tcp, udp | |
from os_ken.lib.packet import packet, packet_utils | |
from os_ken.lib import addrconv |
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
import socket, ssl, sys | |
if len(sys.argv) == 1: | |
hostname = 'www.naver.com' | |
else: | |
hostname = sys.argv[1] | |
ctx = ssl.create_default_context() | |
ctx.check_hostname = False | |
ctx.verify_mode = ssl.CERT_NONE |
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
import os | |
import socket | |
import struct | |
# These constants map to constants in the Linux kernel. This is a crappy | |
# way to get at them, but it'll do for now. | |
RTMGRP_LINK = 1 | |
NLMSG_NOOP = 1 | |
NLMSG_ERROR = 2 |
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 | |
import os | |
import time | |
import fnmatch | |
from vpp_papi import VPPApiClient | |
def init_vpp(vpp_json_dir='/usr/share/vpp/api/core/'): | |
jsonfiles = [] |
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
import socket | |
import ssl | |
def set_keepalive_linux(sock, after_idle_sec=1, interval_sec=3, max_fails=5): | |
"""Set TCP keepalive on an open socket. | |
It activates after 1 second (after_idle_sec) of idleness, | |
then sends a keepalive ping once every 3 seconds (interval_sec), | |
and closes the connection after 5 failed ping (max_fails), or 15 seconds | |
""" |
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/perl | |
# | |
# 21 Apr 2020 | |
# Chul-Woong Yang | |
# | |
# Client (C) Proxy (P1) Proxy (P2) | |
# 10.10.1.1/24 10.10.2.1/24 10.10.3.1/24 | |
# veth0 veth0 veth0 | |
# | | | | |
# veth pair veth pair veth pair |
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
img |
NewerOlder