Loading ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +17 −5 Original line number Diff line number Diff line Loading @@ -14,20 +14,23 @@ module LibItsGeoNetworking_Functions { import from LibCommon_Sync all; import from LibCommon_Time all; // LibIts // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_TestSystem all; import from LibItsCommon_TypesAndValues all; import from LibItsExternal_TypesAndValues {type MacAddress}; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; import from LibItsSecurity_Functions all; // LibItsGeoNetworking import from LibItsGeoNetworking_TestSystem all; import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Templates all; import from LibItsGeoNetworking_Pixits all; import from LibItsGeoNetworking_Pics all; import from LibItsExternal_TypesAndValues {type MacAddress}; group utFuntions { Loading Loading @@ -687,6 +690,9 @@ module LibItsGeoNetworking_Functions { function f_startBeingNeighbour() runs on ItsGeoNetworking { vc_neighbourDefault := activate(a_neighbourDefault()); if (PICS_SECURED_MODE == true) { f_acEnableSecurity(); } f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); } // end f_startBeingNeighbour Loading @@ -697,6 +703,9 @@ module LibItsGeoNetworking_Functions { function f_stopBeingNeighbour() runs on ItsGeoNetworking { f_acTriggerEvent(m_stopBeaconing); if (PICS_SECURED_MODE == true) { f_acDisableSecurity(); } deactivate(vc_neighbourDefault); } // end f_stopBeingNeighbour Loading Loading @@ -1654,9 +1663,12 @@ module LibItsGeoNetworking_Functions { * @return FncRetCode */ function f_acEnableSecurity() runs on ItsGeoNetworking return FncRetCode { var template (value) ToBeSignedData v_toBeSignedData; return f_acTriggerEvent(m_enableSecurity); // Build the beacon template v_toBeSignedData := f_buildSecuredMessagePayloadToBeSigned(); return f_acTriggerEvent(AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(bit2oct(encvalue(v_toBeSignedData))) } ); } /** Loading @@ -1665,7 +1677,7 @@ module LibItsGeoNetworking_Functions { */ function f_acDisableSecurity() runs on ItsGeoNetworking return FncRetCode { return f_acTriggerEvent(m_disableSecurity); return f_acTriggerEvent(AcGnPrimitive:{ acDisableSecurity := m_disableSecurity } ); } Loading ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +1 −25 Original line number Diff line number Diff line Loading @@ -423,30 +423,6 @@ module LibItsGeoNetworking_Templates { getLongPosVector := mw_longPosVectorAny(p_gnAddress) } /** * @desc Enable security support */ template AcGnPrimitive m_enableSecurity := { acEnableSecurity := { enable := true, signingPrivateKey := PX_PRIVATE_SIGNING_KEYS[PX_CERTIFICATE_CONFIG_IDX], signingPublicKeyX := PX_AT_CERTIFICATES[PX_CERTIFICATE_CONFIG_IDX].subject_attributes[0].attribute.key.public_key.eccPoint.x, signingPublicKeyY := PX_AT_CERTIFICATES[PX_CERTIFICATE_CONFIG_IDX].subject_attributes[0].attribute.key.public_key.eccPoint.y.y, encryptPrivateKey := omit, encryptPublicKeyX := omit, encryptPublicKeyY := omit } } /** * @desc Disable security support */ template AcGnPrimitive m_disableSecurity := { acDisableSecurity := { disable := true } } } // end taPrimitives } // geoNwPrimitivesTemplates Loading ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +1 −24 Original line number Diff line number Diff line Loading @@ -17,9 +17,7 @@ module LibItsGeoNetworking_TypesAndValues { import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} // LibItsSecurity import from LibItsSecurity_TypesAndValues { type SecuredMessage } import from LibItsSecurity_TypesAndValues all; group geoConfigurationValues { Loading Loading @@ -1095,27 +1093,6 @@ module LibItsGeoNetworking_TypesAndValues { encode(gnAddress) "LibItsGeoNetworking" }; /** * @desc Primitive used to activate security support */ type record AcEnableSecurity { boolean enable, Oct32 signingPrivateKey, Oct32 signingPublicKeyX, Oct32 signingPublicKeyY, Oct32 encryptPrivateKey optional, Oct32 encryptPublicKeyX optional, Oct32 encryptPublicKeyY optional } /** * @desc Primitive used to deactiate security support */ type record AcDisableSecurity { // TODO To be refined, adding keys, certificates...? boolean disable } } // end acPrimitives with { encode "AdapterControl" Loading Loading
ttcn/GeoNetworking/LibItsGeoNetworking_Functions.ttcn +17 −5 Original line number Diff line number Diff line Loading @@ -14,20 +14,23 @@ module LibItsGeoNetworking_Functions { import from LibCommon_Sync all; import from LibCommon_Time all; // LibIts // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_TestSystem all; import from LibItsCommon_TypesAndValues all; import from LibItsExternal_TypesAndValues {type MacAddress}; // LibItsSecurity import from LibItsSecurity_TypesAndValues all; import from LibItsSecurity_Templates all; import from LibItsSecurity_Functions all; // LibItsGeoNetworking import from LibItsGeoNetworking_TestSystem all; import from LibItsGeoNetworking_TypesAndValues all; import from LibItsGeoNetworking_Templates all; import from LibItsGeoNetworking_Pixits all; import from LibItsGeoNetworking_Pics all; import from LibItsExternal_TypesAndValues {type MacAddress}; group utFuntions { Loading Loading @@ -687,6 +690,9 @@ module LibItsGeoNetworking_Functions { function f_startBeingNeighbour() runs on ItsGeoNetworking { vc_neighbourDefault := activate(a_neighbourDefault()); if (PICS_SECURED_MODE == true) { f_acEnableSecurity(); } f_acTriggerEvent(m_startBeaconing(m_beaconHeader(f_getPosition(vc_componentName)).beaconHeader)); f_sleepIgnoreDef(PX_NEIGHBOUR_DISCOVERY_DELAY); } // end f_startBeingNeighbour Loading @@ -697,6 +703,9 @@ module LibItsGeoNetworking_Functions { function f_stopBeingNeighbour() runs on ItsGeoNetworking { f_acTriggerEvent(m_stopBeaconing); if (PICS_SECURED_MODE == true) { f_acDisableSecurity(); } deactivate(vc_neighbourDefault); } // end f_stopBeingNeighbour Loading Loading @@ -1654,9 +1663,12 @@ module LibItsGeoNetworking_Functions { * @return FncRetCode */ function f_acEnableSecurity() runs on ItsGeoNetworking return FncRetCode { var template (value) ToBeSignedData v_toBeSignedData; return f_acTriggerEvent(m_enableSecurity); // Build the beacon template v_toBeSignedData := f_buildSecuredMessagePayloadToBeSigned(); return f_acTriggerEvent(AcGnPrimitive:{ acEnableSecurity := m_enableSecurity(bit2oct(encvalue(v_toBeSignedData))) } ); } /** Loading @@ -1665,7 +1677,7 @@ module LibItsGeoNetworking_Functions { */ function f_acDisableSecurity() runs on ItsGeoNetworking return FncRetCode { return f_acTriggerEvent(m_disableSecurity); return f_acTriggerEvent(AcGnPrimitive:{ acDisableSecurity := m_disableSecurity } ); } Loading
ttcn/GeoNetworking/LibItsGeoNetworking_Templates.ttcn +1 −25 Original line number Diff line number Diff line Loading @@ -423,30 +423,6 @@ module LibItsGeoNetworking_Templates { getLongPosVector := mw_longPosVectorAny(p_gnAddress) } /** * @desc Enable security support */ template AcGnPrimitive m_enableSecurity := { acEnableSecurity := { enable := true, signingPrivateKey := PX_PRIVATE_SIGNING_KEYS[PX_CERTIFICATE_CONFIG_IDX], signingPublicKeyX := PX_AT_CERTIFICATES[PX_CERTIFICATE_CONFIG_IDX].subject_attributes[0].attribute.key.public_key.eccPoint.x, signingPublicKeyY := PX_AT_CERTIFICATES[PX_CERTIFICATE_CONFIG_IDX].subject_attributes[0].attribute.key.public_key.eccPoint.y.y, encryptPrivateKey := omit, encryptPublicKeyX := omit, encryptPublicKeyY := omit } } /** * @desc Disable security support */ template AcGnPrimitive m_disableSecurity := { acDisableSecurity := { disable := true } } } // end taPrimitives } // geoNwPrimitivesTemplates Loading
ttcn/GeoNetworking/LibItsGeoNetworking_TypesAndValues.ttcn +1 −24 Original line number Diff line number Diff line Loading @@ -17,9 +17,7 @@ module LibItsGeoNetworking_TypesAndValues { import from LibItsIpv6OverGeoNetworking_TypesAndValues {type Ipv6Packet;} // LibItsSecurity import from LibItsSecurity_TypesAndValues { type SecuredMessage } import from LibItsSecurity_TypesAndValues all; group geoConfigurationValues { Loading Loading @@ -1095,27 +1093,6 @@ module LibItsGeoNetworking_TypesAndValues { encode(gnAddress) "LibItsGeoNetworking" }; /** * @desc Primitive used to activate security support */ type record AcEnableSecurity { boolean enable, Oct32 signingPrivateKey, Oct32 signingPublicKeyX, Oct32 signingPublicKeyY, Oct32 encryptPrivateKey optional, Oct32 encryptPublicKeyX optional, Oct32 encryptPublicKeyY optional } /** * @desc Primitive used to deactiate security support */ type record AcDisableSecurity { // TODO To be refined, adding keys, certificates...? boolean disable } } // end acPrimitives with { encode "AdapterControl" Loading