| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // 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_MQTT_LGen_Definitions.ttcn |
| // Description: |
| // Rev: R1A |
| // Prodnr: CNL 113 860 |
| // Updated: 2017-09-01 |
| // Contact: http://ttcn.ericsson.se |
| /////////////////////////////////////////////////////////////////////////////// |
| module EPTF_MQTT_LocalTransport_Definitions |
| { |
| import from EPTF_MQTT_Transport_Definitions all; |
| import from EPTF_CLL_Base_Definitions all; |
| import from EPTF_CLL_Logging_Definitions all; |
| import from EPTF_CLL_FBQ_Definitions all; |
| import from EPTF_CLL_TransportCommPortIPL4_Definitions all; |
| import from EPTF_CLL_RBTScheduler_Definitions all; |
| import from IPL4asp_Types all; |
| |
| modulepar boolean tsp_EPTF_MQTT_LocalTransport_debug := false; |
| modulepar boolean tsp_EPTF_MQTT_LocalTransport_debugVerbose := false; |
| |
| const charstring c_MQTT_Transport_LGenType := "MQTT_Transport"; |
| |
| const integer c_MQTT_LocalTransport_Logging_WARNING := 0; |
| const integer c_MQTT_LocalTransport_Logging_DEBUG := 1; |
| const integer c_MQTT_LocalTransport_Logging_DEBUGV := 2; |
| const integer c_MQTT_LocalTransport_Logging_ERROR := 3; |
| |
| type component EPTF_MQTT_LocalTransport_CT extends EPTF_MQTT_Transport_Provider_CT, EPTF_Base_CT, EPTF_Logging_CT, EPTF_CommPort_IPL4_CT, EPTF_Scheduler_CT |
| { |
| var boolean v_EPTF_MQTT_LocalTransport_initialized := false; |
| var integer v_EPTF_MQTT_LocalTransport_loggingMaskId; |
| |
| var SocketEntry v_MQTT_LocalTransport_currentSocket; |
| |
| // database: |
| var SocketDB v_MQTT_LocalTransport_localSocketDB; |
| |
| // statistics: |
| var EPTF_MQTT_Transport_Statistics v_EPTF_MQTT_Transport_stats; |
| } |
| |
| type record SocketEntry |
| { |
| Socket localAddr, |
| Socket remoteAddr optional, |
| ConnectionId connId, |
| SocketState state, |
| integer sessionIdx |
| } |
| |
| type enumerated SocketState |
| { |
| UNUSED, |
| CLOSED, |
| OPENED, |
| TEMPORARY_UNAVAILABLE |
| } |
| |
| const SocketEntry c_SocketEntry_init := |
| { |
| localAddr := { |
| hostName := "", |
| portNumber := -1 |
| }, |
| remoteAddr := omit, |
| connId := -1, |
| state := UNUSED, |
| sessionIdx := -1 |
| } |
| |
| type record of SocketEntry SocketEntry_List; |
| |
| type record SocketDB |
| { |
| EPTF_FreeBusyQueue queue, |
| SocketEntry_List data, |
| integer hashRef, |
| integer connIdHashRef |
| } |
| const charstring c_EPTF_MQTT_LocalTransport_SocketDB := "EPTF_MQTT_LocalTransport_SocketDB"; |
| const charstring c_EPTF_MQTT_LocalTransport_SocketDB_connId := "EPTF_MQTT_LocalTransport_SocketDB_connId"; |
| |
| type record EPTF_MQTT_Transport_Statistics |
| { |
| integer nofOpenConnections, |
| integer nofTransportWarnings, |
| float nofReceivedMessages, |
| float nofSentMessages, |
| float nofReceivedBytes, |
| float nofSentBytes |
| } |
| |
| const EPTF_MQTT_Transport_Statistics c_EPTF_MQTT_Transport_Statistics_empty := |
| { |
| nofOpenConnections := 0, |
| nofTransportWarnings := 0, |
| nofReceivedMessages := 0.0, |
| nofSentMessages := 0.0, |
| nofReceivedBytes := 0.0, |
| nofSentBytes := 0.0 |
| } |
| |
| } |