Grabbed from https://github.com/xtaci/tcpraw with modifications