Backport radsniff and additional required library code from master