Skip to content

Instantly share code, notes, and snippets.

View shlomopongartz's full-sized avatar

Shlomo Pongratz shlomopongartz

View GitHub Profile
@shlomopongartz
shlomopongartz / viewport
Last active January 18, 2024 18:33
Viewport calculation.
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
typedef union {
uint64_t ll;
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
struct {
uint32_t lo;
uint32_t hi;
@shlomopongartz
shlomopongartz / macvatp.h
Created June 26, 2019 08:28
macvtap without libnl
/*
* Copyright (C) 2010 IBM Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@shlomopongartz
shlomopongartz / gateway_netlink.c
Created June 3, 2019 06:56 — forked from javiermon/LICENSE
get default gateway