00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DIAMETER_AUTHORIZE_H
00031 #define DIAMETER_AUTHORIZE_H
00032
00033 #include "diameter_msg.h"
00034 #include "../../parser/digest/digest_parser.h"
00035 #include "../../parser/hf.h"
00036 #include "../../pvar.h"
00037 #include "../../str.h"
00038 #include "defs.h"
00039
00040 typedef enum auth_diam_result {
00041 NONCE_REUSED = -6,
00042 AUTH_ERROR,
00043 NO_CREDENTIALS,
00044 STALE_NONCE,
00045 INVALID_PASSWORD,
00046 USER_UNKNOWN,
00047 ERROR,
00049 AUTHORIZED,
00051 DO_AUTHORIZATION,
00053 } auth_diam_result_t;
00054
00055
00056
00057 int get_uri(struct sip_msg* m, str** uri);
00058
00059 int get_realm(struct sip_msg* m, int hftype, struct sip_uri* u);
00060
00061 auth_diam_result_t diam_pre_auth(struct sip_msg* m, str* realm, int hftype,
00062 struct hdr_field** h);
00063
00064 int authorize(struct sip_msg* msg, pv_elem_t* realm, int hftype);
00065
00066 int diameter_authorize(struct hdr_field* cred, str* p_method,
00067 struct sip_uri uri, struct sip_uri ruri,
00068 unsigned int m_id, rd_buf_t *response);
00069
00070 int srv_response(struct sip_msg* msg, rd_buf_t* rb, int hftype);
00071
00072 int send_resp(struct sip_msg* _m, int _code, str* _reason,
00073 char* _hdr, int _hdr_len);
00074
00075 #endif
00076