cx.h File Reference


Detailed Description

Interrogating-CSCF - Cx operations.

Author:
Dragos Vingarzan vingarzan -at- fokus dot fraunhofer dot de

Definition in file cx.h.

#include "../../sr_module.h"
#include "../cdp/cdp_load.h"

Go to the source code of this file.

Functions

void CxAnswerHandler (AAAMessage *response, void *param)
 Handler for incoming Diameter responses.
void CxFailureHandler (int is_timeout, void *param, AAAMessage *ans)
 Handler for Diameter Failures.
AAAMessageCxRequestHandler (AAAMessage *request, void *param)
 Handler for Diameter incoming requests Not used now as here there are no expected incoming requests.
AAAMessageCx_UAR (struct sip_msg *msg, str private_identity, str public_identity, str visited_network_id, int authorization_type, str realm)
 Sends an UAR and returns the UAA.
AAAMessageCx_LIR (struct sip_msg *msg, str public_identity, str realm)
 Sends an LIR and returns the LIA.


Function Documentation

void CxAnswerHandler ( AAAMessage response,
void *  param 
)

Handler for incoming Diameter responses.

Not used now as all answers are handled by transactional callbacks.

Parameters:
response - the diameter response
param - generic parameter - here the AAATransaction

Definition at line 81 of file cx.c.

References _message_t::commandCode.

00082 {
00083     AAATransaction *t;
00084     t = (AAATransaction*)param;
00085     
00086     if (!param){
00087         LOG(L_ERR,"ERR:CxAnswerHandler: Answer received but no transaction\n");
00088         return;
00089     }
00090 
00091     switch(response->commandCode){
00092         default:
00093             LOG(L_ERR,"ERR:CxAnswerHandler: Unkown Command Code %d\n",
00094                 response->commandCode);
00095     }
00096     return;
00097 }

void CxFailureHandler ( int  is_timeout,
void *  param,
AAAMessage ans 
)

Handler for Diameter Failures.

Not used now as all answers are handled by transactional callbacks.

Parameters:
is_tiemout - if this is a time-out
param - generic parameter - here the AAATransaction
ans - the Diameter answer if available, NULL if not

Definition at line 106 of file cx.c.

References cdp_binds::AAADropTransaction, cdpb, and _AAATransaction::command_code.

00107 {
00108     AAATransaction *t;
00109     t = (AAATransaction*)param;
00110     /* filter only failures */
00111 //  if (!is_timeout) return;
00112     if (!param){
00113         LOG(L_ERR,"ERR:CxFailureHandler: NULL transaction parameter received\n");
00114         return;
00115     }
00116     switch(t->command_code){
00117         default:
00118         LOG(L_ERR,"ERR:CxFailureHandler: Unkown Command Code %d\n",
00119             t->command_code);
00120     }
00121     cdpb.AAADropTransaction(t);
00122     return;
00123 }

AAAMessage* CxRequestHandler ( AAAMessage request,
void *  param 
)

Handler for Diameter incoming requests Not used now as here there are no expected incoming requests.

Parameters:
request - the received request
param - generic pointer
Returns:
the answer to this request

Definition at line 131 of file cx.c.

00132 {
00133     LOG(L_INFO,"INF:CxSIRequestHandler: NOT IMPLEMENTED\n");
00134     return 0;   
00135 }

AAAMessage* Cx_UAR ( struct sip_msg *  msg,
str  private_identity,
str  public_identity,
str  visited_network_id,
int  authorization_type,
str  realm 
)

Sends an UAR and returns the UAA.

Parameters:
msg - the SIP message
private_identity - the username
public_identity - the public identity
visited_network_id - id of the roaming network
authorization_type - if registration or de-registration
realm - Realm
Returns:
the UAA message received or NULL on error

Definition at line 149 of file cx.c.

References cdp_binds::AAACreateRequest, cdp_binds::AAACreateSession, cdp_binds::AAADropSession, cdp_binds::AAAFreeMessage, cdp_binds::AAASendRecvMessage, cdp_binds::AAASendRecvMessageToPeer, AVP_IMS_UAR_REGISTRATION, cdpb, Cx_add_auth_session_state(), Cx_add_authorization_type(), Cx_add_destination_realm(), Cx_add_public_identity(), Cx_add_user_name(), Cx_add_vendor_specific_appid(), Cx_add_visited_network_id(), Flag_Proxyable, icscf_forced_hss_peer_str, IMS_Cx, IMS_UAR, and IMS_vendor_id_3GPP.

Referenced by I_UAR().

