Commit 8aa38892 authored by garciay's avatar garciay
Browse files

Start Security support

Add Service Advertisement support
parent 65fa3f87
......@@ -352,13 +352,15 @@ int GeoNetworkingCodec::decode_extendedHeader(LibItsGeoNetworking__TypesAndValue
decode_(u.anyHeader(), *u.anyHeader().get_descriptor(), decoding_buffer);
break;
case LibItsGeoNetworking__TypesAndValues::HeaderType::e__serviceAnnouncement:
/*if (_dc.header_sub_type == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeSa::e__sa) {
decode_(u.saHeader(), *u.saHeader().get_descriptor(), decoding_buffer);
} else if (_dc.header_sub_type == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeSa::e__saEos) {
decode_(u.saEosHeader(), *u.saEosHeader().get_descriptor(), decoding_buffer);
} else {*/
TTCN_error("GeoNetworkingCodec::decode_headerTST: Service Advertisement subtype not processed");
//}
// TODO Check that Service Advertisment (ETSI TS 102 890-1) uses TSB
decode_(u.tsbHeader(), *u.tsbHeader().get_descriptor(), decoding_buffer);
// if (_dc.header_sub_type == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeSa::e__sa) {
// decode_(u.saHeader(), *u.saHeader().get_descriptor(), decoding_buffer);
// } else if (_dc.header_sub_type == LibItsGeoNetworking__TypesAndValues::HeaderSubTypeSa::e__saEos) {
// decode_(u.saEosHeader(), *u.saEosHeader().get_descriptor(), decoding_buffer);
// } else {
// TTCN_error("GeoNetworkingCodec::decode_headerTST: Service Advertisement subtype not processed");
// }
break;
default:
TTCN_error("GeoNetworkingCodec::decode_headerTST: Not processed, _dc.header_type = %d - _dc.header_sub_type = %d", _dc.header_type, _dc.header_sub_type);
......
......@@ -165,9 +165,7 @@ void GeoNetworkingLayer::receiveData(OCTETSTRING& data, Params& params) {
} else if (htst.ischosen(LibItsGeoNetworking__TypesAndValues::HeaderTST::ALT_lsHdr)) { // Receive a location service
if (ex.ischosen(LibItsGeoNetworking__TypesAndValues::ExtendedHeader::ALT_lsRequestHeader)) { // Receive a LocationService/LsRequest
sopv = &ex.lsRequestHeader().srcPosVector();
// TODO Send LsReply if we are not in context of GN ATS
// TODO Send LsReply if we are not in context of GN ATS in case of non GN test suite
} else {
sopv = &ex.lsReplyHeader().srcPosVector();
}
......@@ -175,12 +173,12 @@ void GeoNetworkingLayer::receiveData(OCTETSTRING& data, Params& params) {
sopv = &ex.geoAnycastHeader().srcPosVector();
} else if (htst.ischosen(LibItsGeoNetworking__TypesAndValues::HeaderTST::ALT_geoUnicastHdr)) {
sopv = &ex.geoUnicastHeader().srcPosVector();
/*} else if (htst.ischosen(LibItsGeoNetworking__TypesAndValues::HeaderTST::ALT_saHdr)) { // Receive Service Advertisement
if (ex.ischosen(LibItsGeoNetworking__TypesAndValues::ExtendedHeader::ALT_xxx)) {
sopv = &ex.xxxHeader().srcPosVector();
} else {
sopv = &ex.xxxHeader().srcPosVector();
}*/
} else if (htst.ischosen(LibItsGeoNetworking__TypesAndValues::HeaderTST::ALT_saHdr)) { // Receive Service Advertisement
if (ex.ischosen(LibItsGeoNetworking__TypesAndValues::ExtendedHeader::ALT_tsbHeader)) { // TODO Check that Service Advertisment (ETSI TS 102 890-1) uses TSB
sopv = &ex.tsbHeader().srcPosVector();
} else {
sopv = &ex.tsbHeader().srcPosVector();
}
} // else, nothing to do
loggers::get_instance().log("GeoNetworkingLayer::receiveData: sopv is boud: %d", sopv->is_bound());
if(sopv->is_bound()) {
......@@ -195,7 +193,7 @@ void GeoNetworkingLayer::receiveData(OCTETSTRING& data, Params& params) {
if (_pass_beacon_table.empty()) { // Discard beacon
loggers::get_instance().log("GeoNetworkingLayer::receiveData: Pass beaconing table empty, skip it");
return;
} else { // TODO Add beacon filter for StartPassBeaconing/Stop
} else { // Check beacon filter for StartPassBeaconing/Stop
if (!_pass_beacon_table.has_entry(sopv->gnAddr().mid())) { // Discard beacon
loggers::get_instance().log_msg("GeoNetworkingLayer::receiveData: Not in pass beaconing table, skip it", *sopv);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment