Newer
Older
* @author ETSI / STF405 / STF449
* @version $URL$
* $Id$
* @desc Module containing types and values for GeoNetworking Protocol
*
*/
module LibItsGeoNetworking_TypesAndValues {
//LibCommon
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
import from LibItsCommon_TypesAndValues all;
import from LibItsBtp_TypesAndValues {type BtpPacket;}
import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;}
// LibItsSecurity
import from LibItsSecurity_TypesAndValues {
type SecuredMessage
}
group geoConfigurationValues {
const charstring c_compIut := "IUT";
const charstring c_compMTC := "MTC";
const charstring c_compNodeA := "NodeA";
const charstring c_compNodeB := "NodeB";
const charstring c_compNodeC := "NodeC";
const charstring c_compNodeD := "NodeD";
const charstring c_compNodeE := "NodeE";
const charstring c_compNodeF := "NodeF";
const charstring c_area1 := "AREA1";
const charstring c_area2 := "AREA2";
const integer c_latitudeFactorNodeB := 2;
const integer c_latitudeFactorNodeC := -6;
const integer c_latitudeFactorNodeD := 1;
const integer c_latitudeFactorNodeE := -1;
const integer c_latitudeFactorNodeF := 2;
const integer c_longitudeFactorNodeA := 0;
const integer c_longitudeFactorNodeB := 0;
const integer c_longitudeFactorNodeC := 0;
const integer c_longitudeFactorNodeD := 0;
const integer c_longitudeFactorNodeE := 0;
const integer c_longitudeFactorNodeF := -3;
tepelmann
committed
group geoSyncMessages {
const charstring c_msgSent := "Message sent";
} // end geoSyncMessages
const UInt6 c_defaultLifetime := 10; // in seconds
const UInt16 c_lifetime := 1000 * c_defaultLifetime; // in seconds
group units {
const float c_squareKm := 1000000.0;
} // end units
/**
* @desc Entry of position table
* @member key Reference key of the entry
* @member position Position vector stored in the entry
*/
type record PositionEntry {
charstring key,
/**
* @desc Table containing node positions
*/
type record of PositionEntry PositionTable;
/**
* @desc Parameters of a geometric area
* @member geoAreaPosLatitude Latitude of area's center
* @member geoAreaPosLongitude Longitude of area's center
* @member distanceA Distance A
* @member distanceB Distance B
* @member angle Angle
*/
Int32 geoAreaPosLatitude,
Int32 geoAreaPosLongitude,
/**
* @desc Compact definition of GeoBroadcastArea
* @member geoBroadcastSubType Type of GeoBroadcastArea (=shape)
* @member geoBroadcastArea Parameters of the geometric area
type record GeoBroadcastArea {
HeaderSubTypeGeoBroadcast geoBroadcastSubType,
Area geoBroadcastArea
}
/**
* @desc Compact definition of GeoAnycastArea
* @member geoAnycastSubType Type of GeoAnycastArea (=shape)
* @member geoAnycastArea Parameters of the geometric area
*/
type record GeoAnycastArea {
/**
* @desc Compact definition of a GeoArea (either GeoBroadcastArea or GeoAnycastArea)
* @member shape Shape of the GeoArea
* @member area Parameters of the geometric area
*/
type record GeoArea {
GeoShape shape,
Area area
}
/**
* @desc Geometric shapes used to define GeoAreas
*/
type enumerated GeoShape {
e_geoCircle(0),
e_geoRect(1),
e_geoElip(2),
e_reserved
}
/**
* @desc Entry of GeoArea table
* @member key Reference key of the entry
* @member geoArea GeoArea stored in the entry
*/
type record GeoAreaEntry {
charstring key,
GeoArea geoArea
}
/**
* @desc Table containing geoArea definitions
*/
type record of GeoAreaEntry GeoAreaTable;
group geoNwValues {
group geoNwHeaderConstants {
const UInt4 c_geoNwProtocolVersion := 0;
const UInt8 c_hopLimit1 := 1;
const UInt8 c_defaultHopLimit := 10;
} // end geoNwHeaderConstants
/**
* @desc GeoNetworking Packet
type record GeoNetworkingPdu {
BasicHeader basicHeader,
GeoNetworkingPacket gnPacket
type record GeoNetworkingPacket {
SecuredMessage securedMsg optional,
GnNonSecuredPacket packet
} with {
encode (securedPacket) "LibIts_Security"
}
type record GnNonSecuredPacket {
CommonHeader commonHeader,
ExtendedHeader extendedHeader optional,
Payload payload optional
} // end group geoNetworkingPdus
group geoNetworkingHeader {
group geoNetworkingBasicHeader {
/**
* @desc Basic Header
* <pre>
* 0 1 2 3
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | V | NH | Reserved | LT | RHL |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* </pre>
*
* @see ETSI EN 302 636-4-1 chapter 8.6.1
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
* @member version
* @member nextHeader
* @member reserved
* @member lifeTime
* @member routerHopLimit
*/
type record BasicHeader {
UInt4 version,
BasicNextHeader nextHeader,
UInt8 reserved,
Lifetime lifeTime,
UInt8 routerHopLimit
}
type enumerated BasicNextHeader {
e_any(0),
e_commonHeader(1),
e_securedPacket(2),
e_reserved
} with {
variant "4 bit"
}
/**
* @desc Indicates the maximum tolerable time a packet can be buffered until it reaches its destination.
* @member multiplier
* @member ltBase
*/
type record Lifetime {
UInt6 multiplier,
LtBase ltBase
}
/**
* @desc The base for the calculation of the lifetime.
*/
type enumerated LtBase {
e_50ms(0),
e_1s(1),
e_10s(2),
e_100s(3)
} with {
variant "2 bit"
}
} // end group geoNetworkingBasicHeader
group geoNetworkingCommonHeader {
/**
* @desc Common header for GeoNetworking
* <pre>
* 0 1 2 3
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | NH | R | HT | HST | TC | Flags |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PL | MHL | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* </pre>
*
* @see ETSI EN 302 636-4-1 chapter 8.7.2
* @member nextHeader
* @member reserved
* @member headerTST Header type + Header Sub Type
* @member trafficClass
* @member flags
* @member plLength
* @member maxHopLimit
* @member reserved2
*/
type record CommonHeader {
NextHeader nextHeader,
HeaderTST headerTST,
TrafficClass trafficClass,
Bit8 flags,
UInt16 plLength, // The Codec shall set the length of the paylaod if present
UInt8 maxHopLimit,
UInt8 reserved2
/**
* @desc Identifies the type of header immediately following the Common Header (4Bits).
*/
type enumerated NextHeader {
e_any(0),
e_btpA(1),
e_btpB(2),
e_ipv6(3),
e_reserved
} with {
variant "4 bits"
}
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
/**
* @desc TrafficClass
*
* <pre>
* 0 1 2 3 4 5 6 7
* +---+---+---+---+---+---+---+---+
* |SCF|Ch.| TC ID |
* | |Off| |
* +---+---+---+---+---+---+---+---+
* </pre>
*
* @see ETSI EN 302 636-4-1 chapter 8.7.5
*
* @member scf
* @member channelOffload
* @member tcId
*/
type record TrafficClass {
SCF scf,
ChannelOffload channelOffload,
TcId tcId
}
type enumerated SCF {
e_scfDisabled(0),
e_scfEnable (1)
} with {
variant "1 bit"
}
type enumerated ChannelOffload {
e_choffDisabled(0),
e_choffEnable (1)
} with {
variant "1 bit"
}
type UInt6 TcId;
} // end group geoNetworkingCommonHeader
group geoNetworkingExtendedHeaders {
/**
* @desc GeoNetworking ExtendedHeader
* @member commonHeader
* @member gnExtHeader
*/
type union ExtendedHeader {
GeoUnicastHeader geoUnicastHeader,
TSBHeader tsbHeader,
SHBHeader shbHeader,
GeoBroadcastHeader geoBroadcastHeader,
GeoAnycastHeader geoAnycastHeader,
BeaconHeader beaconHeader,
LSRequestHeader lsRequestHeader,
LSReplyHeader lsReplyHeader,
AnyHeader anyHeader
}
/**
* @desc The unspecified ANY header.
* @member seqNumber
* @member reserved
*/
type record AnyHeader {
UInt16 seqNumber,
}
/**
* @desc The BEACON packet header.
*
*
* @member commonHeader
*/
type record BeaconHeader {
*
* @member seqNumber
* @member reserved
* @member srcPosVector
* @member geoAreaPosLatitude
* @member geoAreaPosLongitude
* @member distanceA
* @member distanceB
* @member angle
* @member reserved
Int32 geoAreaPosLatitude,
Int32 geoAreaPosLongitude,
UInt16 reserved2
*
* @member seqNumber
* @member reserved
* @member srcPosVector
* @member geoAreaPosLatitude
* @member geoAreaPosLongitude
* @member distanceA
* @member distanceB
* @member angle
* @member reserved
*
* @member seqNumber
* @member reserved
* @member srcPosVector
* @desc The Location Service (LS) Reply packet header.
*
* @member seqNumber
* @member reserved
* @member srcPosVector
type record LSReplyHeader {
UInt16 seqNumber,
LongPosVector srcPosVector,
/**
* @desc The Location Service (LS) Request packet header.
*
*
* @member seqNumber
* @member reserved
* @member srcPosVector
* @member gnAddress
*/
type record LSRequestHeader {
UInt16 seqNumber,
LongPosVector srcPosVector,
GN_Address gnAddress
}
/**
* The Single Hop Broadcast (SHB) packet header.
}
/**
* @desc The Topologically-Scoped Broadcast (TSB) packet header.
*
*
* @member seqNumber
* @member reserved
* @member srcPosVector
*/
LongPosVector srcPosVector
}
group geoNetworkingHeadersSubtypes {
/**
* @desc Identifies the header type and the header subtype for ANY.
* @member headerType
* @member reserved
type record AnyHeaderType {
HeaderType headerType(e_any),
* @desc Identifies the header type and the header subtype for BEACON.
* @member headerType
* @member reserved
type record BeaconHeaderType {
HeaderType headerType(e_beacon),
* @desc Identifies the header type and the header subtype for GEOANYCAST.
* @member headerType
* @member reserved
type record GeoAnycastHeaderType {
HeaderType headerType(e_geoAnycast),
HeaderSubTypeGeoAnycast headerSubType
* @desc Identifies the header type and the header subtype for GEOBROADCAST.
* @member headerType
type record GeoBroadcastHeaderType {
HeaderType headerType(e_geoBroadcast),
HeaderSubTypeGeoBroadcast headerSubType
* @desc Identifies the header type and the header subtype for GEOUNICAST.
* @member headerType
* @member reserved
*/
type record GeoUnicastHeaderType {
HeaderType headerType(e_geoUnicast),
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
/**
* @desc Identifies the header type and the header subtype for Location Service LS.
* @member headerType
* @member reserved
*/
type record LsHeaderType {
HeaderType headerType(e_locationService),
HeaderSubTypeLs headerSubType
}
/**
* @desc Identifies the header type and the header subtype for Service Announcement SA.
* @member headerType
* @member reserved
*/
type record SaHeaderType {
HeaderType headerType(e_serviceAnnouncement),
HeaderSubTypeSa headerSubType
}
/**
* @desc Identifies the header type and the header subtype for Topologically-Scoped Broadcast TSB.
* @member headerType
* @member headerSubType
*/
type record TsbHeaderType {
HeaderType headerType(e_topologicallyScopedBroadcast),
HeaderSubTypeTSB headerSubType
}
* @desc Identifies the header subtype for GEOANYCAST.
type enumerated HeaderSubTypeGeoAnycast {
e_geoAnycastCircle(0),
e_geoAnycastRect(1),
e_geoAnycastElip(2),
e_reserved
* @desc Identifies the header subtype for GEOBROADCAST.
type enumerated HeaderSubTypeGeoBroadcast {
e_geoBroadcastCircle(0),
e_geoBroadcastRect(1),
e_geoBroadcastElip(2),
e_reserved
/**
* @desc Identifies the header subtype for Topologically-scoped broadcast TSB.
*/
type enumerated HeaderSubTypeTSB {
e_singleHop(0),
e_multiHop(1),
e_reserved
* @desc Identifies the header subtype for Location Service LS.
type enumerated HeaderSubTypeLs {
e_lsRequest(0),
e_lsReply(1),
e_reserved
* @desc Identifies the header subtype for Service Announcement SA.
type enumerated HeaderSubTypeSa {
e_sa(0),
e_saEos(1),
e_reserved
* @desc Identifies the header type and the header subtype.
* @member anyHdr
* @member beaconHdr
* @member geoUnicastHdr
* @member geoAnycastHdr
* @member geoBroadcastHdr
* @member tsbHdr
* @member lsHdr
* @member saHdr
type union HeaderTST {
AnyHeaderType anyHdr,
BeaconHeaderType beaconHdr,
GeoUnicastHeaderType geoUnicastHdr,
GeoAnycastHeaderType geoAnycastHdr,
GeoBroadcastHeaderType geoBroadcastHdr,
TsbHeaderType tsbHdr,
LsHeaderType lsHdr,
SaHeaderType saHdr,
UInt8 reserved
* @desc Identifies the type of the GeoAdhoc header type (4Bits).
type enumerated HeaderType {
e_any(0),
e_beacon(1),
e_geoUnicast(2),
e_geoAnycast(3),
e_geoBroadcast(4),
e_topologicallyScopedBroadcast(5),
e_locationService(6),
e_serviceAnnouncement(7),
e_reserved
* <pre>
* 0 1 2 3
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | GN_ADDR |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | TST |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Lat |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Long |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* </pre>
*
type record LongPosVector {
GN_Address gnAddr,
UInt32 timestamp,
Int32 latitude,
Int32 longitude,
* <pre>
* 0 1 2 3
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | GN_ADDR |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | TST |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Lat |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Long |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* </pre>
*
type record ShortPosVector {
GN_Address gnAddr,
UInt32 timestamp,
Int32 latitude,
Int32 longitude
}
group geoNetworkingAddress {
/**
* @desc GeoNetworking address
* <pre>
* 0 1 2 3
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | M_ID |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* </pre>
*
* @member typeOfAddress
* @member stationType
* @member mid
*/
type record GN_Address {
TypeOfAddress typeOfAddress,
StationType stationType,
}
group geoNetworkingAddressSubtypes {
/**
type enumerated StationType {
e_unknown(0),
e_pedestrian(1),
e_cyclist(2),
e_moped(3),
e_motorcycle(4),
e_passengerCar(5),
e_bus(6),
e_lightTruck(7),
e_heavyTruck(8),
e_trailer(9),
e_specialVehicle(10),
e_tram(11),
e_roadSideUnit(15)
* network address and the initial GeoNetwork address (1Bit).
type enumerated TypeOfAddress {
e_manual(1),
e_initial(0)
}
} // end group geoNetworkingAddressSubtypes
} // end group geoNetworkingAddress
} // end group geoNetworkingHeadersSubtypes
} // end group geoNetworkingHeader
group geoNetworkingPayload {
* @member decodedPayload The decoded payload
* @member rawPayload Raw payload as it is received
type record Payload {
DecodedPayload decodedPayload optional,
/**
* @desc The decoded payload of the GN packet
* @member ipv6Packet The IPv6 packet
* @member btpPacket BTP packet
Ipv6Packet ipv6Packet,
} with {
encode (ipv6Packet) "LibItsIpv6OverGeoNetworking";
encode (btpPacket) "LibItsBtp"
} //end group geoNetworkingPayload
/**
* @desc The GeoUnicast forwarding algorithm.
*/
type enumerated GeoUnicastForwardingAlgorithm {
e_unspecified(0),
e_greedy(1),
e_cbf(2)
}
/**
* @desc The GeoBroadcast forwarding algorithm.
*/
type enumerated GeoBroadcastForwardingAlgorithm {
e_unspecified(0),
e_simple(1),
} // end geoNwPicsTypes
/**
* @desc UT primitives for GeoNetworking
* @member geoUnicast -
* @member geoBroadcast -
* @member geoAnycast -
* @member shb -
* @member tsb -
* @member changePosition -
* @member checkPacket -
*/
GenerateGeoUnicastMessage geoUnicast,
GenerateGeoBroadcastMessage geoBroadcast,
GenerateGeoAnycastMessage geoAnycast,
GenerateSHBMessage shb,
/**
* @desc UT primitive for IUT to send a GeoUnicast packet
* @member gnAddress Destination of the packet
* @member lifetime Lifetime of the packet
* @member trafficClass Traffic class of the packet
* @member payload Payload of the packet
type record GenerateGeoUnicastMessage {
GN_Address gnAddress,
/**
* @desc UT primitive for IUT to send a GeoBroadcast packet
* @member shape Shape of the area
* @member lifetime Lifetime of the packet
* @member trafficClass Traffic class of the packet
* @member area Destination GeoArea
* @member payload Payload of the packet
type record GenerateGeoBroadcastMessage {
GeoShape shape,
Area area,
/**
* @desc UT primitive for IUT to send a Geoanycast packet
*/
type GenerateGeoBroadcastMessage GenerateGeoAnycastMessage;
/**
* @desc UT primitive for IUT to send a SHB packet
* @member trafficClass Traffic class of the packet
* @member payload Payload of the packet
type record GenerateSHBMessage {
* @desc UT primitive for IUT to send a SHB packet
* @member nbHops Number of Hops
* @member trafficClass Traffic class of the packet
* @member payload Payload of the packet
type record GenerateTSBMessage {
UInt8 nbHops,
/**
* @desc Upper Tester message to check Upper Layer message transmission on GN IUT
*/
type record UtGnEventInd {
// GeoNetworkingPdu gnPdu
GnRawPayload rawPayload
}
/**
* @desc List of Upper Tester messages to check Upper Layer message transmission on GN IUT
*/
type record of UtGnEventInd UtGnEventIndList;
with {
encode "UpperTester"
}
/**
* @desc TA primitives for GeoNetworking
* @member startBeaconing -
* @member stopBeaconing -
* @member startPassBeaconing -
* @member stopPassBeaconing -
* @member startBeaconingMultipleNeighbour -