00151 {
00152     AAAMessage *uar=0;
00153     AAASessionId sessId={0,0};
00154     AAAMessage *uaa=0;
00155     
00156     sessId = cdpb.AAACreateSession();
00157 
00158     uar = cdpb.AAACreateRequest(IMS_Cx,IMS_UAR,Flag_Proxyable,&sessId);
00159     if (!uar) goto error;
00160 
00161     if (!Cx_add_destination_realm(uar,realm)) goto error;
00162         
00163     if (!Cx_add_vendor_specific_appid(uar,IMS_vendor_id_3GPP,IMS_Cx,0/*IMS_Cx*/)) goto error;
00164     if (!Cx_add_auth_session_state(uar,1)) goto error;
00165 
00166     if (!Cx_add_user_name(uar,private_identity)) goto error;
00167     if (!Cx_add_public_identity(uar,public_identity)) goto error;
00168     if (!Cx_add_visited_network_id(uar,visited_network_id)) goto error;
00169     if (authorization_type!=AVP_IMS_UAR_REGISTRATION)
00170         if (!Cx_add_authorization_type(uar,authorization_type)) goto error;
00171 
00172     #ifdef WITH_IMS_PM
00173         ims_pm_diameter_request(uar);
00174     #endif              
00175     if (icscf_forced_hss_peer_str.len)
00176         uaa = cdpb.AAASendRecvMessageToPeer(uar,&icscf_forced_hss_peer_str);
00177     else 
00178         uaa = cdpb.AAASendRecvMessage(uar); 
00179     #ifdef WITH_IMS_PM
00180         ims_pm_diameter_answer(uaa);
00181     #endif              
00182 
00183     cdpb.AAADropSession(&sessId);
00184     
00185     return uaa;
00186     
00187 error:
00188     //free stuff
00189     if (sessId.s) cdpb.AAADropSession(&sessId);
00190     if (uar) cdpb.AAAFreeMessage(&uar);
00191     return 0;
00192 }   

AAAMessage* Cx_LIR ( struct sip_msg *  msg,
str  public_identity,
str  realm 
)

Sends an LIR and returns the LIA.

Parameters:
msg - the SIP message
public_identity - the public identity
realm - Realm
Returns:
the LIA message received or NULL on error

Definition at line 203 of file cx.c.

References cdp_binds::AAACreateRequest, cdp_binds::AAACreateSession, cdp_binds::AAADropSession, cdp_binds::AAAFreeMessage, cdp_binds::AAASendRecvMessage, cdp_binds::AAASendRecvMessageToPeer, cdpb, Cx_add_auth_session_state(), Cx_add_destination_realm(), Cx_add_public_identity(), Cx_add_vendor_specific_appid(), Flag_Proxyable, icscf_forced_hss_peer_str, IMS_Cx, IMS_LIR, and IMS_vendor_id_3GPP.

Referenced by I_LIR().

00204 {
00205     AAAMessage *lir=0,*lia=0;
00206     AAASessionId sessId={0,0};
00207     
00208     sessId = cdpb.AAACreateSession();
00209 
00210     lir = cdpb.AAACreateRequest(IMS_Cx,IMS_LIR,Flag_Proxyable,&sessId);
00211     if (!lir) goto error;
00212 
00213     if (!Cx_add_destination_realm(lir,realm)) goto error;
00214     
00215     if (!Cx_add_vendor_specific_appid(lir,IMS_vendor_id_3GPP,IMS_Cx,0/*IMS_Cx*/)) goto error;
00216     if (!Cx_add_auth_session_state(lir,1)) goto error;      
00217 
00218     if (!Cx_add_public_identity(lir,public_identity)) goto error;
00219             
00220     #ifdef WITH_IMS_PM
00221         ims_pm_diameter_request(lir);
00222     #endif              
00223     if (icscf_forced_hss_peer_str.len)
00224         lia = cdpb.AAASendRecvMessageToPeer(lir,&icscf_forced_hss_peer_str);
00225     else 
00226         lia = cdpb.AAASendRecvMessage(lir);
00227     #ifdef WITH_IMS_PM
00228         ims_pm_diameter_answer(lia);
00229     #endif              
00230 
00231 
00232     cdpb.AAADropSession(&sessId);
00233     
00234     return lia;
00235     
00236 error:
00237     //free stuff
00238     if (sessId.s) cdpb.AAADropSession(&sessId);
00239     if (lir) cdpb.AAAFreeMessage(&lir);
00240     return 0;
00241 }   


Generated on Thu Oct 23 04:14:40 2008 for Open IMS Core CSCFs by  doxygen 1.5.2