Skip to content

Instantly share code, notes, and snippets.

Arseniy Zaostrovnykh necto

Block or report user

Report or block necto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fw-forward-existing.py
if received_on_port == EXT_DEVICE and flow_emap.has(internal_flow):
fl_id = flow_emap.get(internal_flow)
flow_emap.refresh_idx(fl_id, now)
out_port = vector_get(int_devices, fl_id)
return ([out_port],[ether(h1, saddr=..., daddr=...), ipv4(h2, cksum=...), tcpudp(h3)])
else:
pass
View firewall-spec.py
from state import flow_emap, int_devices
EXP_TIME = 10 * 1000
EXT_DEVICE = 1
if a_packet_received:
flow_emap.expire_all(now - EXP_TIME)
h3 = pop_header(tcpudp, on_mismatch=([],[]))
h2 = pop_header(ipv4, on_mismatch=([],[]))
h1 = pop_header(ether, on_mismatch=([],[]))
View docker networking output
$ sh setup.sh
436234216b461993ee2b8e79f8051dc0979436d039267f69f8b7fb592871739d
81663cf6eea37b106b78963f200c1b685772444ebc4dbb03715aabfb00ba9c53
d006e3d89fa4542f8f0573de8bb99678af92add3a12aa141827f44dd5c9ad76f
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [230 kB]
Ign http://httpredir.debian.org jessie InRelease
Get:3 http://httpredir.debian.org jessie-updates InRelease [136 kB]
Get:4 http://httpredir.debian.org jessie Release.gpg [2373 B]
Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [3619 B]
View gist:152027a3c021fafd082c
{
int nr;
CriuVethPair **a, *p;
p = malloc(sizeof(*p));
if (!p)
goto er;
criu_veth_pair__init(p);
p->if_in = strdup(in);
if (!p->if_in)
goto er_p;
View gist:5338163
constructor TGrd2DProcess.CreateGrid(Dat: TData; Nx,Ny: integer);
var N1,N2,N3,i,j: integer; h,S,q: double; LnUp1: TLn; SLn: TSLn;
begin
Self.Nx:=Nx; Self.Ny:=Ny;
hy1:=Dat.hy1; dNy1:=Dat.dNy1;
hx1:=Dat.hx1; dNx1:=Dat.dNx1;
Ny1:=Round(Ny*dNy1);
{Ceтка на плоскости XY}
for j:=0 to Dat.Ny do Y[j]:=Dat.Ly*j/Dat.Ny;
{Ceтка на плоскости XZ}
You can’t perform that action at this time.