Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_SetValueActionMethodExtern.cpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
00017  *
00018  */
00019 
00020 #include "C_SetValueActionMethodExtern.hpp"
00021 #include "GeneratorTrace.hpp"
00022 #include "GeneratorError.h"
00023 #include "C_ScenarioControl.hpp"
00024 
00025 
00026 C_SetValueActionMethodExtern::C_SetValueActionMethodExtern(T_CmdAction        P_cmdAction,
00027                                                            T_pControllers P_controllers)
00028   : C_SetValueAction (P_cmdAction, P_controllers) {
00029 }
00030 
00031 
00032 C_SetValueActionMethodExtern::~C_SetValueActionMethodExtern() {
00033 
00034 }
00035 
00036 
00037 T_exeCode    C_SetValueActionMethodExtern::execute(T_pCmd_scenario P_pCmd,
00038                                                    T_pCallContext  P_callCtxt,
00039                                                    C_MessageFrame *P_msg,
00040                                                    C_MessageFrame *P_ref) {
00041   
00042 
00043   T_exeCode           L_exeCode    = E_EXE_NOERROR ;
00044   int                 L_ret        = 0             ;
00045 
00046   T_ValueData         L_mem                        ;
00047   T_ValueData         L_result                     ;
00048   T_ValueData         L_value                      ;
00049 
00050   bool                L_reset_value = false        ;
00051 
00052 
00053   L_mem = search_memory(P_callCtxt, P_msg, L_reset_value) ;
00054 
00055   
00056   L_value.m_type = E_TYPE_NUMBER ;
00057   L_result.m_type = E_TYPE_NUMBER ;
00058 
00059   if (P_msg->get_buffer(&L_value,E_BODY_TYPE) == -1) {
00060     GEN_LOG_EVENT(LOG_LEVEL_TRAFFIC_ERR, 
00061                   action_name_table[m_type] 
00062                   << ": error in body of message");
00063     
00064     GEN_LOG_EVENT(LOG_LEVEL_TRAFFIC_ERR, 
00065                   "error on call with session-id ["
00066                   << P_callCtxt->m_id_table[P_pCmd->m_channel_id] << "]");
00067     
00068     L_exeCode = E_EXE_ERROR;
00069     return (L_exeCode);
00070   } else {
00071     L_ret = (*m_external_method)(&L_value, 
00072                                  &L_mem,
00073                                  &L_result);
00074     
00075     if (L_ret != -1) {
00076       if (P_msg->set_field_value(&L_result,
00077                                  m_id,
00078                                  m_instance_id,
00079                                  m_sub_id) == false ) {
00080         
00081         GEN_LOG_EVENT(LOG_LEVEL_TRAFFIC_ERR, 
00082                       action_name_table[m_type] 
00083                       << ": problem when set field value");
00084         
00085         GEN_LOG_EVENT(LOG_LEVEL_TRAFFIC_ERR, 
00086                       "error on call with session-id ["
00087                       << P_callCtxt->m_id_table[P_pCmd->m_channel_id] << "]");
00088         
00089         L_exeCode = E_EXE_ERROR;
00090       }
00091     } else {
00092       GEN_LOG_EVENT(LOG_LEVEL_TRAFFIC_ERR, 
00093                     action_name_table[m_type] 
00094                     << ": problem when using external method (md5 or AKA)");
00095       
00096       GEN_LOG_EVENT(LOG_LEVEL_TRAFFIC_ERR, 
00097                     "error on call with session-id ["
00098                     << P_callCtxt->m_id_table[P_pCmd->m_channel_id] << "]");
00099       
00100       L_exeCode = E_EXE_ERROR;
00101     }
00102     resetMemory(L_result);
00103     resetMemory(L_value);
00104   }
00105 
00106   if (L_reset_value == true) {
00107     L_mem.m_type = E_TYPE_NUMBER ;
00108   }
00109     
00110   return (L_exeCode);
00111 }
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00119 
00120 

Generated on Wed Mar 7 14:44:58 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002