📄 pana_client_fsm.h
字号:
/* BEGIN_COPYRIGHT *//* *//* Open Diameter: Open-source software for the Diameter and *//* Diameter related protocols *//* *//* Copyright (C) 2002-2004 Open Diameter Project *//* *//* This library is free software; you can redistribute it and/or modify *//* it under the terms of the GNU Lesser General Public License as *//* published by the Free Software Foundation; either version 2.1 of the *//* License, or (at your option) any later version. *//* *//* This library is distributed in the hope that it will be useful, *//* but WITHOUT ANY WARRANTY; without even the implied warranty of *//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *//* Lesser General Public License for more details. *//* *//* You should have received a copy of the GNU Lesser General Public *//* License along with this library; if not, write to the Free Software *//* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *//* USA. *//* *//* In addition, when you copy and redistribute some or the entire part of *//* the source code of this software with or without modification, you *//* MUST include this copyright notice in each copy. *//* *//* If you make any changes that are appeared to be useful, please send *//* sources that include the changed part to *//* diameter-developers@lists.sourceforge.net so that we can reflect your *//* changes to one unified version of this software. *//* *//* END_COPYRIGHT */#ifndef __PANA_CLIENT_FSM_H__#define __PANA_CLIENT_FSM_H__#include "framework.h"#include "pana_fsm.h"#include "pana_client.h"class PANA_PacEventVariable{ private: typedef union { struct { ACE_UINT32 m_Ver_Flag : 1; ACE_UINT32 m_Type_Msg : 5; ACE_UINT32 m_Event_App : 4; ACE_UINT32 m_Flag_Separate : 1; ACE_UINT32 m_Flag_SAResumed : 1; ACE_UINT32 m_Cfg_Separate : 1; ACE_UINT32 m_Cfg_AbortOnFirstEap : 1; ACE_UINT32 m_Cfg_EapPiggyback : 1; // dependent ACE_UINT32 m_Do_Separate : 1; // dependent ACE_UINT32 m_Do_ResumeSession : 1; ACE_UINT32 m_Do_Ping : 1; ACE_UINT32 m_Do_RetryTimeout : 1; ACE_UINT32 m_Do_ReTransmission : 1; ACE_UINT32 m_Do_FatalError : 1; ACE_UINT32 m_Do_SessTimeout : 1; ACE_UINT32 m_Result_FirstEap : 2; ACE_UINT32 m_Result_Eap : 2; ACE_UINT32 m_AvpExist_KeyId : 1; // dependent ACE_UINT32 m_AvpExist_Auth : 1; ACE_UINT32 m_AvpExist_Cookie : 1; ACE_UINT32 m_AvpExist_EapPayload : 1; ACE_UINT32 m_Reserved : 1; } i; ACE_UINT32 p; } EventParams01; typedef union { struct { ACE_UINT32 m_Ver_Flag : 1; ACE_UINT32 m_Event_Eap : 4; ACE_UINT32 m_NotSupported_Pcap : 1; ACE_UINT32 m_NotSupported_Ppac : 1; ACE_UINT32 m_Cfg_EapPiggyback : 1; ACE_UINT32 m_AvpExist_KeyId : 1; ACE_UINT32 m_Do_Separate : 1; ACE_UINT32 m_Reserved : 22; } i; ACE_UINT32 p; } EventParams02; typedef union { struct { ACE_UINT32 m_Ver_Flag : 1; ACE_UINT32 m_Data : 31; } i; ACE_UINT32 p; EventParams01 e01; EventParams02 e02; } EventParams; public: PANA_PacEventVariable() { m_Event.p = 0; } void MsgType(PANA_MSG_TYPE type) { m_Event.p = 0; m_Event.e01.i.m_Type_Msg = type; } void Event_App(PANA_APP_EVENT event) { m_Event.e01.i.m_Event_App = event; } void EnableFlag_Separate(bool set = true) { m_Event.e01.i.m_Flag_Separate = set; } void EnableCfg_Separate(bool set = true) { m_Event.e01.i.m_Cfg_Separate = set; } void EnableCfg_AbortOnFirstEap(bool set = true) { m_Event.e01.i.m_Cfg_AbortOnFirstEap = set; } void EnableCfg_EapPiggyback(bool set = true) { if (! m_Event.i.m_Ver_Flag) { m_Event.e01.i.m_Cfg_EapPiggyback = set; } else { m_Event.e02.i.m_Cfg_EapPiggyback = set; } } void Do_Separate(bool set = true) { if (! m_Event.i.m_Ver_Flag) { m_Event.e01.i.m_Do_Separate = set; } else { m_Event.e02.i.m_Do_Separate = set; } } void Do_ResumeSession(bool set = true) { m_Event.e01.i.m_Do_ResumeSession = set; } void Do_Ping(bool set = true) { m_Event.e01.i.m_Do_Ping = set; } void Do_SessTimeout(bool set = true) { m_Event.e01.i.m_Do_SessTimeout = set; } void Do_RetryTimeout(bool set = true) { m_Event.e01.i.m_Do_RetryTimeout = set; } void Do_ReTransmission(bool set = true) { m_Event.e01.i.m_Do_ReTransmission = set; } void Do_FatalError(bool set = true) { m_Event.e01.i.m_Do_FatalError = set; } void Result_FirstEap(PANA_EAP_RESULT event) { m_Event.e01.i.m_Result_FirstEap = event; } void Result_Eap(PANA_EAP_RESULT event) { m_Event.e01.i.m_Result_Eap = event; } void AvpExist_KeyId(bool set = true) { if (! m_Event.i.m_Ver_Flag) { m_Event.e01.i.m_AvpExist_KeyId = set; } else { m_Event.e02.i.m_AvpExist_KeyId = set; } } void AvpExist_Auth(bool set = true) { m_Event.e01.i.m_AvpExist_Auth = set; } void AvpExist_Cookie(bool set = true) { m_Event.e01.i.m_AvpExist_Cookie = set; } void AvpExist_EapPayload(bool set = true) { m_Event.e01.i.m_AvpExist_EapPayload = set; } void Event_Eap(PANA_EAP_EVENT event) { m_Event.i.m_Ver_Flag = 1; m_Event.e02.i.m_Event_Eap = event; } void NotSupported_Pcap(bool set = true) { m_Event.e02.i.m_NotSupported_Pcap = set; } void NotSupported_Ppac(bool set = true) { m_Event.e02.i.m_NotSupported_Ppac = set; } void Reset() { m_Event.p = 0; } ACE_UINT32 Get() { DumpEvent(); return m_Event.p; } void DumpEvent() {#if defined(PANA_DEBUG) if (m_Event.i.m_Ver_Flag) DumpParam02(); else DumpParam01();#endif } private: void DumpParam01() { ACE_DEBUG((LM_DEBUG, "Event01: ")); if (m_Event.e01.i.m_Type_Msg) ACE_DEBUG((LM_DEBUG, "Msg[%d] ", m_Event.e01.i.m_Type_Msg)); if (m_Event.e01.i.m_Event_App) ACE_DEBUG((LM_DEBUG, "App[%d] ", m_Event.e01.i.m_Event_App)); if (m_Event.e01.i.m_Flag_Separate) ACE_DEBUG((LM_DEBUG, "S-flag ")); if (m_Event.e01.i.m_Flag_SAResumed) ACE_DEBUG((LM_DEBUG, "SA resumed ")); if (m_Event.e01.i.m_Cfg_Separate) ACE_DEBUG((LM_DEBUG, "SepCfg ")); if (m_Event.e01.i.m_Cfg_AbortOnFirstEap) ACE_DEBUG((LM_DEBUG, "Abort1stEap ")); if (m_Event.e01.i.m_Cfg_EapPiggyback) ACE_DEBUG((LM_DEBUG, "EapPiggy ")); if (m_Event.e01.i.m_Do_Separate) ACE_DEBUG((LM_DEBUG, "DoSep ")); if (m_Event.e01.i.m_Do_ResumeSession) ACE_DEBUG((LM_DEBUG, "DoResumeSA ")); if (m_Event.e01.i.m_Do_Ping) ACE_DEBUG((LM_DEBUG, "DoPing ")); if (m_Event.e01.i.m_Do_RetryTimeout) ACE_DEBUG((LM_DEBUG, "RetryTout ")); if (m_Event.e01.i.m_Do_ReTransmission) ACE_DEBUG((LM_DEBUG, "Retran ")); if (m_Event.e01.i.m_Do_FatalError) ACE_DEBUG((LM_DEBUG, "Fatal ")); if (m_Event.e01.i.m_Do_SessTimeout) ACE_DEBUG((LM_DEBUG, "SessTout ")); if (m_Event.e01.i.m_Result_FirstEap) ACE_DEBUG((LM_DEBUG, "1stEAP[%d] ", m_Event.e01.i.m_Result_FirstEap)); if (m_Event.e01.i.m_Result_Eap) ACE_DEBUG((LM_DEBUG, "EAP[%d] ", m_Event.e01.i.m_Result_Eap)); if (m_Event.e01.i.m_AvpExist_KeyId) ACE_DEBUG((LM_DEBUG, "keyId ")); if (m_Event.e01.i.m_AvpExist_Auth) ACE_DEBUG((LM_DEBUG, "Auth ")); if (m_Event.e01.i.m_AvpExist_Cookie) ACE_DEBUG((LM_DEBUG, "Cookie ")); if (m_Event.e01.i.m_AvpExist_EapPayload) ACE_DEBUG((LM_DEBUG, "EapPayload ")); ACE_DEBUG((LM_DEBUG, "\n")); } void DumpParam02() { ACE_DEBUG((LM_DEBUG, "Event02: ")); if (m_Event.e02.i.m_Event_Eap) ACE_DEBUG((LM_DEBUG, "Eap[%d] ", m_Event.e02.i.m_Event_Eap)); if (m_Event.e02.i.m_NotSupported_Pcap) ACE_DEBUG((LM_DEBUG, "NoPcap ")); if (m_Event.e02.i.m_NotSupported_Ppac) ACE_DEBUG((LM_DEBUG, "NoPpac ")); if (m_Event.e02.i.m_Cfg_EapPiggyback) ACE_DEBUG((LM_DEBUG, "EapPiggy ")); if (m_Event.e02.i.m_AvpExist_KeyId) ACE_DEBUG((LM_DEBUG, "keyId ")); if (m_Event.e02.i.m_Do_Separate) ACE_DEBUG((LM_DEBUG, "DoSep ")); ACE_DEBUG((LM_DEBUG, "\n")); } EventParams m_Event;};class PANA_PacSession;class PANA_EXPORT PANA_ClientStateTable :
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -