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
43
44
45
46
47
/**
* @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;
};
import from LibItsCommon_TypesAndValues {
type UtCommandConfirm
};
import from LibItsCommon_Functions {
function
f_utInitializeIut,
f_utCommandRequestConfirm, f_utCommandRequestWithoutConfirm
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
};
import from LibIts_Interface all;
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>
*/
function f_cf01Up() runs on ItsNt {
// 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>
*/
function f_cf02Up() runs on ItsNt {
// 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
*/
function f_cf01Down() runs on ItsNt {
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();
function f_cf02Down() runs on ItsNt {
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 ItsNt {
// 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.
*/
function f_initialState() runs on ItsNt {
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 ItsNt {
// 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(
Loading full blame...