Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* @author ETSI / STF422_EETS
* @version $URL:$
* $Id:$
* @desc FAST networking & transport layer protocol (ISO 29281-2) functions
*/
module LibItsFntp_Functions {
// Libcommon
import from LibCommon_Sync all;
import from LibCommon_VerdictControl {
type FncRetCode
};
import from LibCommon_Time {
function f_sleepIgnoreDef
};
import from LibCommon_BasicTypesAndValues {
type UInt16
};
// LibIts
import from CALMmanagement language "ASN.1:1997" {
type StationID, ITS_scuId;
};
import from CALMllsap language "ASN.1:1997" {
type
EUI64, IN_SAPaddress, LLserviceAddr, Link_ID, AccessParameters
};
import from CALMfntp language "ASN.1:1997" all;
import from LibItsMgt_Functions {
altstep
a_mgtMNSapPortDefault, a_mgtSapAwaitFWTupdate
};
import from LibItsFntp_TypesAndValues {
const c_portDyn, c_portNon;
type AcFntpPrimitive
};
import from LibItsFntp_Templates all;
import from LibItsFntp_Pixits all;
import from LibItsFntp_Pics {
modulepar PICS_ITS_S_INW;
};
garciay
committed
// FIXME To be removed
// import from LibItsCommon_TypesAndValues {
// type UtCommandConfirm
// };
group fntpConfigurationFunctions {
/**
* @desc This configuration features:
* <li>Host and Router are combined (see ISO/WD 29281-2 - Figure 1 - Implementation architecture I)</li>
* <li>MGT1 IISC Port (IISC/LAN) is not used</li>
*/
// Sanity check
if (PICS_ITS_S_INW) {
log("*** f_cf01Up: ERROR: PICS_ITS_S_INW shall not be required for executing the TC ***");
stop;
}
// Map
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
map(self:mgtMNSapPort, system:mgtMNSapPort);
map(self:fntpPort, system:fntpPort);
// Connect
f_connect4SelfOrClientSync();
// Set processing on shutdown
activate(a_cf01Down());
// Initialize the component
f_initialiseComponent("cf01Up");
// Initialze the IUT
f_initialState();
} // End of function f_cf01Up
/**
* @desc This configuration features:
* <li>Host and Router are separated (see ISO/WD 29281-2 - Figure 3 - Implementation architecture II & III)</li>
* <li>MGT1 IISC Port (IISC/LAN) is not used</li>
*/
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Sanity check
if (not(PICS_ITS_S_INW)) {
log("*** f_cf02Up: ERROR: PICS_ITS_S_INW required for executing the TC ***");
stop;
}
vc_commandRef := 0;
vc_pduCounter := 0;
// Map
map(self:acPort, system:acPort);
map(self:utPort, system:utPort);
map(self:mgtMNSapPort, system:mgtMNSapPort);
map(self:fntpPort, system:fntpPort);
// Connect
f_connect4SelfOrClientSync();
// Set processing on shutdown
activate(a_cf02Down());
// Initialize the component
f_initialiseComponent("cf02Up");
// Initialze the IUT
f_initialState();
} // End of function f_cf02Up
/**
* @desc Deletes configuration cf01
*/
deactivate;
// Unmap
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
unmap(self:mgtMNSapPort, system:mgtMNSapPort);
unmap(self:fntpPort, system:fntpPort);
// Disconnect
f_disconnect4SelfOrClientSync();
garciay
committed
/**
* @desc Deletes configuration cf02
*/
deactivate;
// Unmap
unmap(self:acPort, system:acPort);
unmap(self:utPort, system:utPort);
unmap(self:fntpPort, system:fntpPort);
// Disconnect
f_disconnect4SelfOrClientSync();
/**
* @desc Behavior function for initializing component's variables and tables
* @param p_componentName Name of the component
*/
function f_initialiseComponent(in charstring p_componentName) runs on ItsCalm {
// Initialize variables
vc_componentName := p_componentName;
vc_portNumber := { portLong := c_portNon };
vc_scuId := 255;
// Set defaults
activate(a_fntpDefault()); // Default for Fntp module
activate(a_mgtMNSapPortDefault()); // Default for MGT module / MF-SAP port
} // End of group fntpConfigurationFunctions
group preambles {
/**
* @desc Brings the IUT into an initial state.
*/
f_utInitializeIut(m_fntpInitialize);
f_sleepIgnoreDef(PX_WAIT_FOR_IUT_READY); // Wait until the IUT is in a stable situation (beaconing...)
} // End of function f_initialState
/**
* @desc Implement the following Initial conditions:
* <li>the IUT having set up properly the FNTP forwarding table, and the local port number of the ITS-S application</li>
* <li>the IUT having an entry in the FNTP forwarding table for unicast communication with remote Link Port and Service Port</li>
* <li>the IUT having an entry in the FNTP forwarding table for Service Port = port1, but not for Service Port = port2</li>
* <li>the IUT having an entry in the FNTP forwarding table for a Service Port, but no entry for the peer station</li>
* @param p_port Indicates the port number
* @verdict Unchanged on success, set to fail on error (e_timeout)
* @see ISO/WD 29281-2 Clause 8.2
*/
function f_initializeFntpForwardingTable(in PortNumber p_port) runs on ItsCalm {
// Request allocation of a port number associated with the ITS-SP
// TODO Consider case of c_portDyn, and use f_utCommandRequestConfirm
f_utCommandRequestWithoutConfirm(
m_generateNfFntpPortCreationRequest(
f_getIutServiceRef(),
Loading full blame...