move protobuff-specific actions to net.c