Import.
Add -I flag to set srcip, other fixes and cleanups.