Newer
Older
/**
* @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 Types and values for IPv6 over GeoNetworking Protocol
*
*/
module LibItsIpv6OverGeoNetworking_TypesAndValues {
//LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
//LibIts
group ipv6OverGeoConfigurationTypes {
type record GvlTableEntry {
Oct16 prefix,
UInt8 prefixLength,
charstring area,
charstring interface
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
49
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
}
type record of GvlTableEntry GvlTable;
type record MacTableEntry {
charstring key,
MacAddress macAddress
}
type record of MacTableEntry MacTable;
} // end ipv6OverGeoConfigurationTypes
group ethernet {
/**
* @desc Ethernet MAC address
*/
type Oct6 MacAddress;
} // end ethernet
group ipv6 {
/**
* @desc PDU type derived from RFC2460
*/
type record Ipv6Packet {
Ipv6Header ipv6Hdr,
ExtensionHeaderList extHdrList optional,
Ipv6Payload ipv6Payload optional
}
/**
* @desc Derived from RFC 2460 Section 3
* @url http://www.ietf.org/rfc/rfc2460.txt
*/
type record Ipv6Header {
UInt4 version,
UInt8 trafficClass,
UInt20 flowLabel,
UInt16 payloadLength,
UInt8 nextHeader,
UInt8 hopLimit,
Ipv6Address sourceAddress,
Ipv6Address destinationAddress
}
const UInt8 c_noNextHdr := 59;
/**
* @desc IPv6 extension header list
*/
type octetstring ExtensionHeaderList;
/**
* @desc IPv6 payload
*/
type union Ipv6Payload {
RouterAdvertisementMsg routerAdvMsg,
octetstring octetstringMsg
}
/**
* @desc IPv6 Address
*/
type Oct16 Ipv6Address;
group rfc2461MessageTypes {
const UInt8 c_prefixInfo := 3 ;
const UInt8 c_rtAdvMsg := 134;
} // end group rfc2461MessageTypes
group ipv6Address {
//Prefix
const Oct2 c_llaMcaPrefix := 'FF02'O ;
const Oct2 c_llaPrefix := 'FE80'O ;
//Postfix
const Oct2 c_allNodesMcaPostfix := '0001'O ;
const Oct2 c_allRoutersMcaPostfix := '0002'O ;
const Oct2 c_anycastPostfix := 'FFFF'O ;
const Oct1 c_haAnycastPostfix := '7E'O ;
//Wellknown Multicast Address
const Ipv6Address c_allNodesMca := c_llaMcaPrefix & c_12ZeroBytes & c_allNodesMcaPostfix ;
const Ipv6Address c_allRoutersMca := c_llaMcaPrefix & c_12ZeroBytes & c_allRoutersMcaPostfix ;
}//end group ipv6Address
/**
* @desc PDU type derived from RFC2461 clause 4.2
*/
type record RouterAdvertisementMsg {
UInt8 icmpType(c_rtAdvMsg),
UInt8 icmpCode,
Oct2 checksum,
UInt8 curHopLimit,
UInt1 managedConfigFlag,
UInt1 otherConfigFlag,
UInt1 homeAgentFlag,
UInt5 reserved,
UInt16 routerLifetime,
UInt32 reachableTime,
UInt32 retransTimer,
RtAdvOptions rtAdvOptions optional
}
/**
* @desc RouterAdvertisement option list
*
* @remark Any RtAdvOptions value should at least have
* one of the first three options present!
*/
type set RtAdvOptions {
SrcLinkLayerAddress srcLinkLayerAddr optional,
// MtuOption mtuOption optional,
PrefixInfoList prefixInfoList optional,
// AdvertisementInterval advertisementInterval optional,
// HomeAgentInfo homeAgentInfo optional,
octetstring otherOption optional
}
/**
* @desc Derived from RFC2461 clause4.6.1 + MIPv6
* @url http://www.ietf.org/rfc/rfc2461.txt
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
type record SrcLinkLayerAddress {
UInt8 icmpType(c_srcLinkLayerAddress),
UInt8 optionLength,
Oct6to15 linkLayerAddr
}
type set length (1..c_maxNrPrefixInfo) of PrefixInfo PrefixInfoList;
/**
* @desc Derived from RFC 2461 clause 4.6.2
*/
type record PrefixInfo {
UInt8 icmpType(c_prefixInfo),
UInt8 optionLength,
UInt8 prefixLength,
UInt1 linkFlag,
UInt1 autoConfigFlag,
UInt1 rtAddrFlag,
UInt5 reserved1,
UInt32 validLifetime,
UInt32 preferredLifetime,
UInt32 reserved2,
Prefix prefix
}
type Ipv6Address Prefix ;
group nd_constants {
const UInt8 c_maxNrPrefixInfo := 10;
const UInt1 c_rtAddrFlag0 := 0;
const UInt1 c_aFlag0 := 0;
const UInt1 c_aFlag1 := 1;
const UInt1 c_rFlag0 := 0;
const UInt1 c_rFlag1 := 1;
const UInt1 c_sFlag0 := 0;
const UInt1 c_sFlag1 := 1;
const UInt1 c_oFlag0 := 0;
const UInt1 c_oFlag1 := 1;
const UInt1 c_mFlag0 := 0;
const UInt1 c_mFlag1 := 1;
const UInt1 c_lFlag0 := 0;
const UInt1 c_lFlag1 := 1;
const UInt16 c_zeroLifetime := 0 ;
const UInt32 c_validLifetime30s := 30;
const UInt32 c_preferredLifetime30s := 30;
} // end group nd_constants
const UInt8 c_srcLinkLayerAddress := 1;
const UInt8 c_prefixInfoLen := 4;