diameter_msg.h File Reference

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

Include dependency graph for diameter_msg.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _avp_list_t
struct  _message_t
struct  avp

Defines

#define AAA_MSG_HDR_SIZE
#define AAA_NO_VENDOR_ID   0
#define AAACreateAndAddAVPToMessage(_msg_, _code_, _flags_, _vdr_, _data_, _len_)
#define AC_MSG_CODE   0x0f010000
#define ad_free   pkg_free
#define ad_malloc   pkg_malloc
#define APPLICATION_ID_SIZE   4
#define AS_MSG_CODE   0x12010000
#define AVP_CODE_SIZE   4
#define AVP_FLAGS_SIZE   1
#define AVP_HDR_SIZE(_flags_)
#define AVP_LENGTH_SIZE   3
#define AVP_VENDOR_ID_SIZE   4
#define CE_MSG_CODE   0x01010000
#define COMMAND_CODE_SIZE   3
#define DP_MSG_CODE   0x1a010000
#define DW_MSG_CODE   0x18010000
#define END_TO_END_IDENTIFIER_SIZE   4
#define FLAGS_SIZE   1
#define HOP_BY_HOP_IDENTIFIER_SIZE   4
#define is_req(_msg_)   (((_msg_)->flags)&0x80)
#define MASK_MSG_CODE   0xffffff00
#define MESSAGE_LENGTH_SIZE   3
#define RA_MSG_CODE   0x02010000
#define ST_MSG_CODE   0x13010000
#define VER_SIZE   1

Typedefs

typedef struct avp AAA_AVP
typedef struct _avp_list_t AAA_AVP_LIST
typedef unsigned int AAA_AVPCode
typedef unsigned int AAAApplicationId
typedef void * AAAApplicationRef
typedef unsigned int AAACommandCode
typedef unsigned int AAAExtensionId
typedef struct _message_t AAAMessage
typedef unsigned char AAAMsgFlag
typedef unsigned int AAAMsgIdentifier
typedef str AAASessionId
typedef unsigned int AAAValue
typedef unsigned int AAAVendorId

Enumerations

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 = (int)0xffffffff
}
enum  AAA_AVPCodeNr {
  AVP_User_Name = 1, AVP_Class = 25, AVP_Session_Timeout = 27, AVP_Proxy_State = 33,
  AVP_Host_IP_Address = 257, AVP_Auth_Application_Id = 258, 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, AVP_Resource = 400,
  AVP_Response = 401, AVP_Challenge = 402, AVP_Method = 403, AVP_Service_Type = 404,
  AVP_User_Group = 405, AVP_SIP_MSGID = 406
}
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
}
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
}
enum  AAAAcctMessageType { AAA_ACCT_EVENT = 1, AAA_ACCT_START = 2, AAA_ACCT_INTERIM = 3, AAA_ACCT_STOP = 4 }
enum  AAAResultCode {
  AAA_MUTI_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
}
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
}
enum  AAASearchType { AAA_FORWARD_SEARCH = 0, AAA_BACKWARD_SEARCH }
enum  AVPDataStatus { AVP_DUPLICATE_DATA, AVP_DONT_FREE_DATA, AVP_FREE_DATA }

Functions

AAAReturnCode AAAAddAVPToMessage (AAAMessage *msg, AAA_AVP *avp, AAA_AVP *position)
AAAReturnCode AAABuildMsgBuffer (AAAMessage *msg)
AAA_AVPAAACloneAVP (AAA_AVP *avp, unsigned char duplicate_data)
char * AAAConvertAVPToString (AAA_AVP *avp, char *dest, unsigned int destLen)
AAA_AVPAAACreateAVP (AAA_AVPCode code, AAA_AVPFlag flags, AAAVendorId vendorId, char *data, unsigned int length, AVPDataStatus data_status)
AAA_AVPAAAFindMatchingAVP (AAAMessage *msg, AAA_AVP *startAvp, AAA_AVPCode avpCode, AAAVendorId vendorId, AAASearchType searchType)
AAAReturnCode AAAFreeAVP (AAA_AVP **avp)
AAAReturnCode AAAFreeMessage (AAAMessage **message)
AAA_AVPAAAGetFirstAVP (AAA_AVP_LIST *avpList)
AAA_AVPAAAGetLastAVP (AAA_AVP_LIST *avpList)
AAA_AVPAAAGetNextAVP (AAA_AVP *avp)
AAA_AVPAAAGetPrevAVP (AAA_AVP *avp)
AAAMessageAAAInMessage (AAACommandCode commandCode, AAAApplicationId appId)
void AAAPrintMessage (AAAMessage *msg)
AAAReturnCode AAARemoveAVPFromMessage (AAAMessage *msg, AAA_AVP *avp)
AAAReturnCode AAASetMessageResultCode (AAAMessage *message, AAAResultCode resultCode)
AAAMessageAAATranslateMessage (unsigned char *source, unsigned int sourceLen, int attach_buf)


Define Documentation

#define AAA_MSG_HDR_SIZE

#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

#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

Definition at line 47 of file diameter_msg.h.

Referenced by AAATranslateMessage().

#define AVP_FLAGS_SIZE   1

Definition at line 48 of file diameter_msg.h.

Referenced by AAATranslateMessage().

#define AVP_HDR_SIZE ( _flags_   ) 

#define AVP_LENGTH_SIZE   3

Definition at line 49 of file diameter_msg.h.

Referenced by AAATranslateMessage().

#define AVP_VENDOR_ID_SIZE   4

Definition at line 50 of file diameter_msg.h.

Referenced by AAATranslateMessage().

#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)

Definition at line 312 of file diameter_msg.h.

Referenced by AAASetMessageResultCode().

#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 Documentation

typedef struct avp AAA_AVP

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.


