API and bug fixes for raw socket support.