diff options
Diffstat (limited to 'pjsip/include/pjsip/sip_auth_msg.h')
-rw-r--r-- | pjsip/include/pjsip/sip_auth_msg.h | 170 |
1 files changed, 104 insertions, 66 deletions
diff --git a/pjsip/include/pjsip/sip_auth_msg.h b/pjsip/include/pjsip/sip_auth_msg.h index 81d6cd09..d73946bc 100644 --- a/pjsip/include/pjsip/sip_auth_msg.h +++ b/pjsip/include/pjsip/sip_auth_msg.h @@ -24,21 +24,23 @@ PJ_BEGIN_DECL /** - * @defgroup PJSIP_MSG_AUTHORIZATION Header Field: Authorization and Proxy-Authorization - * @brief Authorization and Proxy-Authorization header field. - * @ingroup PJSIP_MSG + * @addtogroup PJSIP_MSG_HDR * @{ */ /** - * Common credential. + * Common credential structure represents common credential fields + * present in Authorization/Proxy-Authorization header. */ struct pjsip_common_credential { - pj_str_t realm; - pjsip_param other_param; + pj_str_t realm; /**< Credential's realm. */ + pjsip_param other_param; /**< Other parameters. */ }; +/** + * @see pjsip_common_credential + */ typedef struct pjsip_common_credential pjsip_common_credential; @@ -48,19 +50,22 @@ typedef struct pjsip_common_credential pjsip_common_credential; */ struct pjsip_digest_credential { - pj_str_t realm; - pjsip_param other_param; - pj_str_t username; - pj_str_t nonce; - pj_str_t uri; - pj_str_t response; - pj_str_t algorithm; - pj_str_t cnonce; - pj_str_t opaque; - pj_str_t qop; - pj_str_t nc; + pj_str_t realm; /**< Realm of the credential */ + pjsip_param other_param; /**< Other parameters. */ + pj_str_t username; /**< Username parameter. */ + pj_str_t nonce; /**< Nonce parameter. */ + pj_str_t uri; /**< URI parameter. */ + pj_str_t response; /**< Response digest. */ + pj_str_t algorithm; /**< Algorithm. */ + pj_str_t cnonce; /**< Cnonce. */ + pj_str_t opaque; /**< Opaque value. */ + pj_str_t qop; /**< Quality of protection. */ + pj_str_t nc; /**< Nonce count. */ }; +/** + * @see pjsip_digest_credential + */ typedef struct pjsip_digest_credential pjsip_digest_credential; /** @@ -69,14 +74,17 @@ typedef struct pjsip_digest_credential pjsip_digest_credential; */ struct pjsip_pgp_credential { - pj_str_t realm; - pjsip_param other_param; - pj_str_t version; - pj_str_t signature; - pj_str_t signed_by; - pj_str_t nonce; + pj_str_t realm; /**< Realm. */ + pjsip_param other_param; /**< Other parameters. */ + pj_str_t version; /**< Version parameter. */ + pj_str_t signature; /**< Signature parameter. */ + pj_str_t signed_by; /**< Signed by parameter. */ + pj_str_t nonce; /**< Nonce parameter. */ }; +/** + * @see pjsip_pgp_credential + */ typedef struct pjsip_pgp_credential pjsip_pgp_credential; /** @@ -85,16 +93,24 @@ typedef struct pjsip_pgp_credential pjsip_pgp_credential; */ struct pjsip_authorization_hdr { + /** Standard header fiends. */ PJSIP_DECL_HDR_MEMBER(struct pjsip_authorization_hdr); + + /** Authorization scheme. */ pj_str_t scheme; + + /** Type of credentials, depending on the scheme. */ union { - pjsip_common_credential common; - pjsip_digest_credential digest; - pjsip_pgp_credential pgp; + pjsip_common_credential common; /**< Common fields. */ + pjsip_digest_credential digest; /**< Digest credentials. */ + pjsip_pgp_credential pgp; /**< PGP credentials. */ } credential; }; +/** + * @see pjsip_authorization_hdr. + */ typedef struct pjsip_authorization_hdr pjsip_authorization_hdr; /** SIP Proxy-Authorization header shares the same structure as SIP @@ -104,36 +120,34 @@ typedef struct pjsip_authorization_hdr pjsip_proxy_authorization_hdr; /** * Create SIP Authorization header. - * @param pool Pool where memory will be allocated from. - * @return SIP Authorization header. + * @param pool Pool where memory will be allocated from. + * @return SIP Authorization header. */ -PJ_DECL(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool); +PJ_DECL(pjsip_authorization_hdr*) +pjsip_authorization_hdr_create(pj_pool_t *pool); /** * Create SIP Proxy-Authorization header. - * @param pool Pool where memory will be allocated from. - * @return SIP Proxy-Authorization header. + * @param pool Pool where memory will be allocated from. + * @return SIP Proxy-Authorization header. */ -PJ_DECL(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool); +PJ_DECL(pjsip_proxy_authorization_hdr*) +pjsip_proxy_authorization_hdr_create(pj_pool_t *pool); /** - * @} - */ - -/** - * @defgroup PJSIP_WWW_AUTH Header Field: Proxy-Authenticate and WWW-Authenticate - * @brief Proxy-Authenticate and WWW-Authenticate. - * @ingroup PJSIP_MSG - * @{ + * This structure describes common fields in authentication challenge + * headers (WWW-Authenticate and Proxy-Authenticate). */ - struct pjsip_common_challenge { - pj_str_t realm; - pjsip_param other_param; + pj_str_t realm; /**< Realm for the challenge. */ + pjsip_param other_param; /**< Other parameters. */ }; +/** + * @see pjsip_common_challenge + */ typedef struct pjsip_common_challenge pjsip_common_challenge; /** @@ -142,16 +156,19 @@ typedef struct pjsip_common_challenge pjsip_common_challenge; */ struct pjsip_digest_challenge { - pj_str_t realm; - pjsip_param other_param; - pj_str_t domain; - pj_str_t nonce; - pj_str_t opaque; - int stale; - pj_str_t algorithm; - pj_str_t qop; + pj_str_t realm; /**< Realm for the challenge. */ + pjsip_param other_param; /**< Other parameters. */ + pj_str_t domain; /**< Domain. */ + pj_str_t nonce; /**< Nonce challenge. */ + pj_str_t opaque; /**< Opaque value. */ + int stale; /**< Stale parameter. */ + pj_str_t algorithm; /**< Algorithm parameter. */ + pj_str_t qop; /**< Quality of protection. */ }; +/** + * @see pjsip_digest_challenge + */ typedef struct pjsip_digest_challenge pjsip_digest_challenge; /** @@ -160,14 +177,17 @@ typedef struct pjsip_digest_challenge pjsip_digest_challenge; */ struct pjsip_pgp_challenge { - pj_str_t realm; - pjsip_param other_param; - pj_str_t version; - pj_str_t micalgorithm; - pj_str_t pubalgorithm; - pj_str_t nonce; + pj_str_t realm; /**< Realm for the challenge. */ + pjsip_param other_param; /**< Other parameters. */ + pj_str_t version; /**< PGP version. */ + pj_str_t micalgorithm; /**< micalgorithm parameter. */ + pj_str_t pubalgorithm; /**< pubalgorithm parameter. */ + pj_str_t nonce; /**< Nonce challenge. */ }; +/** + * @see pjsip_pgp_challenge + */ typedef struct pjsip_pgp_challenge pjsip_pgp_challenge; /** @@ -176,33 +196,51 @@ typedef struct pjsip_pgp_challenge pjsip_pgp_challenge; */ struct pjsip_www_authenticate_hdr { + /** Standard header fields. */ PJSIP_DECL_HDR_MEMBER(struct pjsip_www_authenticate_hdr); + + /** Authentication scheme */ pj_str_t scheme; + + /** This union contains structures that are only relevant + depending on the value of the scheme being used. + */ union { - pjsip_common_challenge common; - pjsip_digest_challenge digest; - pjsip_pgp_challenge pgp; + pjsip_common_challenge common; /**< Common fields. */ + pjsip_digest_challenge digest; /**< Digest challenge. */ + pjsip_pgp_challenge pgp; /**< PGP challenge. */ } challenge; }; +/** + * WWW-Authenticate header. + */ typedef struct pjsip_www_authenticate_hdr pjsip_www_authenticate_hdr; + +/** + * Proxy-Authenticate header. + */ typedef struct pjsip_www_authenticate_hdr pjsip_proxy_authenticate_hdr; /** * Create SIP WWW-Authenticate header. - * @param pool Pool where memory will be allocated from. - * @return SIP WWW-Authenticate header. + * + * @param pool Pool where memory will be allocated from. + * @return SIP WWW-Authenticate header. */ -PJ_DECL(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool); +PJ_DECL(pjsip_www_authenticate_hdr*) +pjsip_www_authenticate_hdr_create(pj_pool_t *pool); /** * Create SIP Proxy-Authenticate header. - * @param pool Pool where memory will be allocated from. - * @return SIP Proxy-Authenticate header. + * + * @param pool Pool where memory will be allocated from. + * @return SIP Proxy-Authenticate header. */ -PJ_DECL(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool); +PJ_DECL(pjsip_proxy_authenticate_hdr*) +pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool); /** * @} |