Skip to content

Instantly share code, notes, and snippets.

@troglobit
troglobit / rtdump.c
Last active May 3, 2021 09:46
Read IPv4 routes from main routing table in Linux using netlink
/* Read kernel IPv4 routes from main routing table
*
* Copyright (c) 2021 Joachim Wiberg <troglobit@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF