Definition in file diameter.h.
#include "utils.h"
#include <ctype.h>
Go to the source code of this file.
Data Structures | |
| struct | avp |
| This structure contains a message AVP in parsed format. More... | |
| struct | _avp_list_t |
| This structure is used for representing lists of AVPs on the message or in grouped AVPs. More... | |
| struct | _message_t |
| This structure contains the full AAA message. More... | |
| struct | _AAATransaction |
| This structure defines a Diameter Transaction. More... | |
Defines | |
| #define | get_2bytes(_b) |
| #define | get_3bytes(_b) |
| #define | get_4bytes(_b) |
| #define | set_2bytes(_b, _v) |
| #define | set_3bytes(_b, _v) |
| #define | set_4bytes(_b, _v) |
| #define | to_32x_len(_len_) ( (_len_)+(((_len_)&3)?4-((_len_)&3):0) ) |
| #define | AAA_NO_VENDOR_ID 0 |
| #define | VER_SIZE 1 |
| #define | MESSAGE_LENGTH_SIZE 3 |
| #define | FLAGS_SIZE 1 |
| #define | COMMAND_CODE_SIZE 3 |
| #define | APPLICATION_ID_SIZE 4 |
| #define | HOP_BY_HOP_IDENTIFIER_SIZE 4 |
| #define | END_TO_END_IDENTIFIER_SIZE 4 |
| #define | AVP_CODE_SIZE 4 |
| #define | AVP_FLAGS_SIZE 1 |
| #define | AVP_LENGTH_SIZE 3 |
| #define | AVP_VENDOR_ID_SIZE 4 |
| #define | AAA_MSG_HDR_SIZE |
| #define | AVP_HDR_SIZE(_flags_) |
| #define | AS_MSG_CODE 0x12010000 |
| #define | AC_MSG_CODE 0x0f010000 |
| #define | CE_MSG_CODE 0x01010000 |
| #define | DW_MSG_CODE 0x18010000 |
| #define | DP_MSG_CODE 0x1a010000 |
| #define | RA_MSG_CODE 0x02010000 |
| #define | ST_MSG_CODE 0x13010000 |
| #define | MASK_MSG_CODE 0xffffff00 |
| #define | Flag_Request 0x80 |
| #define | Flag_Proxyable 0x40 |
| #define | Code_CE 257 |
| #define | Code_DW 280 |
| #define | Code_DP 282 |
| #define | is_req(_msg_) (((_msg_)->flags)&0x80) |
| if the message is a request | |
Typedefs | |
| typedef unsigned int | AAACommandCode |
| Code for a Diameter Command. | |
| typedef unsigned int | AAAVendorId |
| Vendor identifier. | |
| typedef unsigned int | AAAExtensionId |
| Extension identifier. | |
| typedef unsigned int | AAA_AVPCode |
| Code for an AVP. | |
| typedef unsigned int | AAAValue |
| Value. | |
| typedef unsigned int | AAAApplicationId |
| Application Identifier. | |
| typedef void * | AAAApplicationRef |
| Application Reference. | |
| typedef str | AAASessionId |
| Session Identifier. | |
| typedef unsigned int | AAAMsgIdentifier |
| Message Identifier. | |
| typedef unsigned char | AAAMsgFlag |
| Message flag. | |
| typedef avp | AAA_AVP |
| This structure contains a message AVP in parsed format. | |
| typedef _avp_list_t | AAA_AVP_LIST |
| This structure is used for representing lists of AVPs on the message or in grouped AVPs. | |
| typedef _message_t | AAAMessage |
| This structure contains the full AAA message. | |
| typedef _AAATransaction | AAATransaction |
| This structure defines a Diameter Transaction. | |
| typedef void( | AAATransactionCallback_f )(int is_timeout, void *param, AAAMessage *ans) |
| Function for callback on transaction events: response or time-out for request. | |
| typedef AAAMessage *( | AAARequestHandler_f )(AAAMessage *req, void *param) |
| Function for callback on request received. | |
| typedef void( | AAAResponseHandler_f )(AAAMessage *res, void *param) |
| Function for callback on response received. | |
Enumerations | |
| enum | AAAReturnCode { AAA_ERR_NOT_FOUND = -2, AAA_ERR_FAILURE = -1, AAA_ERR_SUCCESS = 0, AAA_ERR_NOMEM, AAA_ERR_PROTO, AAA_ERR_SECURITY, AAA_ERR_PARAMETER, AAA_ERR_CONFIG, AAA_ERR_UNKNOWN_CMD, AAA_ERR_MISSING_AVP, AAA_ERR_ALREADY_INIT, AAA_ERR_TIMED_OUT, AAA_ERR_CANNOT_SEND_MSG, AAA_ERR_ALREADY_REGISTERED, AAA_ERR_CANNOT_REGISTER, AAA_ERR_NOT_INITIALIZED, AAA_ERR_NETWORK_ERROR } |
| Status codes returned by functions in the AAA API. More... | |
| enum | AAA_AVPDataType { AAA_AVP_DATA_TYPE, AAA_AVP_STRING_TYPE, AAA_AVP_ADDRESS_TYPE, AAA_AVP_INTEGER32_TYPE, AAA_AVP_INTEGER64_TYPE, AAA_AVP_TIME_TYPE } |
| The following are AVP data type codes. More... | |
| enum | AAA_AVPFlag { AAA_AVP_FLAG_NONE = 0x00, AAA_AVP_FLAG_MANDATORY = 0x40, AAA_AVP_FLAG_RESERVED = 0x1F, AAA_AVP_FLAG_VENDOR_SPECIFIC = 0x80, AAA_AVP_FLAG_END_TO_END_ENCRYPT = 0x20 } |
| The following are used for AVP header flags and for flags in the AVP wrapper struct and AVP dictionary definitions. More... | |
| enum | AAA_APP_IDS { AAA_APP_DIAMETER_COMMON_MSG = 0, AAA_APP_NASREQ = 1, AAA_APP_MOBILE_IP = 2, AAA_APP_DIAMETER_BASE_ACC = 3, AAA_APP_RELAY = 0xffffffff } |
| List with all known application identifiers. More... | |
| enum | AAAResultCode { AAA_MULTI_ROUND_AUTH = 1001, AAA_SUCCESS = 2001, AAA_COMMAND_UNSUPPORTED = 3001, AAA_UNABLE_TO_DELIVER = 3002, AAA_REALM_NOT_SERVED = 3003, AAA_TOO_BUSY = 3004, AAA_LOOP_DETECTED = 3005, AAA_REDIRECT_INDICATION = 3006, AAA_APPLICATION_UNSUPPORTED = 3007, AAA_INVALID_HDR_BITS = 3008, AAA_INVALID_AVP_BITS = 3009, AAA_UNKNOWN_PEER = 3010, AAA_AUTHENTICATION_REJECTED = 4001, AAA_OUT_OF_SPACE = 4002, AAA_ELECTION_LOST = 4003, AAA_AVP_UNSUPPORTED = 5001, AAA_UNKNOWN_SESSION_ID = 5002, AAA_AUTHORIZATION_REJECTED = 5003, AAA_INVALID_AVP_VALUE = 5004, AAA_MISSING_AVP = 5005, AAA_RESOURCES_EXCEEDED = 5006, AAA_CONTRADICTING_AVPS = 5007, AAA_AVP_NOT_ALLOWED = 5008, AAA_AVP_OCCURS_TOO_MANY_TIMES = 5009, AAA_NO_COMMON_APPLICATION = 5010, AAA_UNSUPPORTED_VERSION = 5011, AAA_UNABLE_TO_COMPLY = 5012, AAA_INVALID_BIT_IN_HEADER = 5013, AAA_INVALIS_AVP_LENGTH = 5014, AAA_INVALID_MESSGE_LENGTH = 5015, AAA_INVALID_AVP_BIT_COMBO = 5016, AAA_NO_COMMON_SECURITY = 5017 } |
| The following are the result codes returned from remote servers as part of messages. More... | |
| enum | AAA_AVPCodeNr { AVP_User_Name = 1, AVP_Framed_IP_Address = 8, AVP_Class = 25, AVP_Session_Timeout = 27, AVP_Proxy_State = 33, AVP_NAS_Port_Type = 61, AVP_Framed_Interface_Id = 96, AVP_Framed_IPv6_Prefix = 97, AVP_Host_IP_Address = 257, AVP_Auth_Application_Id = 258, AVP_Acct_Application_Id = 259, AVP_Vendor_Specific_Application_Id = 260, AVP_Redirect_Max_Cache_Time = 262, AVP_Session_Id = 263, AVP_Origin_Host = 264, AVP_Supported_Vendor_Id = 265, AVP_Vendor_Id = 266, AVP_Result_Code = 268, AVP_Product_Name = 269, AVP_Session_Binding = 270, AVP_Disconnect_Cause = 273, AVP_Auth_Request_Type = 274, AVP_Auth_Grace_Period = 276, AVP_Auth_Session_State = 277, AVP_Origin_State_Id = 278, AVP_Proxy_Host = 280, AVP_Error_Message = 281, AVP_Record_Route = 282, AVP_Destination_Realm = 283, AVP_Proxy_Info = 284, AVP_Re_Auth_Request_Type = 285, AVP_Authorization_Lifetime = 291, AVP_Redirect_Host = 292, AVP_Destination_Host = 293, AVP_Termination_Cause = 295, AVP_Origin_Realm = 296 } |
| Standard AVP Codes. More... | |
| enum | AAA_AVPReasonCode { Permanent_Termination = 0, New_Server_Assigned = 1, Server_Change = 2, Remove_S_CSCF = 3 } |
| enum | AAASearchType { AAA_FORWARD_SEARCH = 0, AAA_BACKWARD_SEARCH } |
| The following type allows the client to specify which direction to search for an AVP in the AVP list:. More... | |
| enum | AAAAcctMessageType { AAA_ACCT_EVENT = 1, AAA_ACCT_START = 2, AAA_ACCT_INTERIM = 3, AAA_ACCT_STOP = 4 } |
| Accounting message types. More... | |
| enum | AVPDataStatus { AVP_DUPLICATE_DATA, AVP_DONT_FREE_DATA, AVP_FREE_DATA } |
| Hint on what do do with the AVP payload. More... | |
| #define get_2bytes | ( | _b | ) |
| #define get_3bytes | ( | _b | ) |
Value:
Definition at line 67 of file diameter.h.
Referenced by AAATranslateMessage(), AAAUngroupAVPS(), and receive_loop().
| #define get_4bytes | ( | _b | ) |
Value:
((((unsigned char)(_b)[0])<<24)|(((unsigned char)(_b)[1])<<16)|\ (((unsigned char)(_b)[2])<<8)|(((unsigned char)(_b)[3])))
Definition at line 71 of file diameter.h.
Referenced by AAATranslateMessage(), AAAUngroupAVPS(), Cx_get_auth_data_item_answer(), Cx_get_authorization_type(), Cx_get_capabilities(), Cx_get_experimental_result_code(), Cx_get_result_code(), Cx_get_server_assignment_type(), Cx_get_sip_number_auth_items(), Cx_get_userdata_available(), get_routing_peer(), Process_CEA(), Process_CER(), and save_peer_applications().
| #define set_2bytes | ( | _b, | |||
| _v | ) |
| #define set_3bytes | ( | _b, | |||
| _v | ) |
Value:
Definition at line 79 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAAGroupAVPS().
| #define set_4bytes | ( | _b, | |||
| _v | ) |
Value:
{(_b)[0]=((_v)&0xff000000)>>24;(_b)[1]=((_v)&0x00ff0000)>>16;\
(_b)[2]=((_v)&0x0000ff00)>>8;(_b)[3]=((_v)&0x000000ff);}
Definition at line 83 of file diameter.h.
Referenced by AAABuildMsgBuffer(), AAAGroupAVPS(), Cx_add_auth_session_state(), Cx_add_authorization_type(), Cx_add_experimental_result_code(), Cx_add_result_code(), Cx_add_server_assignment_type(), Cx_add_sip_number_auth_items(), Cx_add_userdata_available(), Cx_add_vendor_specific_appid(), e2_add_auth_session_state(), e2_add_authorization_type(), e2_add_experimental_result_code(), e2_add_result_code(), e2_add_vendor_specific_appid(), I_Snd_CER(), Snd_CE_add_applications(), Snd_CEA(), Snd_DPR(), and Snd_DWA().
| #define to_32x_len | ( | _len_ | ) | ( (_len_)+(((_len_)&3)?4-((_len_)&3):0) ) |
Definition at line 87 of file diameter.h.
Referenced by AAABuildMsgBuffer(), AAAGroupAVPS(), AAATranslateMessage(), and AAAUngroupAVPS().
| #define AAA_NO_VENDOR_ID 0 |
Definition at line 93 of file diameter.h.
| #define VER_SIZE 1 |
Definition at line 95 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define MESSAGE_LENGTH_SIZE 3 |
Definition at line 96 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define FLAGS_SIZE 1 |
Definition at line 97 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define COMMAND_CODE_SIZE 3 |
Definition at line 98 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define APPLICATION_ID_SIZE 4 |
Definition at line 99 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define HOP_BY_HOP_IDENTIFIER_SIZE 4 |
Definition at line 100 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define END_TO_END_IDENTIFIER_SIZE 4 |
Definition at line 101 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define AVP_CODE_SIZE 4 |
Definition at line 102 of file diameter.h.
Referenced by AAATranslateMessage(), and AAAUngroupAVPS().
| #define AVP_FLAGS_SIZE 1 |
Definition at line 103 of file diameter.h.
Referenced by AAATranslateMessage(), and AAAUngroupAVPS().
| #define AVP_LENGTH_SIZE 3 |
Definition at line 104 of file diameter.h.
Referenced by AAATranslateMessage(), and AAAUngroupAVPS().
| #define AVP_VENDOR_ID_SIZE 4 |
Definition at line 105 of file diameter.h.
Referenced by AAATranslateMessage(), and AAAUngroupAVPS().
| #define AAA_MSG_HDR_SIZE |
Value:
(VER_SIZE + MESSAGE_LENGTH_SIZE + FLAGS_SIZE + COMMAND_CODE_SIZE +\ APPLICATION_ID_SIZE+HOP_BY_HOP_IDENTIFIER_SIZE+END_TO_END_IDENTIFIER_SIZE)
Definition at line 107 of file diameter.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define AVP_HDR_SIZE | ( | _flags_ | ) |
Value:
(AVP_CODE_SIZE+AVP_FLAGS_SIZE+AVP_LENGTH_SIZE+\ AVP_VENDOR_ID_SIZE*(((_flags_)&AAA_AVP_FLAG_VENDOR_SPECIFIC)!=0) )
Definition at line 111 of file diameter.h.
Referenced by AAABuildMsgBuffer(), AAAGroupAVPS(), AAATranslateMessage(), and AAAUngroupAVPS().
| #define AS_MSG_CODE 0x12010000 |
Definition at line 117 of file diameter.h.
| #define AC_MSG_CODE 0x0f010000 |
Definition at line 118 of file diameter.h.
| #define CE_MSG_CODE 0x01010000 |
Definition at line 119 of file diameter.h.
| #define DW_MSG_CODE 0x18010000 |
Definition at line 120 of file diameter.h.
| #define DP_MSG_CODE 0x1a010000 |
Definition at line 121 of file diameter.h.
| #define RA_MSG_CODE 0x02010000 |
Definition at line 122 of file diameter.h.
| #define ST_MSG_CODE 0x13010000 |
Definition at line 123 of file diameter.h.
| #define MASK_MSG_CODE 0xffffff00 |
Definition at line 124 of file diameter.h.
| #define Flag_Request 0x80 |
Definition at line 149 of file diameter.h.
| #define Flag_Proxyable 0x40 |
| #define Code_CE 257 |
Definition at line 152 of file diameter.h.
Referenced by I_Snd_CER(), receive_message(), and Snd_CEA().
| #define Code_DW 280 |
Definition at line 153 of file diameter.h.
Referenced by receive_message(), Snd_DWA(), and Snd_DWR().
| #define Code_DP 282 |
Definition at line 154 of file diameter.h.
Referenced by receive_message(), Snd_DPA(), and Snd_DPR().
| #define is_req | ( | _msg_ | ) | (((_msg_)->flags)&0x80) |
if the message is a request
Definition at line 372 of file diameter.h.
Referenced by AAASendMessage(), AAASendMessageToPeer(), AAASendRecvMessage(), AAASendRecvMessageToPeer(), AAASetMessageResultCode(), api_callback(), CxRequestHandler(), e2RequestHandler(), receive_message(), and worker_process().
| typedef unsigned int AAACommandCode |
| typedef unsigned int AAAVendorId |
| typedef unsigned int AAAExtensionId |
| typedef unsigned int AAA_AVPCode |
| typedef unsigned int AAAValue |
| typedef unsigned int AAAApplicationId |
| typedef void* AAAApplicationRef |
| typedef str AAASessionId |
| typedef unsigned int AAAMsgIdentifier |
| typedef unsigned char AAAMsgFlag |
| typedef struct _avp_list_t AAA_AVP_LIST |
This structure is used for representing lists of AVPs on the message or in grouped AVPs.
| typedef struct _message_t AAAMessage |
This structure contains the full AAA message.
| typedef struct _AAATransaction AAATransaction |
This structure defines a Diameter Transaction.
This is used to link a response to a request
| typedef void( AAATransactionCallback_f)(int is_timeout, void *param, AAAMessage *ans) |
Function for callback on transaction events: response or time-out for request.
Definition at line 390 of file diameter.h.
| typedef AAAMessage*( AAARequestHandler_f)(AAAMessage *req, void *param) |
| typedef void( AAAResponseHandler_f)(AAAMessage *res, void *param) |
| enum AAAReturnCode |
Status codes returned by functions in the AAA API.
Definition at line 158 of file diameter.h.
00158 { 00159 AAA_ERR_NOT_FOUND = -2, 00160 AAA_ERR_FAILURE = -1, 00161 AAA_ERR_SUCCESS = 0, 00162 AAA_ERR_NOMEM, 00163 AAA_ERR_PROTO, 00164 AAA_ERR_SECURITY, 00165 AAA_ERR_PARAMETER, 00166 AAA_ERR_CONFIG, 00167 AAA_ERR_UNKNOWN_CMD, 00168 AAA_ERR_MISSING_AVP, 00169 AAA_ERR_ALREADY_INIT, 00170 AAA_ERR_TIMED_OUT, 00171 AAA_ERR_CANNOT_SEND_MSG, 00172 AAA_ERR_ALREADY_REGISTERED, 00173 AAA_ERR_CANNOT_REGISTER, 00174 AAA_ERR_NOT_INITIALIZED, 00175 AAA_ERR_NETWORK_ERROR, 00176 } AAAReturnCode;
| enum AAA_AVPDataType |
The following are AVP data type codes.
They correspond directly to the AVP data types outline in the Diameter specification [1]:
| AAA_AVP_DATA_TYPE | |
| AAA_AVP_STRING_TYPE | |
| AAA_AVP_ADDRESS_TYPE | |
| AAA_AVP_INTEGER32_TYPE | |
| AAA_AVP_INTEGER64_TYPE | |
| AAA_AVP_TIME_TYPE |
Definition at line 181 of file diameter.h.
00181 { 00182 AAA_AVP_DATA_TYPE, 00183 AAA_AVP_STRING_TYPE, 00184 AAA_AVP_ADDRESS_TYPE, 00185 AAA_AVP_INTEGER32_TYPE, 00186 AAA_AVP_INTEGER64_TYPE, 00187 AAA_AVP_TIME_TYPE, 00188 } AAA_AVPDataType;
| enum AAA_AVPFlag |
The following are used for AVP header flags and for flags in the AVP wrapper struct and AVP dictionary definitions.
| AAA_AVP_FLAG_NONE | |
| AAA_AVP_FLAG_MANDATORY | |
| AAA_AVP_FLAG_RESERVED | |
| AAA_AVP_FLAG_VENDOR_SPECIFIC | |
| AAA_AVP_FLAG_END_TO_END_ENCRYPT |
Definition at line 193 of file diameter.h.
00193 { 00194 AAA_AVP_FLAG_NONE = 0x00, 00195 AAA_AVP_FLAG_MANDATORY = 0x40, 00196 AAA_AVP_FLAG_RESERVED = 0x1F, 00197 AAA_AVP_FLAG_VENDOR_SPECIFIC = 0x80, 00198 AAA_AVP_FLAG_END_TO_END_ENCRYPT = 0x20, 00199 } AAA_AVPFlag;
| enum AAA_APP_IDS |
List with all known application identifiers.
| AAA_APP_DIAMETER_COMMON_MSG | |
| AAA_APP_NASREQ | |
| AAA_APP_MOBILE_IP | |
| AAA_APP_DIAMETER_BASE_ACC | |
| AAA_APP_RELAY |
Definition at line 203 of file diameter.h.
00203 { 00204 AAA_APP_DIAMETER_COMMON_MSG = 0, 00205 AAA_APP_NASREQ = 1, 00206 AAA_APP_MOBILE_IP = 2, 00207 AAA_APP_DIAMETER_BASE_ACC = 3, 00208 AAA_APP_RELAY = 0xffffffff, 00209 }AAA_APP_IDS;
| enum AAAResultCode |
The following are the result codes returned from remote servers as part of messages.
Definition at line 214 of file diameter.h.
00214 { 00215 AAA_MULTI_ROUND_AUTH = 1001, 00216 AAA_SUCCESS = 2001, 00217 AAA_COMMAND_UNSUPPORTED = 3001, 00218 AAA_UNABLE_TO_DELIVER = 3002, 00219 AAA_REALM_NOT_SERVED = 3003, 00220 AAA_TOO_BUSY = 3004, 00221 AAA_LOOP_DETECTED = 3005, 00222 AAA_REDIRECT_INDICATION = 3006, 00223 AAA_APPLICATION_UNSUPPORTED = 3007, 00224 AAA_INVALID_HDR_BITS = 3008, 00225 AAA_INVALID_AVP_BITS = 3009, 00226 AAA_UNKNOWN_PEER = 3010, 00227 AAA_AUTHENTICATION_REJECTED = 4001, 00228 AAA_OUT_OF_SPACE = 4002, 00229 AAA_ELECTION_LOST = 4003, 00230 AAA_AVP_UNSUPPORTED = 5001, 00231 AAA_UNKNOWN_SESSION_ID = 5002, 00232 AAA_AUTHORIZATION_REJECTED = 5003, 00233 AAA_INVALID_AVP_VALUE = 5004, 00234 AAA_MISSING_AVP = 5005, 00235 AAA_RESOURCES_EXCEEDED = 5006, 00236 AAA_CONTRADICTING_AVPS = 5007, 00237 AAA_AVP_NOT_ALLOWED = 5008, 00238 AAA_AVP_OCCURS_TOO_MANY_TIMES = 5009, 00239 AAA_NO_COMMON_APPLICATION = 5010, 00240 AAA_UNSUPPORTED_VERSION = 5011, 00241 AAA_UNABLE_TO_COMPLY = 5012, 00242 AAA_INVALID_BIT_IN_HEADER = 5013, 00243 AAA_INVALIS_AVP_LENGTH = 5014, 00244 AAA_INVALID_MESSGE_LENGTH = 5015, 00245 AAA_INVALID_AVP_BIT_COMBO = 5016, 00246 AAA_NO_COMMON_SECURITY = 5017, 00247 } AAAResultCode;
| enum AAA_AVPCodeNr |
Standard AVP Codes.