Move typedef to single location; fixes for replicated packets (probably still not correct); reserve zero as local ID; pass domain server's local ID in domain server list; other tweaks.