diff options
author | Neal H. Walfield <[email protected]> | 2016-03-02 14:45:39 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2016-03-02 19:36:17 +0000 |
commit | 24e0f1d56e6f56e7fb52b5c6bdb100131e12dfe3 (patch) | |
tree | 79f27363cd520c1d45b9f8007182192b88951e2c | |
parent | gpg: Rename pop_filter to iobuf_pop_filter and export it. (diff) | |
download | gnupg-24e0f1d56e6f56e7fb52b5c6bdb100131e12dfe3.tar.gz gnupg-24e0f1d56e6f56e7fb52b5c6bdb100131e12dfe3.zip |
common: Provide a function for mapping packet types to strings.
* common/openpgpdefs.h (pkttype_str): New function.
--
Signed-off-by: Neal H. Walfield <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | common/openpgpdefs.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/common/openpgpdefs.h b/common/openpgpdefs.h index c81109a9e..e200d6b3b 100644 --- a/common/openpgpdefs.h +++ b/common/openpgpdefs.h @@ -56,6 +56,34 @@ typedef enum } pkttype_t; +static inline const char * +pkttype_str (pkttype_t type) +{ + switch (type) + { + case PKT_PUBKEY_ENC: return "PUBKEY_ENC"; + case PKT_SIGNATURE: return "SIGNATURE"; + case PKT_SYMKEY_ENC: return "SYMKEY_ENC"; + case PKT_ONEPASS_SIG: return "ONEPASS_SIG"; + case PKT_SECRET_KEY: return "SECRET_KEY"; + case PKT_PUBLIC_KEY: return "PUBLIC_KEY"; + case PKT_SECRET_SUBKEY: return "SECRET_SUBKEY"; + case PKT_COMPRESSED: return "COMPRESSED"; + case PKT_ENCRYPTED: return "ENCRYPTED"; + case PKT_MARKER: return "MARKER"; + case PKT_PLAINTEXT: return "PLAINTEXT"; + case PKT_RING_TRUST: return "RING_TRUST"; + case PKT_USER_ID: return "USER_ID"; + case PKT_PUBLIC_SUBKEY: return "PUBLIC_SUBKEY"; + case PKT_OLD_COMMENT: return "OLD_COMMENT"; + case PKT_ATTRIBUTE: return "ATTRIBUTE"; + case PKT_ENCRYPTED_MDC: return "ENCRYPTED_MDC"; + case PKT_MDC: return "MDC"; + case PKT_COMMENT: return "COMMENT"; + case PKT_GPG_CONTROL: return "GPG_CONTROL"; + default: return "unknown packet type"; + } +} typedef enum { |