Enumeration Type Documentation

Enumerator:
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.

Enumerator:
AVP_User_Name 
AVP_Class 
AVP_Session_Timeout 
AVP_Proxy_State 
AVP_Host_IP_Address 
AVP_Auth_Application_Id 
AVP_Vendor_Specific_Application_Id 
AVP_Redirect_Max_Cache_Time 
AVP_Session_Id 
AVP_Origin_Host 
AVP_Supported_Vendor_Id 
AVP_Vendor_Id 
AVP_Result_Code 
AVP_Product_Name 
AVP_Session_Binding 
AVP_Disconnect_Cause 
AVP_Auth_Request_Type 
AVP_Auth_Grace_Period 
AVP_Auth_Session_State 
AVP_Origin_State_Id 
AVP_Proxy_Host 
AVP_Error_Message 
AVP_Record_Route 
AVP_Destination_Realm 
AVP_Proxy_Info 
AVP_Re_Auth_Request_Type 
AVP_Authorization_Lifetime 
AVP_Redirect_Host 
AVP_Destination_Host 
AVP_Termination_Cause 
AVP_Origin_Realm 
AVP_Resource 
AVP_Response 
AVP_Challenge 
AVP_Method 
AVP_Service_Type 
AVP_User_Group 
AVP_SIP_MSGID 

Definition at line 191 of file diameter_msg.h.

Enumerator:
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.

Enumerator:
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.

Enumerator:
AAA_ACCT_EVENT 
AAA_ACCT_START 
AAA_ACCT_INTERIM 
AAA_ACCT_STOP 

Definition at line 245 of file diameter_msg.h.

Enumerator:
AAA_MUTI_ROUND_AUTH 
AAA_SUCCESS 
AAA_COMMAND_UNSUPPORTED 
AAA_UNABLE_TO_DELIVER 
AAA_REALM_NOT_SERVED 
AAA_TOO_BUSY 
AAA_LOOP_DETECTED 
AAA_REDIRECT_INDICATION 
AAA_APPLICATION_UNSUPPORTED 
AAA_INVALID_HDR_BITS 
AAA_INVALID_AVP_BITS 
AAA_UNKNOWN_PEER 
AAA_AUTHENTICATION_REJECTED 
AAA_OUT_OF_SPACE 
AAA_ELECTION_LOST 
AAA_AVP_UNSUPPORTED 
AAA_UNKNOWN_SESSION_ID 
AAA_AUTHORIZATION_REJECTED 
AAA_INVALID_AVP_VALUE 
AAA_MISSING_AVP 
AAA_RESOURCES_EXCEEDED 
AAA_CONTRADICTING_AVPS 
AAA_AVP_NOT_ALLOWED 
AAA_AVP_OCCURS_TOO_MANY_TIMES 
AAA_NO_COMMON_APPLICATION 
AAA_UNSUPPORTED_VERSION 
AAA_UNABLE_TO_COMPLY 
AAA_INVALID_BIT_IN_HEADER 
AAA_INVALIS_AVP_LENGTH 
AAA_INVALID_MESSGE_LENGTH 
AAA_INVALID_AVP_BIT_COMBO 
AAA_NO_COMMON_SECURITY 

Definition at line 155 of file diameter_msg.h.

Enumerator:
AAA_ERR_NOT_FOUND 
AAA_ERR_FAILURE 
AAA_ERR_SUCCESS 
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 

Definition at line 99 of file diameter_msg.h.

Enumerator:
AAA_FORWARD_SEARCH 
AAA_BACKWARD_SEARCH 

Definition at line 238 of file diameter_msg.h.

Enumerator:
AVP_DUPLICATE_DATA 
AVP_DONT_FREE_DATA 
AVP_FREE_DATA 

Definition at line 253 of file diameter_msg.h.


Function Documentation

AAAReturnCode AAAAddAVPToMessage ( AAAMessage msg,
AAA_AVP avp,
AAA_AVP position 
)

AAAReturnCode AAABuildMsgBuffer ( AAAMessage msg  ) 

AAA_AVP* AAACloneAVP ( AAA_AVP avp,
unsigned char  duplicate_data 
)

Definition at line 414 of file avp.c.

References ad_free, ad_malloc, avp::data, avp::free_it, _str::len, LM_ERR, avp::next, avp::prev, and _str::s.

char* AAAConvertAVPToString ( AAA_AVP avp,
char *  dest,
unsigned int  destLen 
)

AAA_AVP* AAACreateAVP ( AAA_AVPCode  code,
AAA_AVPFlag  flags,
AAAVendorId  vendorId,
char *  data,
unsigned int  length,
AVPDataStatus  data_status 
)

AAA_AVP* AAAFindMatchingAVP ( AAAMessage msg,
AAA_AVP startAvp,
AAA_AVPCode  avpCode,
AAAVendorId  vendorId,
AAASearchType  searchType 
)

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  ) 

Definition at line 316 of file avp.c.

References _avp_list_t::head.

AAA_AVP* AAAGetLastAVP ( AAA_AVP_LIST avpList  ) 

Definition at line 323 of file avp.c.

References _avp_list_t::tail.

Referenced by diameter_authorize().

AAA_AVP* AAAGetNextAVP ( AAA_AVP avp  ) 

Definition at line 332 of file avp.c.

References avp::next.

AAA_AVP* AAAGetPrevAVP ( AAA_AVP avp  ) 

Definition at line 340 of file avp.c.

References avp::prev.

AAAMessage* AAAInMessage ( AAACommandCode  commandCode,
AAAApplicationId  appId 
)

void AAAPrintMessage ( AAAMessage msg  ) 

AAAReturnCode AAARemoveAVPFromMessage ( AAAMessage msg,
AAA_AVP avp 
)

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 
)


Generated on Tue May 22 16:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6