blob: ce267b45fb25fd40a374791d6eca965f3ad788a1 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2018 Ericsson Telecom AB
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
//
// File: EPTF_HTTP_Functions.ttcn
// Rev: <RnXnn>
// Prodnr: CNL 113 618
// Updated: 2015-05-20
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Module: EPTF_HTTP_Functions
//
// Purpose:
// This module contains the functions of the EPTF HTTP application id
//
// Module Parameters:
// See <EPTF_HTTP_Definitions>
//
// Module depends on:
// <EPTF_CLL_Common_Definitions>
//
// <EPTF_CLL_Base_Functions>
//
// <EPTF_CLL_LGenBase_Definitions>
//
// <EPTF_CLL_LGenBase_Functions>
//
// <EPTF_CLL_LGenBase_ConfigFunctions>
//
// <EPTF_CLL_LGenBase_EventHandlingFunctions>
//
// <EPTF_CLL_HashMapStr2Int_Functions>
//
// <EPTF_CLL_HashMapOct2Int_Functions>
//
// <EPTF_CLL_Variable_Functions>
//
// <EPTF_CLL_Logging_Functions>
//
// <EPTF_CLL_Logging_Definitions>
//
// <EPTF_HTTP_Definitions>
//
// <HTTPmsg_Types>
//
// <TCCSecurity_Functions>
//
// <TCCDateTime_Functions>
// Current Owner:
// EAKOPER
//
// Last Review Date:
// 2012-10-24
//
///////////////////////////////////////////////////////////////////////////////
module EPTF_HTTP_Functions {
//=============================================================================
// Import Part
//=============================================================================
import from EPTF_CLL_Common_Definitions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_LGenBase_Definitions all;
import from EPTF_CLL_LGenBase_Functions all;
import from EPTF_CLL_LGenBase_ConfigFunctions all;
import from EPTF_CLL_LGenBase_EventHandlingFunctions all;
import from EPTF_CLL_LGenBase_TemplateFunctions all;
import from EPTF_CLL_HashMapStr2Int_Functions all;
import from EPTF_CLL_HashMapOct2Int_Functions all;
import from EPTF_CLL_Variable_Functions all;
import from EPTF_CLL_Logging_Functions all;
import from EPTF_CLL_Logging_Definitions all;
import from EPTF_HTTP_Definitions all;
import from HTTPmsg_Types all;
import from TCCDateTime_Functions all;
import from TCCConversion_Functions all;
//=============================================================================
// Functions
//=============================================================================
///////////////////////////////////////////////////////////////////////////////
// Group: EPTF_HTTP_PublicFunctions
//
// Purpose:
// The functions of the EPTF HTTP Public Functions
//
///////////////////////////////////////////////////////////////////////////////
group EPTF_HTTP_PublicFunctions{
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_init
//
// Purpose:
// Function to initialize HTTP behaviour
//
// Parameters:
// pl_selfName - *in* *charstring* - the components self name
// pl_selfId - *in* *integer* - component self id
// pl_entityNamePrefix - *in* *charstring* - entity name prefix
// pl_numEntities - *in* *integer* - number of entities
// pl_bind - *in* <EPTF_LGenBase_BehaviorContextBinder_FT> - behaviour
// context bind callback function
// pl_reset - *in* <EPTF_LGenBase_BehaviorContextHandler_FT> - behaviour
// context reset callback function
// pl_unbind - *in* <EPTF_LGenBase_BehaviorContextHandler_FT> - behaviour
// context unbind callback function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_init(
in charstring pl_selfName,
in integer pl_selfId,
in charstring pl_entityNamePrefix,
in integer pl_numEntities := 0,
in EPTF_LGenBase_BehaviorContextBinder_FT pl_bind := refers(f_EPTF_HTTP_bindEntity4Behavior),
in EPTF_LGenBase_BehaviorContextHandler_FT pl_reset := refers(f_EPTF_HTTP_resetEntity4Behavior),
in EPTF_LGenBase_BehaviorContextHandler_FT pl_unbind := refers(f_EPTF_HTTP_unbindEntity4Behavior))
runs on EPTF_HTTP_LGen_CT
{
if (not v_EPTF_HTTP_initialized)
{
f_EPTF_Base_assert(%definitionId &
": tsp_EPTF_HTTP_maxNumberOfEntities must be set to at least: " &
int2str(f_EPTF_LGenBase_entityCount()),
tsp_EPTF_HTTP_maxNumberOfEntities > f_EPTF_LGenBase_entityCount());
f_EPTF_HTTP_initializeExtendedComponents( // LGenbase, Variable, Logging
pl_selfName,pl_numEntities,pl_entityNamePrefix);
f_EPTF_Base_registerCleanup(refers(f_EPTF_HTTP_cleanup_CT));
v_EPTF_HTTP_loggingMaskId :=
f_EPTF_Logging_registerComponentMasks(
tsp_EPTF_HTTP_loggingComponentMask,
c_EPTF_HTTP_loggingEventClasses,
EPTF_Logging_CLL);
if (tsp_EPTF_HTTP_loggingEnable)
{
f_EPTF_Logging_enableLocalMask(
v_EPTF_HTTP_loggingMaskId,
c_EPTF_HTTP_loggingClassIdx_Debug);
}
else
{
f_EPTF_Logging_disableLocalMask(
v_EPTF_HTTP_loggingMaskId,
c_EPTF_HTTP_loggingClassIdx_Debug);
}
v_EPTF_HTTP_selfName := pl_selfName;
v_EPTF_HTTP_selfId := pl_selfId;
v_EPTF_HTTP_EntityOffset := pl_selfId * tsp_EPTF_HTTP_maxNumberOfEntities;
f_EPTF_HTTP_debug(%definitionId & ": Entity offset: " &
int2str(v_EPTF_HTTP_EntityOffset));
vf_EPTF_HTTP_sendRequest := refers(f_EPTF_HTTP_defaultSendRequest);
vf_EPTF_HTTP_connectionOpen := refers(f_EPTF_HTTP_defaultConnectionOpen);
vf_EPTF_HTTP_connectionClose := refers(f_EPTF_HTTP_defaultConnectionClose);
vf_EPTF_HTTP_connectionHalfClose := refers(f_EPTF_HTTP_defaultConnectionHalfClose);
vf_EPTF_HTTP_closePortOfUser := refers(f_EPTF_HTTP_defaultFreePortOfUser);
vf_EPTF_HTTP_freePortOfUser := refers(f_EPTF_HTTP_defaultFreePortOfUser);
vf_EPTF_HTTP_closePort := refers(f_EPTF_HTTP_defaultClosePort);
vf_EPTF_HTTP_sendResponse := refers(f_EPTF_HTTP_defaultSendResponse);
vf_EPTF_HTTP_listen := refers(f_EPTF_HTTP_defaultListen);
vf_EPTF_HTTP_searchContext := refers(f_EPTF_HTTP_defaultSearch);
vf_EPTF_HTTP_searchContext4Event := refers(f_EPTF_HTTP_defaultSearch);
vf_EPTF_HTTP_searchContext4Error := refers(f_EPTF_HTTP_defaultSearch);
v_EPTF_HTTP_myBIdx := f_EPTF_LGenBase_declareBehaviorType(
c_EPTF_HTTP_myBName,
-1,
pl_reset,
pl_bind,
pl_unbind
);
v_EPTF_HTTP_charDB := f_EPTF_str2int_HashMap_New(c_EPTF_HTTP_HashMap_charDatabase);
v_EPTF_HTTP_octDB := f_EPTF_oct2int_HashMap_New(c_EPTF_HTTP_HashMap_octDatabase);
// set event dispatch mechanism
select (tsp_EPTF_HTTP_dispatchLevel) {
case (Class) { vf_EPTF_HTTP_dispatchFn := refers(f_EPTF_HTTP_reportClassEvent); }
case (Detailed) { vf_EPTF_HTTP_dispatchFn := refers(f_EPTF_HTTP_reportDetailedEvent); }
case else { }
}
f_EPTF_HTTP_declareStepsAndEvent();
f_EPTF_HTTP_initStats();
v_EPTF_HTTP_authData := c_EPTF_HTTP_initAuthData;
f_EPTF_HTTP_generateNonceValues(tsp_EPTF_HTTP_nofNonceValues, v_EPTF_HTTP_authData.nonceValues)
//Declare external template types
v_EPTF_HTTP_extTemplType_customHeader := f_EPTF_LGenBase_declareTemplateType(
{behaviourType:=c_EPTF_HTTP_myBName, templateName:=c_EPTF_HTTP_templName_CustomHeader},
{"method"}, {"requestURI","versionMajor","versionMinor","customHeader","contentLength"} );
v_EPTF_HTTP_extTemplType_customHeaderResponse := f_EPTF_LGenBase_declareTemplateType(
{behaviourType:=c_EPTF_HTTP_myBName, templateName:=c_EPTF_HTTP_templName_CustomHeaderResponse},
{}, {"status","versionMajor","versionMinor","contentLength"} );
v_EPTF_HTTP_extTemplType_customBody := f_EPTF_LGenBase_declareTemplateType(
{behaviourType:=c_EPTF_HTTP_myBName, templateName:=c_EPTF_HTTP_templName_CustomBody},
{}, {} );
v_EPTF_HTTP_initialized := true;
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getContextIndex
//
// Purpose:
// Function to add new entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *integer* - index of the entity context
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getContextIndex(
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
return f_EPTF_LGenBase_getBehaviorCtxItem(pl_eIdx, v_EPTF_HTTP_myBIdx, 0);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_initStats
//
// Purpose:
// Function to initialize HTTP statistics
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_initStats()
runs on EPTF_HTTP_LGen_CT
{
var charstring vl_prefix :=
v_EPTF_HTTP_selfName & "." & int2str(v_EPTF_HTTP_selfId) & ".";
// incoming methods
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncRequests, 0,
v_EPTF_HTTP_stats.incoming.requests_k);
f_EPTF_Var_setSubsCanAdjust(v_EPTF_HTTP_stats.incoming.requests_k, false)
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncOptionMessages, 0,
v_EPTF_HTTP_stats.incoming.method.options_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncGetMessages, 0,
v_EPTF_HTTP_stats.incoming.method.get_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncHeadMessages, 0,
v_EPTF_HTTP_stats.incoming.method.head_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncPostMessages, 0,
v_EPTF_HTTP_stats.incoming.method.post_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncPutMessages, 0,
v_EPTF_HTTP_stats.incoming.method.put_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncDeleteMessages, 0,
v_EPTF_HTTP_stats.incoming.method.delete_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncTraceMessages, 0,
v_EPTF_HTTP_stats.incoming.method.trace_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncConnectMessages, 0,
v_EPTF_HTTP_stats.incoming.method.connect_k);
// outgoing methods
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutRequests, 0,
v_EPTF_HTTP_stats.outgoing.requests_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutOptionMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.options_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutGetMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.get_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutHeadMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.head_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutPostMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.post_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutPutMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.put_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutDeleteMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.delete_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutTraceMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.trace_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutConnectMessages, 0,
v_EPTF_HTTP_stats.outgoing.method.connect_k);
// incoming status codes
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofIncResponses, 0,
v_EPTF_HTTP_stats.incoming.responses_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc100StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code100_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc101StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code101_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc200StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code200_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc201StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code201_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc202StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code202_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc203StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code203_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc204StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code204_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc205StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code205_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc206StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code206_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc300StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code300_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc301StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code301_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc302StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code302_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc303StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code303_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc304StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code304_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc305StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code305_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc306StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code306_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc307StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code307_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc400StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code400_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc401StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code401_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc402StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code402_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc403StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code403_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc404StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code404_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc405StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code405_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc406StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code406_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc407StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code407_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc408StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code408_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc409StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code409_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc410StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code410_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc411StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code411_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc412StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code412_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc413StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code413_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc414StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code414_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc415StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code415_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc416StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code416_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc417StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code417_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc500StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code500_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc501StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code501_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc502StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code502_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc503StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code503_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc504StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code504_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofInc505StatusCode, 0,
v_EPTF_HTTP_stats.incoming.status.code505_k);
// outgoing status codes
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOutResponses, 0,
v_EPTF_HTTP_stats.outgoing.responses_k);
f_EPTF_Var_setSubsCanAdjust(v_EPTF_HTTP_stats.outgoing.responses_k, false)
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut100StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code100_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut101StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code101_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut200StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code200_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut201StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code201_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut202StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code202_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut203StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code203_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut204StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code204_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut205StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code205_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut206StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code206_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut300StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code300_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut301StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code301_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut302StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code302_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut303StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code303_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut304StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code304_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut305StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code305_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut306StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code306_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut307StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code307_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut400StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code400_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut401StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code401_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut402StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code402_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut403StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code403_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut404StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code404_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut405StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code405_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut406StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code406_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut407StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code407_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut408StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code408_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut409StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code409_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut410StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code410_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut411StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code411_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut412StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code412_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut413StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code413_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut414StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code414_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut415StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code415_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut416StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code416_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut417StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code417_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut500StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code500_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut501StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code501_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut502StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code502_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut503StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code503_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut504StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code504_k);
f_EPTF_Var_newInt(
vl_prefix & c_EPTF_HTTP_Stat_nofOut505StatusCode, 0,
v_EPTF_HTTP_stats.outgoing.status.code505_k);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_resetStats
//
// Purpose:
// Function to reset HTTP statistics
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_resetStats()
runs on EPTF_HTTP_LGen_CT
{
// incoming methods
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.requests_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.options_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.get_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.head_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.post_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.put_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.delete_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.trace_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.method.connect_k,
{ intVal := 0 });
// outgoing methods
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.requests_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.options_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.get_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.head_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.post_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.put_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.delete_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.trace_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.method.connect_k,
{ intVal := 0 });
// incoming status codes
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.responses_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code100_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code101_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code200_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code201_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code202_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code203_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code204_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code205_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code206_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code300_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code301_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code302_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code303_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code304_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code305_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code306_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code307_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code400_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code401_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code402_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code403_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code404_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code405_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code406_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code407_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code408_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code409_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code410_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code411_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code412_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code413_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code414_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code415_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code416_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code417_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code500_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code501_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code502_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code503_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code504_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.incoming.status.code505_k,
{ intVal := 0 });
// outgoing status codes
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.responses_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code100_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code101_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code200_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code201_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code202_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code203_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code204_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code205_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code206_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code300_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code301_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code302_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code303_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code304_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code305_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code306_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code307_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code400_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code401_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code402_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code403_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code404_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code405_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code406_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code407_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code408_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code409_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code410_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code411_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code412_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code413_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code414_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code415_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code416_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code417_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code500_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code501_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code502_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code503_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code504_k,
{ intVal := 0 });
f_EPTF_Var_adjustContent(
v_EPTF_HTTP_stats.outgoing.status.code505_k,
{ intVal := 0 });
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_updateStatistics
//
// Purpose:
// Function to update HTTP statistics
//
// Parameters:
// pl_in - *in* *boolean* - message direction (incoming/outgoing)
// pl_method - *in* *charstring* - HTTP method
// pl_code - *in* *integer* - HTTP response status code
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// If pl_in is true, incoming statistics is updated, else outgoing
// If pl_method is empty string then method statistics will not be updates
// If pl_code is -1 then statuscode statistics will not be updated
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_updateStatistics(
in boolean pl_in := true,
in charstring pl_method := "",
in integer pl_code := -1)
runs on EPTF_HTTP_LGen_CT
{
if (pl_in)
{
if ("" != pl_method)
{
// incoming methods
select (pl_method)
{
case ("OPTIONS")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.options_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.options_k) + 1 });
}
case ("GET")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.get_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.get_k) + 1 });
}
case ("HEAD")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.head_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.head_k) + 1 });
}
case ("POST")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.post_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.post_k) + 1 });
}
case ("PUT")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.put_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.put_k) + 1 });
}
case ("DELETE")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.delete_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.delete_k) + 1 });
}
case ("TRACE")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.trace_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.trace_k) + 1 });
}
case ("CONNECT")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.method.connect_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.method.connect_k) + 1 });
}
case else
{
f_EPTF_HTTP_error(%definitionId &
": Unhandled HTTP method: " & pl_method);
}
}
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.requests_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.requests_k) + 1 });
}
if (-1 != pl_code)
{
// incoming status codes
select (pl_code)
{
case (100)
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code100_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code100_k) + 1 });
}
case (101) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code101_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code101_k) + 1 });
}
case (200) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code200_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code200_k) + 1 });
}
case (201) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code201_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code201_k) + 1 });
}
case (202) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code202_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code202_k) + 1 });
}
case (203) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code203_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code203_k) + 1 });
}
case (204) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code204_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code204_k) + 1 });
}
case (205) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code205_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code205_k) + 1 });
}
case (206) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code206_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code206_k) + 1 });
}
case (300) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code300_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code300_k) + 1 });
}
case (301) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code301_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code301_k) + 1 });
}
case (302) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code302_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code302_k) + 1 });
}
case (303) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code303_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code303_k) + 1 });
}
case (304) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code304_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code304_k) + 1 });
}
case (305) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code305_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code305_k) + 1 });
}
case (306) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code306_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code306_k) + 1 });
}
case (307) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code307_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code307_k) + 1 });
}
case (400) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code400_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code400_k) + 1 });
}
case (401) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code401_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code401_k) + 1 });
}
case (402) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code402_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code402_k) + 1 });
}
case (403) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code403_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code403_k) + 1 });
}
case (404) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code404_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code404_k) + 1 });
}
case (405) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code405_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code405_k) + 1 });
}
case (406) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code406_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code406_k) + 1 });
}
case (407) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code407_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code407_k) + 1 });
}
case (408) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code408_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code408_k) + 1 });
}
case (409) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code409_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code409_k) + 1 });
}
case (410) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code410_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code410_k) + 1 });
}
case (411) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code411_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code411_k) + 1 });
}
case (412) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code412_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code412_k) + 1 });
}
case (413) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code413_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code413_k) + 1 });
}
case (414) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code414_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code414_k) + 1 });
}
case (415) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code415_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code415_k) + 1 });
}
case (416) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code416_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code416_k) + 1 });
}
case (417) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code417_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code417_k) + 1 });
}
case (500) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code500_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code500_k) + 1 });
}
case (501) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code501_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code501_k) + 1 });
}
case (502) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code502_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code502_k) + 1 });
}
case (503) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code503_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code503_k) + 1 });
}
case (504) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code504_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code504_k) + 1 });
}
case (505) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.status.code505_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.status.code505_k) + 1 });
}
}
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.incoming.responses_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.incoming.responses_k) + 1 });
}
}
else
{
if ("" != pl_method)
{
// outgoing method
select (pl_method)
{
case ("OPTIONS")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.options_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.options_k) + 1 });
}
case ("GET")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.get_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.get_k) + 1 });
}
case ("HEAD")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.head_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.head_k) + 1 });
}
case ("POST")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.post_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.post_k) + 1 });
}
case ("PUT")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.put_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.put_k) + 1 });
}
case ("DELETE")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.delete_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.delete_k) + 1 });
}
case ("TRACE")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.trace_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.trace_k) + 1 });
}
case ("CONNECT")
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.method.connect_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.method.connect_k) + 1 });
}
case else
{
f_EPTF_HTTP_error(%definitionId &
": Unhandled HTTP method: " & pl_method);
}
}
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.requests_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.requests_k) + 1 });
}
if (-1 != pl_code)
{
// outgoing status codes
select (pl_code)
{
case (100)
{
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code100_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code100_k) + 1 });
}
case (101) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code101_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code101_k) + 1 });
}
case (200) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code200_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code200_k) + 1 });
}
case (201) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code201_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code201_k) + 1 });
}
case (202) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code202_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code202_k) + 1 });
}
case (203) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code203_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code203_k) + 1 });
}
case (204) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code204_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code204_k) + 1 });
}
case (205) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code205_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code205_k) + 1 });
}
case (206) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code206_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code206_k) + 1 });
}
case (300) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code300_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code300_k) + 1 });
}
case (301) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code301_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code301_k) + 1 });
}
case (302) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code302_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code302_k) + 1 });
}
case (303) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code303_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code303_k) + 1 });
}
case (304) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code304_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code304_k) + 1 });
}
case (305) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code305_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code305_k) + 1 });
}
case (306) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code306_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code306_k) + 1 });
}
case (307) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code307_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code307_k) + 1 });
}
case (400) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code400_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code400_k) + 1 });
}
case (401) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code401_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code401_k) + 1 });
}
case (402) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code402_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code402_k) + 1 });
}
case (403) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code403_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code403_k) + 1 });
}
case (404) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code404_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code404_k) + 1 });
}
case (405) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code405_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code405_k) + 1 });
}
case (406) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code406_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code406_k) + 1 });
}
case (407) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code407_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code407_k) + 1 });
}
case (408) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code408_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code408_k) + 1 });
}
case (409) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code409_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code409_k) + 1 });
}
case (410) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code410_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code410_k) + 1 });
}
case (411) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code411_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code411_k) + 1 });
}
case (412) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code412_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code412_k) + 1 });
}
case (413) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code413_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code413_k) + 1 });
}
case (414) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code414_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code414_k) + 1 });
}
case (415) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code415_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code415_k) + 1 });
}
case (416) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code416_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code416_k) + 1 });
}
case (417) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code417_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code417_k) + 1 });
}
case (500) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code500_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code500_k) + 1 });
}
case (501) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code501_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code501_k) + 1 });
}
case (502) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code502_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code502_k) + 1 });
}
case (503) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code503_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code503_k) + 1 });
}
case (504) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code504_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code504_k) + 1 });
}
case (505) {
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.status.code505_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.status.code505_k) + 1 });
}
}
f_EPTF_Var_adjustContent(v_EPTF_HTTP_stats.outgoing.responses_k,
{ intVal := f_EPTF_Var_getIntValue(v_EPTF_HTTP_stats.outgoing.responses_k) + 1 });
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setConnectionOpenFunction
//
// Purpose:
// Function to set open connection callback function pointer
//
// Parameters:
// plf_connectionOpen - *in* <EPTF_HTTP_connectionOpen_FT> - connection
// open callback function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setConnectionOpenFunction (
in EPTF_HTTP_connectionOpen_FT plf_connectionOpen)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_connectionOpen := plf_connectionOpen;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setConnectionCloseFunction
//
// Purpose:
// Function to set close connection callback function pointer
//
// Parameters:
// plf_connectionClose - *in* <EPTF_HTTP_connectionClose_FT> - connection
// close callback function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setConnectionCloseFunction (
in EPTF_HTTP_connectionClose_FT plf_connectionClose)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_connectionClose := plf_connectionClose;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setConnectionHalfCloseFunction
//
// Purpose:
// Function to set half close connection callback function pointer
//
// Parameters:
// plf_connectionHalfClose - *in* <EPTF_HTTP_connectionClose_FT> -
// connection half close callback function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setConnectionHalfCloseFunction (
in EPTF_HTTP_connectionClose_FT plf_connectionHalfClose)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_connectionHalfClose := plf_connectionHalfClose;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setSendRequestFunction
//
// Purpose:
// Function to set send message callback function pointer
//
// Parameters:
// pl_sendRequest_fp - <EPTF_HTTP_sendRequest_FT> - sendRequest function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setSendRequestFunction(
in EPTF_HTTP_messageProcessSend_FT pl_sendRequest_fp)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_sendRequest := pl_sendRequest_fp;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setClosePortOfUserFunction
//
// Purpose:
// Function to set close port of user callback function pointer
//
// Parameters:
// plf_cpou - *in* <EPTF_HTTP_SessionOperation_FT> - close port of
// user function reference
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setClosePortOfUserFunction (
in EPTF_HTTP_SessionOperation_FT plf_cpou)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_closePortOfUser := plf_cpou;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setFreePortOfUserFunction
//
// Purpose:
// Function to set free port of user callback function pointer
//
// Parameters:
// plf_cpou - *in* <EPTF_HTTP_SessionOperation_FT> - close port of
// user function reference
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setFreePortOfUserFunction (
in EPTF_HTTP_SessionOperation_FT plf_fpou)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_freePortOfUser := plf_fpou;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setClosePortFunction
//
// Purpose:
// Function to set close a port callback function pointer
//
// Parameters:
// plf_close - *in* <EPTF_HTTP_PortOperation_FT> - close port function reference
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setClosePortFunction(
in EPTF_HTTP_PortOperation_FT plf_close)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_closePort := plf_close;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setSendResponseFunction
//
// Purpose:
// Sets the response sender callback function.
//
// Parameters:
// plf_sendResponse - *in* <EPTF_HTTP_sendResponse_FT> - send response function reference
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setSendResponseFunction (
in EPTF_HTTP_sendResponse_FT plf_sendResponse)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_sendResponse := plf_sendResponse;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setListenFunction
//
// Purpose:
// Sets the listen callback function.
//
// Parameters:
// plf_listen - *in* <EPTF_HTTP_Listen_FT> - listen function reference
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setListenFunction(
in EPTF_HTTP_Listen_FT plf_listen)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_listen := plf_listen;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setSearchContextFunction
//
// Purpose:
// Sets the entity searching callback function.
//
// Parameters:
// plf_search - *in* <EPTF_HTTP_searchEntity_FT> - entity searching function reference
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setSearchContextFunction(
in EPTF_HTTP_searchContext_FT plf_search)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_searchContext := plf_search;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setSearchContextFunction4Event
//
// Purpose:
// Sets the entity searching callback function for socket events.
//
// Parameters:
// plf_search - *in* <EPTF_HTTP_searchEntity_FT> - entity searching function reference
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setSearchContextFunction4Event(
in EPTF_HTTP_searchContext_FT plf_search)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_searchContext4Event := plf_search;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setSearchContextFunction4Error
//
// Purpose:
// Sets the entity searching callback function for socket error events.
//
// Parameters:
// plf_search - *in* <EPTF_HTTP_searchEntity_FT> - entity searching function reference
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setSearchContextFunction4Error(
in EPTF_HTTP_searchContext_FT plf_search)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_searchContext4Error := plf_search;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContext
//
// Purpose:
// Function to set entity context
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_method - *charstring* - HTTP method
// pl_uri - *charstring* - HTTP URI
// pl_version_major - *integer* - HTTP major version number
// pl_version_minor - *integer* - HTTP minor version number
// pl_headerLines - <HeaderLines> - HTTP header lines
// pl_connId - *integer* - port group index beloning to the entity
// pl_authDetails - <EPTF_HTTP_AuthDetails> - authorization details
// pl_body - *charstring* - message body
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContext (
in integer pl_eIdx,
in charstring pl_method,
in charstring pl_uri,
in integer pl_version_major,
in integer pl_version_minor,
in HeaderLines pl_headerlines,
in integer pl_connId := -1,
in EPTF_HTTP_AuthDetails pl_authDetails := c_EPTF_HTTP_initAuthDetails,
in EPTF_HTTP_CharOrOct pl_body := { charVal := "" })
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
var integer vl_bodyIdx := -1;
var integer vl_headerLinesIdx := -1;
if (ischosen(pl_body.charVal))
{
vl_bodyIdx := f_EPTF_HTTP_setCharEntityBody(pl_body.charVal);
}else{
vl_bodyIdx := f_EPTF_HTTP_setOctEntityBody(pl_body.octVal);
}
vl_headerLinesIdx := f_EPTF_HTTP_addNewHeaderLines(pl_headerlines);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx] := c_EPTF_HTTP_initCtx;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].method := pl_method;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].uri := pl_uri;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_major := pl_version_major;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_minor := pl_version_minor;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].headerLinesIdx := vl_headerLinesIdx;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].authDetails := pl_authDetails;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].connId := pl_connId;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].bodyId := vl_bodyIdx;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].headerGetterFn := refers(f_EPTF_HTTP_getHeaderContentForEntity);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].contentGetterFn := refers(f_EPTF_HTTP_getCharstringBodyContentForEntity);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].charBodyHandlerFn := refers(f_EPTF_HTTP_defaultCharstringBodyHandler);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].binaryBodyHandlerFn := refers(f_EPTF_HTTP_defaultBinaryBodyHandler);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextServer
//
// Purpose:
// Sets the entity context of a server entity.
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_statusCode - *integer* - status code of the response
// pl_statusText - *charstring* - status text of the response
// pl_version_major - *integer* - HTTP major version number
// pl_version_minor - *integer* - HTTP minor version number
// pl_headerLines - <HeaderLines> - HTTP header lines
// pl_connId - *integer* - port group index beloning to the entity
// pl_body - *charstring* - message body
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextServer (
in integer pl_eIdx,
in integer pl_statusCode,
in charstring pl_statusText,
in integer pl_version_major,
in integer pl_version_minor,
in HeaderLines pl_headerlines,
in EPTF_HTTP_CharOrOct pl_body := { charVal := "" })
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
var integer vl_bodyIdx := -1;
var integer vl_headerLinesIdx := -1;
if (ischosen(pl_body.charVal))
{
vl_bodyIdx := f_EPTF_HTTP_setCharEntityBody(pl_body.charVal);
}else{
vl_bodyIdx := f_EPTF_HTTP_setOctEntityBody(pl_body.octVal);
}
vl_headerLinesIdx := f_EPTF_HTTP_addNewHeaderLines(pl_headerlines);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx] := c_EPTF_HTTP_initCtx;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusCode := pl_statusCode;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusText := pl_statusText;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_major := pl_version_major;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_minor := pl_version_minor;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].headerLinesIdx := vl_headerLinesIdx;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].bodyId := vl_bodyIdx;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].headerGetterFn := refers(f_EPTF_HTTP_getHeaderContentForEntity);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].contentGetterFn := refers(f_EPTF_HTTP_getCharstringBodyContentForEntity);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].charBodyHandlerFn := refers(f_EPTF_HTTP_defaultCharstringBodyHandler);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].binaryBodyHandlerFn := refers(f_EPTF_HTTP_defaultBinaryBodyHandler);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setCharstringBodyHandlerFunction4Entity
//
// Purpose:
// Function to set the HTTP charstring body handler function of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_bodySender - *in* <EPTF_HTTP_charstringBodyHandler_FT> - body handler function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setCharstringBodyHandlerFunction4Entity(
in integer pl_eIdx,
in EPTF_HTTP_charstringBodyHandler_FT pl_bodySender)
runs on EPTF_HTTP_LGen_CT
{
v_EPTF_HTTP_contexts[pl_eIdx].charBodyHandlerFn := pl_bodySender;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setBinaryBodyHandlerFunction4Entity
//
// Purpose:
// Function to set the HTTP binary body handler function of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_bodySender - *in* <EPTF_HTTP_binaryBodyHandler_FT> - body handler function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setBinaryBodyHandlerFunction4Entity(
in integer pl_eIdx,
in EPTF_HTTP_binaryBodyHandler_FT pl_bodySender)
runs on EPTF_HTTP_LGen_CT
{
v_EPTF_HTTP_contexts[pl_eIdx].binaryBodyHandlerFn := pl_bodySender;
}
/////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextMethod
//
// Purpose:
// Function to get the HTTP Method field of the entity context of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *charstring* - method name
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextMethod (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return charstring
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].method;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextMethod
//
// Purpose:
// Function to set the HTTP Method field of the entity context of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_method - *in* *charstring* - HTTP method name
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextMethod (
in integer pl_eIdx,
in charstring pl_method)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].method := pl_method;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextStatusCode
//
// Purpose:
// Gets the HTTP status code field from an entity context.
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *integer* - status code
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextStatusCode (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusCode;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextStatusCode
//
// Purpose:
// Sets the HTTP status code field in an entity context.
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_statusCode - *in* *charstring* - status code
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextStatusCode (
in integer pl_eIdx,
in integer pl_statusCode)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusCode := pl_statusCode;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextStatusText
//
// Purpose:
// Gets the HTTP status text field from an entity context.
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *charstring* - status text
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextStatusText (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return charstring
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusText;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextStatusText
//
// Purpose:
// Sets the HTTP status text field in an entity context.
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_statusText - *in* *charstring* - status text
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextStatusText (
in integer pl_eIdx,
in charstring pl_statusText)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusText := pl_statusText;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextHeaderLinesIdx
//
// Purpose:
// Sets the header line index of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_headerLinesIdx - *in* *integer* - header line index
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextHeaderLinesIdx(
in integer pl_eIdx,
in integer pl_headerLinesIdx)
runs on EPTF_HTTP_LGen_CT
{
if (0 > pl_headerLinesIdx) {return;}
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].headerLinesIdx := pl_headerLinesIdx;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_ETPF_HTTP_setEntityContextStatusCode
//
// Purpose:
// Sets the status code of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_statusCode - *in* *integer* - status code
//
///////////////////////////////////////////////////////////////////////////////
function f_ETPF_HTTP_setEntityContextStatusCode(
in integer pl_eIdx,
in integer pl_statusCode)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusCode := pl_statusCode;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_ETPF_HTTP_setEntityContextStatusText
//
// Purpose:
// Sets the status text of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_statusText - *in* *charstring* - status text
//
///////////////////////////////////////////////////////////////////////////////
function f_ETPF_HTTP_setEntityContextStatusText(
in integer pl_eIdx,
in charstring pl_statusText)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].statusText := pl_statusText;
}
/////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextURI
//
// Purpose:
// Function to get the HTTP URI field of the entity context of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *charstring* - URI
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextURI (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return charstring
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].uri;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextURI
//
// Purpose:
// Function to set the HTTP URI field of the entity context of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_uri - *in* *charstring* - HTTP URI
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextURI (
in integer pl_eIdx,
in charstring pl_uri)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].uri := pl_uri;
}
/////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextVersionMajor
//
// Purpose:
// Function to get the major version number of HTTP
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *integer* - major version number
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextVersionMajor (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_major;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextVersionMajor
//
// Purpose:
// Function to set the major version number of HTTP
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_version_major - *in* *integer* - major version number
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextVersionMajor (
in integer pl_eIdx,
in integer pl_version_major)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_major := pl_version_major;
}
/////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextVersionMinor
//
// Purpose:
// Function to get the minor version number of HTTP
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// *integer* - minor version number
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextVersionMinor (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_minor;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextVersionMinor
//
// Purpose:
// Function to set the minor version number of HTTP
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_version_minor - *in* *integer* - minor version number
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextVersionMinor (
in integer pl_eIdx,
in integer pl_version_minor)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].version_minor := pl_version_minor;
}
/////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextMessageHeader
//
// Purpose:
// Function to get the HTTP header lines of the entity context of an entity
//
// Parameters:
// pl_ctxIdx - *in* *integer* - entity index
//
// Return Value:
// *charstring* - URI
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextMessageHeader (
in integer pl_ctxIdx)
runs on EPTF_HTTP_LGen_CT
return HeaderLines
{
//var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
var integer vl_headerLinesIdx := v_EPTF_HTTP_contexts[pl_ctxIdx].headerLinesIdx;
return v_EPTF_HTTP_headerLinesList[vl_headerLinesIdx];
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextAddCustomHeader
//
// Purpose:
// Function to add a custom HTTP header to the entity context of an entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_uri - *in* *charstring* - HTTP URI
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextAddCustomHeader (
in integer pl_eIdx,
in charstring pl_field_name,
in charstring pl_field_value)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
var integer vl_headerLinesIdx := v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].headerLinesIdx;
if(vl_headerLinesIdx < 0) { return; }
v_EPTF_HTTP_headerLinesList[vl_headerLinesIdx][sizeof(v_EPTF_HTTP_headerLinesList[vl_headerLinesIdx])] :=
{ pl_field_name, pl_field_value }
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextConnectionId
//
// Purpose:
// Function to get entity context connection Id
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// Return Value:
// *integer* - connection id
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextConnectionId (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[myCtx].connId;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextConnectionId
//
// Purpose:
// Function to set entity context
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_connId - *integer* - port group index beloning to the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextConnectionId (
in integer pl_eIdx,
in integer pl_connId)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[myCtx].connId := pl_connId;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextBodyId
//
// Purpose:
// Function to get entity context body Id
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be get
// Return Value:
// *integer* - body id
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextBodyId (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[myCtx].bodyId;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextBodyId
//
// Purpose:
// Function to set entity context
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_bodyId - *integer* - body index beloning to the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextBodyId (
in integer pl_eIdx,
in integer pl_bodyId)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[myCtx].bodyId := pl_bodyId;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextPortId
//
// Purpose:
// Function to get entity context port Id
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be get
// Return Value:
// *integer* - port id
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextPortId (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[myCtx].portId;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextPortId
//
// Purpose:
// Function to set entity context
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_portId - *integer* - port index beloning to the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextPortId (
in integer pl_eIdx,
in integer pl_portId)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[myCtx].portId := pl_portId;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getEntityContextSeqNum
//
// Purpose:
// Function to get entity context sequence number
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be get
// Return Value:
// *integer* - sequence number
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getEntityContextSeqNum (
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
return v_EPTF_HTTP_contexts[myCtx].seqNum;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextSeqNum
//
// Purpose:
// Function to set entity context
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_connId - *integer* - sequence number beloning to the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextSeqNum (
in integer pl_eIdx,
in integer pl_seqNum)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[myCtx].seqNum := pl_seqNum;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setCharEntityBody
//
// Purpose:
// Function to set the charstring body of an entity
//
// Parameters:
// pl_connId - *integer* - port group index beloning to the entity
//
// Return Value:
// *integer* - database index
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setCharEntityBody(
in charstring pl_val)
runs on EPTF_HTTP_LGen_CT return integer
{
var integer vl_dbIdx;
if (f_EPTF_str2int_HashMap_Find(v_EPTF_HTTP_charDB, pl_val, vl_dbIdx))
{
f_EPTF_HTTP_debug(%definitionId &
": CHAR Body already exists at index: " & int2str(vl_dbIdx));
}
else
{
vl_dbIdx := sizeof(v_EPTF_HTTP_charBodyDB);
f_EPTF_str2int_HashMap_Insert(v_EPTF_HTTP_charDB, pl_val, vl_dbIdx);
v_EPTF_HTTP_charBodyDB[vl_dbIdx] := pl_val;
f_EPTF_HTTP_debug(%definitionId &
": CHAR Body does not exists, now added: " & int2str(vl_dbIdx));
}
return vl_dbIdx;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setOctEntityBody
//
// Purpose:
// Function to set the octetstring body of an entity
//
// Parameters:
// pl_connId - *integer* - port group index beloning to the entity
//
// Return Value:
// *integer* - database index
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setOctEntityBody(
in octetstring pl_val)
runs on EPTF_HTTP_LGen_CT return integer
{
var integer vl_dbIdx;
if (f_EPTF_oct2int_HashMap_Find(v_EPTF_HTTP_octDB, pl_val, vl_dbIdx))
{
f_EPTF_HTTP_debug(%definitionId &
": OCT Body already exists at index: " & int2str(vl_dbIdx));
}
else
{
vl_dbIdx := sizeof(v_EPTF_HTTP_binBodyDB);
f_EPTF_oct2int_HashMap_Insert(v_EPTF_HTTP_octDB, pl_val, vl_dbIdx);
v_EPTF_HTTP_binBodyDB[vl_dbIdx] := pl_val;
f_EPTF_HTTP_debug(%definitionId &
": OCT Body does not exists, now added: " & int2str(vl_dbIdx));
}
return vl_dbIdx;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getHeaderContentForEntity
//
// Purpose:
// Get HTTP header content for an entity
//
// Parameters:
// pl_pars - *in* <EPTF_IntegerList> - parameter list, element #0 is the entity context index
// pl_headerLines - *inout* <HeaderLines> - header content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getHeaderContentForEntity(
in EPTF_IntegerList pl_pars,
inout HeaderLines pl_headerLines)
runs on EPTF_HTTP_LGen_CT
{
pl_headerLines := f_EPTF_HTTP_getEntityContextMessageHeader(pl_pars[0]);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getCharstringBodyContentForEntity
//
// Purpose:
// Get HTTP body content for an entity
//
// Parameters:
// pl_pars - *in* <EPTF_IntegerList> - parameter list, element #0 is the entity context index
// pl_body - *inout* <EPTF_HTTP_CharOrOct> - charstring or binary body content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getCharstringBodyContentForEntity(
in EPTF_IntegerList pl_pars,
inout EPTF_HTTP_CharOrOct pl_body)
runs on EPTF_HTTP_LGen_CT
{
pl_body := { charVal := v_EPTF_HTTP_charBodyDB[v_EPTF_HTTP_contexts[pl_pars[0]].bodyId] };
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getCharstringBodyContentForEntity
//
// Purpose:
// Get HTTP body content for an entity
//
// Parameters:
// pl_pars - *in* <EPTF_IntegerList> - parameter list, element #0 is the entity context index
// pl_body - *inout* <EPTF_HTTP_CharOrOct> - charstring or binary body content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getBinaryBodyContentForEntity(
in EPTF_IntegerList pl_pars,
inout EPTF_HTTP_CharOrOct pl_body)
runs on EPTF_HTTP_LGen_CT
{
pl_body := { octVal := v_EPTF_HTTP_binBodyDB[v_EPTF_HTTP_contexts[pl_pars[0]].bodyId] };
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getBodyContentForEntity
//
// Purpose:
// Get HTTP body for an entity (entity context)
//
// Parameters:
// pl_ctxIdx - *in* *integer* - entity context
// pl_body - *inout* <EPTF_HTTP_CharOrOct> - charstring or binary body content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getBodyContentForEntity(
in integer pl_ctxIdx,
inout EPTF_HTTP_CharOrOct pl_body)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_Base_assert(
%definitionId & ": Content getter function is null!",
v_EPTF_HTTP_contexts[pl_ctxIdx].contentGetterFn != null);
f_EPTF_Base_assert(
%definitionId & ": Content getter function is unbound!",
isvalue(v_EPTF_HTTP_contexts[pl_ctxIdx].contentGetterFn));
v_EPTF_HTTP_contexts[pl_ctxIdx].contentGetterFn.apply(
{pl_ctxIdx}, pl_body)
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getHeaderForEntity
//
// Purpose:
// Get HTTP header for an entity (entity context)
//
// Parameters:
// pl_ctxIdx - *in* *integer* - entity context
// pl_headerLines - *inout* <HeaderLines> - header content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getHeaderForEntity(
in integer pl_ctxIdx,
inout HeaderLines pl_headerLines)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_Base_assert(
%definitionId & ": Header content getter function is null!",
v_EPTF_HTTP_contexts[pl_ctxIdx].headerGetterFn != null);
f_EPTF_Base_assert(
%definitionId & ": Header content getter function is unbound!",
isvalue(v_EPTF_HTTP_contexts[pl_ctxIdx].headerGetterFn));
v_EPTF_HTTP_contexts[pl_ctxIdx].headerGetterFn.apply(
{pl_ctxIdx}, pl_headerLines)
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getRawHeaderForEntity
//
// Purpose:
// Get HTTP raw header for an entity (entity context)
//
// Parameters:
// pl_ctxIdx - *in* *integer* - entity context
// pl_body - *inout* <EPTF_HTTP_CharOrOct> - charstring or binary body content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getRawHeaderForEntity(
in integer pl_ctxIdx,
inout octetstring pl_rawHeader)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_Base_assert(
%definitionId & ": Raw header content getter function is null!",
v_EPTF_HTTP_contexts[pl_ctxIdx].rawHeaderGetterFn != null);
f_EPTF_Base_assert(
%definitionId & ": Raw header content getter function is unbound!",
isvalue(v_EPTF_HTTP_contexts[pl_ctxIdx].rawHeaderGetterFn));
v_EPTF_HTTP_contexts[pl_ctxIdx].rawHeaderGetterFn.apply(
{pl_ctxIdx}, pl_rawHeader)
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setEntityContextMessageBody
//
// Purpose:
// Get HTTP body for an entity (entity context)
//
// Parameters:
// pl_eIdx - *in* *integer* - index of entity whose context
// database is to be set
// pl_body - *inout* <EPTF_HTTP_CharOrOct> - charstring or binary body content
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setEntityContextMessageBody(
in integer pl_eIdx,
inout EPTF_HTTP_CharOrOct pl_body)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
if(ischosen(pl_body.charVal))
{
v_EPTF_HTTP_contexts[vl_myCtx].bodyId := f_EPTF_HTTP_setCharEntityBody(pl_body.charVal);
}
else
{
v_EPTF_HTTP_contexts[vl_myCtx].bodyId := f_EPTF_HTTP_setOctEntityBody(pl_body.octVal);
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_reportEvent
//
// Purpose:
// Function to report an event on the initially set reporting level
//
// Parameters:
// pl_statusCode - *in* *integer* - status code of the message
// pl_eIdx - *in* *integer* - index of the entity
// pl_fsmIdx - *in* *integer* - index of the fsm of the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_reportEvent(
in integer pl_statusCode,
in integer pl_eIdx,
in integer pl_fsmIdx)
runs on EPTF_HTTP_LGen_CT
{
if (vf_EPTF_HTTP_dispatchFn != null) {
vf_EPTF_HTTP_dispatchFn.apply(pl_statusCode, pl_eIdx, pl_fsmIdx);
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_convertEvent
//
// Purpose:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_convertEvent(
in EPTF_LGenBase_ReportedEventDescriptor pl_eventIN,
inout EPTF_LGenBase_ReportedEventDescriptor pl_eventOUT)
{
pl_eventOUT := pl_eventIN;
if (omit != pl_eventIN.event.target)
{
if (0 > pl_eventIN.event.target.eIdx)
{
pl_eventOUT.event.target := omit;
}else if (0 > pl_eventIN.event.target.fsmCtxIdx)
{
pl_eventOUT.event.target.fsmCtxIdx := omit;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_dispatchEvent
//
// Purpose:
// HTTP dispatch function
//
// Parameters:
// pl_event - *in* <EPTF_LGenBase_ReportedEventDescriptor> - status code of the message
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_dispatchEvent(in EPTF_LGenBase_ReportedEventDescriptor pl_event)
runs on EPTF_HTTP_LGen_CT
{
var EPTF_LGenBase_ReportedEventDescriptor vl_local;
f_EPTF_HTTP_convertEvent(pl_event, vl_local);
f_EPTF_LGenBase_dispatchEvent(vl_local);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_postEvent
//
// Purpose:
// HTTP post function
//
// Parameters:
// pl_event - *in* <EPTF_LGenBase_ReportedEventDescriptor> - status code of the message
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_postEvent(in EPTF_LGenBase_ReportedEventDescriptor pl_event)
runs on EPTF_HTTP_LGen_CT
{
var EPTF_LGenBase_ReportedEventDescriptor vl_local;
f_EPTF_HTTP_convertEvent(pl_event, vl_local);
f_EPTF_LGenBase_postEvent(vl_local);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_reportClassEvent
//
// Purpose:
// Function to report an event to an entity/fsm (class reporting level)
//
// Parameters:
// pl_statusCode - *in* *integer* - status code of the message
// pl_eIdx - *in* *integer* - index of the entity
// pl_fsmIdx - *in* *integer* - index of the fsm of the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_reportClassEvent(
in integer pl_statusCode,
in integer pl_eIdx,
in integer pl_fsmIdx)
runs on EPTF_HTTP_LGen_CT
{
if (pl_statusCode < 100 or pl_statusCode > 599)
{
f_EPTF_HTTP_warning(%definitionId &
": Status code of incoming message is invalid: " &
int2str(pl_statusCode));
return;
}
if (pl_statusCode < 200) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response100class,{pl_eIdx,pl_fsmIdx}, omit},{}});
}
else
if (pl_statusCode < 300) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
}
else
if (pl_statusCode < 400) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
}
else
if (pl_statusCode < 500) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
}
else
if (pl_statusCode < 600) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_reportDetailedEvent
//
// Purpose:
// Function to report an event to an entity/fsm (detailed reporting level)
//
// Parameters:
// pl_statusCode - *in* *integer* - status code of the message
// pl_eIdx - *in* *integer* - index of the entity
// pl_fsmIdx - *in* *integer* - index of the fsm of the entity
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_reportDetailedEvent(
in integer pl_statusCode,
in integer pl_eIdx,
in integer pl_fsmIdx)
runs on EPTF_HTTP_LGen_CT
{
// do reporting
select (pl_statusCode)
{
case (100) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response100class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response100Continue,{pl_eIdx,pl_fsmIdx}, omit},{}});
}
case (101) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response100class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response101SwitchingProtocols,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (200) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200OK,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (201) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response201Created,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (202) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response202Accepted,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (203) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response203NonAuthoritativeInformation,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (204) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response204NoContent,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (205) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response205ResetContent,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (206) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response200class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response206PartialContent,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (300) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300MultipleChoices,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (301) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response301MovedPermanently,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (302) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response302Found,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (303) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response303SeeOther,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (304) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response304NotModified,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (305) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response305UseProxy,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (306) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response306Unused,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (307) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response300class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response307TemporaryRedirect,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (400) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400BadRequest,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (401) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response401Unauthorized,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (402) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response402PaymentRequired,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (403) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response403Forbidden,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (404) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response404NotFound,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (405) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response405MethodNotAllowed,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (406) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response406NotAcceptable,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (407) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response407ProxyAuthenticationRequired,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (408) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response408RequestTimeout,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (409) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response409Conflict,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (410) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response410Gone,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (411) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response411LengthRequired,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (412) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response412PreconditionFailed,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (413) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response413RequestEntityTooLarge,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (414) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response414RequestURITooLong,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (415) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response415UnsupportedMediaType,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (416) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response416RequestedRangeNotSatisfiable,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (417) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response400class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response417ExpectationFailed,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (500) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500InternalServerError,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (501) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response501NotImplemented,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (502) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response502BadGateway,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (503) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response503ServiceUnavailable,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (504) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response504GatewayTimeout,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
case (505) {
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response500class,{pl_eIdx,pl_fsmIdx}, omit},{}});
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_response505HTTPVersionNotSupported,{pl_eIdx,pl_fsmIdx}, omit},{}}) ;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_messageReceived
//
// Purpose:
// Function to handle received message
//
// Parameters:
// pl_message - *in* <EPTF_HTTP_IncomingMessage> - incoming message from the transport layer
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_messageReceived(
in EPTF_HTTP_IncomingMessage pl_message)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug(%definitionId & ": Message received!");
f_EPTF_HTTP_debug(%definitionId & ": Session id and entity offset: " &
int2str(pl_message.sessionId) & " / " & int2str(v_EPTF_HTTP_EntityOffset));
var integer vl_fsmIdx, vl_eIdx := pl_message.sessionId - v_EPTF_HTTP_EntityOffset;
if (vl_eIdx < 0) {
f_EPTF_HTTP_warning(%definitionId &
": Entity cannot be determined to message on session: " &
int2str(pl_message.sessionId))
return;
};
f_EPTF_Base_assert(%definitionId & ": Invalid entity index (" &
int2str(vl_eIdx) &
") applied to connId -> fsm index database!",
isvalue(v_EPTF_HTTP_ConnId2FIdx[vl_eIdx]));
vl_fsmIdx := v_EPTF_HTTP_ConnId2FIdx[vl_eIdx];
//v_EPTF_HTTP_ConnId2FIdx[vl_fsmIdx] := -1;
f_EPTF_HTTP_debug(%definitionId & ": Fsm index: " &
int2str(vl_fsmIdx) & " acquired for entity id: " &
int2str(vl_eIdx));
v_intNoWarningLG := dec_HTTPMessage(pl_message.httpMessage, v_EPTF_HTTP_incomingMessage);
if (vf_EPTF_HTTP_messageReceivedHook != null) {
vf_EPTF_HTTP_messageReceivedHook.apply(vl_eIdx, v_EPTF_HTTP_incomingMessage);
}
if (ischosen(v_EPTF_HTTP_incomingMessage.request))
{
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_requestCharReceived, {vl_eIdx,vl_fsmIdx}, omit},{}});
f_EPTF_HTTP_updateStatistics(true,
v_EPTF_HTTP_incomingMessage.request.method, -1);
var integer myctx := f_EPTF_HTTP_getContextIndex(vl_eIdx);
v_EPTF_HTTP_contexts[myctx].charBodyHandlerFn.apply( vl_eIdx, v_EPTF_HTTP_incomingMessage.request.body);
}
else
if (ischosen(v_EPTF_HTTP_incomingMessage.request_binary))
{
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_requestOctReceived, {vl_eIdx,vl_fsmIdx}, omit},{}});
f_EPTF_HTTP_updateStatistics(true,
v_EPTF_HTTP_incomingMessage.request_binary.method, -1);
var integer myctx := f_EPTF_HTTP_getContextIndex(vl_eIdx);
v_EPTF_HTTP_contexts[myctx].binaryBodyHandlerFn.apply( vl_eIdx, v_EPTF_HTTP_incomingMessage.request_binary.body);
}
else
if (ischosen(v_EPTF_HTTP_incomingMessage.response))
{
var integer myctx := f_EPTF_HTTP_getContextIndex(vl_eIdx);
// do automatic adminsitration
if (v_EPTF_HTTP_contexts[myctx].requestPending)
{
v_EPTF_HTTP_contexts[myctx].requestPending := false; // request is not pending after answer
f_EPTF_HTTP_createAuthorizationDataFromMessage(myctx); // store auth data into entity context
}
if( v_EPTF_HTTP_contexts[myctx].uri != "")
{
v_EPTF_HTTP_contexts[myctx].etag:="";
var integer vl_size := sizeof(v_EPTF_HTTP_incomingMessage.response.header);
for(var integer vl_i := 0; vl_i < vl_size; vl_i := vl_i + 1)
{
if(v_EPTF_HTTP_incomingMessage.response.header[vl_i].header_name == "ETag")
{
var charstring vl_etag := v_EPTF_HTTP_incomingMessage.response.header[vl_i].header_value;
var integer vl_length := lengthof(vl_etag);
if(vl_etag[0] == "\"" and vl_etag[vl_length-1] == "\"")
{
vl_etag := substr(vl_etag,1,vl_length-2);
}
v_EPTF_HTTP_contexts[myctx].etag := vl_etag;
break;
}
}
}
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_responseCharReceived,{vl_eIdx,vl_fsmIdx}, omit},{}});
f_EPTF_HTTP_reportEvent(
v_EPTF_HTTP_incomingMessage.response.statuscode,
vl_eIdx, vl_fsmIdx)
f_EPTF_HTTP_updateStatistics(true, "",
v_EPTF_HTTP_incomingMessage.response.statuscode);
v_EPTF_HTTP_contexts[myctx].charBodyHandlerFn.apply( vl_eIdx,v_EPTF_HTTP_incomingMessage.response.body);
}
else if (ischosen(v_EPTF_HTTP_incomingMessage.response_binary))
{
var integer myctx := f_EPTF_HTTP_getContextIndex(vl_eIdx);
// do automatic adminsitration
if (v_EPTF_HTTP_contexts[myctx].requestPending)
{
v_EPTF_HTTP_contexts[myctx].requestPending := false; // request is not pending after answer
f_EPTF_HTTP_createAuthorizationDataFromMessage(myctx); // store auth data into entity context
}
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
c_EPTF_HTTP_inputIdx_responseOctReceived,{vl_eIdx,vl_fsmIdx}, omit},{}});
f_EPTF_HTTP_reportEvent(
v_EPTF_HTTP_incomingMessage.response_binary.statuscode,
vl_eIdx, vl_fsmIdx)
f_EPTF_HTTP_updateStatistics(true, "",
v_EPTF_HTTP_incomingMessage.response_binary.statuscode);
v_EPTF_HTTP_contexts[myctx].binaryBodyHandlerFn.apply( vl_eIdx, v_EPTF_HTTP_incomingMessage.response_binary.body);
}
else // not response
{
f_EPTF_HTTP_debug(%definitionId & ": Unhandled message type received: " &
log2str(v_EPTF_HTTP_incomingMessage));
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_eventReceived
//
// Purpose:
// Function to handle received events
//
// Parameters:
// pl_sessionId - *integer* - session id of received event
// pl_type - *integer* - event type
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_eventReceived(
in EPTF_HTTP_Event pl_event)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug(%definitionId & ": Event received!");
f_EPTF_HTTP_debug(%definitionId & ": Session id and entity offset: " &
int2str(pl_event.sessionId) & " / " & int2str(v_EPTF_HTTP_EntityOffset));
var integer vl_fsmIdx, vl_eIdx := pl_event.sessionId - v_EPTF_HTTP_EntityOffset;
if (vl_eIdx < 0) {
f_EPTF_HTTP_debug(%definitionId &
": Entity cannot be determined to event: " &
int2str(pl_event.eventType) & " on session: " &
int2str(pl_event.sessionId) & ", dispatching generic event");
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
pl_event.eventType, omit, omit},{}}) ;
return;
};
f_EPTF_Base_assert(%definitionId & ": Invalid connection id (" &
int2str(vl_eIdx) &
") applied to connId -> fsm index database!",
isvalue(v_EPTF_HTTP_ConnId2FIdx[vl_eIdx]));
vl_fsmIdx := v_EPTF_HTTP_ConnId2FIdx[vl_eIdx];
//v_EPTF_HTTP_ConnId2FIdx[vl_eIdx] := -1;
f_EPTF_HTTP_debug(%definitionId & ": Fsm index: " &
int2str(vl_fsmIdx) & " acquired for entity id: " &
int2str(vl_eIdx));
f_EPTF_HTTP_dispatchEvent({{v_EPTF_HTTP_myBIdx,
pl_event.eventType,{vl_eIdx,vl_fsmIdx}, omit},{}}) ;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_socketErrorReceived
//
// Purpose:
// Function to handle received socket errors
//
// Parameters:
// pl_error - *in* <EPTF_HTTP_EventError> - error received from the transport layer
//
// Detailed Comments:
// This function handles received socket error messages and events and sends a socketError event
// with LGenbase postEvent method. This is a private function.
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_socketErrorReceived(
in EPTF_HTTP_EventError pl_error)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug(%definitionId & ": Socket Error received!");
if(ispresent(pl_error.transportError.errorCode)) {
f_EPTF_HTTP_debug(%definitionId & ": Socket Error result: " & log2str(pl_error.transportError));
f_EPTF_HTTP_debug(%definitionId & ": Session id and entity offset: " &
int2str(pl_error.sessionId) & " / " & int2str(v_EPTF_HTTP_EntityOffset));
var EPTF_IntegerList vl_reportedArgs := { enum2int(pl_error.transportError.errorCode), -1 };
if(ispresent(pl_error.transportError.os_error_code)) { vl_reportedArgs[1] := pl_error.transportError.os_error_code; }
var integer vl_fsmIdx, vl_eIdx := pl_error.sessionId - v_EPTF_HTTP_EntityOffset;
if (vl_eIdx < 0) {
//if connection opened with f_EPTF_HTTP_LocalTransport_newPortGroup() with no instant connection open sessionId cannot be determined
f_EPTF_HTTP_debug(%definitionId &
": Entity cannot be determined to socket Error on session: " &
int2str(pl_error.sessionId));
f_EPTF_HTTP_postEvent({{v_EPTF_HTTP_myBIdx,c_EPTF_HTTP_inputIdx_responseSocketError,
omit,omit},vl_reportedArgs});
return;
};
f_EPTF_Base_assert(%definitionId & ": Invalid connection id (" &
int2str(vl_eIdx) &
") applied to connId -> fsm index database!",
isvalue(v_EPTF_HTTP_ConnId2FIdx[vl_eIdx]));
vl_fsmIdx := v_EPTF_HTTP_ConnId2FIdx[vl_eIdx];
f_EPTF_HTTP_debug(%definitionId & ": Fsm index: " &
int2str(vl_fsmIdx) & " acquired for entity id: " &
int2str(vl_eIdx));
// generating postEvent for socket error
f_EPTF_HTTP_postEvent({{v_EPTF_HTTP_myBIdx,c_EPTF_HTTP_inputIdx_responseSocketError,
{vl_eIdx,vl_fsmIdx},omit},vl_reportedArgs});
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_messageReceivedServer
//
// Purpose:
// Function to handle received message in a server
//
// Parameters:
// pl_message - *in* <EPTF_HTTP_IncomingMessage> - incoming message from the transport layer
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_messageReceivedServer(
in EPTF_HTTP_IncomingMessage pl_message)
runs on EPTF_HTTP_LGen_CT
{
v_intNoWarningLG := dec_HTTPMessage(pl_message.httpMessage, v_EPTF_HTTP_incomingMessage);
v_EPTF_HTTP_lastReceivedGroupId := pl_message.groupId;
v_EPTF_HTTP_lastReceivedPortId := pl_message.sessionId;
v_EPTF_HTTP_lastReceivedSeqNum := pl_message.seqNum;
f_EPTF_HTTP_debug(%definitionId & ": Message received!");
var integer vl_eIdx := -1;
var integer vl_fsmCtx := -1;
var integer vl_eventIdx := -1;
if (null != vf_EPTF_HTTP_searchContext)
{
vf_EPTF_HTTP_searchContext.apply(vl_eIdx, vl_fsmCtx);
}
if (ischosen(v_EPTF_HTTP_incomingMessage.request))
{
vl_eventIdx := c_EPTF_HTTP_inputIdx_requestCharReceived;
f_EPTF_HTTP_updateStatistics(true,
v_EPTF_HTTP_incomingMessage.request.method, -1);
}
else
if (ischosen(v_EPTF_HTTP_incomingMessage.request_binary))
{
vl_eventIdx := c_EPTF_HTTP_inputIdx_requestOctReceived;
f_EPTF_HTTP_updateStatistics(true,
v_EPTF_HTTP_incomingMessage.request_binary.method, -1);
}
else // not response
{
f_EPTF_HTTP_warning(%definitionId & ": Unhandled message type received: " &
log2str(v_EPTF_HTTP_incomingMessage));
return;
}
f_EPTF_HTTP_dispatchEvent( {{v_EPTF_HTTP_myBIdx, vl_eventIdx,
{vl_eIdx,vl_fsmCtx}, omit},{}});
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_eventReceivedServer
//
// Purpose:
// Function to handle received events in a server
//
// Parameters:
// pl_sessionId - *in* <EPTF_HTTP_Event> - event received from the transport layer
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_eventReceivedServer(
in EPTF_HTTP_Event pl_event)
runs on EPTF_HTTP_LGen_CT
{
v_EPTF_HTTP_event := pl_event;
var integer vl_eIdx := -1;
var integer vl_fsmCtx := -1;
if (null != vf_EPTF_HTTP_searchContext4Event)
{
vf_EPTF_HTTP_searchContext4Event.apply(vl_eIdx, vl_fsmCtx);
}
f_EPTF_HTTP_dispatchEvent( {{v_EPTF_HTTP_myBIdx, pl_event.eventType,
{vl_eIdx,vl_fsmCtx}, omit},{}});
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_socketErrorReceivedServer
//
// Purpose:
// Function to handle received socket errors
//
// Parameters:
// pl_error - *in* <EPTF_HTTP_EventError> - error received from the transport layer
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_socketErrorReceivedServer(
in EPTF_HTTP_EventError pl_error)
runs on EPTF_HTTP_LGen_CT
{
v_EPTF_HTTP_error := pl_error;
var integer vl_eIdx := -1;
var integer vl_fsmCtx := -1;
if (null != vf_EPTF_HTTP_searchContext4Error)
{
vf_EPTF_HTTP_searchContext4Error.apply(vl_eIdx, vl_fsmCtx);
}
var EPTF_IntegerList vl_reportedArgs := { -1, -1 };
if(ispresent(pl_error.transportError.errorCode)) { vl_reportedArgs[0] := enum2int(pl_error.transportError.errorCode); }
if(ispresent(pl_error.transportError.os_error_code)) { vl_reportedArgs[1] := pl_error.transportError.os_error_code; }
f_EPTF_HTTP_postEvent( {{v_EPTF_HTTP_myBIdx, c_EPTF_HTTP_inputIdx_responseSocketError,
{vl_eIdx,vl_fsmCtx}, omit},vl_reportedArgs} );
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_sendRequest
//
// Purpose:
// Function to send HTTP message
//
// Parameters:
// pl_connId - *integer* - port group index on which the message is
// intended to be sent
// pl_sessionId - *integer* - session id
// pl_message - *octetstring* - message to send
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_sendRequest(
in integer pl_connId,
in integer pl_sessionId,
in octetstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_sendRequest.apply(pl_connId, pl_sessionId, pl_message);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_closeConnection
//
// Purpose:
// Function to close connection
//
// Parameters:
// pl_connId - *integer* - port group index
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Closes all open conection in a port group
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_closeConnection(
in integer pl_connId)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_connectionClose.apply(pl_connId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_closeHalfConnection
//
// Purpose:
// Function to half close connection
//
// Parameters:
// pl_connId - *integer* - port group index
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Half closes all open connections in a port group
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_closeHalfConnection(
in integer pl_connId)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_connectionHalfClose.apply(pl_connId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_openConnection
//
// Purpose:
// Function to open connection
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// Open all idle connections in a port group
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_openConnection(
in integer pl_connId,
in integer pl_sessionId)
runs on EPTF_HTTP_LGen_CT return boolean
{
return vf_EPTF_HTTP_connectionOpen.apply(pl_connId, pl_sessionId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_closePortOfUser
//
// Purpose:
// Function to close port of user
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_closePortOfUser(
in integer pl_groupId,
in integer pl_sessionId)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_closePortOfUser.apply(pl_groupId, pl_sessionId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_freePortOfUser
//
// Purpose:
// Function to free port of user
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_freePortOfUser(
in integer pl_groupId,
in integer pl_sessionId)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_freePortOfUser.apply(pl_groupId, pl_sessionId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_sendResponse
//
// Purpose:
// Sends the response.
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_sendResponse(
in integer pl_groupId,
in integer pl_portId,
in integer pl_seqNum,
in octetstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_sendResponse.apply(pl_groupId, pl_portId, pl_seqNum, pl_message);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_listen
//
// Purpose:
// Opens a listen port
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_listen(
in integer pl_groupId)
runs on EPTF_HTTP_LGen_CT
return integer
{
return vf_EPTF_HTTP_listen.apply(pl_groupId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_closePort
//
// Purpose:
// Closes a port in a server port group.
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_closePort(
in integer pl_groupId,
in integer pl_portId
)
runs on EPTF_HTTP_LGen_CT
{
vf_EPTF_HTTP_closePort.apply(pl_groupId, pl_portId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setAuthData
//
// Purpose:
// Sets the authentication data for the server.
//
// Parameters:
// pl_authData - *in* <EPTF_HTTP_setAuthData> - authentication data
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setAuthData(in EPTF_HTTP_setAuthData pl_authData)
runs on EPTF_HTTP_LGen_CT
{
v_EPTF_HTTP_authData.method := pl_authData.method;
v_EPTF_HTTP_authData.algorithm := pl_authData.algorithm;
v_EPTF_HTTP_authData.realm := pl_authData.realm;
v_EPTF_HTTP_authData.domain := pl_authData.domain;
v_EPTF_HTTP_authData.qopOptions := pl_authData.qopOptions;
v_EPTF_HTTP_authData.password := pl_authData.password;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_genAuthResponse
//
// Purpose:
// Generates authentication response data.
//
// Parameters:
// pl_authResp - *inout* *charstring* - authentication data
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_genAuthResponse(inout charstring pl_authResp)
runs on EPTF_HTTP_LGen_CT
{
var charstring vl_nonce := f_EPTF_HTTP_getNonceValue(v_EPTF_HTTP_authData);
pl_authResp := v_EPTF_HTTP_authData.method &
" realm=\"" & v_EPTF_HTTP_authData.realm & "\"" &
",nonce=\"" & vl_nonce & "\"" &
",algorithm=" & v_EPTF_HTTP_authData.algorithm &
",qop=\"" & v_EPTF_HTTP_authData.qopOptions &"\"";
if (ispresent(v_EPTF_HTTP_authData.domain))
{
pl_authResp := pl_authResp & ",domain=\"" & v_EPTF_HTTP_authData.domain & "\"";
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_checkAuthData
//
// Purpose:
// Checks authorization data.
//
// Parameters:
// pl_method - *in* *charstring* - HTTP request method
// pl_authData - *in* *charstring* - the Authorization header value
// pl_entityBody - *in* *charstring* - the entity body
//
// Return value:
// boolean - check result
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_checkAuthData(in charstring pl_httpMethod, in charstring pl_authData, in charstring pl_entityBody)
runs on EPTF_HTTP_LGen_CT
return boolean
{
var EPTF_HTTP_AuthDetails vl_authDetails := c_EPTF_HTTP_initAuthDetails;
f_EPTF_HTTP_getAuthParams(pl_authData, vl_authDetails);
f_EPTF_HTTP_debug(log2str(%definitionId, ": Authentication details: ", vl_authDetails));
var charstring vl_response := f_calculateDigestResponse(
vl_authDetails.nonce,
vl_authDetails.cnonce,
vl_authDetails.username,
vl_authDetails.realm,
v_EPTF_HTTP_authData.password,
vl_authDetails.algorithm,
vl_authDetails.nonceCount,
pl_httpMethod,
vl_authDetails.qop,
vl_authDetails.uri,
f_calculateMD5(pl_entityBody));
return vl_response == vl_authDetails.response;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_addNewHeaderLines
//
// Purpose:
// Add header lines to the header lines database
//
// Parameters:
// pl_headerLines - *in* <HeaderLines> - header lines to add
//
// Return Value:
// *integer* - index of HTTP header lines database where new data is
// found or inserted
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_addNewHeaderLines (
in HeaderLines pl_headerLines)
runs on EPTF_HTTP_LGen_CT
return integer
{
var integer pl_headerLinesIdx := f_EPTF_HTTP_existHeaderLines(pl_headerLines);
if (pl_headerLinesIdx > -1) {
return pl_headerLinesIdx;
}
else {
var integer pl_size := sizeof(v_EPTF_HTTP_headerLinesList);
v_EPTF_HTTP_headerLinesList[pl_size] := pl_headerLines;
return pl_size;
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setHeaderValue
//
// Purpose:
// Sets a header value for an element in the HeaderLines list.
//
// Parameters:
// pl_headerLinesIdx - *in* *integer* - header line index
// pl_headerName - *in* *charstring* - header name
// pl_headerValue - *in* *charstring* - header value
//
// Detailed comments:
// If the header does not exist, the value is NOT added.
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setHeaderValue(
in integer pl_headerLinesIdx,
in charstring pl_headerName,
in charstring pl_headerValue)
runs on EPTF_HTTP_LGen_CT
{
for (var integer i := 0; i < sizeof(v_EPTF_HTTP_headerLinesList[pl_headerLinesIdx]); i := i + 1)
{
if (pl_headerName == v_EPTF_HTTP_headerLinesList[pl_headerLinesIdx][i].header_name)
{
v_EPTF_HTTP_headerLinesList[pl_headerLinesIdx][i].header_value := pl_headerValue;
break;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setCharBody
//
// Purpose:
// Sets the charstring body of an entity. All of the entities referencing this
/// charstring body entry will be affected.
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_body - *in* *charstring* - body value
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setCharBody(
in integer pl_eIdx,
in charstring pl_body
)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_ctx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
var integer vl_bodyId := v_EPTF_HTTP_contexts[vl_ctx].bodyId;
v_EPTF_HTTP_charBodyDB[vl_bodyId] := pl_body;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_createContextLengthHeaderLine
//
// Purpose:
// Create header lines containing only content length header line
//
// Parameters:
// pl_body - *in* *charstring* - message body
//
// Return Value:
// <HeaderLines> - created header lines
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_createContextLengthHeaderLine(
in charstring pl_body)
runs on EPTF_HTTP_LGen_CT
return HeaderLines
{
var HeaderLines vl_hl;
vl_hl := { { "Content-Length", int2str(lengthof(pl_body)) } };
return vl_hl;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_addOptTempParamNumber
//
// Purpose:
// Sets the variable that holds the user added optional template parameters.
//
// Parameters:
// pl_number - *in* *integer* - the number of the optional template parameters
//
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_addOptTempParamNumber(in integer pl_number)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_sizeof := sizeof(v_EPTF_HTTP_optionalTempParams)
for (var integer i := vl_sizeof; i < pl_number; i := i + 1)
{
v_EPTF_HTTP_optionalTempParams[i] := "";
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setOptTempParam
//
// Purpose:
// Sets the user added optional template parameter value
//
// Parameters:
// pl_idx - *in* *integer* - the index of the optional template parameter
// pl_paramValue - *in* *charstring* - parameter value
//
// Detailed Comments:
// The index must be the same as the index of the parameter
// when calling f_EPTF_LGenBase_extendTemplateType.
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setOptTempParam(in integer pl_idx, in charstring pl_paramValue)
runs on EPTF_HTTP_LGen_CT
{
if (pl_idx >= sizeof(v_EPTF_HTTP_optionalTempParams) or 0 > pl_idx)
{
f_EPTF_HTTP_warning(%definitionId &
": Setting invalid template parameter: " & int2str(pl_idx));
return;
}
v_EPTF_HTTP_optionalTempParams[pl_idx] := pl_paramValue;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_cleanupContext
//
// Purpose:
// Cleans up entity context. All the value set by f_EPTF_HTTP_setEntityContextServer
// or f_EPTF_HTTP_setEntityContext remains unchanged.
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_cleanupContext(in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].requestPending := c_EPTF_HTTP_initCtx.requestPending;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].portId := c_EPTF_HTTP_initCtx.portId;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].httpMessage := omit;//c_EPTF_HTTP_initCtx.httpMessage;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].seqNum := c_EPTF_HTTP_initCtx.seqNum;
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx].connId := c_EPTF_HTTP_initCtx.connId;
v_EPTF_HTTP_ConnId2FIdx[pl_eIdx] := -1;
}
} //EPTF_HTTP_PublicFunctions
///////////////////////////////////////////////////////////////////////////////
// Group: EPTF_HTTP_PrivateFunctions
//
// Purpose:
// The functions of the EPTF HTTP Private Functions
//
///////////////////////////////////////////////////////////////////////////////
group EPTF_HTTP_PrivateFunctions {
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_cleanup_CT
//
// Purpose:
// The HTTP HTTP cleanup function
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
private function f_EPTF_HTTP_cleanup_CT()
runs on EPTF_HTTP_LGen_CT
{
if (not v_EPTF_HTTP_initialized)
{
return;
}
v_EPTF_HTTP_initialized := false;
f_EPTF_str2int_HashMap_Delete(c_EPTF_HTTP_HashMap_charDatabase);
f_EPTF_oct2int_HashMap_Delete(c_EPTF_HTTP_HashMap_octDatabase);
v_EPTF_HTTP_charDB := -1;
v_EPTF_HTTP_octDB := -1;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_declareStepsAndEvent
//
// Purpose:
// Function to declare the steps and events
//
// Parameters:
// -
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_declareStepsAndEvent( )
runs on EPTF_HTTP_LGen_CT
{
if( //steps
c_EPTF_HTTP_stepIdx_sendRequest != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_sendRequest,refers(f_EPTF_HTTP_step_sendRequest)})
or c_EPTF_HTTP_stepIdx_handleTimeout != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_handleTimeout,refers(f_EPTF_HTTP_step_handleTimeout)})
or c_EPTF_HTTP_stepIdx_responseReceived != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_responseReceived,refers(f_EPTF_HTTP_step_processResponse)})
or c_EPTF_HTTP_stepIdx_openConnection != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_openConnection,refers(f_EPTF_HTTP_step_sendConnect)})
or c_EPTF_HTTP_stepIdx_closeConnection != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_closeConnection,refers(f_EPTF_HTTP_step_sendClose)})
or c_EPTF_HTTP_stepIdx_halfCloseConnection != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_halfCloseConnection,refers(f_EPTF_HTTP_step_sendHalfClose)})
or c_EPTF_HTTP_stepIdx_closePortOfUser != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_closePortOfUser,refers(f_EPTF_HTTP_step_closePortOfUser)})
or c_EPTF_HTTP_stepIdx_freePortOfUser != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_freePortOfUser,refers(f_EPTF_HTTP_step_freePortOfUser)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodCONNECT != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodCONNECT,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodCONNECT)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodDELETE != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodDELETE,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodDELETE)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodGET != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodGET,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodGET)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodHEAD != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodHEAD,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodHEAD)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodOPTIONS != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodOPTIONS,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodOPTIONS)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodPOST != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodPOST,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodPOST)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodPUT != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodPUT,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodPUT)})
or c_EPTF_HTTP_stepIdx_setEntityContextHTTPMethodTRACE != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_setEntityContextHTTPMethodTRACE,refers(f_EPTF_HTTP_step_setEntityContextHTTPMethodTRACE)})
or c_EPTF_HTTP_stepIdx_handleRequest != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName,{c_EPTF_HTTP_stepName_handleRequest,refers(f_EPTF_HTTP_step_handleRequest)})
or c_EPTF_HTTP_stepIdx_sendResponse != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName,{c_EPTF_HTTP_stepName_sendResponse,refers(f_EPTF_HTTP_step_sendResponse)})
or c_EPTF_HTTP_stepIdx_closePort != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_closePort, refers(f_EPTF_HTTP_step_closePort)})
or c_EPTF_HTTP_stepIdx_cleanUpContext != f_EPTF_LGenBase_declareStep(c_EPTF_HTTP_myBName, {c_EPTF_HTTP_stepName_cleanUpContext, refers(f_EPTF_HTTP_step_cleanUp)})
//inputs
or c_EPTF_HTTP_inputIdx_response100Continue != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response100Continue)
or c_EPTF_HTTP_inputIdx_response101SwitchingProtocols != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response101SwitchingProtocols)
or c_EPTF_HTTP_inputIdx_response200OK != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response200OK)
or c_EPTF_HTTP_inputIdx_response201Created != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response201Created)
or c_EPTF_HTTP_inputIdx_response202Accepted != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response202Accepted)
or c_EPTF_HTTP_inputIdx_response203NonAuthoritativeInformation != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response203NonAuthoritativeInformation)
or c_EPTF_HTTP_inputIdx_response204NoContent != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response204NoContent)
or c_EPTF_HTTP_inputIdx_response205ResetContent != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response205ResetContent)
or c_EPTF_HTTP_inputIdx_response206PartialContent != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response206PartialContent)
or c_EPTF_HTTP_inputIdx_response300MultipleChoices != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response300MultipleChoices)
or c_EPTF_HTTP_inputIdx_response301MovedPermanently != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response301MovedPermanently)
or c_EPTF_HTTP_inputIdx_response302Found != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response302Found)
or c_EPTF_HTTP_inputIdx_response303SeeOther != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response303SeeOther)
or c_EPTF_HTTP_inputIdx_response304NotModified != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response304NotModified)
or c_EPTF_HTTP_inputIdx_response305UseProxy != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response305UseProxy)
or c_EPTF_HTTP_inputIdx_response306Unused != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response306Unused)
or c_EPTF_HTTP_inputIdx_response307TemporaryRedirect != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response307TemporaryRedirect)
or c_EPTF_HTTP_inputIdx_response400BadRequest != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response400BadRequest)
or c_EPTF_HTTP_inputIdx_response401Unauthorized != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response401Unauthorized)
or c_EPTF_HTTP_inputIdx_response402PaymentRequired != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response402PaymentRequired)
or c_EPTF_HTTP_inputIdx_response403Forbidden != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response403Forbidden)
or c_EPTF_HTTP_inputIdx_response404NotFound != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response404NotFound)
or c_EPTF_HTTP_inputIdx_response405MethodNotAllowed != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response405MethodNotAllowed)
or c_EPTF_HTTP_inputIdx_response406NotAcceptable != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response406NotAcceptable)
or c_EPTF_HTTP_inputIdx_response407ProxyAuthenticationRequired != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response407ProxyAuthenticationRequired)
or c_EPTF_HTTP_inputIdx_response408RequestTimeout != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response408RequestTimeout)
or c_EPTF_HTTP_inputIdx_response409Conflict != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response409Conflict)
or c_EPTF_HTTP_inputIdx_response410Gone != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response410Gone)
or c_EPTF_HTTP_inputIdx_response411LengthRequired != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response411LengthRequired)
or c_EPTF_HTTP_inputIdx_response412PreconditionFailed != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response412PreconditionFailed)
or c_EPTF_HTTP_inputIdx_response413RequestEntityTooLarge != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response413RequestEntityTooLarge)
or c_EPTF_HTTP_inputIdx_response414RequestURITooLong != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response414RequestURITooLong)
or c_EPTF_HTTP_inputIdx_response415UnsupportedMediaType != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response415UnsupportedMediaType)
or c_EPTF_HTTP_inputIdx_response416RequestedRangeNotSatisfiable != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response416RequestedRangeNotSatisfiable)
or c_EPTF_HTTP_inputIdx_response417ExpectationFailed != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response417ExpectationFailed)
or c_EPTF_HTTP_inputIdx_response500InternalServerError != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response500InternalServerError)
or c_EPTF_HTTP_inputIdx_response501NotImplemented != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response501NotImplemented)
or c_EPTF_HTTP_inputIdx_response502BadGateway != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response502BadGateway)
or c_EPTF_HTTP_inputIdx_response503ServiceUnavailable != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response503ServiceUnavailable)
or c_EPTF_HTTP_inputIdx_response504GatewayTimeout != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response504GatewayTimeout)
or c_EPTF_HTTP_inputIdx_response505HTTPVersionNotSupported != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response505HTTPVersionNotSupported)
or c_EPTF_HTTP_inputIdx_response100class != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response100class)
or c_EPTF_HTTP_inputIdx_response200class != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response200class)
or c_EPTF_HTTP_inputIdx_response300class != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response300class)
or c_EPTF_HTTP_inputIdx_response400class != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response400class)
or c_EPTF_HTTP_inputIdx_response500class != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_response500class)
or c_EPTF_HTTP_inputIdx_connectionOpened != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_connectionOpened)
or c_EPTF_HTTP_inputIdx_connectionClosed != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_connectionClosed)
or c_EPTF_HTTP_inputIdx_errorReceived != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_errorReceived)
or c_EPTF_HTTP_inputIdx_OKReceived != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_OKReceived)
or c_EPTF_HTTP_inputIdx_responseCharReceived != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_responseCharReceived)
or c_EPTF_HTTP_inputIdx_requestCharReceived != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_requestCharReceived)
or c_EPTF_HTTP_inputIdx_responseOctReceived != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_responseOctReceived)
or c_EPTF_HTTP_inputIdx_requestOctReceived != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_requestOctReceived)
or c_EPTF_HTTP_inputIdx_responseSocketError != f_EPTF_LGenBase_declareFsmEvent(c_EPTF_HTTP_myBName,c_EPTF_HTTP_inputName_responseSocketError)
)
{
f_EPTF_HTTP_error(%definitionId&": error");
mtc.stop;
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_bindEntity4Behavior
//
// Purpose:
// Function to bind entity for the behaviour
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// <EPTF_IntegerList> - behaviour integer list
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_bindEntity4Behavior(
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
return EPTF_IntegerList
{
var integer vl_EPTF_HTTP_index := sizeof(v_EPTF_HTTP_contexts);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_index] := c_EPTF_HTTP_initCtx;
return {vl_EPTF_HTTP_index};
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setContentGetterFunction4Entity
//
// Purpose:
// Function to set content getter function to the entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_contentGetter - *in* <EPTF_HTTP_bodyContentGetter_FT> - the content getter function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setContentGetterFunction4Entity(
in integer pl_eIdx,
in EPTF_HTTP_bodyContentGetter_FT pl_contentGetter)
runs on EPTF_HTTP_LGen_CT {
v_EPTF_HTTP_contexts[pl_eIdx].contentGetterFn := pl_contentGetter;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setContentGetterFunction4Entities
//
// Purpose:
// Function to set content getter function to the entities
//
// Parameters:
// pl_contentGetter - *in* <EPTF_HTTP_bodyContentGetter_FT> - the content getter function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setContentGetterFunction4Entities(
in EPTF_HTTP_bodyContentGetter_FT pl_contentGetter)
runs on EPTF_HTTP_LGen_CT {
for (var integer i := 0; i < sizeof(v_EPTF_HTTP_contexts); i := i + 1) {
v_EPTF_HTTP_contexts[i].contentGetterFn := pl_contentGetter;
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setHeaderContentGetterFunction4Entity
//
// Purpose:
// Function to set header content getter function to the entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_headerContentGetter - *in* <EPTF_HTTP_headerContentGetter_FT> - the header content getter function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setHeaderContentGetterFunction4Entity(
in integer pl_eIdx,
in EPTF_HTTP_headerContentGetter_FT pl_headerContentGetter)
runs on EPTF_HTTP_LGen_CT {
v_EPTF_HTTP_contexts[pl_eIdx].headerGetterFn := pl_headerContentGetter;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setHeaderContentGetterFunction4Entities
//
// Purpose:
// Function to set header content getter function to the entities
//
// Parameters:
// pl_headerContentGetter - *in* <EPTF_HTTP_headerContentGetter_FT> - the header content getter function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setHeaderContentGetterFunction4Entities(
in EPTF_HTTP_headerContentGetter_FT pl_headerContentGetter)
runs on EPTF_HTTP_LGen_CT {
for (var integer i := 0; i < sizeof(v_EPTF_HTTP_contexts); i := i + 1) {
v_EPTF_HTTP_contexts[i].headerGetterFn := pl_headerContentGetter;
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setRawHeaderContentGetterFunction4Entity
//
// Purpose:
// Function to set raw header content getter function to the entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
// pl_rawHeaderContentGetter - *in* <EPTF_HTTP_rawHeaderContentGetter_FT> - the raw header content getter function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setRawHeaderContentGetterFunction4Entity(
in integer pl_eIdx,
in EPTF_HTTP_rawHeaderContentGetter_FT pl_rawHeaderContentGetter)
runs on EPTF_HTTP_LGen_CT {
v_EPTF_HTTP_contexts[pl_eIdx].rawHeaderGetterFn := pl_rawHeaderContentGetter;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setRawHeaderContentGetterFunction4Entities
//
// Purpose:
// Function to set raw header content getter function to the entities
//
// Parameters:
// pl_rawHeaderContentGetter - *in* <EPTF_HTTP_rawHeaderContentGetter_FT> - the raw header content getter function
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setRawHeaderContentGetterFunction4Entities(
in EPTF_HTTP_rawHeaderContentGetter_FT pl_rawHeaderContentGetter)
runs on EPTF_HTTP_LGen_CT {
for (var integer i := 0; i < sizeof(v_EPTF_HTTP_contexts); i := i + 1) {
v_EPTF_HTTP_contexts[i].rawHeaderGetterFn := pl_rawHeaderContentGetter;
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_unbindEntity4Behavior
//
// Purpose:
// Function to unbind entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_unbindEntity4Behavior(
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT {
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_resetEntity4Behavior
//
// Purpose:
// Function to reset entity
//
// Parameters:
// pl_eIdx - *in* *integer* - entity index
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_resetEntity4Behavior(
in integer pl_eIdx)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_EPTF_HTTP_myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[vl_EPTF_HTTP_myCtx] := {
method := "",
uri:= "",
headerLinesIdx := -1
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_initializeExtendedComponents
//
// Purpose:
// Function to initialize the extended components
//
// Parameters:
// pl_selfName - *charstring* - component self name
// pl_numEntities - *integer* - number of entities
// pl_entityNamePrefix - *charstring* - entity name prefix
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_initializeExtendedComponents(
in charstring pl_selfName,
in integer pl_numEntities := 0,
in charstring pl_entityNamePrefix)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_LGenBase_init(pl_selfName,pl_numEntities,pl_entityNamePrefix);
f_EPTF_Var_init_CT(pl_selfName);
f_EPTF_Logging_init_CT(pl_selfName);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_existHeaderLines
//
// Purpose:
// Check if header lines exist in header lines database
//
// Parameters:
// pl_headerLines - *in* <HeaderLines> - header lines to check
//
// Return Value:
// *integer* - database index if header lines exist, otherwise -1
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_existHeaderLines(
in HeaderLines pl_headerLines)
runs on EPTF_HTTP_LGen_CT
return integer
{
for (var integer i := 0; i < sizeof(v_EPTF_HTTP_headerLinesList); i := i + 1){
if (pl_headerLines == v_EPTF_HTTP_headerLinesList[i]) {
return i;
}
}
return -1;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setAuthDetails4Entity
//
// Purpose:
// Function to set authorization details for entity such as password
//
// Parameters:
// pl_eIdx - *integer* - entity index
// pl_algorithm - *charstring* - used algorithm eg: MD5
// pl_password - *charstring* - used password
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// This function can be used to set authorization details for entity such as password, algorithm...
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setAuthDetails4Entity(
in integer pl_eIdx,
in charstring pl_algorithm,
in charstring pl_password)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_eIdx);
v_EPTF_HTTP_contexts[myCtx].authDetails.algorithm := pl_algorithm;
v_EPTF_HTTP_contexts[myCtx].authDetails.password := pl_password;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getHeaderIndex
//
// Purpose:
// This function retrieves the index of a given header
//
// Parameters:
// pl_headerName - *in* *charstring* - the name of the header
// pl_headerList - *inout* <HeaderLines> - the HTTP header
//
// Return Value:
// *integer* - the header index
//
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getHeaderIndex(
in charstring pl_headerName,
inout HeaderLines pl_headerList)
return integer
{
var integer vl_headerIdx := -1;
var integer vl_headers := sizeof(pl_headerList);
for(var integer i := 0; i < vl_headers; i:=i+1)
{
if (pl_headerList[i].header_name == pl_headerName) {
vl_headerIdx := i;
break;
}
}
return vl_headerIdx;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_isWhiteSpace
//
// Purpose:
// Function to decide wether a character is a whitespace.
//
// Parameters:
// pl_char - *in* *integer* - the character
//
// Return Value:
// *boolean* - the result
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_isWhiteSpace(
in integer pl_char)
return boolean{
return (pl_char == 32 /* SP */ or pl_char == 9 /* TAB */);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_isWSBeforeEq
//
// Purpose:
// Function to decide wether a whitespace is before an equal sign.
//
// Parameters:
// pl_char - *in* *integer* - the whistspace character
//
// Return Value:
// *boolean* - the result
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_isWSBeforeEq(
in charstring pl_string,
inout integer pl_pos,
out charstring pl_segment)
return boolean
{
pl_segment := "";
while (pl_pos<lengthof(pl_string)) {
var integer ch := char2int(pl_string[pl_pos]);
pl_segment := pl_segment & int2char(ch);
if (not f_EPTF_HTTP_isWhiteSpace(ch)) {
if (ch == 61 /* = */) {
return true;
} else {
return false;
}
}
pl_pos:=pl_pos+1;
}
return false;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getNextAttribute
//
// Purpose:
// Function to process the next header field parameter.
//
// Parameters:
// pl_char - *in* *integer* - the whistspace character
// pl_authenticateHeader - *in* *charstring* - the header field string
// pl_pos - *inout* *integer* - the actual position in the proccessing
// pl_errpos - *out* *integer* - the character position where the error occured
// pl_key - *out* *charstring* - the recevied parameter key
// pl_value - *out* *charstring* - the recevied parameter value
//
// Return Value:
// *boolean* - true if there is more parameters
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_getNextAttribute(
in charstring pl_authenticateHeader,
inout integer pl_pos,
out integer pl_errpos,
out charstring pl_key,
out charstring pl_value)
return boolean{
const integer cl_WSKEY := 0;
const integer cl_KEY := 1;
const integer cl_EQ := 2;
const integer cl_WSVALUE := 3;
const integer cl_VALUE := 4;
const integer cl_WSCOMMA := 5;
var integer vl_state := cl_WSKEY;
var boolean vl_woqoute := false;
pl_key := "";
pl_value := "";
pl_errpos := -1;
for(var integer i:=pl_pos; i<lengthof(pl_authenticateHeader); i:=i+1) {
// action("pl_authenticateHeader[",i,"] := ", pl_authenticateHeader[i])
var integer ch := char2int(pl_authenticateHeader[i]);
select (vl_state) {
case (cl_WSKEY) {
if (not f_EPTF_HTTP_isWhiteSpace(ch)) {
vl_state := cl_KEY;
pl_key := pl_key & int2char(ch);
}
} case (cl_KEY) {
if (f_EPTF_HTTP_isWhiteSpace(ch)) {
var charstring vl_segment;
if (f_EPTF_HTTP_isWSBeforeEq(pl_authenticateHeader, i, vl_segment)) {
// action("f_isWSBeforeEq():true -> ", vl_segment);
vl_state := cl_WSVALUE;
} else {
// action("f_isWSBeforeEq():false -> ", vl_segment);
pl_key := pl_key & vl_segment;
}
} else if (ch == 61 /* = */) {
vl_state := cl_EQ;
} else {
pl_key := pl_key & int2char(ch);
}
} case (cl_EQ) {
if (f_EPTF_HTTP_isWhiteSpace(ch)) {
vl_state := cl_WSVALUE;
} else if (ch==34 /* " */) {
vl_state := cl_VALUE;
} else if (ch==44 /* , */) {
pl_pos := i+1;
return true;
} else {
vl_woqoute := true; // value wo qoute
pl_value := pl_value & int2char(ch);
vl_state := cl_VALUE;
}
} case (cl_WSVALUE) {
if (ch == 34 /* " */) {
vl_state := cl_VALUE;
} else if (ch == 44 /* , */) {
pl_pos := i+1;
return true;
} else if (not f_EPTF_HTTP_isWhiteSpace(ch)) {
vl_woqoute := true; // value wo qoute
pl_value := pl_value & int2char(ch);
vl_state := cl_VALUE;
}
} case (cl_VALUE) {
if (vl_woqoute) {
if (ch == 44 /* , */) {
pl_pos := i+1;
return true;
} else {
pl_value := pl_value & int2char(ch);
}
} else {
if (ch == 34 /* " */) {
vl_state := cl_WSCOMMA;
} else {
pl_value := pl_value & int2char(ch);
}
}
} case (cl_WSCOMMA) {
if (ch == 44 /* , */) {
pl_pos := i+1;
return true;
}
}
}
}
// action ("pl_key := ", pl_key, "; pl_value := ", pl_value);
return false;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_setAuthorizationDataToContextFromMessage
//
// Purpose:
// This function acquires authentication data from a message
//
// Parameters:
// pl_myCtx - *in* *integer* - the index of the context
// pl_authHeader - *in* *charstring* - authentication header
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_setAuthorizationDataToContextFromMessage(
in integer pl_myCtx,
in charstring pl_authHeader)
runs on EPTF_HTTP_LGen_CT
{
var boolean vl_hasParameter := false;
var integer vl_pos := 0;
var integer vl_errpos := 0;
var charstring vl_key := "";
var charstring vl_value := "";
do
{
vl_hasParameter := f_EPTF_HTTP_getNextAttribute(pl_authHeader, vl_pos, vl_errpos, vl_key, vl_value);
if (vl_errpos != -1) {
f_EPTF_Logging_warning(tsp_EPTF_HTTP_logEnabled,%definitionId&
": Parsing WWW-Authenticate header failed on position: "&
int2str(vl_errpos)&" in """&pl_authHeader&"""");
}
if (vl_key == "Digest realm"){
v_EPTF_HTTP_contexts[pl_myCtx].authDetails.realm := vl_value;
} else if (vl_key == "qop"){
v_EPTF_HTTP_contexts[pl_myCtx].authDetails.qop := vl_value;
} else if (vl_key == "nonce"){
v_EPTF_HTTP_contexts[pl_myCtx].authDetails.nonce := vl_value;
} else if (vl_key == "opaque"){
v_EPTF_HTTP_contexts[pl_myCtx].authDetails.opaque := vl_value;
}
} while ( vl_hasParameter )
f_EPTF_HTTP_debug(%definitionId&
": Authentication data stored: realm -> " &
v_EPTF_HTTP_contexts[pl_myCtx].authDetails.realm &
" qop-> "&v_EPTF_HTTP_contexts[pl_myCtx].authDetails.qop &
" nonce-> "&v_EPTF_HTTP_contexts[pl_myCtx].authDetails.nonce &
" opaque-> "&v_EPTF_HTTP_contexts[pl_myCtx].authDetails.opaque);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_createAuthorizationDataFromMessage
//
// Purpose:
// This function generates the authorization data header
//
// Parameters:
// pl_myCtx - *in* *integer* - the index of the context
// pl_userName - *in* *charstring* - the username
// pl_requestUri - *in* *charstring* - HTTP requestUri
// pl_method - *charstring* - HTTP method
//
// Return Value:
// *charstring* - the generated authorization data
//
// Errors:
// -
//
// Detailed Comments:
// This function generates the authorization data to the header if the authorization details exists
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_createAuthorizationDataFromMessage(
in integer pl_myctx)
runs on EPTF_HTTP_LGen_CT
{
var integer vl_hIdx := -1;
if (ischosen(v_EPTF_HTTP_incomingMessage.response))
{
vl_hIdx := f_EPTF_HTTP_getHeaderIndex("WWW-Authenticate",
v_EPTF_HTTP_incomingMessage.response.header);
if (vl_hIdx != -1) {
f_EPTF_HTTP_setAuthorizationDataToContextFromMessage(pl_myctx,
v_EPTF_HTTP_incomingMessage.response.header[vl_hIdx].header_value);
}
}
else {
vl_hIdx := f_EPTF_HTTP_getHeaderIndex("WWW-Authenticate",
v_EPTF_HTTP_incomingMessage.response_binary.header);
if (vl_hIdx != -1) {
f_EPTF_HTTP_setAuthorizationDataToContextFromMessage(pl_myctx,
v_EPTF_HTTP_incomingMessage.response_binary.header[vl_hIdx].header_value);
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_createAuthorizationData
//
// Purpose:
// This function generates the authorization data header
//
// Parameters:
// pl_myCtx - *in* *integer* - the index of the context
// pl_userName - *in* *charstring* - the username
// pl_requestUri - *in* *charstring* - HTTP requestUri
// pl_method - *charstring* - HTTP method
//
// Return Value:
// *charstring* - the generated authorization data
//
// Errors:
// -
//
// Detailed Comments:
// This function generates the authorization data to the header if the authorization details exists
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_createAuthorizationData(
in integer pl_myCtx,
in charstring pl_userName,
in charstring pl_requestUri,
in charstring pl_method)
runs on EPTF_HTTP_LGen_CT return charstring
{
// MD5 hash of empty entity body for qop=auth, for qop=auth-int a new hash for the body must be calculated).
const charstring hEntity := ""; //"d41d8cd98f00b204e9800998ecf8427e"; //hash for empty string
var charstring cnonce := "01234567890abcdef01234567890abcdef";
var charstring realm := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.realm;
var charstring qop := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.qop;
var charstring nonce := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.nonce;
var charstring opaque := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.opaque;
var charstring password := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.password;
var charstring algorithm := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.algorithm;
var charstring nonceCount := v_EPTF_HTTP_contexts[pl_myCtx].authDetails.nonceCount;
v_EPTF_HTTP_contexts[pl_myCtx].authDetails.nonceCount := f_putInLowercase(
hex2str(int2hex( hex2int( str2hex(nonceCount) ) + 1, 8 ) )); //nonce count +1
var charstring response := f_calculateDigestResponse(
nonce, cnonce, pl_userName, realm, password, algorithm, nonceCount,
pl_method, qop, pl_requestUri, hEntity);
var charstring vl_authData :=
"Authorization: Digest username=\""&pl_userName&"\""&
", realm=\""&realm&"\""&
", nonce=\""&nonce&"\""&
", uri=\""&pl_requestUri&"\""&
", response=\""&response&"\"";
if(algorithm != "") { vl_authData := vl_authData & ", algorithm=\""&algorithm&"\"" }
vl_authData := vl_authData &
", qop="&qop& // qop is without quotes, see rfc
", nc="&nonceCount& // nc is without quotes, see rfc
", cnonce=\""&cnonce&"\""&
", opaque=\""&opaque&"\"" &
"\r\n";
f_EPTF_HTTP_debug(%definitionId & "Authorization data: " &
vl_authData);
return vl_authData;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_contentLength
//
// Purpose:
// Function to calculate the length of the given string
//
// Parameters:
// p_str - *in* *charstring* - content
//
// Return Value:
// *charstring* - the length of the content in charstring
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_contentLength (
in charstring p_str)
return charstring
{
return int2str(lengthof(p_str));
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_encodeHeader
//
// Purpose:
// Function to encode header
//
// Parameters:
// pl_myCtx - *in* *integer* - the index of the context
// pl_templSetIdx - *in* *integer* - the index of the template set
// pl_templItemIdxHeader - *in* *integer* - the index of the template item holding the header
// pl_content_length - *in* *charstring* - content length
// pl_headerOct - *inout* *octetstring* - encoded header
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_encodeHeader(
in integer pl_myCtx,
in integer pl_templSetIdx,
in integer pl_templItemIdxHeader,
in charstring pl_content_length,
inout octetstring pl_headerOct)
runs on EPTF_HTTP_LGen_CT
{
var boolean isRawheader := (v_EPTF_HTTP_contexts[pl_myCtx].rawHeaderGetterFn != null) and
isvalue(v_EPTF_HTTP_contexts[pl_myCtx].rawHeaderGetterFn);
var boolean isExternalTemplate := pl_templItemIdxHeader > -1;
var charstring vl_method := v_EPTF_HTTP_contexts[pl_myCtx].method;
var charstring vl_uri := v_EPTF_HTTP_contexts[pl_myCtx].uri;
var charstring vl_version_major := int2str(v_EPTF_HTTP_contexts[pl_myCtx].version_major);
var charstring vl_version_minor := int2str(v_EPTF_HTTP_contexts[pl_myCtx].version_minor);
var HeaderLines vl_headerlines;
if(isExternalTemplate)
{
var charstring vl_context_header := "";
var charstring vl_message_header;
// custom header from entity context
f_EPTF_HTTP_getHeaderForEntity(pl_myCtx, vl_headerlines);
for(var integer i := 0; i < sizeof(vl_headerlines); i := i + 1)
{
if(vl_headerlines[i].header_name == "" or vl_headerlines[i].header_value == "") { continue;}
vl_context_header := vl_context_header &
vl_headerlines[i].header_name & ": " &
vl_headerlines[i].header_value;
// There is a newline character after the customHeader parameter in each template.
if(i < sizeof(vl_headerlines) - 1)
{
vl_context_header := vl_context_header & "\n";
}
} // => $(customHeader) + \n
v_boolNoWarningLG := f_EPTF_LGenBase_getTemplateContentFast(pl_templSetIdx, pl_templItemIdxHeader,
{ vl_method, vl_uri, vl_version_major, vl_version_minor, vl_context_header, pl_content_length },
vl_message_header );
//external template resolves crlf conversion
//vl_message_header := f_replaceEveryOccurenceOfSubstring(vl_message_header,"\n","\r\n");
pl_headerOct := char2oct(vl_message_header);
f_EPTF_Logging_debug(v_EPTF_HTTP_logEnabled,
%definitionId&": "&
"SendMessage, header: "&vl_message_header);
}
else if(isRawheader)
{
f_EPTF_HTTP_getRawHeaderForEntity(pl_myCtx, pl_headerOct);
}
else // inner template
{
f_EPTF_HTTP_getHeaderForEntity(pl_myCtx, vl_headerlines);
if (pl_content_length != "0") {
vl_headerlines[sizeof(vl_headerlines)] := { "Content-Length", pl_content_length };
}
var HTTPMessage vl_outgoingMessage := valueof(t_EPTF_HTTP_HTTPdistr_request(
vl_method,
vl_uri,
v_EPTF_HTTP_contexts[pl_myCtx].version_major,
v_EPTF_HTTP_contexts[pl_myCtx].version_minor,
vl_headerlines,
""
));
var octetstring temp := enc_HTTPMessage(vl_outgoingMessage);
// cutting trailing /r/n
pl_headerOct := substr(temp, 0, lengthof(temp)-2);
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_encodeHeaderResponse
//
// Purpose:
// Encodes response header.
//
// Parameters:
// pl_myCtx - *in* *integer* - the index of the context
// pl_templSetIdx - *in* *integer* - the index of the template set
// pl_templItemIdxHeader - *in* *integer* - the index of the template item holding the header
// pl_content_length - *in* *charstring* - content length
// pl_headerOct - *inout* *octetstring* - encoded header
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_encodeHeaderResponse(
in integer pl_myCtx,
in integer pl_templSetIdx,
in integer pl_templItemIdxHeader,
in charstring pl_content_length,
inout octetstring pl_headerOct,
in EPTF_CharstringList pl_optParams := {})
runs on EPTF_HTTP_LGen_CT
{
var boolean isRawheader := (v_EPTF_HTTP_contexts[pl_myCtx].rawHeaderGetterFn != null) and
isvalue(v_EPTF_HTTP_contexts[pl_myCtx].rawHeaderGetterFn);
var boolean isExternalTemplate := pl_templItemIdxHeader > -1;
if(isExternalTemplate)
{
var charstring vl_version_major := int2str(v_EPTF_HTTP_contexts[pl_myCtx].version_major);
var charstring vl_version_minor := int2str(v_EPTF_HTTP_contexts[pl_myCtx].version_minor);
var charstring vl_status := int2str(v_EPTF_HTTP_contexts[pl_myCtx].statusCode) & " " & v_EPTF_HTTP_contexts[pl_myCtx].statusText;
var charstring vl_message_header;
var EPTF_CharstringList vl_paramListDef := { vl_status, vl_version_major, vl_version_minor, pl_content_length } ;
var EPTF_CharstringList vl_paramListOpt
if(pl_optParams == {}) {
vl_paramListOpt := v_EPTF_HTTP_optionalTempParams;
}
else {
vl_paramListOpt := pl_optParams;
}
v_boolNoWarningLG := f_EPTF_LGenBase_getTemplateContentFast(pl_templSetIdx, pl_templItemIdxHeader,
vl_paramListDef & vl_paramListOpt,
vl_message_header );
pl_headerOct := char2oct(vl_message_header);
f_EPTF_Logging_debug(v_EPTF_HTTP_logEnabled,
%definitionId&": "&
"SendMessage, header: "&vl_message_header);
return;
}
if(isRawheader)
{
f_EPTF_HTTP_getRawHeaderForEntity(pl_myCtx, pl_headerOct);
return;
}
var HeaderLines vl_headerlines := {};
f_EPTF_HTTP_getHeaderForEntity(pl_myCtx, vl_headerlines);
if (pl_content_length != "0") {
vl_headerlines[sizeof(vl_headerlines)] := { "Content-Length", pl_content_length };
}
var HTTPMessage vl_outgoingMessage := {
response :={
client_id := omit,
version_major := v_EPTF_HTTP_contexts[pl_myCtx].version_major,
version_minor := v_EPTF_HTTP_contexts[pl_myCtx].version_minor,
statuscode := v_EPTF_HTTP_contexts[pl_myCtx].statusCode,
statustext := v_EPTF_HTTP_contexts[pl_myCtx].statusText,
header := vl_headerlines,
body := ""
}
}
var octetstring temp := enc_HTTPMessage(vl_outgoingMessage);
// cutting trailing /r/n
pl_headerOct := substr(temp, 0, lengthof(temp)-2);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_encodeBody
//
// Purpose:
// Function to encode body
//
// Parameters:
// pl_myCtx - *in* *integer* - the index of the context
// pl_templSetIdx - *in* *integer* - the index of the template set
// pl_templItemIdxBody - *in* *integer* - the index of the template item holding the body
// pl_content_length - *inout* *charstring* - content length
// pl_bodyOct - *inout* *octetstring* - encoded body
// pl_templParamList - *in* *EPTF_CharstringList* - extra optional parameters for the body template
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_encodeBody(
in integer pl_myCtx,
in integer pl_templSetIdx,
in integer pl_templItemIdxBody,
inout charstring pl_content_length,
inout octetstring pl_bodyOct,
in EPTF_CharstringList pl_templParamList := {})
runs on EPTF_HTTP_LGen_CT
{
var boolean isExternalTemplate := pl_templItemIdxBody > -1;
if(isExternalTemplate)
{
var charstring vl_message_body;
v_boolNoWarningLG := f_EPTF_LGenBase_getTemplateContentFast(pl_templSetIdx, pl_templItemIdxBody,
pl_templParamList, vl_message_body );
//external template resolves crlf conversion
//vl_message_body := f_replaceEveryOccurenceOfSubstring(vl_message_body,"\n","\r\n");
pl_bodyOct := char2oct(vl_message_body);
pl_content_length := int2str(lengthof(pl_bodyOct));
}
else // inner template
{
var EPTF_HTTP_CharOrOct vl_body;
f_EPTF_HTTP_getBodyContentForEntity(pl_myCtx, vl_body);
if (ischosen(vl_body.charVal))
{
pl_bodyOct := char2oct(vl_body.charVal);
}
else
{
pl_bodyOct := vl_body.octVal;
}
pl_content_length := int2str(lengthof(pl_bodyOct));
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getNonceValue
//
// Purpose:
// Generates a nonce value.
//
// Parameters:
// pl_authData - *inout* <EPTF_HTTP_AuthData> - the generated nonce values
//
// Return value:
// charstring - nonce value
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getNonceValue(inout EPTF_HTTP_AuthDataServer pl_authData)
return charstring
{
if (0 == sizeof(pl_authData.nonceValues))
{
return "";
}
var integer vl_currentNonce := pl_authData.currentNonce;
pl_authData.currentNonce := (pl_authData.currentNonce + 1) mod sizeof(pl_authData.nonceValues);
return pl_authData.nonceValues[vl_currentNonce];
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_getAuthParams
//
// Purpose:
// Retrieves the authentication data from the Authorization request header.
//
// Parameters:
// pl_authData - *in* *charstring* - the Authorization header value
// pl_authParams - *inout* <EPTF_HTTP_AuthDetails> - the retreived paramters
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_getAuthParams(in charstring pl_authData, inout EPTF_HTTP_AuthDetails pl_authParams)
{
var EPTF_CharstringList vl_list := {};
var EPTF_CharstringList vl_paramValues := {};
var EPTF_HTTP_ParamValue_List vl_params := {};
var charstring vl_paramValue := "";
f_EPTF_HTTP_Tokenize(pl_authData, " ,", vl_list);
for (var integer i := 0; i < sizeof(vl_list); i := i + 1)
{
f_EPTF_HTTP_Tokenize(vl_list[i], "=", vl_paramValues);
if (sizeof(vl_paramValues) == 1)
{
vl_params[sizeof(vl_params)] := {vl_paramValues[0], ""};
}else
{
vl_paramValue := vl_paramValues[1];
if (lengthof(vl_paramValue) > 2)
{
if ("\"" == vl_paramValue[0] and "\"" == vl_paramValue[lengthof(vl_paramValue) - 1])
{
vl_paramValue := substr(vl_paramValue, 1, lengthof(vl_paramValue) - 2);
}
}else{
vl_paramValue := "";
}
vl_params[sizeof(vl_params)] := {vl_paramValues[0], vl_paramValue};
}
vl_paramValues := {}
}
for (var integer i := 0; i < sizeof(vl_params); i := i + 1)
{
if ("nonce" == vl_params[i].paramName)
{
pl_authParams.nonce := vl_params[i].paramValue;
continue;
}
if ("algorithm" == vl_params[i].paramName)
{
pl_authParams.algorithm := vl_params[i].paramValue;
continue;
}
if ("cnonce" == vl_params[i].paramName)
{
pl_authParams.cnonce := vl_params[i].paramValue;
continue;
}
if ("nc" == vl_params[i].paramName)
{
pl_authParams.nonceCount := vl_params[i].paramValue;
continue;
}
if ("realm" == vl_params[i].paramName)
{
pl_authParams.realm := vl_params[i].paramValue;
continue;
}
if ("qop" == vl_params[i].paramName)
{
pl_authParams.qop := vl_params[i].paramValue;
continue;
}
if ("response" == vl_params[i].paramName)
{
pl_authParams.response := vl_params[i].paramValue;
continue;
}
if ("uri" == vl_params[i].paramName)
{
pl_authParams.uri := vl_params[i].paramValue;
continue;
}
if ("username" == vl_params[i].paramName)
{
pl_authParams.username := vl_params[i].paramValue;
continue;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_Tokenize
//
// Purpose:
// Breaks a string into a sequence of tokens, each of which is delimited by
// one or more characters.
//
// Parameters:
// pl_string - *in* *charstring* - the string to break into tokens
// pl_delimiters - *in* *charstring* - the delimiter characters
// pl_tokens - *in* <EPTF_CharstringList> - the tokens
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_Tokenize(in charstring pl_string, in charstring pl_delimiters, inout EPTF_CharstringList pl_tokens)
{
var integer vl_state := 0; //0: not delim; 1: delim; 2: quoted
var boolean vl_isDelim := false;
var charstring vl_value := "";
for (var integer i := 0; i < lengthof(pl_string); i := i + 1)
{
vl_isDelim := false;
if (0 == vl_state)
{
for (var integer ii := 0; ii < lengthof(pl_delimiters) and not vl_isDelim; ii := ii + 1)
{
vl_isDelim := pl_delimiters[ii] == pl_string[i];
}
if (vl_isDelim)
{
if (vl_value != "")
{
pl_tokens[sizeof(pl_tokens)] := vl_value;
}
vl_state := 1
}else{
vl_value := vl_value & pl_string[i];
if (pl_string[i] == "\"")
{
vl_state := 2;
}
}
}else if (1 == vl_state)
{
for (var integer ii := 0; ii < lengthof(pl_delimiters) and not vl_isDelim; ii := ii + 1)
{
vl_isDelim := pl_delimiters[ii] == pl_string[i];
}
if (vl_isDelim)
{/*do nothing*/}
else{
vl_state := 0;
vl_value := pl_string[i];
if (pl_string[i] == "\"")
{
vl_state := 2;
}
}
}else if (2 == vl_state)
{
vl_value := vl_value & pl_string[i];
if (pl_string[i] == "\"")
{
vl_state := 0;
}
}
}
if (vl_value != ""){pl_tokens[sizeof(pl_tokens)] := vl_value;}
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_generateNonceValues
//
// Purpose:
// Generates nonce values for the server
//
// Parameters:
// pl_number - *in* *integer* - number of nonce values to generate
// pl_nonceValues - *in* <EPTF_CharstringList> - generated nonce values
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_generateNonceValues(in integer pl_number, inout EPTF_CharstringList pl_nonceValues)
{
for (var integer i := 0; i < pl_number; i := i + 1)
{
pl_nonceValues[sizeof(pl_nonceValues)] := f_calculateMD5(int2str(f_time()));
}
}
} //EPTF_HTTP_PrivateFunctions
///////////////////////////////////////////////////////////////////////////////
// Group: EPTF_HTTP_TestSteps
//
// Purpose:
// The functions of the EPTF HTTP Test Steps
//
// Test Steps:
// f_EPTF_HTTP_step_handleTimeout -
// f_EPTF_HTTP_step_sendRequest -
// f_EPTF_HTTP_step_closePortOfUser -
// f_EPTF_HTTP_step_freePortOfUser -
// f_EPTF_HTTP_step_processResponse -
// f_EPTF_HTTP_step_sendConnect -
// f_EPTF_HTTP_step_sendClose -
// f_EPTF_HTTP_step_sendHalfClose -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodCONNECT -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodDELETE -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodGET -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodHEAD -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodOPTIONS -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodPOST -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodPUT -
// f_EPTF_HTTP_step_setEntityContextHTTPMethodTRACE -
// f_EPTF_HTTP_step_handleRequest -
// f_EPTF_HTTP_step_sendResponse -
// f_EPTF_HTTP_step_closePort -
// f_EPTF_HTTP_step_cleanUp -
//
//
///////////////////////////////////////////////////////////////////////////////
group EPTF_HTTP_TestSteps
{
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_handleTimeout
//
// Purpose:
// This function implements handle timeout test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_handleTimeout(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
var integer fCtx := pl_ptr.refContext.fCtxIdx;
f_EPTF_HTTP_debug(%definitionId&
": Timed Out: cIdx-> "&int2str(myCtx)&
" fCtx-> "&int2str(fCtx));
// Update The Statistics
// Delete the entity context and databases
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_sendRequest
//
// Purpose:
// This function implements send request test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// stepArgs first element holds the desired callType
// stepArgs second element holds the fsm to report events up
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_sendRequest(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
var integer fCtx := pl_ptr.refContext.fCtxIdx;
var integer vl_connId := v_EPTF_HTTP_contexts[myCtx].connId; // port group id
var integer vl_templSetIdx := f_EPTF_LGenBase_templateSetIdxOfStep(pl_ptr);
var integer vl_templItemIdxHeader := -1;
var integer vl_templItemIdxBody := -1;
var charstring vl_content_length;
var octetstring vl_outgoingMessage;
f_EPTF_HTTP_debug(%definitionId & ": " &
" myCtx-> "&int2str(myCtx)&
" pl_ptr.eIdx-> "&int2str(pl_ptr.eIdx)&
" fCtx-> "&int2str(fCtx)//&
//" vl_tcIdx-> "&int2str(vl_tcIdx)
);
if(vl_templSetIdx>-1) { // if template set exists
vl_templItemIdxHeader := f_EPTF_LGenBase_getTemplateItemIdxFromSet(
vl_templSetIdx, v_EPTF_HTTP_extTemplType_customHeader );
vl_templItemIdxBody := f_EPTF_LGenBase_getTemplateItemIdxFromSet(
vl_templSetIdx, v_EPTF_HTTP_extTemplType_customBody );
}
var octetstring vl_headerOct;
var octetstring vl_bodyOct;
f_EPTF_HTTP_encodeBody(myCtx, vl_templSetIdx, vl_templItemIdxBody, vl_content_length, vl_bodyOct);
f_EPTF_HTTP_encodeHeader(myCtx, vl_templSetIdx, vl_templItemIdxHeader, vl_content_length, vl_headerOct);
vl_outgoingMessage := vl_headerOct & '0D0A'O & vl_bodyOct;
f_EPTF_HTTP_debug(%definitionId & ": sending message: " &
log2str(vl_outgoingMessage));
//v_EPTF_HTTP_ConnId2EIdx[vl_connId] := pl_ptr.eIdx;
v_EPTF_HTTP_ConnId2FIdx[pl_ptr.eIdx] := pl_ptr.refContext.fCtxIdx;
f_EPTF_HTTP_debug(%definitionId & ": Entity and Fsm index: " &
int2str(pl_ptr.eIdx) & " / " &
int2str(v_EPTF_HTTP_ConnId2FIdx[pl_ptr.eIdx]) &
" set for connection id: " & int2str(vl_connId));
f_EPTF_HTTP_sendRequest(vl_connId,
v_EPTF_HTTP_EntityOffset + pl_ptr.eIdx,
vl_outgoingMessage);
v_EPTF_HTTP_contexts[myCtx].requestPending := true; // if request sent out, message is pending
f_EPTF_HTTP_updateStatistics(false, v_EPTF_HTTP_contexts[myCtx].method);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_sendResponse
//
// Purpose:
// This function implements send response test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_sendResponse(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
var integer fCtx := pl_ptr.refContext.fCtxIdx;
var integer vl_connId := v_EPTF_HTTP_contexts[myCtx].connId; // port group id
var integer vl_portId := v_EPTF_HTTP_contexts[myCtx].portId;
var integer vl_seqNum := v_EPTF_HTTP_contexts[myCtx].seqNum;
var integer vl_templSetIdx := f_EPTF_LGenBase_templateSetIdxOfStep(pl_ptr);
var integer vl_templItemIdxHeader := -1;
var integer vl_templItemIdxBody := -1;
var charstring vl_content_length;
var octetstring vl_outgoingMessage;
var octetstring vl_headerOct;
var octetstring vl_bodyOct;
f_EPTF_HTTP_debug(%definitionId & ": " &
" myCtx-> "&int2str(myCtx)&
" pl_ptr.eIdx-> "&int2str(pl_ptr.eIdx)&
" fCtx-> "&int2str(fCtx)//&
//" vl_tcIdx-> "&int2str(vl_tcIdx)
);
if(vl_templSetIdx>-1) { // if template set exists
vl_templItemIdxHeader := f_EPTF_LGenBase_getTemplateItemIdxFromSet(
vl_templSetIdx, v_EPTF_HTTP_extTemplType_customHeaderResponse );
vl_templItemIdxBody := f_EPTF_LGenBase_getTemplateItemIdxFromSet(
vl_templSetIdx, v_EPTF_HTTP_extTemplType_customBody );
}
f_EPTF_HTTP_encodeBody(myCtx, vl_templSetIdx, vl_templItemIdxBody, vl_content_length, vl_bodyOct);
f_EPTF_HTTP_encodeHeaderResponse(myCtx, vl_templSetIdx, vl_templItemIdxHeader, vl_content_length, vl_headerOct);
vl_outgoingMessage := vl_headerOct & '0D0A'O & vl_bodyOct;
f_EPTF_HTTP_debug(%definitionId & ": sending message: " &
log2str(vl_outgoingMessage));
f_EPTF_HTTP_debug(%definitionId & ": Entity index: " &
int2str(pl_ptr.eIdx) &
" set for group id: " & int2str(vl_connId));
f_EPTF_HTTP_sendResponse(vl_connId,
vl_portId,
vl_seqNum,
vl_outgoingMessage);
f_EPTF_HTTP_updateStatistics(false, "", v_EPTF_HTTP_contexts[myCtx].statusCode);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_closePortOfUser
//
// Purpose:
// This function implements the close port of user test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_closePortOfUser(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
//var integer fCtx := pl_ptr.refContext.fCtxIdx;
//var integer vl_tcIdx := f_EPTF_LGenBase_tcIdxOfStep(pl_ptr);
var integer vl_connId := v_EPTF_HTTP_contexts[myCtx].connId; // port group id
f_EPTF_HTTP_debug(%definitionId & ": " &
" myCtx-> "&int2str(myCtx)//&
//" fCtx-> "&int2str(fCtx)&
//" vl_tcIdx-> "&int2str(vl_tcIdx)
);
f_EPTF_HTTP_closePortOfUser(vl_connId,
v_EPTF_HTTP_EntityOffset + pl_ptr.eIdx);
v_EPTF_HTTP_contexts[myCtx].requestPending := false;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_freePortOfUser
//
// Purpose:
// This function implements the free port of user test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_freePortOfUser(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
//var integer fCtx := pl_ptr.refContext.fCtxIdx;
//var integer vl_tcIdx := f_EPTF_LGenBase_tcIdxOfStep(pl_ptr);
var integer vl_connId := v_EPTF_HTTP_contexts[myCtx].connId; // port group id
f_EPTF_HTTP_debug(%definitionId & ": " &
" myCtx-> "&int2str(myCtx)//&
//" fCtx-> "&int2str(fCtx)&
//" vl_tcIdx-> "&int2str(vl_tcIdx)
);
f_EPTF_HTTP_freePortOfUser(vl_connId,
v_EPTF_HTTP_EntityOffset + pl_ptr.eIdx);
v_EPTF_HTTP_contexts[myCtx].requestPending := false;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_processResponse
//
// Purpose:
// This function implements processing of HTTP responses
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_processResponse(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
f_EPTF_HTTP_debug(%definitionId &
": Request arrived for entity context: " & int2str(myCtx));
//var integer fCtx := pl_ptr.refContext.fCtxIdx;
//var integer vl_tcIdx := f_EPTF_LGenBase_tcIdxOfStep(pl_ptr);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_sendConnect
//
// Purpose:
// This function implements connect request test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_sendConnect(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
v_boolNoWarningLG :=
f_EPTF_HTTP_openConnection(v_EPTF_HTTP_contexts[myCtx].connId, v_EPTF_HTTP_EntityOffset + pl_ptr.eIdx);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_sendClose
//
// Purpose:
// This function implements close request test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_sendClose(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
f_EPTF_HTTP_closeConnection(v_EPTF_HTTP_contexts[myCtx].connId);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_sendHalfClose
//
// Purpose:
// This function implements half close request test step
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_sendHalfClose(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer myCtx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
f_EPTF_HTTP_closeHalfConnection(v_EPTF_HTTP_contexts[myCtx].connId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_handleRequest
//
// Purpose:
// Handles the incoming HTTP requests
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Detailed Comments:
// Handles the following events: c_EPTF_HTTP_inputIdx_requestCharReceived,
// c_EPTF_HTTP_inputIdx_requestOctReceived.
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_handleRequest(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer v_ctx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
v_EPTF_HTTP_contexts[v_ctx].httpMessage := v_EPTF_HTTP_incomingMessage;
v_EPTF_HTTP_contexts[v_ctx].connId := v_EPTF_HTTP_lastReceivedGroupId;
v_EPTF_HTTP_contexts[v_ctx].portId := v_EPTF_HTTP_lastReceivedPortId;
v_EPTF_HTTP_contexts[v_ctx].seqNum := v_EPTF_HTTP_lastReceivedSeqNum;
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodCONNECT
//
// Purpose:
// This function sets the HTTP method of the entity context to CONNECT.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodCONNECT(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "CONNECT");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodDELETE
//
// Purpose:
// This function sets the HTTP method of the entity context to DELETE.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodDELETE(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "DELETE");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodGET
//
// Purpose:
// This function sets the HTTP method of the entity context to GET.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodGET(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "GET");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodHEAD
//
// Purpose:
// This function sets the HTTP method of the entity context to HEAD.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodHEAD(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "HEAD");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodOPTIONS
//
// Purpose:
// This function sets the HTTP method of the entity context to OPTIONS.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodOPTIONS(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "OPTIONS");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodPOST
//
// Purpose:
// This function sets the HTTP method of the entity context to POST.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodPOST(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "POST");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodPUT
//
// Purpose:
// This function sets the HTTP method of the entity context to PUT.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodPUT(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "PUT");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_setEntityContextHTTPMethodTRACE
//
// Purpose:
// This function sets the HTTP method of the entity context to TRACE.
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_setEntityContextHTTPMethodTRACE(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, "TRACE");
}
///////////////////////////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_step_closePort
//
// Purpose:
// Test step wrapper for <f_EPTF_HTTP_closePort>
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_closePort(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
var integer v_ctx := f_EPTF_HTTP_getContextIndex(pl_ptr.eIdx);
f_EPTF_HTTP_closePort(v_EPTF_HTTP_contexts[v_ctx].connId, v_EPTF_HTTP_contexts[v_ctx].portId);
}
///////////////////////////////////////////////////////////////////////////////
// Function: EPTF_LGenBase_TestStepArgs
//
// Purpose:
// Test step wrapper for <f_EPTF_HTTP_cleanupContext>
//
// Parameters:
// pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
//
///////////////////////////////////////////////////////////////////////////////
function f_EPTF_HTTP_step_cleanUp(
in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_cleanupContext(pl_ptr.eIdx);
}
} //EPTF_HTTP_TestSteps
///////////////////////////////////////////////////////////////////////////////
// Group: EPTF_HTTP_DefaultFunctions
//
// Purpose:
// The functions of the EPTF HTTP Default Functions
//
///////////////////////////////////////////////////////////////////////////////
group EPTF_HTTP_DefaultFunctions {
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultSendRequest
//
// Purpose:
// This function is the default send request function
//
// Parameters:
// pl_Message - *in* <EPTF_HTTP_Message> - the outgoing HTTP message
// pl_result - *out* <Result> - the result of send
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultSendRequest(
in integer pl_connId,
in integer pl_sessionId,
in octetstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug(%definitionId&": "&
"You should set your sender function with f_EPTF_HTTP_setSendRequestFunction");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultConnectionOpen
//
// Purpose:
// This function is the default connection open function
//
// Parameters:
// pl_connId - *in* *integer* - the ID of the opened connection
// pl_sessionId - *in* *integer* - session id
//
// Return Value:
// *boolean* - success result of operation
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultConnectionOpen (
in integer pl_connId,
in integer pl_sessionId)
runs on EPTF_HTTP_LGen_CT return boolean
{
f_EPTF_HTTP_debug("Default Connection Open fucntion has been called");
return true;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultConnectionClose
//
// Purpose:
// This function is the default connection close function
//
// Parameters:
// pl_connId - *in* *integer* - the connection ID
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultConnectionClose (
in integer pl_connId)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug("Default Connection Close fucntion has been called");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultConnectionHalfClose
//
// Purpose:
// This function is the default connection half close function
//
// Parameters:
// pl_connId - *in* *integer* - the connection ID
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultConnectionHalfClose (
in integer pl_connId)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug("Default Connection Half Close function has been called");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultClosePortOfUser
//
// Purpose:
// This function is the default close port of user function
//
// Parameters:
// pl_groupId - *in* *integer* - group id
// pl_sessionId - *in* *integer* - session id
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultClosePortOfUser (
in integer pl_groupId,
in integer pl_sessionId)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug("Default Close Port of User function has been called");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultFreePortOfUser
//
// Purpose:
// This function is the default free port of user function
//
// Parameters:
// pl_groupId - *in* *integer* - group id
// pl_sessionId - *in* *integer* - session id
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultFreePortOfUser (
in integer pl_groupId,
in integer pl_sessionId)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug("Default Free Port of User function has been called");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultClosePort
//
// Purpose:
// This function is the default free port of user function
//
// Parameters:
// pl_groupId - *in* *integer* - group id
// pl_portId - *in* *integer* - session id
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultClosePort(
in integer pl_groupId,
in integer pl_portId)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug("Default connection close function has been called");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultSendResponse
//
// Purpose:
// This function is the default send response function
//
// Parameters:
// pl_groupId - *in* *integer* - group identifier to send the response
// pl_portId - *out* *integer* - unique port identifier in the port group
// pl_message - *out* *integer* - the message to send
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultSendResponse(
in integer pl_groupId,
in integer pl_portId,
in integer pl_seqNum,
in octetstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug(%definitionId&": "&
"You should set your sender function with f_EPTF_HTTP_setSendResponseFunction");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultListen
//
// Purpose:
// This function is the default listen function
//
// Parameters:
// pl_groupId - *in* *integer* - group identifier to send the response
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultListen(
in integer pl_groupId)
runs on EPTF_HTTP_LGen_CT
return integer
{
f_EPTF_HTTP_debug(%definitionId&": "&
"You should set your sender function with f_EPTF_HTTP_setListenFunction");
return -1;
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultSearch
//
// Purpose:
// The default context searching function
//
// Parameters:
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultSearch(
inout integer pl_eIdx,
inout integer pl_fsmCtx)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_HTTP_debug(%definitionId&": "&
"You should set your sender function with f_EPTF_HTTP_setSearchContextFunction");
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultCharstringBodyHandler
//
// Purpose:
// The default charstring body handler function
//
// Parameters:
// pl_eIdx - *in* *integer* - group id
// pl_bodyMessage - *in* *charstring* - the body message
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultCharstringBodyHandler (
in integer pl_eIdx,
in charstring pl_bodyMessage)
runs on EPTF_HTTP_LGen_CT
{
//f_EPTF_HTTP_debug(pl_bodyMessage);
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_defaultBinaryBodyHandler
//
// Purpose:
// The default binary body handler function
//
// Parameters:
// pl_eIdx - *in* *integer* - group id
// pl_bodyMessage - *in* *octetstring* - the body message
//
// Return Value:
// -
//
// Errors:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_defaultBinaryBodyHandler (
in integer pl_eIdx,
in octetstring pl_bodyMessage)
runs on EPTF_HTTP_LGen_CT
{
//f_EPTF_HTTP_debug(pl_bodyMessage);
}
function f_calculateMD5(in charstring pszHashInput)
return charstring
{
// implemented in a non-opensource TCC useful functions module
action("f_calculateMD5 not implemented!!");
return "";
}
function f_calculateDigestResponse(
charstring nonce,
charstring cnonce,
charstring user,
charstring realm,
charstring passwd,
charstring alg,
charstring nonceCount,
charstring method,
charstring qop,
charstring URI,
charstring HEntity) return charstring
{
// implemented in a non-opensource TCC useful functions module
action("f_calculateDigestResponse not implemented!!");
return "";
}
} //EPTF_HTTP_DefaultFunctions
///////////////////////////////////////////////////////////////////////////////
// Group: EPTF_HTTP_Logging
//
// Purpose:
// The functions of the EPTF HTTP Logging
//
///////////////////////////////////////////////////////////////////////////////
group EPTF_HTTP_Logging
{
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_error
//
// Purpose:
// Function to log an error from StatMeasure feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_error(
in @lazy charstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_Logging_errorV2(pl_message,
v_EPTF_HTTP_loggingMaskId,
{c_EPTF_HTTP_loggingClassIdx_Error});
f_EPTF_Base_stopAll();
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_warning
//
// Purpose:
// Function to log a warning from StatMeasure feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_warning(
in @lazy charstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_Logging_warningV2(pl_message,
v_EPTF_HTTP_loggingMaskId,
{c_EPTF_HTTP_loggingClassIdx_Warning});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_debug
//
// Purpose:
// Function to log a debug message from StatMeasure feature.
//
// Parameters:
// - pl_message - *in* *charstring* - the message to log
//
// Return Value:
// -
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_debug(
in @lazy charstring pl_message)
runs on EPTF_HTTP_LGen_CT
{
f_EPTF_Logging_debugV2(pl_message,
v_EPTF_HTTP_loggingMaskId,
{c_EPTF_HTTP_loggingClassIdx_Debug});
}
///////////////////////////////////////////////////////////
// Function: f_EPTF_HTTP_debugEnabled
//
// Purpose:
// Function to check if debug is enabled for StatMeasure
//
// Parameters:
// -
//
// Return Value:
// *boolean* - true if debug enalbed
//
// Errors & assertions:
// -
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
function f_EPTF_HTTP_debugEnabled()
runs on EPTF_HTTP_LGen_CT
return boolean
{
return f_EPTF_Logging_isEnabled(
v_EPTF_HTTP_loggingMaskId,
c_EPTF_HTTP_loggingClassIdx_Debug);
}
} // group Logging
}//end of module
with {
extension "version <RnXnn>"
}