Add an utility function to generate register message payload.
Make defines for return codes.