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
48
/**
* @author ETSI / STF405
* @version $URL: svn+ssh://vcs.etsi.org/TTCN3/ATS/Its/trunk/ttcn/AtsIPv6OverGeoNetworking/ItsIpv6OverGeoNetworking_TestCases.ttcn $
* $Id: ItsIpv6OverGeoNetworking_TestCases.ttcn 169 2010-09-23 08:12:36Z berge $
* @desc IPv6 over GeoNetworking Protocol Templates
*
*/
module LibItsIpv6OverGeoNetworking_Templates {
//LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
//LibIts
import from LibIts_Interface all;
import from LibItsGeoNetworking_TypesAndValues {type Payload;}
import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
group ipv6OverGeoNwPrimitivesTemplates {
template (value) IPv6OverGeoNetworkingReq m_ipv6OverGeoNwReq(
template (value) charstring p_interface,
template (value) MacAddress p_srcMacAddr,
template (value) MacAddress p_dstMacAddr,
template (value) Ipv6Packet p_ipv6Packet
) := {
interface := p_interface,
macSourceAddress := p_srcMacAddr,
macDestinationAddress := p_dstMacAddr,
ipv6Packet := p_ipv6Packet
}
template IPv6OverGeoNetworkingInd mw_ipv6OverGeoNwInd(
template (value) charstring p_interface,
template (value) MacAddress p_srcMacAddr,
template (value) MacAddress p_dstMacAddr,
template (present) Ipv6Packet p_ipv6Packet
) := {
interface := p_interface,
macSourceAddress := p_srcMacAddr,
macDestinationAddress := p_dstMacAddr,
ipv6Packet := p_ipv6Packet
}
} // ipv6OverGeoNwPrimitivesTemplates
group ipv6 {
template Payload m_ipv6Payload(in template (value) Ipv6Packet p_ipv6Packet) := {
ipv6Packet := p_ipv6Packet
}
template Payload mw_ipv6Payload(in template (present) Ipv6Packet p_ipv6Packet) := {
ipv6Packet := p_ipv6Packet
}
template (value) Ipv6Packet m_ipv6Packet(
in template (value) Ipv6Address p_srcAddr,
in template (value) Ipv6Address p_dstAddr,
in template (value) UInt8 p_nextHdr,
in template (omit) Ipv6Payload p_payload
) := {
ipv6Hdr := m_ipv6Header(p_srcAddr, p_dstAddr, p_nextHdr),
extHdrList := omit,
ipv6Payload := p_payload
}
template Ipv6Header m_ipv6Header(
in template (value) Ipv6Address p_srcAddr,
in template (value) Ipv6Address p_dstAddr,
in template (value) UInt8 p_nextHdr
) := {
version := 6,
trafficClass := 0,
flowLabel := 0,
payloadLength := 0, //indicates that the adaptation will fill the correct value
nextHeader := p_nextHdr,
hopLimit := 255,
sourceAddress := p_srcAddr,
destinationAddress := p_dstAddr
}
template Ipv6Payload m_rtAdvWithOptions(
in template (omit) RtAdvOptions p_rtAdvOptions
) := {
routerAdvMsg := {
icmpType := c_rtAdvMsg,
icmpCode := 0,
checksum := c_2ZeroBytes, //indicates that the adaptation will fill the correct value
curHopLimit := 255,
managedConfigFlag := 0,
otherConfigFlag := 0,
homeAgentFlag := 0,
reserved := 0,
routerLifetime := c_uInt16Max,
reachableTime := 0,
retransTimer := 0,
rtAdvOptions := p_rtAdvOptions
}
}
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/**
* @param p_prefixLength Length of the prefix.
* @param p_lFlag Value for link flag.
* @param p_aFlag Value for autoconfiguration flag.
* @param p_validLifetime Value for valid life time duration.
* @param p_preferredLifetime Value for preffered life time duration.
* @param p_prefix Address prefix to be used
*/
template RtAdvOptions m_rtAdvOpt_prefixOpt (
UInt8 p_prefixLength,
UInt1 p_lFlag,
UInt1 p_aFlag,
UInt32 p_validLifetime,
UInt32 p_preferredLifetime,
Ipv6Address p_prefix
):={
srcLinkLayerAddr := omit,
// mtuOption:= omit,
prefixInfoList := {
m_prefixInfo(
p_prefixLength,
p_lFlag,
p_aFlag,
p_validLifetime,
p_preferredLifetime,
p_prefix
)
},
// advertisementInterval := omit,
// homeAgentInfo := omit,
otherOption := omit
}
/**
* @param p_prefixLength The length of the prefix
* @param p_lFlag Value for link flag.
* @param p_aFlag Value for autoconfiguration flag.
* @param p_validLifetime Value for valid life time duration.
* @param p_preferredLifetime Value for preffered life time duration.
* @param p_prefix Address prefix to be used
*/
template PrefixInfo m_prefixInfo (
UInt8 p_prefixLength,
UInt1 p_lFlag,
UInt1 p_aFlag,
UInt32 p_validLifetime,
UInt32 p_preferredLifetime,
Ipv6Address p_prefix
):= {
icmpType:= c_prefixInfo,
optionLength:= c_prefixInfoLen,
prefixLength:= p_prefixLength,
linkFlag:=p_lFlag,
autoConfigFlag:=p_aFlag,
rtAddrFlag := c_rtAddrFlag0,
reserved1:=0,
validLifetime:=p_validLifetime,
preferredLifetime:=p_preferredLifetime,
reserved2:=0,
prefix:= p_prefix
}
} // end group ipv6
} // end LibItsIpv6OverGeoNetworking_TypesAndValues