It's useful to be able to share error codes between C files, so move the codes currently only used in protocols to a generic file.