#include "../../str.h"#include "../../mem/mem.h"


Go to the source code of this file.
| #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 52 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define AAA_NO_VENDOR_ID 0 |
Definition at line 38 of file diameter_msg.h.
| #define AAACreateAndAddAVPToMessage | ( | _msg_, | |||
| _code_, | |||||
| _flags_, | |||||
| _vdr_, | |||||
| _data_, | |||||
| _len_ | ) |
Value:
( AAAAddAVPToMessage(_msg_, \ AAACreateAVP(_code_,_flags_,_vdr_,_data_,_len_, AVP_DUPLICATE_DATA),\ (_msg_)->avpList.tail) )
Definition at line 341 of file diameter_msg.h.
| #define AC_MSG_CODE 0x0f010000 |
Definition at line 64 of file diameter_msg.h.
| #define ad_free pkg_free |
Definition at line 34 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), AAACloneAVP(), AAAFreeAVP(), and AAAFreeMessage().
| #define ad_malloc pkg_malloc |
Definition at line 33 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), AAACloneAVP(), AAACreateAVP(), AAAInMessage(), AAATranslateMessage(), diameter_authorize(), and srv_response().
| #define APPLICATION_ID_SIZE 4 |
Definition at line 44 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define AS_MSG_CODE 0x12010000 |
Definition at line 63 of file diameter_msg.h.
| #define AVP_CODE_SIZE 4 |
| #define AVP_FLAGS_SIZE 1 |
| #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 56 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define AVP_LENGTH_SIZE 3 |
| #define AVP_VENDOR_ID_SIZE 4 |
| #define CE_MSG_CODE 0x01010000 |
Definition at line 65 of file diameter_msg.h.
| #define COMMAND_CODE_SIZE 3 |
Definition at line 43 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define DP_MSG_CODE 0x1a010000 |
Definition at line 67 of file diameter_msg.h.
| #define DW_MSG_CODE 0x18010000 |
Definition at line 66 of file diameter_msg.h.
| #define END_TO_END_IDENTIFIER_SIZE 4 |
Definition at line 46 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define FLAGS_SIZE 1 |
Definition at line 42 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define HOP_BY_HOP_IDENTIFIER_SIZE 4 |
Definition at line 45 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define is_req | ( | _msg_ | ) | (((_msg_)->flags)&0x80) |
| #define MASK_MSG_CODE 0xffffff00 |
Definition at line 70 of file diameter_msg.h.
| #define MESSAGE_LENGTH_SIZE 3 |
Definition at line 41 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| #define RA_MSG_CODE 0x02010000 |
Definition at line 68 of file diameter_msg.h.
| #define ST_MSG_CODE 0x13010000 |
Definition at line 69 of file diameter_msg.h.
| #define VER_SIZE 1 |
Definition at line 40 of file diameter_msg.h.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| typedef struct _avp_list_t AAA_AVP_LIST |
| typedef unsigned int AAA_AVPCode |
Definition at line 88 of file diameter_msg.h.
| typedef unsigned int AAAApplicationId |
Definition at line 90 of file diameter_msg.h.
| typedef void* AAAApplicationRef |
Definition at line 91 of file diameter_msg.h.
| typedef unsigned int AAACommandCode |
Definition at line 85 of file diameter_msg.h.
| typedef unsigned int AAAExtensionId |
Definition at line 87 of file diameter_msg.h.
| typedef struct _message_t AAAMessage |
| typedef unsigned char AAAMsgFlag |
Definition at line 94 of file diameter_msg.h.
| typedef unsigned int AAAMsgIdentifier |
Definition at line 93 of file diameter_msg.h.
| typedef str AAASessionId |
Definition at line 92 of file diameter_msg.h.
| typedef unsigned int AAAValue |
Definition at line 89 of file diameter_msg.h.
| typedef unsigned int AAAVendorId |
Definition at line 86 of file diameter_msg.h.
| enum AAA_APP_IDS |
| AAA_APP_DIAMETER_COMMON_MSG | |
| AAA_APP_NASREQ | |
| AAA_APP_MOBILE_IP | |
| AAA_APP_DIAMETER_BASE_ACC | |
| AAA_APP_RELAY |
Definition at line 144 of file diameter_msg.h.
| enum AAA_AVPCodeNr |
Definition at line 191 of file diameter_msg.h.
| 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 |
Definition at line 122 of file diameter_msg.h.
| enum AAA_AVPFlag |
| 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 134 of file diameter_msg.h.
| enum AAAAcctMessageType |
Definition at line 245 of file diameter_msg.h.
| enum AAAResultCode |
Definition at line 155 of file diameter_msg.h.
| enum AAAReturnCode |
Definition at line 99 of file diameter_msg.h.
| enum AAASearchType |
| enum AVPDataStatus |
Definition at line 253 of file diameter_msg.h.
| AAAReturnCode AAAAddAVPToMessage | ( | AAAMessage * | msg, | |
| AAA_AVP * | avp, | |||
| AAA_AVP * | position | |||
| ) |
Definition at line 153 of file avp.c.
References AAA_ERR_PARAMETER, AAA_ERR_SUCCESS, _message_t::auth_ses_state, AVP_Auth_Session_State, AVP_Destination_Host, AVP_Destination_Realm, AVP_Origin_Host, AVP_Origin_Realm, AVP_Result_Code, AVP_Session_Id, _message_t::avpList, avp::code, _message_t::dest_host, _message_t::dest_realm, _avp_list_t::head, LM_ERR, avp::next, _message_t::orig_host, _message_t::orig_realm, avp::prev, _message_t::res_code, _message_t::sessionId, and _avp_list_t::tail.
Referenced by AAATranslateMessage(), diameter_authorize(), and diameter_is_user_in().
| AAAReturnCode AAABuildMsgBuffer | ( | AAAMessage * | msg | ) |
Definition at line 58 of file message.c.
References AAA_ERR_SUCCESS, AAA_MSG_HDR_SIZE, ad_free, ad_malloc, APPLICATION_ID_SIZE, _message_t::applicationId, AVP_HDR_SIZE, _message_t::avpList, _message_t::buf, avp::code, COMMAND_CODE_SIZE, _message_t::commandCode, avp::data, END_TO_END_IDENTIFIER_SIZE, _message_t::endtoendId, _message_t::flags, avp::flags, FLAGS_SIZE, _avp_list_t::head, HOP_BY_HOP_IDENTIFIER_SIZE, _message_t::hopbyhopId, _str::len, LM_ERR, MESSAGE_LENGTH_SIZE, avp::next, _str::s, set_3bytes, set_4bytes, to_32x_len, avp::vendorId, and VER_SIZE.
Referenced by diameter_authorize(), and diameter_is_user_in().
| char* AAAConvertAVPToString | ( | AAA_AVP * | avp, | |
| char * | dest, | |||
| unsigned int | destLen | |||
| ) |
Definition at line 349 of file avp.c.
References AAA_AVP_ADDRESS_TYPE, AAA_AVP_DATA_TYPE, AAA_AVP_INTEGER32_TYPE, AAA_AVP_STRING_TYPE, AAA_AVP_TIME_TYPE, avp::code, avp::data, avp::flags, _str::len, LM_ERR, LM_WARN, avp::next, avp::packetType, avp::prev, _str::s, snprintf, avp::type, and avp::vendorId.
Referenced by AAAPrintMessage().
| AAA_AVP* AAACreateAVP | ( | AAA_AVPCode | code, | |
| AAA_AVPFlag | flags, | |||
| AAAVendorId | vendorId, | |||
| char * | data, | |||
| unsigned int | length, | |||
| AVPDataStatus | data_status | |||
| ) |
Definition at line 99 of file avp.c.
References ad_malloc, AVP_DUPLICATE_DATA, AVP_FREE_DATA, avp::code, avp::data, avp::flags, avp::free_it, _str::len, LM_ERR, avp::packetType, _str::s, set_avp_fields(), and avp::vendorId.
Referenced by AAATranslateMessage(), diameter_authorize(), and diameter_is_user_in().
| AAA_AVP* AAAFindMatchingAVP | ( | AAAMessage * | msg, | |
| AAA_AVP * | startAvp, | |||
| AAA_AVPCode | avpCode, | |||
| AAAVendorId | vendorId, | |||
| AAASearchType | searchType | |||
| ) |
Definition at line 207 of file avp.c.
References AAA_FORWARD_SEARCH, _message_t::avpList, avp::code, _avp_list_t::head, LM_ERR, avp::next, avp::prev, _avp_list_t::tail, and avp::vendorId.
Referenced by tcp_send_recv().
| AAAReturnCode AAAFreeAVP | ( | AAA_AVP ** | avp | ) |
Definition at line 295 of file avp.c.
References AAA_ERR_PARAMETER, AAA_ERR_SUCCESS, ad_free, and LM_ERR.
Referenced by AAAFreeMessage(), diameter_authorize(), and diameter_is_user_in().
| AAAReturnCode AAAFreeMessage | ( | AAAMessage ** | message | ) |
Definition at line 140 of file message.c.
References AAA_ERR_SUCCESS, AAAFreeAVP(), ad_free, and avp::next.
Referenced by AAATranslateMessage(), diameter_authorize(), and diameter_is_user_in().
| AAA_AVP* AAAGetFirstAVP | ( | AAA_AVP_LIST * | avpList | ) |
| AAA_AVP* AAAGetLastAVP | ( | AAA_AVP_LIST * | avpList | ) |
Definition at line 323 of file avp.c.
References _avp_list_t::tail.
Referenced by diameter_authorize().
| AAAMessage* AAAInMessage | ( | AAACommandCode | commandCode, | |
| AAAApplicationId | appId | |||
| ) |
Definition at line 320 of file message.c.
References ad_malloc, _message_t::applicationId, _message_t::commandCode, _message_t::flags, LM_ERR, and NULL.
Referenced by diameter_authorize(), and diameter_is_user_in().
| void AAAPrintMessage | ( | AAAMessage * | msg | ) |
Definition at line 348 of file message.c.
References AAAConvertAVPToString(), _message_t::avpList, buf, _message_t::commandCode, _message_t::flags, _avp_list_t::head, LM_DBG, and avp::next.
Referenced by diameter_authorize(), and diameter_is_user_in().
| AAAReturnCode AAARemoveAVPFromMessage | ( | AAAMessage * | msg, | |
| AAA_AVP * | avp | |||
| ) |
Definition at line 248 of file avp.c.
References AAA_ERR_PARAMETER, AAA_ERR_SUCCESS, _message_t::auth_ses_state, AVP_Auth_Session_State, AVP_Destination_Host, AVP_Destination_Realm, AVP_Origin_Host, AVP_Origin_Realm, AVP_Result_Code, AVP_Session_Id, _message_t::avpList, avp::code, _message_t::dest_host, _message_t::dest_realm, _avp_list_t::head, LM_ERR, avp::next, _message_t::orig_host, _message_t::orig_realm, avp::prev, _message_t::res_code, _message_t::sessionId, and _avp_list_t::tail.
| AAAReturnCode AAASetMessageResultCode | ( | AAAMessage * | message, | |
| AAAResultCode | resultCode | |||
| ) |
Definition at line 174 of file message.c.
References AAA_ERR_FAILURE, AAA_ERR_SUCCESS, avp::data, is_req, _message_t::res_code, and _str::s.
| AAAMessage* AAATranslateMessage | ( | unsigned char * | source, | |
| unsigned int | sourceLen, | |||
| int | attach_buf | |||
| ) |
Definition at line 188 of file message.c.
References AAA_AVP_FLAG_VENDOR_SPECIFIC, AAA_MSG_HDR_SIZE, AAAAddAVPToMessage(), AAACreateAVP(), AAAFreeMessage(), ad_malloc, APPLICATION_ID_SIZE, _message_t::applicationId, AVP_CODE_SIZE, AVP_DONT_FREE_DATA, AVP_FLAGS_SIZE, AVP_HDR_SIZE, AVP_LENGTH_SIZE, AVP_VENDOR_ID_SIZE, _message_t::avpList, _message_t::buf, COMMAND_CODE_SIZE, _message_t::commandCode, END_TO_END_IDENTIFIER_SIZE, _message_t::endtoendId, _message_t::flags, FLAGS_SIZE, get_3bytes, get_4bytes, HOP_BY_HOP_IDENTIFIER_SIZE, _message_t::hopbyhopId, _str::len, LM_ERR, MESSAGE_LENGTH_SIZE, _str::s, _avp_list_t::tail, to_32x_len, VER_SIZE, and version.
Referenced by tcp_send_recv().
1.5.6