Skip to content

Instantly share code, notes, and snippets.

View DrPizza's full-sized avatar
🙄
they see me rollin'. they hatin'.

Peter Bright DrPizza

🙄
they see me rollin'. they hatin'.
View GitHub Profile
#include <type_traits>
#include <cstddef>
template<typename T>
struct wrapper {
protected:
wrapper() {}
};
struct base {};
#include <type_traits>
#include <cstddef>
template<typename T>
struct wrapper {
protected:
wrapper() {}
};
struct base {};
// compile with -std=gnu99 -lrt
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
template <typename F, std::size_t... Indices, typename... Args>
static void __forceinline unroll_aux(F&& fun, std::index_sequence<Indices...>, Args&&... args)
{
using swallow = int[];
static_cast<void>(swallow{ 0, (std::forward<F>(fun)(std::forward<Args>(args)...), void(), Indices)... });
}
template <size_t N, typename F, typename... Args>
static void __forceinline unroll(F&& fun, Args&&... args)
{
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <ucontext.h>
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
56191 7349K delegate_input all -- any any anywhere anywhere
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
2314K 1341M delegate_forward all -- any any anywhere anywhere
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
^Croot@r8000:/etc# ipsec statusall
no files found matching '/etc/strongswan.d/*.conf'
Status of IKE charon daemon (strongSwan 5.3.3, Linux 3.18.23, armv7l):
uptime: 6 minutes, since Apr 16 17:48:45 2016
malloc: sbrk 262144, mmap 0, used 242960, free 19184
worker threads: 9 of 16 idle, 7/0/0/0 working, job queue: 0/0/0/0, scheduled: 1
loaded plugins: charon test-vectors ldap pkcs11 aes des blowfish rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl gcrypt af-alg fips-prf gmp agent xcbc cmac hmac ctr ccm gcm curl mysql sqlite attr kernel-netlink resolve socket-default farp stroke smp updown eap-identity eap-md5 eap-mschapv2 eap-radius eap-tls xauth-generic xauth-eap dhcp whitelist led duplicheck uci addrblock unity
Virtual IP pools (size/online/offline):
192.168.1.16/27: 15/0/0
Listening IP addresses:
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[NET] received packet: from 172.58.224.135[57586] to 74.64.40.133[500] (880 bytes)
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[ENC] parsed IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) V V V V ]
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[IKE] received MS NT5 ISAKMPOAKLEY v9 vendor ID
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[IKE] received MS-Negotiation Discovery Capable vendor ID
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[IKE] received Vid-Initial-Contact vendor ID
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[ENC] received unknown vendor ID: 01:52:8b:bb:c0:06:96:12:18:49:ab:9a:1c:5b:2a:51:00:00:00:02
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[IKE] 172.58.224.135 is initiating an IKE_SA
Sat Apr 16 17:48:56 2016 authpriv.info syslog: 08[IKE] 172.58.224.135 is initiating an IKE_SA
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[IKE] remote host is behind NAT
Sat Apr 16 17:48:56 2016 daemon.info syslog: 08[ENC] generating IKE
config setup
# strictcrlpolicy=yes
# uniqueids = no
charondebug="cfg 3, dmn 3, ike 3, net 3"
# Add connections here.
conn %default
keyexchange=ikev2
root@r8000:~# lsmod
act_ipt 2374 0
act_mirred 2258 1
act_police 2963 0
act_skbedit 1562 0
aead 4248 3 esp6
af_alg 3695 2 algif_skcipher
af_key 22624 0
ah4 4556 0
ah6 4530 0