#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <netinet/in.h>#include "../../mem/shm_mem.h"#include "../../dprint.h"#include "diameter_msg.h"

Go to the source code of this file.
Defines | |
| #define | get_3bytes(_b) |
| #define | get_4bytes(_b) |
| #define | set_3bytes(_b, _v) |
| #define | set_4bytes(_b, _v) |
| #define | to_32x_len(_len_) ( (_len_)+(((_len_)&3)?4-((_len_)&3):0) ) |
Functions | |
| AAAReturnCode | AAABuildMsgBuffer (AAAMessage *msg) |
| AAAReturnCode | AAAFreeMessage (AAAMessage **msg) |
| AAAMessage * | AAAInMessage (AAACommandCode commandCode, AAAApplicationId appId) |
| void | AAAPrintMessage (AAAMessage *msg) |
| AAAReturnCode | AAASetMessageResultCode (AAAMessage *message, AAAResultCode resultCode) |
| AAAMessage * | AAATranslateMessage (unsigned char *source, unsigned int sourceLen, int attach_buf) |
| #define get_3bytes | ( | _b | ) |
Value:
((((unsigned int)(_b)[0])<<16)|(((unsigned int)(_b)[1])<<8)|\ (((unsigned int)(_b)[2])))
Definition at line 36 of file message.c.
Referenced by AAATranslateMessage().
| #define get_4bytes | ( | _b | ) |
Value:
((((unsigned int)(_b)[0])<<24)|(((unsigned int)(_b)[1])<<16)|\ (((unsigned int)(_b)[2])<<8)|(((unsigned int)(_b)[3])))
Definition at line 40 of file message.c.
Referenced by AAATranslateMessage().
| #define set_3bytes | ( | _b, | |||
| _v | ) |
Value:
{(_b)[0]=((_v)&0x00ff0000)>>16;(_b)[1]=((_v)&0x0000ff00)>>8;\
(_b)[2]=((_v)&0x000000ff);}
Definition at line 44 of file message.c.
Referenced by AAABuildMsgBuffer().
| #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 48 of file message.c.
Referenced by AAABuildMsgBuffer().
| #define to_32x_len | ( | _len_ | ) | ( (_len_)+(((_len_)&3)?4-((_len_)&3):0) ) |
Definition at line 52 of file message.c.
Referenced by AAABuildMsgBuffer(), and AAATranslateMessage().
| 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().
| AAAReturnCode AAAFreeMessage | ( | AAAMessage ** | msg | ) |
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().
| 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 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