Skip to content
Commits on Source (9)
......@@ -16,8 +16,8 @@ namespace LIB__NG__NAS__Functions {
}
INTEGER fx__f1(const BITSTRING& p_authK, const BITSTRING& p_rand, const BITSTRING& p_sqn, const BITSTRING& p_amf, BITSTRING& p_mac_a) {
loggers::get_instance().log_msg(">>> fx__f1: p_authK: ", p_authK);
loggers::get_instance().log_msg(">>> fx__f1: p_rand: ", p_rand);
loggers::get_instance().log_msg(">>> fx__f1: p_authK: ", bit2oct(p_authK));
loggers::get_instance().log_msg(">>> fx__f1: p_rand: ", bit2oct(p_rand));
rijndael r;
OCTETSTRING authK = bit2oct(p_authK);
......@@ -74,8 +74,8 @@ namespace LIB__NG__NAS__Functions {
}
INTEGER fx__f1star(const BITSTRING& p_authK, const BITSTRING& p_rand, const BITSTRING& p_sqn, const BITSTRING& p_amf, BITSTRING& p_mac_s) {
loggers::get_instance().log_msg(">>> fx__f1star: p_authK: ", p_authK);
loggers::get_instance().log_msg(">>> fx__f1star: p_rand: ", p_rand);
loggers::get_instance().log_msg(">>> fx__f1star: p_authK: ", bit2oct(p_authK));
loggers::get_instance().log_msg(">>> fx__f1star: p_rand: ", bit2oct(p_rand));
rijndael r;
OCTETSTRING authK = bit2oct(p_authK);
......
......@@ -26,13 +26,17 @@ namespace CommonDefs {
*/
//INTEGER fx__KeyDerivationFunction(INTEGER const&, BITSTRING const&, OCTETSTRING const&){
BITSTRING fx__KeyDerivationFunction(const INTEGER& p__KDF, const BITSTRING& p__Key, const OCTETSTRING& p__String){
loggers::get_instance().log_msg(">>> fx__KeyDerivationFunction: p__KDF: ", p__KDF);
loggers::get_instance().log_msg(">>> fx__KeyDerivationFunction: p__Key: ", bit2oct(p__Key));
hmac h; // hash_algorithms::sha_256: p__KDF == 1 (tsc_KDF_HMAC_SHA_256 see CommonDefs.ttcn)
OCTETSTRING res;
if (h.generate(p__String, bit2oct(p__Key), res) == -1) {
loggers::get_instance().error("fx__KeyDerivationFunction: Key derivation failed");
return int2bit(0, 0);
}
loggers::get_instance().log_msg("<<< fx__KeyDerivationFunction: res: ", res);
return oct2bit(res);
}
/**
......@@ -42,6 +46,11 @@ namespace CommonDefs {
*/
//INTEGER fx__GetSystemTime(CommonDefs::Struct__tm__Type&, INTEGER&){
void fx__GetSystemTime(CommonDefs::Struct__tm__Type& p__Struct__tm, INTEGER& p__TimezoneInfo){
const time_t t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
tm* now = std::localtime(&t);
p__Struct__tm = Struct__tm__Type(now->tm_sec, now->tm_min, now->tm_hour, now->tm_mday, now->tm_mon, now->tm_year, now->tm_wday, now->tm_yday, now->tm_isdst);
p__TimezoneInfo = 0; // TODO FSCOM
return;
}
//void fx__CalculateFCS32(BITSTRING const&) {
......
......@@ -77,12 +77,12 @@ namespace LibNGAP__Interface {
}
static_cast<ngap_layer*>(_layer)->add_upper_port(this);
// Create layer
/*IJ commented out // Create layer
_layer = layer_stack_builder::get_instance()->create_layer_stack(it->second.c_str());
if (static_cast<ngap_layer*>(_layer) == NULL) {
loggers::get_instance().error("NGAPPort::user_map: Invalid stack configuration: %s", it->second.c_str());
}
static_cast<ngap_layer*>(_layer)->add_upper_port(this);
static_cast<ngap_layer*>(_layer)->add_upper_port(this);*/
} else {
loggers::get_instance().error("NGAPPort::user_map: No layers defined in configuration file");
}
......
Subproject commit e7f13cca244490ee6f5fc6e80c6836384b562568
Subproject commit 9ed59ebd3c0a769688262f2370f6d3c3507b2a5f
......@@ -14,77 +14,77 @@ module CommonDefs {
//----------------------------------------------------------------------------
// type definitions:
type bitstring B1_Type length(1);
type bitstring B2_Type length(2);
type bitstring B3_Type length(3);
type bitstring B4_Type length(4);
type bitstring B5_Type length(5);
type bitstring B6_Type length(6);
type bitstring B7_Type length(7);
type bitstring B1_Type length(1) with { variant "FIELDLENGTH(1)" };
type bitstring B2_Type length(2) with { variant "FIELDLENGTH(2)" };
type bitstring B3_Type length(3) with { variant "FIELDLENGTH(3)" };
type bitstring B4_Type length(4) with { variant "FIELDLENGTH(4)" };
type bitstring B5_Type length(5) with { variant "FIELDLENGTH(5)" };
type bitstring B6_Type length(6) with { variant "FIELDLENGTH(6)" };
type bitstring B7_Type length(7) with { variant "FIELDLENGTH(7)" };
type bitstring B7_15_Type length(7..15); // NOTE: length restriction can only be a range but not two destinct lengths
type bitstring B8_Type length(8);
type bitstring B9_Type length(9);
type bitstring B10_Type length(10);
type bitstring B11_Type length(11);
type bitstring B12_Type length(12);
type bitstring B13_Type length(13);
type bitstring B14_Type length(14);
type bitstring B15_Type length(15);
type bitstring B16_Type length(16);
type bitstring B18_Type length(18);
type bitstring B20_Type length(20);
type bitstring B22_Type length(22);
type bitstring B24_Type length(24);
type bitstring B27_Type length(27);
type bitstring B28_Type length(28);
type bitstring B32_Type length(32);
type bitstring B36_Type length(36);
type bitstring B40_Type length(40);
type bitstring B41_Type length(41);
type bitstring B42_Type length(42);
type bitstring B43_Type length(43);
type bitstring B45_Type length(45);
type bitstring B47_Type length(47);
type bitstring B48_Type length(48);
type bitstring B56_Type length(56);
type bitstring B64_Type length(64);
type bitstring B80_Type length(80);
type bitstring B112_Type length(112);
type bitstring B128_Type length(128);
type bitstring B160_Type length(160);
type bitstring B184_Type length(184);
type bitstring B192_Type length(192);
type bitstring B256_Type length(256);
type bitstring B8_Type length(8) with { variant "FIELDLENGTH(8)" };
type bitstring B9_Type length(9) with { variant "FIELDLENGTH(9)" };
type bitstring B10_Type length(10) with { variant "FIELDLENGTH(10)" };
type bitstring B11_Type length(11) with { variant "FIELDLENGTH(11)" };
type bitstring B12_Type length(12) with { variant "FIELDLENGTH(12)" };
type bitstring B13_Type length(13) with { variant "FIELDLENGTH(13)" };
type bitstring B14_Type length(14) with { variant "FIELDLENGTH(14)" };
type bitstring B15_Type length(15) with { variant "FIELDLENGTH(15)" };
type bitstring B16_Type length(16) with { variant "FIELDLENGTH(16)" };
type bitstring B18_Type length(18) with { variant "FIELDLENGTH(18)" };
type bitstring B20_Type length(20) with { variant "FIELDLENGTH(20)" };
type bitstring B22_Type length(22) with { variant "FIELDLENGTH(22)" };
type bitstring B24_Type length(24) with { variant "FIELDLENGTH(24)" };
type bitstring B27_Type length(27) with { variant "FIELDLENGTH(27)" };
type bitstring B28_Type length(28) with { variant "FIELDLENGTH(28)" };
type bitstring B32_Type length(32) with { variant "FIELDLENGTH(32)" };
type bitstring B36_Type length(36) with { variant "FIELDLENGTH(36)" };
type bitstring B40_Type length(40) with { variant "FIELDLENGTH(40)" };
type bitstring B41_Type length(41) with { variant "FIELDLENGTH(41)" };
type bitstring B42_Type length(42) with { variant "FIELDLENGTH(42)" };
type bitstring B43_Type length(43) with { variant "FIELDLENGTH(43)" };
type bitstring B45_Type length(45) with { variant "FIELDLENGTH(45)" };
type bitstring B47_Type length(47) with { variant "FIELDLENGTH(47)" };
type bitstring B48_Type length(48) with { variant "FIELDLENGTH(48)" };
type bitstring B56_Type length(56) with { variant "FIELDLENGTH(56)" };
type bitstring B64_Type length(64) with { variant "FIELDLENGTH(64)" };
type bitstring B80_Type length(80) with { variant "FIELDLENGTH(80)" };
type bitstring B112_Type length(112) with { variant "FIELDLENGTH(112)" };
type bitstring B128_Type length(128) with { variant "FIELDLENGTH(128)" };
type bitstring B160_Type length(160) with { variant "FIELDLENGTH(160)" };
type bitstring B184_Type length(184) with { variant "FIELDLENGTH(184)" };
type bitstring B192_Type length(192) with { variant "FIELDLENGTH(192)" };
type bitstring B256_Type length(256) with { variant "FIELDLENGTH(256)" };
type bitstring B32_128_Type length(32..128);
type B128_Type B128_Key_Type; /* 128 bit security key */
type B256_Type B256_Key_Type; /* 256 bit security key */
type octetstring O1_Type length(1);
type octetstring O2_Type length(2);
type octetstring O3_Type length(3);
type octetstring O4_Type length(4);
type octetstring O5_Type length(5);
type octetstring O6_Type length(6);
type octetstring O8_Type length(8);
type octetstring O9_Type length(9);
type octetstring O10_Type length(10);
type octetstring O13_Type length(13);
type octetstring O14_Type length(14);
type octetstring O15_Type length(15);
type octetstring O16_Type length(16);
type octetstring O28_Type length(28);
type octetstring O32_Type length(32);
type octetstring O43_Type length(43);
type hexstring H1_Type length(1);
type hexstring H2_Type length(2);
type hexstring H4_Type length(4);
type hexstring H12_Type length(12);
type hexstring H14_Type length(14);
type octetstring O1_Type length(1) with { variant "FIELDLENGTH(1)" };
type octetstring O2_Type length(2) with { variant "FIELDLENGTH(2)" };
type octetstring O3_Type length(3) with { variant "FIELDLENGTH(3)" };
type octetstring O4_Type length(4) with { variant "FIELDLENGTH(4)" };
type octetstring O5_Type length(5) with { variant "FIELDLENGTH(5)" };
type octetstring O6_Type length(6) with { variant "FIELDLENGTH(6)" };
type octetstring O8_Type length(8) with { variant "FIELDLENGTH(8)" };
type octetstring O9_Type length(9) with { variant "FIELDLENGTH(9)" };
type octetstring O10_Type length(10) with { variant "FIELDLENGTH(10)" };
type octetstring O13_Type length(13) with { variant "FIELDLENGTH(13)" };
type octetstring O14_Type length(14) with { variant "FIELDLENGTH(14)" };
type octetstring O15_Type length(15) with { variant "FIELDLENGTH(15)" };
type octetstring O16_Type length(16) with { variant "FIELDLENGTH(16)" };
type octetstring O28_Type length(28) with { variant "FIELDLENGTH(28)" };
type octetstring O32_Type length(32) with { variant "FIELDLENGTH(32)" };
type octetstring O43_Type length(43) with { variant "FIELDLENGTH(43)" };
type hexstring H1_Type length(1) with { variant "FIELDLENGTH(1)" };
type hexstring H2_Type length(2) with { variant "FIELDLENGTH(2)" };
type hexstring H4_Type length(4) with { variant "FIELDLENGTH(4)" };
type hexstring H12_Type length(12) with { variant "FIELDLENGTH(12)" };
type hexstring H14_Type length(14) with { variant "FIELDLENGTH(14)" };
type O1_Type Octet_Type;
type hexstring HalfOctet_Type length(1);
type hexstring HalfOctet_Type length(1) with { variant "FIELDLENGTH(1)" };
type record of B8_Type B8_List_Type;
......@@ -1695,4 +1695,6 @@ module CommonDefs {
}
return omit;
}
} with {
encode "RAW"
}
......@@ -29,7 +29,7 @@ module NAS_CommonTypeDefs {
type HalfOctet_Type SpareHalfOctet;
type hexstring NAS_Mcc length(3); //* @desc Type which can be used to represent an MCC (as string of 3 decimal digits).
type hexstring NAS_Mcc length(3) with { variant "FIELDLENGTH(3)" }; //* @desc Type which can be used to represent an MCC (as string of 3 decimal digits).
type record of hexstring EmergencyNumList;
......@@ -65,7 +65,7 @@ module NAS_CommonTypeDefs {
type B3_Type PdnTypeValue;
type bitstring BcdDigit_Bit length(4);
type bitstring BcdDigit_Bit length(4) with { variant "FIELDLENGTH(4)" };
type B3_Type NAS_IdType;
type B8_Type NAS_CauseValue_Type;
......@@ -92,6 +92,11 @@ module NAS_CommonTypeDefs {
IEI8_Type iei optional, /* present in case of TLV; omit in case of LV */
Type4Length_Type iel,
octetstring nameValue length(1..100)
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (nameValue)";
variant (iel) "BYTEORDER(last)";
variant (nameValue) "BYTEORDER(last)";
};
type record AdditionalUpdateType { /* 24.301 cl. 9.9.3.0B @sic R5s100135 sic@ */
......@@ -99,6 +104,8 @@ module NAS_CommonTypeDefs {
B2_Type pnb_CIOT, // 0=no additional info, 1=CP, 2=UP, 3=reserved @sic R5s160711 Baseline Moving sic@
B1_Type signallingActiveFlag, // @sic R5s160711 Baseline Moving sic@
B1_Type addUpdateTypeValue
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -110,6 +117,8 @@ module NAS_CommonTypeDefs {
IEI4_Type iei optional, // '1000'B
B1_Type spare1,
KeySeq keySeq
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -120,6 +129,8 @@ module NAS_CommonTypeDefs {
type record ConnectivityType {
IEI4_Type iei,
B4_Type connectivityValue
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -130,6 +141,8 @@ module NAS_CommonTypeDefs {
// IEI is always skipped
B1_Type switchOff,
NAS_AttDetValue_Type typeOfDetach
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -141,6 +154,8 @@ module NAS_CommonTypeDefs {
IEI4_Type iei,
B3_Type spare,
B1_Type lowPriority
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -154,6 +169,8 @@ module NAS_CommonTypeDefs {
B4_Type cnDRXcoef, // CN specific DRX cycle length coefficient
B1_Type splitOnCCCH, // Split on CCCCH
B3_Type nonDRXtimer // non-DRX timer
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -164,6 +181,8 @@ module NAS_CommonTypeDefs {
type record EmergServCat {
B1_Type spare,
B7_Type emergSCValue // Emergency Service Category value
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -175,6 +194,11 @@ module NAS_CommonTypeDefs {
Type4Length_Type len, // length
EmergServCat emergServCat, // Emergency Service Category
octetstring digits length(0..10) // BCD numbers
} with {
variant "FIELDORDER(msb)";
variant (len) "LENGTHTO (emergServCat, digits)";
variant (len) "BYTEORDER(last)";
variant (digits) "BYTEORDER(last)";
};
// =============================================================================
......@@ -186,6 +210,10 @@ module NAS_CommonTypeDefs {
IEI8_Type iei, // '00110100'B (34 hex) @sic R5s110420 sic@
Type4Length_Type iel, // length @sic R5s110420 sic@
record length (1..10) of EmergNum emergNum // Emergency Number
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (emergNum)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -197,6 +225,8 @@ module NAS_CommonTypeDefs {
IEI8_Type iei optional, /* present in case of TV; omit in case of V */
GprsTimerUnit unit,
B5_Type timerValue
} with {
variant "FIELDORDER(msb)";
};
type B3_Type GprsTimerUnit;
......@@ -211,6 +241,10 @@ module NAS_CommonTypeDefs {
Type4Length_Type iel, // length @sic R5s110420 sic@
GprsTimerUnit unit, // Unit
B5_Type gprsTimerValue // Timer value
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (unit, gprsTimerValue)";
variant (iel) "BYTEORDER(last)";
};
type GPRS_Timer2 GPRS_Timer3; // definition is identical @sic R5s150329 Baseline Moving sic@
......@@ -224,6 +258,8 @@ module NAS_CommonTypeDefs {
IEI4_Type iei optional, /* present in case of TV; omit in case of V */
B1_Type spare,
B3_Type requestValue
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -235,6 +271,8 @@ module NAS_CommonTypeDefs {
IEI8_Type iei optional,
NAS_PlmnId plmn, // MCC + MNC 3 digits each
NAS_Lac lac // LAC
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -246,6 +284,8 @@ module NAS_CommonTypeDefs {
IEI8_Type iei optional, /* present in case of TV; omit in case of V */
LocAreaId lai, /* MCC + MNC + LAC */
O1_Type rac /* RAC */
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -256,6 +296,8 @@ module NAS_CommonTypeDefs {
IEI8_Type iei optional, /* present in case of TV; omit in case of V */
B4_Type spare,
B4_Type llcSapiValue
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -271,6 +313,11 @@ module NAS_CommonTypeDefs {
B1_Type oddEvenInd, // Odd/even indicator
NAS_IdType typeOfId, // Type of identity
octetstring otherDigits length(0..10) // Other identity digits (10 octets rather than 8 to cover Guti as well)
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (idDigit1, oddEvenInd, typeOfId, otherDigits)";
variant (iel) "BYTEORDER(last)";
variant (otherDigits) "BYTEORDER(last)";
};
// =============================================================================
......@@ -301,6 +348,10 @@ module NAS_CommonTypeDefs {
B1_Type cMSP, // CM Service Prompt Support
B1_Type a5_3, // Algorithm A5/3 Support
B1_Type a5_2 // Algorithm A5/2 Support
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare1_1, revLvl, eSIND, a5_1, rFPwrCap, spare1_2, pSCap, sSSI, sMCap, vBS, vGCS, fC, cM3, spare1_3, lCSVA, uCS2, soLSA, cMSP, a5_3, a5_2)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -405,6 +456,11 @@ module NAS_CommonTypeDefs {
B1_Type xtdTSCSetCap optional, // @sic R5s150329 Baseline Moving sic@
B1_Type xtdEARFCNValueRange optional, // @sic R5s160712 Baseline Moving sic@
bitstring spareBits2 optional
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spareBit, multibandSupported, a5_7, a5_6, a5_5, a5_4, associatedRadioCapabilty2, spareBits1, associatedRadioCapabilty1, maskBit1, rGSM_RadioCapability, maskBit2, multiSlotClass, uCS2Treatment, extMeasurementCapability, maskBit3, msMeasurementCapability, maskBit4, msPositioningMethod, maskBit5, eDGE_MultiSlot, maskBit6, psk8_Struct, maskBit7, gSM400BandsSupported, gSM400AssociatedRadioCapability, maskBit8, gSM850AssociatedRadiioCapability, maskBit9, pCS1900AssociatedRadiioCapability, uMTS_FDD_RAT_Capability, uMTS384TDD_RAT_Capability, cDMA2000_RAT_Capability, maskBit10, dTM_GPRS_MultiSlotSubclass, singleSlotDTM, maskBit11, dTM_EGPRS_MultiSlorSubclass, maskBit12, singleBandSupport, maskBit13, gSM700AssociatedRadioCapability, uMTS128TDD_RAT_Capability, gERANFeatPack1, mask14, extDTM_GPRS_MultiSlotSubclass, etxDTM_EGPRS_MultiSlotSubclass, mask15, highMultislotCap, spare2, gERANFeatPack2, gMSKMultislotPowerProfile, pSKMultislotPowerProfile, mask17, tGSM400BandsSupported, tGSM400AssocRadioCap, spare, dlAdvancedRxPerf, dTMEhancCap, mask19, dTMGPRSHighMultislotClass, offsetReq, mask20, dTMEGPRSHighMultislotClass, rptdACCHCap, mask21, gsm710AssocRadioCap, mask22, tgsm810AssocRadioCap, cipheringModeSettingCap, addPositionCap, eutraFDDSupport, eutraTDDSupport, eutraMeasAndReporting, priorityBasedReselection, utraCSGCellsReporting, vamosLevel, tighterCap, selectCipheringDLSACCH, csPS_SRVCC_G2U, csPS_SRVCC_G2E, geranNwkSharing, eutraWidebandRSRQMeas, erBandSupport, utraMultipleFreqBandInd, eutraMultipleFreqBandInd, xtdTSCSetCap, xtdEARFCNValueRange)";
variant (iel) "BYTEORDER(last)";
variant (spareBits2) "BYTEORDER(last)";
};
// =============================================================================
......@@ -417,6 +473,8 @@ module NAS_CommonTypeDefs {
B2_Type eDGE_RF_PowerCapability1 optional, // not present if pwrMask1 = 0
B1_Type pwrMask2,
B2_Type eDGE_RF_PowerCapability2 optional // not present if pwrMask2 = 0
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -426,6 +484,8 @@ module NAS_CommonTypeDefs {
type record MS_MeasCapability {
B4_Type sMS_VALUE,
B4_Type sM_VALUE
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -468,6 +528,11 @@ module NAS_CommonTypeDefs {
B1_Type restrictEnhancedCoverageCap optional, // @sic R5s170598 Baseline Moving sic@
B1_Type dualConnectivityEUTRA_NR optional, // @sic R5s180553 Baseline Moving sic@
bitstring spareBits length (0..43) optional
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (gea1, smCapDedicated, smCapGPRS, ucs2, ssScreeningIndicator, soLSACap, revLevelIndicator, pfcFeatureMode, gea2, gea3, gea4, gea5, gea6, gea7, lcsVACap, psHOtoUTRAN_IuModeCap, psHOtoEUTRAN_S1ModeCap, emmCombinedCap, isrSupport, srvccToGERAN_UTRANCap, epcCap, nfCap, gERANNtwkShareCap, userPlaneIntegrityProtSupport, gia4, gia5, gia6, gia7, ePCOInd, restrictEnhancedCoverageCap, dualConnectivityEUTRA_NR, spareBits)";
variant (iel) "BYTEORDER(last)";
variant (spareBits) "BYTEORDER(last)";
};
// =============================================================================
......@@ -479,6 +544,8 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI4_Type iei,
B3_Type spareBits,
B1_Type n3ENInd
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -491,6 +558,10 @@ type record Non3GPP_NW_ProvidedPolicies {
Type4Length_Type iel, //
B10_Type nriContainerValue, // @sic R5s140778 sic@
B6_Type spareBits // @sic R5s140778 sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (nriContainerValue, spareBits)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -503,6 +574,10 @@ type record Non3GPP_NW_ProvidedPolicies {
Type4Length_Type iel, // @sic R5s110420 sic@
B1_Type spare,
B7_Type idValue
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare, idValue)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -514,6 +589,10 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI8_Type iei,
Type4Length_Type iel,
NAS_PlmnId plmn
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (plmn)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -526,6 +605,10 @@ type record Non3GPP_NW_ProvidedPolicies {
Type4Length_Type iel, // @sic R5s110420 sic@
record length(1..15) of
NAS_PlmnId plmnList /* list of PLMNs */
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (plmnList)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -537,6 +620,8 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI4_Type iei,
B3_Type spare,
B1_Type extdPeriodicTimers
} with {
variant "FIELDORDER(msb)";
};
type PLMN_List.plmnList NAS_PlmnIdList_Type;
......@@ -554,6 +639,11 @@ type record Non3GPP_NW_ProvidedPolicies {
B3_Type configProtocol,
record length (0..83) of
ProtocolContainer pco optional
} with {
variant "FIELDORDER(msb)";
// FIXME variant (pco) "FORCEOMIT(protocolLongLength)";
variant (iel) "LENGTHTO (ext, spare, configProtocol, pco)";
variant (iel) "BYTEORDER(last)";
};
type record ProtocolContainer {
......@@ -561,6 +651,11 @@ type record Non3GPP_NW_ProvidedPolicies {
Type4Length_Type protocolLength optional, // @sic R5s201386 Baseline Moving sic@
Type6Length_Type protocolLongLength optional, // always set to omit in UL @sic R5s201386 Baseline Moving sic@
octetstring content optional
} with {
variant "FIELDORDER(msb)";
variant (protocolLength) "LENGTHTO (content)";
variant (protocolLength) "BYTEORDER(last)";
variant (content) "BYTEORDER(last)";
};
type ProtocolConfigOptions.pco NAS_ProtocolConfigOptions_Type;
......@@ -570,6 +665,9 @@ type record Non3GPP_NW_ProvidedPolicies {
B1_Type aer,
B3_Type uplinkTimeUnit,
O3_Type maxUplinkRate optional // @sic R5s170598 Baseline Moving sic@
} with {
variant "FIELDORDER(msb)";
variant (maxUplinkRate) "BYTEORDER(last)";
};
// =============================================================================
// Structured Type Definition
......@@ -580,6 +678,11 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI8_Type iei optional, /* present in case of TV; omit in case of V */
Type4Length_Type iel optional, // only present in 24.008 version of DETACH REQUEST message
O3_Type signatureValue
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (signatureValue)";
variant (iel) "BYTEORDER(last)";
variant (signatureValue) "BYTEORDER(last)";
};
// =============================================================================
......@@ -620,6 +723,10 @@ type record Non3GPP_NW_ProvidedPolicies {
B8_Type guaranteedBitRateDL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@
B8_Type maxBitRateUL_Ext2 optional, // @sic R5s1300195 Baseline Moving sic@
B8_Type guaranteedBitRateUL_Ext2 optional // @sic R5s1300195 Baseline Moving sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare1, delayClass, relabilityClass, peakThroughput, spare2, precedenceClass, spare3, meanThroughput, trafficClass, deliveryOrder, deliveryErrorSDU, maxSduSize, maxBitRateUL, maxBitRateDL, residualBER, sduErrorRatio, transferDelay, trafficHandlingPrio, guaranteedBitRateUL, guaranteedBitRateDL, spare4, signallingInd, sourceStatisticsDescriptor, maxBitRateDL_Ext, guaranteedBitRateDL_Ext, maxBitRateUL_Ext, guaranteedBitRateUL_Ext, maxBitRateDL_Ext2, guaranteedBitRateDL_Ext2, maxBitRateUL_Ext2, guaranteedBitRateUL_Ext2)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -631,6 +738,8 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI4_Type iei optional, /* present in case of TV; omit in case of V */
B1_Type spare,
B3_Type levelValue
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -643,6 +752,10 @@ type record Non3GPP_NW_ProvidedPolicies {
Type4Length_Type len, // length
B8_Type bitMap1to8, // codec bitmap bits 1-8
B8_Type bitMap9to16 optional // codec bitmap bits 9-16
} with {
variant "FIELDORDER(msb)";
variant (len) "LENGTHTO (bitMap1to8, bitMap9to16)";
variant (len) "BYTEORDER(last)";
};
// =============================================================================
......@@ -654,6 +767,10 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI8_Type iei, // '01000000'B (40 hex) @sic R5s110420 sic@
Type4Length_Type iel, // length @sic R5s110420 sic@
record of Codec codec// list of codecs
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (codec)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -665,6 +782,8 @@ type record Non3GPP_NW_ProvidedPolicies {
// IEI is always skipped
B1_Type spare,
B3_Type typeValue
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -676,6 +795,8 @@ type record Non3GPP_NW_ProvidedPolicies {
IEI4_Type iei optional,
B3_Type spare3,
TmsiStatusValue flag // Flag
} with {
variant "FIELDORDER(msb)";
};
// =============================================================================
......@@ -691,12 +812,21 @@ type record Non3GPP_NW_ProvidedPolicies {
B4_Type noOfPktFilter,
record of PacketFilter packetFilterList optional,
record of TftParameter parameterList optional
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (tftOperationCode, eBit, noOfPktFilter, packetFilterList, parameterList)";
variant (iel) "BYTEORDER(last)";
};
type record TftParameter {
IEI8_Type iei,
Type4Length_Type iel,
octetstring contents
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (contents)";
variant (iel) "BYTEORDER(last)";
variant (contents) "BYTEORDER(last)";
};
type record PacketFilter {
......@@ -706,6 +836,11 @@ type record Non3GPP_NW_ProvidedPolicies {
B8_Type precedence optional,
Type4Length_Type iel optional,
PacketFilterContents contents optional
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (contents)";
variant (iel) "BYTEORDER(last)";
variant (contents) "BYTEORDER(last)";
};
type record of PacketFilterComponent PacketFilterContents;
......@@ -713,7 +848,9 @@ type record Non3GPP_NW_ProvidedPolicies {
type record PacketFilterComponent {
O1_Type id,
PacketFilterComponentValue packetFilterComponentValue
} with { variant (id)"FIELDLENGTH(8)";};
} with {
variant "FIELDORDER(msb)";
};
type union PacketFilterComponentValue {
O8_Type ipv4RemoteAddress,
......@@ -726,6 +863,17 @@ type record Non3GPP_NW_ProvidedPolicies {
O4_Type securityParameterIndex,
O2_Type typeOfServiceTrafficClass,
O3_Type flowLabel
} with {
variant "FIELDORDER(msb)";
variant (ipv4RemoteAddress) "BYTEORDER(last)";
variant (ipv6RemoteAddress) "BYTEORDER(last)";
variant (singleLocalPort) "BYTEORDER(last)";
variant (localPortRange) "BYTEORDER(last)";
variant (singleRemotePort) "BYTEORDER(last)";
variant (remotePortRange) "BYTEORDER(last)";
variant (securityParameterIndex) "BYTEORDER(last)";
variant (typeOfServiceTrafficClass) "BYTEORDER(last)";
variant (flowLabel) "BYTEORDER(last)";
};
type record UE_NetworkCap { // 24.301 cl. 9.9.3.34
......@@ -743,6 +891,8 @@ type record Non3GPP_NW_ProvidedPolicies {
octetstring spare optional // @sic R5s100135 sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO(eeaCap, eiaCap, ueaCap, uiaCap, srvcc_LPP_ProSeCap, cIoT_proSeCap, cIoT_V2X, edt_WUS, musim, spare)";
variant (iel) "BYTEORDER(last)";
}
type record ReAttemptIndicator { // 24.301 cl. 9.9.4.13A, 24.008 cl. 10.5.6.5A
......@@ -755,6 +905,8 @@ type record Non3GPP_NW_ProvidedPolicies {
B1_Type ratcValue
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO(spare, eplmncValue, ratcValue)";
variant (iel) "BYTEORDER(last)";
}
// =============================================================================
......@@ -768,8 +920,9 @@ type record Non3GPP_NW_ProvidedPolicies {
B128_Type aUTN /* (as for UMTS) */
} with {
variant "FIELDORDER(msb)";
variant "PRESENCE (iei = '20'O)";
variant (iel) "LENGTHTO (aUTN)"
variant (iel) "LENGTHTO (aUTN)";
variant (iel) "BYTEORDER(last)";
variant (aUTN) "BYTEORDER(last)";
}
// =============================================================================
......@@ -784,8 +937,9 @@ type record Non3GPP_NW_ProvidedPolicies {
B112_Type auts // AUTS, 14 octets
} with {
variant "FIELDORDER(msb)";
variant "PRESENCE (iei = '30'O)";
variant (iel) "LENGTHTO (auts)"
variant (iel) "LENGTHTO (auts)";
variant (iel) "BYTEORDER(last)";
variant (auts) "BYTEORDER(last)";
}
// =============================================================================
......@@ -798,7 +952,7 @@ type record Non3GPP_NW_ProvidedPolicies {
B128_Type randValue // Authentication Parameter RAND value
} with {
variant "FIELDORDER(msb)";
variant "PRESENCE (iei = '21'O)"
variant (randValue) "BYTEORDER(last)";
}
type record DaylightSavingTime { /* 24.301 cl. 9.9.3.5 -> 24.008 cl. 10.5.3.12 */
......@@ -808,6 +962,8 @@ type record Non3GPP_NW_ProvidedPolicies {
B2_Type val
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare, val)";
variant (iel) "BYTEORDER(last)";
};
type record NetworkName { /* 24.301 cl. 9.9.3.21 -> 24.008 cl. 10.5.3.5a */
......@@ -820,6 +976,9 @@ type record Non3GPP_NW_ProvidedPolicies {
octetstring text
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (ext, codingScheme, addCI, spareBitCnt, text)";
variant (iel) "BYTEORDER(last)";
variant (text) "BYTEORDER(last)";
};
type record TimeZone { /* 24.301 cl. 9.9.3.26 -> 24.008 cl. 10.5.3.8 */
......@@ -855,6 +1014,8 @@ type record Non3GPP_NW_ProvidedPolicies {
B2_Type voiceDomainPrefEUTRA // @sic R5s110233 sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spareBits, ueUsageSetting, voiceDomainPrefEUTRA)";
variant (iel) "BYTEORDER(last)";
};
type record IdentityType { /* 24.301 cl. 9.9.3.15 -> 24.008 cl. 10.5.3.4 */
......@@ -919,6 +1080,9 @@ type record Non3GPP_NW_ProvidedPolicies {
octetstring components // ASN.1 definitions BER encoded
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (components)";
variant (iel) "BYTEORDER(last)";
variant (components) "BYTEORDER(last)";
};
// =============================================================================
......@@ -946,6 +1110,8 @@ type record Non3GPP_NW_ProvidedPolicies {
O1_Type sS_VersionInfo // ss version information
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (sS_VersionInfo)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -987,6 +1153,10 @@ type record ExtdDRXParams {
B4_Type pagingTimeWindow,
B4_Type eDRXValue,
B8_Type extdPTW optional // @sic R5s221182 Baseline Moving Rel-17 sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (pagingTimeWindow, eDRXValue, extdPTW)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -998,6 +1168,11 @@ type record NBIFOMContainer {
IEI8_Type iei,
Type4Length_Type iel, // length
octetstring containerContents
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (containerContents)";
variant (iel) "BYTEORDER(last)";
variant (containerContents) "BYTEORDER(last)";
};
// =============================================================================
......@@ -1009,6 +1184,11 @@ type record NBIFOMContainer {
IEI8_Type iei,
Type4Length_Type iel,
O2_Type dcnIdValue
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (dcnIdValue)";
variant (iel) "BYTEORDER(last)";
variant (dcnIdValue) "BYTEORDER(last)";
};
// =============================================================================
......@@ -1023,6 +1203,10 @@ type record NBIFOMContainer {
B4_Type spare,
B3_Type configProtocol,
record of ProtocolContainer pco optional
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (ext, spare, configProtocol, configProtocol)";
variant (iel) "BYTEORDER(last)";
};
type record of ProtocolContainer NAS_ExtdProtocolConfigOptions_Type; /* @sic R5-2001649 sic@ @status APPROVED (LTE_A_PRO, NBIOT) */
......@@ -1035,6 +1219,11 @@ type record NBIFOMContainer {
IEI8_Type iei,
Type4Length_Type iel,
octetstring additionalInfo
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (additionalInfo)";
variant (iel) "BYTEORDER(last)";
variant (additionalInfo) "BYTEORDER(last)";
};
type record AuthenticationResponseParameter { /* 24.301 cl. 9.9.3.4 */
......@@ -1042,8 +1231,10 @@ type record NBIFOMContainer {
Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */
B32_128_Type res /* 4..16 octets */
} with {
variant "PRESENCE (iei = '2D'O)";
variant (iel) "LENGTHTO (res)"
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (res)";
variant (iel) "BYTEORDER(last)";
variant (res) "BYTEORDER(last)";
}
type record NAS_KeySetIdentifier { /* 24.301 cl. 9.9.3.21 */
......@@ -1052,8 +1243,6 @@ type record NBIFOMContainer {
NAS_KsiValue nasKeySetId
} with {
variant "FIELDORDER(msb)";
variant "FORCEOMIT(iei)";
variant "FIELDLENGTH(4)";
}
type record HashMME { /* 24.301 cl. 9.9.3.50 @sic R5s170597 Baseline Moving sic@ */
......@@ -1062,8 +1251,9 @@ type record NBIFOMContainer {
O8_Type hashMME
} with {
variant "FIELDORDER(msb)";
variant "FORCEOMIT(iei)";
variant "FIELDLENGTH(4)";
variant (iel) "LENGTHTO (hashMME)";
variant (iel) "BYTEORDER(last)";
variant (hashMME) "BYTEORDER(last)";
}
type record PDN_Address { /* 24.301 cl. 9.9.4.9 */
......@@ -1074,8 +1264,9 @@ type record NBIFOMContainer {
octetstring adressInfo length(4..12)
} with {
variant "FIELDORDER(msb)";
variant "FORCEOMIT(iei)";
variant (iel) "LENGTHTO (adressInfo)";
variant (iel) "LENGTHTO (spare, typeValue, adressInfo)";
variant (iel) "BYTEORDER(last)";
variant (adressInfo) "BYTEORDER(last)";
};
type record ReplayedNASMessageContainer { /* 24.301 cl. 9.9.3.51 @sic R5s170597 Baseline Moving sic@ */
......@@ -1084,8 +1275,9 @@ type record NBIFOMContainer {
octetstring replayedNASMsgContainerValue
} with {
variant "FIELDORDER(msb)";
variant "FORCEOMIT(iei)";
variant (iel) "LENGTHTO (replayedNASMsgContainerValue)";
variant (iel) "BYTEORDER(last)";
variant (replayedNASMsgContainerValue) "BYTEORDER(last)";
};
type record NAS_SecurityAlgorithms { /* 24.301 cl. 9.9.3.23 */
......@@ -1094,6 +1286,8 @@ type record NBIFOMContainer {
B3_Type cipheringType, /* Type of ciphering algorithm */
B1_Type spare2,
B3_Type integrityType /* Type of integrity protection algorithm */
} with {
variant "FIELDORDER(msb)";
};
type record Extd_EPS_QOS { /* 24.301 cl. 9.9.4.30 */
......@@ -1109,6 +1303,10 @@ type record NBIFOMContainer {
B8_Type guaranteedBitRateUl_2,
B8_Type guaranteedBitRateDl_1,
B8_Type guaranteedBitRateDl_2
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (unitMaxBitRate, maxBitRateUl_1, maxBitRateUl_2, maxBitRateDl_1, maxBitRateDl_2, unitGuaranteedBitRate, guaranteedBitRateUl_1, guaranteedBitRateUl_2, guaranteedBitRateDl_1, guaranteedBitRateDl_2)";
variant (iel) "BYTEORDER(last)";
};
type record UE_Status { // 24.501 cl. 9.11.3.56
......@@ -1117,6 +1315,10 @@ type record NBIFOMContainer {
B6_Type spare,
B1_Type n1ModeRegistered,
B1_Type s1ModeRegistered
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare, n1ModeRegistered, s1ModeRegistered)";
variant (iel) "BYTEORDER(last)";
};
// =============================================================================
......@@ -1130,6 +1332,10 @@ type record NBIFOMContainer {
B7_Type spareBits, // @sic R5s201386 Baseline Moving sic@
B1_Type extdEmergNumListValidity,
record of ExtdEmergNum emergNum
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spareBits, extdEmergNumListValidity, emergNum)";
variant (iel) "BYTEORDER(last)";
};
type record ExtdEmergNum {
......@@ -1137,6 +1343,12 @@ type record NBIFOMContainer {
octetstring digits, // BCD numbers
Type4Length_Type lengthOfSubService,
octetstring subServices
} with {
variant "FIELDORDER(msb)";
variant (lengthOfSubService) "LENGTHTO (subServices)";
variant (lengthOfSubService) "BYTEORDER(last)";
variant (digits) "BYTEORDER(last)";
variant (subServices) "BYTEORDER(last)";
};
// =============================================================================
......@@ -1151,6 +1363,10 @@ type record NBIFOMContainer {
O1_Type ueaCap optional, // @sic R5s100135 sic@
O1_Type uiaCap optional, // @sic R5s100135 sic@
O1_Type geaCap optional // @sic R5s100135 sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (eeaCap, eiaCap, ueaCap, uiaCap, geaCap)";
variant (iel) "BYTEORDER(last)";
};
type record EPS_QualityOfService { /* 24.301 cl. 9.9.4.3 */
......@@ -1169,6 +1385,10 @@ type record NBIFOMContainer {
B8_Type maxBitRateDL_Ext2 optional, // @sic R5s1300195 Baseline Moving, R5s180640 sic@
B8_Type guaranteedBitRateUL_Ext2 optional, // @sic R5s1300195 Baseline Moving, R5s180640 sic@
B8_Type guaranteedBitRateDL_Ext2 optional // @sic R5s1300195 Baseline Moving, R5s180640 sic@
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (maxBitRateUl, maxBitRateDl, guaranteedBitRateUl, guaranteedBitRateDl, maxBitRateUlExt, maxBitRateDlExt, guaranteedBitRateUlExt, guaranteedBitRateDlExt, maxBitRateUL_Ext2, maxBitRateDL_Ext2, guaranteedBitRateUL_Ext2, guaranteedBitRateDL_Ext2)";
variant (iel) "BYTEORDER(last)";
};
type record EPS_BearerContextStatus { /* 24.301 cl. 9.9.2.1 */
......@@ -1178,18 +1398,29 @@ type record NBIFOMContainer {
B4_Type ebi4_1, /* EBI(1)- EBI(4) @sic R5s180552 Baseline Moving 2018 Phase 2 sic@ */
B1_Type spare, /* EBI(0) is spare and shall be coded as zero @sic R5s180552 Baseline Moving 2018 Phase 2 sic@ */
B8_Type ebi8_15 /* EBI(8)- EBI(15)*/
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (ebi5_7, ebi4_1, spare, ebi5_7)";
variant (iel) "BYTEORDER(last)";
};
type record UERadioCapId { /* 24.501 cl. 9.11.3.68 */
IEI8_Type iei optional, /* present in case of TV or TLV; omit in case of V */
Type4Length_Type iel optional, /* present in case of LV or TLV; omit in case of V */
octetstring id
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (id)";
variant (iel) "BYTEORDER(last)";
variant (id) "BYTEORDER(last)";
};
type record UERadioCapIdDeletion { /* 24.501 cl. 9.11.3.69 */
IEI4_Type iei optional,
B1_Type spare,
B3_Type deleteReq
} with {
variant "FIELDORDER(msb)";
};
type record DRXParamCommon { /* 24.301 cl. 9.9.3.63 */
......@@ -1197,42 +1428,67 @@ type record NBIFOMContainer {
Type4Length_Type iel,
B4_Type spare,
B4_Type drxValue
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare, drxValue)";
variant (iel) "BYTEORDER(last)";
};
type record ReleaseAssistanceInd { /* 24.301 cl. 9.9.4.25 */
IEI4_Type iei optional,
B2_Type spare,
B2_Type dlDataExpected
} with {
variant "FIELDORDER(msb)";
};
type record WUSAssistInfo { /* 24.301 cl. 9.9.3.62 */
IEI8_Type iei optional,
Type4Length_Type iel,
record of WusInfoType infoType
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (infoType)";
variant (iel) "BYTEORDER(last)";
};
type record WusInfoType {
B3_Type wusType,
B5_Type pagingProbability,
octetstring wusValue optional
} with {
variant "FIELDORDER(msb)";
variant (wusValue) "BYTEORDER(last)";
};
type record ServingPLMNRateControl { /* 24.301 cl. 9.9.4.28 */
IEI8_Type iei optional,
Type4Length_Type iel,
O2_Type servingPLMNRate
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (servingPLMNRate)";
variant (iel) "BYTEORDER(last)";
variant (servingPLMNRate) "BYTEORDER(last)";
};
type record ControlPlaneInd { /* 24.301 cl. 9.9.4.23 */
IEI4_Type iei optional,
B3_Type spare,
B1_Type cpIndValue
} with {
variant "FIELDORDER(msb)";
};
type record QoSParameters {
O1_Type id,
Type4Length_Type lenOfContent,
octetstring qosParam
} with {
variant "FIELDORDER(msb)";
variant (lenOfContent) "LENGTHTO (qosParam)";
variant (lenOfContent) "BYTEORDER(last)";
variant (qosParam) "BYTEORDER(last)";
};
type record of QoSParameters QoSParametersList;
......@@ -1242,7 +1498,11 @@ type record NBIFOMContainer {
Type4Length_Type iel,
B4_Type spare,
B4_Type requestType
} with {
variant "FIELDORDER(msb)";
variant (iel) "LENGTHTO (spare, requestType)";
variant (iel) "BYTEORDER(last)";
};
//} with { encode "NAS Types" }
} with { encode "RAW"; variant "" }
} with { encode "RAW" }
......@@ -29,6 +29,8 @@ module NG_NAS_Common {
PDU_SessionStatus SessionStatus optional,
EPS_BearerContextStatus EPSBearerStatus optional, // @sic R5-206426 sic@
UERadioCapId UERadioCapId optional // @sic R5-206419 sic@
} with {
variant "FIELDORDER(msb)";
};
type record GSM_MobilityInfo_Type { /* structured type to be stored & passed in/out of GSM Msgs
......@@ -43,6 +45,8 @@ module NG_NAS_Common {
integer EPS_Bearer optional, // @sic R5s201094 sic@
PDN_Index_Type PdnIndex optional, // @sic R5s201094 sic@
S_NSSAI_Type NSSAI optional // @sic R5s210148 sic@
} with {
variant "FIELDORDER(msb)";
};
type record of GSM_MobilityInfo_Type PDUSessionInfoList_Type; /* @status APPROVED (IMS, NR5GC, NR5GC_IRAT, POS) */
......
......@@ -56,16 +56,35 @@ module NG_NAS_MsgContainers
SET_UAI_RESPONSE set_UAI_Response,
SET_UL_MESSAGE_RESPONSE set_UL_Message_Response,
UE_TEST_LOOP_NR_SIDELINK_COUNTER_RESPONSE test_Loop_Sidelink_Counter_Response // @sic R5-225291 sic@
} with {
} with { // FIXME FSCOM Check messageType for deregistration_RequestMO
variant "TAG(
security_Protected_Nas_Message, securityHeaderType = '0001'B;
security_Protected_Nas_Message, securityHeaderType = '0010'B;
security_Protected_Nas_Message, securityHeaderType = '0011'B;
security_Protected_Nas_Message, securityHeaderType = '0100'B;
authentication_Failure, messageType = '01011001'B;
authentication_Response, messageType = '01010111'B;
configuration_Update_Complete, messageType = '01010101'B;
cp_Service_Request, messageType = '01001111'B;
deregistration_Accept, messageType = '01000110'B;
deregistration_RequestMO, messageType = '01001000'B;
gmm_Status, messageType = '01100100'B;
gsm_Status, messageType = '11010110'B;
network_Slice_Specific_Authentication_Complete, messageType = '01010001'B;
identity_Response, messageType = '01011100'B;
notification_Response, messageType = '01100110'B;
pdu_Session_Authentication_Complete, messageType = '11000110'B;
pdu_Session_Establishment_Request, messageType = '11000001'B;
pdu_Session_Modification_Command_Reject, messageType = '11001101'B;
pdu_Session_Modification_Complete, messageType = '11001100'B;
pdu_Session_Modification_Request, messageType = '11001001'B;
pdu_Session_Release_Complete, messageType = '11010100'B;
pdu_Session_Release_Request, messageType = '11010001'B;
registration_Request, messageType = '01000001'B;
registration_Complete, messageType = '01000011'B;
authentication_Response, messageType = '01010111'B;
security_Mode_Complete, messageType = '01011110'B;
security_Mode_Reject, messageType = '01011111'B;
service_Request, messageType = '01001100'B;
ul_Nas_Transport, messageType = '01100111'B;
)"
......@@ -115,17 +134,38 @@ module NG_NAS_MsgContainers
UPDATE_UE_LOCATION_INFORMATION update_Ue_Location_Information //@sic R5-213421 sic@
} with {
} with { // FIXME FSCOM Check messageType for deregistration_RequestMT
variant "TAG(
security_Protected_Nas_Message, securityHeaderType = '0001'B;
security_Protected_Nas_Message, securityHeaderType = '0010'B;
security_Protected_Nas_Message, securityHeaderType = '0011'B;
security_Protected_Nas_Message, securityHeaderType = '0100'B;
registration_Accept, messageType = '01000010'B;
authentication_Reject, messageType = '01011000'B;
authentication_Request, messageType = '01010110'B;
security_Mode_Command, messageType = '01011101'B;
authentication_Result, messageType = '01011010'B;
configuration_Update_Command, messageType = '01010100'B;
deregistration_Accept, messageType = '01000110'B;
deregistration_RequestMT, messageType = '01001000'B;
dl_Nas_Transport, messageType = '01101000'B;
gmm_Status, messageType = '01100100'B;
gsm_Status, messageType = '11010110'B;
identity_Request, messageType = '01011011'B;
network_Slice_Specific_Authentication_Command, messageType = '01010000'B;
network_Slice_Specific_Authentication_Result, messageType = '01010010'B;
notification, messageType = '01100101'B;
pdu_Session_Authentication_Command, messageType = '11000101'B;
pdu_Session_Authentication_Result, messageType = '11000111'B;
pdu_Session_Establishment_Accept, messageType = '11000010'B;
pdu_Session_Establishment_Reject, messageType = '11000011'B;
pdu_Session_Modification_Command, messageType = '11001011'B;
pdu_Session_Modification_Reject, messageType = '11001010'B;
pdu_Session_Release_Command, messageType = '11010011'B;
pdu_Session_Release_Reject, messageType = '11010010'B;
registration_Accept, messageType = '01000010'B;
registration_Reject, messageType = '01000100'B;
security_Mode_Command, messageType = '01011101'B;
service_Accept, messageType = '01001110'B;
service_Reject, messageType = '01001101'B;
)"
}
......
......@@ -388,24 +388,40 @@ module NG_NAS_SecurityFunctions {
var octetstring v_S;
var octetstring v_P0;
log(">>> f_NG_Authentication_A4: p_PLMN=", p_PLMN);
log(">>> f_NG_Authentication_A4: p_AuthParams=", p_AuthParams);
log(">>> f_NG_Authentication_A4: p_KDF=", p_KDF);
log(">>> f_NG_Authentication_A4: p_Key=", p_Key);
// Generation of String
v_S := const_S6B_FC;
//FC = 0x6B
v_P0 := fl_GetServingNetworkName(p_PLMN, p_NID); // @sic R5s220753 sic@
log("f_NG_Authentication_A4: v_P0=", v_P0);
v_S := (v_S & v_P0);
log("f_NG_Authentication_A4: v_S=", v_S);
//P0 = serving network ID
v_S := (v_S & int2oct(lengthof(v_P0), 2)) ;
log("f_NG_Authentication_A4: v_S=", v_S);
//L0 = length of serving network ID
v_S := ( v_S & bit2oct ( p_AuthParams.RandValue ) );
log("f_NG_Authentication_A4: v_S=", v_S);
//P1 = RAND
v_S := ( v_S & '0010'O );
//L1 = length of RAND (i.e. 0x00 0x10)
log("f_NG_Authentication_A4: v_S=", v_S);
v_S := ( v_S & bit2oct (substr(p_AuthParams.XRES, 0, px_NAS_5GC_XRES_Length*8))); // @sic R5s190394 sic@
log("f_NG_Authentication_A4: v_S=", v_S);
//P2 = RES or XRES
v_S := ( v_S & int2oct(px_NAS_5GC_XRES_Length, 2) ); // @sic R5w190117 sic@
log("f_NG_Authentication_A4: v_S=", v_S);
//L2 = length of RES/XRES (e.g. 0x00 0x10)
return substr(fx_KeyDerivationFunction(p_KDF, p_Key, v_S), 128, 128);
var bitstring bs := fx_KeyDerivationFunction(p_KDF, p_Key, v_S); // Already 128 bits length
return bs;
//return substr(fx_KeyDerivationFunction(p_KDF, p_Key, v_S), 128, 128);
// returns LSB 128 bits[truncated] of the key generated
}
......
This diff is collapsed.
......@@ -5450,6 +5450,27 @@ module LibNGAP_Templates {
 
group Receive {
 
/**
* @see ETSI TS 138 413 V16.12.0 (2023-05) Clause 9.2.5.2 DOWNLINK NAS TRANSPORT
*/
template (present) InitiatingMessage mw_n2_UplinkNASTransport_base_nas:= {
procedureCode := id_UplinkNASTransport,
criticality := ?,
value_ := {
UplinkNASTransport := {
protocolIEs := {
*,
{
id := id_NAS_PDU,
criticality := ?,
value_ := { NAS_PDU := ? }
},
*
}
}
}
} // End of template mw_n2_UplinkNASTransport_base_nas
/**
* @see ETSI TS 138 413 V16.12.0 (2023-05) Clause 9.2.5.2 DOWNLINK NAS TRANSPORT
*/
......@@ -156,7 +156,7 @@ module LIB_NG_NAS_Functions {
if (f_Check_5GAKA_NAS_DL_Message(
vc_recvNAS_PDU,
mw_NG_AUTHENTICATION_REQUEST(
'000'B,
'100'B,
-,
mw_GMM_AuthRAND,
mw_GSM_AUTN
......@@ -322,9 +322,12 @@ module LIB_NG_NAS_Functions {
if ( (vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs[i].id) == 38 /*id_NAS_PDU*/){
vc_recvNAS_PDU := vc_recvNGAP_PDU.initiatingMessage.value_.InitialUEMessage.protocolIEs[i].value_.nAS_PDU;
var bitstring bs := oct2bit(vc_recvNAS_PDU);
var integer v_result := decvalue(bs,vc_recvNgNasUl_Msg);
log("****************************************");
log("InitialUEMessage - NAS-PDU! ");
log( vc_recvNAS_PDU );
log( vc_recvNgNasUl_Msg );
log("****************************************");
}
......@@ -336,9 +339,29 @@ module LIB_NG_NAS_Functions {
if ( (vc_recvNGAP_PDU.initiatingMessage.value_.DownlinkNASTransport.protocolIEs[i].id) == 38 /*id_NAS_PDU*/){
vc_recvNAS_PDU := vc_recvNGAP_PDU.initiatingMessage.value_.DownlinkNASTransport.protocolIEs[i].value_.nAS_PDU;
var bitstring bs := oct2bit(vc_recvNAS_PDU);
var integer v_result := decvalue(bs,vc_recvNgNasDl_Msg);
log("****************************************");
log("DownlinkNASTransport - NAS-PDU! ");
log( vc_recvNAS_PDU );
log( vc_recvNgNasDl_Msg );
log("****************************************");
}
}
}else if (match(vc_recvNGAP_PDU.initiatingMessage,mw_n2_UplinkNASTransport_base_nas)){
var integer numOfIEs := lengthof(vc_recvNGAP_PDU.initiatingMessage.value_.UplinkNASTransport.protocolIEs)
for (var integer i:=0;i<numOfIEs;i:=i+1){
if ( (vc_recvNGAP_PDU.initiatingMessage.value_.UplinkNASTransport.protocolIEs[i].id) == 38 /*id_NAS_PDU*/){
vc_recvNAS_PDU := vc_recvNGAP_PDU.initiatingMessage.value_.UplinkNASTransport.protocolIEs[i].value_.nAS_PDU;
var bitstring bs := oct2bit(vc_recvNAS_PDU);
var integer v_result := decvalue(bs,vc_recvNgNasUl_Msg);
log("****************************************");
log("UplinkNASTransport - NAS-PDU! ");
log( vc_recvNAS_PDU );
log( vc_recvNgNasUl_Msg );
log("****************************************");
}
......@@ -576,7 +599,9 @@ module LIB_NG_NAS_Functions {
p_ng_nas_security_params_type.KDF,
p_ng_nas_security_params_type.Ks,
p_NID);
p_ng_nas_security_params_type.AuthParams.XRESLength := lengthof(bit2oct(p_ng_nas_security_params_type.AuthParams.XRES));
log("f_5g_aka_compute_res_xres: XRES=", p_ng_nas_security_params_type.AuthParams.XRES);
log("f_5g_aka_compute_res_xres: XRESLength=", p_ng_nas_security_params_type.AuthParams.XRESLength);
// Generate KAUSF
p_ng_nas_security_params_type.KAUSF := f_NG_Authentication_A2(p_ng_nas_security_params_type.AuthParams,
......
......@@ -38,6 +38,8 @@ module Lib_NG_NAS_Interface {
var octetstring vc_sendNAS_PDU :=''O;
var octetstring vc_recvNAS_PDU :=''O;
var octetstring vc_recvNAS_PDUDefault:=''O;
var NG_NAS_UL_Message_Type vc_recvNgNasUl_Msg;
var NG_NAS_DL_Message_Type vc_recvNgNasDl_Msg;
var NG_NAS_SecurityParams_Type vc_ng_nas_security_params_type := {};
// Init of values at component started
......
......@@ -22,4 +22,6 @@ module Lib_NG_NAS_Pixits {
modulepar B128_Type PX_USIM_SECRET_KEY := oct2bit('00000000000000000000000000000000'O);
modulepar NAS_PlmnId PX_PLMN := '000000'O;
} // End of module Lib_NG_NAS_Pixits
\ No newline at end of file
diff --git a/src/Abstract_Socket.cc b/src/Abstract_Socket.cc
index 8b7b753..5e4addf 100644
--- a/src/Abstract_Socket.cc
+++ b/src/Abstract_Socket.cc
@@ -40,6 +40,7 @@
# include <signal.h>
diff --git a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc
old mode 100644
new mode 100755
index 910c13e..9d93bed
--- a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc
+++ b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc
@@ -1,28 +1,17 @@
/******************************************************************************
-* Copyright (c) 2000-2019 Ericsson Telecom AB
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Eclipse Public License v2.0
-* which accompanies this distribution, and is available at
-* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
-*
-* Contributors:
-* Zoltan Bibo - initial implementation and initial documentation
-* Gergely Futo
-* Oliver Ferenc Czerman
-* Balasko Jeno
-* Zoltan Bibo
-* Eduard Czimbalmos
-* Kulcsár Endre
-* Gabor Szalai
-* Jozsef Gyurusi
-* Csöndes Tibor
-* Zoltan Jasz
-******************************************************************************/
+ * Copyright (c) 2000-2025 Ericsson Telecom AB
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ ******************************************************************************/
//
// File: Abstract_Socket.cc
// Description: Abstract_Socket implementation file
-// Rev: R9B
+// Rev: <RnXnn>
// Prodnr: CNL 113 384
+// Updated: 2012-08-07
+// Contact: http://ttcn.ericsson.se
//
#include "Abstract_Socket.hh"
@@ -254,20 +243,16 @@ bool Abstract_Socket::parameter_set(const char *parameter_name,
Free(local_host_name);
local_host_name = mcopystr(parameter_value);
} else if(strcmp(parameter_name, remote_port_name()) == 0){
- int a;
- if (sscanf(parameter_value, "%d", &a)!=1) log_error("Invalid input as port number given: %s", parameter_value);
- if (a>65535 || a<0){ log_error("Port number must be between 0 and 65535, %d is given", remote_port_number);}
- else {remote_port_number=a;}
+ if (sscanf(parameter_value, "%d", &remote_port_number)!=1) log_error("Invalid input as port number given: %s", parameter_value);
+ if (remote_port_number>65535 || remote_port_number<0) log_error("Port number must be between 0 and 65535, %d is given", remote_port_number);
} else if(strcmp(parameter_name, ai_family_name()) == 0){
if (strcasecmp(parameter_value,"IPv6")==0 || strcasecmp(parameter_value,"AF_INET6")==0) ai_family = AF_INET6;
else if (strcasecmp(parameter_value,"IPv4")==0 || strcasecmp(parameter_value,"AF_INET")==0) ai_family = AF_INET;
else if (strcasecmp(parameter_value,"UNSPEC")==0 || strcasecmp(parameter_value,"AF_UNSPEC")==0) ai_family = AF_UNSPEC;
else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ai_family_name());
} else if(strcmp(parameter_name, local_port_name()) == 0){
- int a;
- if (sscanf(parameter_value, "%d", &a)!=1) log_error("Invalid input as port number given: %s", parameter_value);
- if (a>65535 || a<0) {log_error("Port number must be between 0 and 65535, %d is given", local_port_number);}
- else {local_port_number=a;}
+ if (sscanf(parameter_value, "%d", &local_port_number)!=1) log_error("Invalid input as port number given: %s", parameter_value);
+ if (local_port_number>65535 || local_port_number<0) log_error("Port number must be between 0 and 65535, %d is given", local_port_number);
} else if (strcmp(parameter_name, nagling_name()) == 0) {
if (strcasecmp(parameter_value,"yes")==0) nagling = true;
else if (strcasecmp(parameter_value,"no")==0) nagling = false;
@@ -316,14 +301,16 @@ void Abstract_Socket::Handle_Socket_Event(int fd, boolean is_readable, boolean i
} else {
if(shutdown(fd, SHUT_RD) != 0) {
if(errno == ENOTCONN) {
+ remove_client(fd);
+ peer_disconnected(fd);
errno = 0;
- } else {
+ } else
log_error("shutdown(SHUT_RD) system call failed");
- }
+ } else {
+ client_data->tcp_state = CLOSE_WAIT;
+ Remove_Fd_Read_Handler(fd);
+ peer_half_closed(fd);
}
- client_data->tcp_state = CLOSE_WAIT;
- Remove_Fd_Read_Handler(fd);
- peer_half_closed(fd);
}
} // switch (client_data->reading_state)
} else if (messageLength > 0) {
@@ -425,7 +412,6 @@ int Abstract_Socket::receive_message_on_fd(int client_id)
size_t end_len=AS_TCP_CHUNCK_SIZE;
recv_tb->get_end(end_ptr, end_len);
int messageLength = recv(client_id, (char *)end_ptr, end_len, 0);
- log_debug("========> receive_message_on_fd errno: '%d', '%s'", errno, strerror(errno));
if (messageLength==0) return messageLength; // peer disconnected
else if (messageLength < 0) {
log_warning("Error when reading the received TCP PDU: %s", strerror(errno));
@@ -464,11 +450,12 @@ int Abstract_Socket::send_message_on_nonblocking_fd(int client_id,
log_debug("entering Abstract_Socket::"
"send_message_on_nonblocking_fd(id: %d)", client_id);
- as_client_struct * client_data = get_peer(client_id);
+ as_client_struct * client_data;
int sent_len = 0;
while(sent_len < length){
int ret;
log_debug("Abstract_Socket::send_message_on_nonblocking_fd(id: %d): new iteration", client_id);
+ client_data = get_peer(client_id);
if (client_data->reading_state == STATE_DONT_CLOSE){
goto client_closed_connection;
} else ret = send(client_id, send_par + sent_len, length - sent_len, 0);
@@ -549,7 +536,7 @@ const PacketHeaderDescr* Abstract_Socket::Get_Header_Descriptor() const
return NULL;
}
-void Abstract_Socket::peer_connected(int /*client_id*/, sockaddr_in& /*remote_addr*/)
+void Abstract_Socket::peer_connected(int client_id, sockaddr_in& remote_addr)
{
}
@@ -614,8 +601,8 @@ void Abstract_Socket::map_user()
char remotePort[6];
char localPort[6];
- sprintf(localPort, "%u", local_port_number);
- sprintf(remotePort, "%u", remote_port_number);
+ sprintf(localPort, "%d", local_port_number);
+ sprintf(remotePort, "%d", remote_port_number);
if(!use_connection_ASPs)
{
@@ -797,7 +784,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
log_warning("Cannot open socket when trying to open the listen port: %s", strerror(errno));
listen_port_opened(-1);
errno = 0;
- freeaddrinfo(aip);
return -1;
}
else log_error("Cannot open socket");
@@ -815,7 +801,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
log_warning("Setsockopt failed when trying to open the listen port: %s", strerror(errno));
listen_port_opened(-1);
errno = 0;
- freeaddrinfo(aip);
return -1;
}
else log_error("Setsockopt failed");
@@ -828,10 +813,10 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
log_debug("Bind to port...");
if (bind(listen_fd, res->ai_addr, res->ai_addrlen) == -1) {
- error = errno; // save it for the warning message
close(listen_fd);
listen_fd = -1;
log_debug("Cannot bind to port when trying to open the listen port: %s", strerror(errno));
+ error = errno; // save it for the warning message
errno = 0;
continue;
}
@@ -843,8 +828,8 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
{
log_warning("Cannot bind to port when trying to open the listen port: %s", strerror(error));
listen_port_opened(-1);
+ error = errno; // save it for the warning message
error = 0;
- freeaddrinfo(aip);
return -1;
}
else log_error("Cannot bind to port");
@@ -858,7 +843,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
log_warning("Cannot listen at port when trying to open the listen port: %s", strerror(errno));
listen_port_opened(-1);
errno = 0;
- freeaddrinfo(aip);
return -1;
}
else log_error("Cannot listen at port");
@@ -877,14 +861,13 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
log_warning("getsockname() system call failed on the server socket when trying to open the listen port: %s", strerror(errno));
listen_port_opened(-1);
errno = 0;
- freeaddrinfo(aip);
return -1;
}
else log_error("getsockname() system call failed on the server socket");
}
char hname[NI_MAXHOST];
char sname[NI_MAXSERV];
-/* error = getnameinfo(res->ai_addr, res->ai_addrlen,
+ error = getnameinfo(res->ai_addr, res->ai_addrlen,
hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICSERV);
if (error) {
close(listen_fd);
@@ -893,14 +876,13 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
{
log_warning("getnameinfo() system call failed on the server socket when trying to open the listen port: %s", gai_strerror(error));
listen_port_opened(-1);
- freeaddrinfo(aip);
return -1;
}
else log_error("getsockname() system call failed on the server socket");
} else {
log_debug("Listening on (name): %s/%s\n",
hname, sname);
- }*/
+ }
error = getnameinfo(res->ai_addr, res->ai_addrlen,
hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICHOST|NI_NUMERICSERV);
if (error) {
@@ -910,7 +892,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
{
log_warning("getnameinfo() system call failed on the server socket when trying to open the listen port: %s", gai_strerror(error));
listen_port_opened(-1);
- freeaddrinfo(aip);
return -1;
}
else log_error("getsockname() system call failed on the server socket");
@@ -932,12 +913,11 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
if(use_connection_ASPs)
listen_port_opened(listenPort);
- freeaddrinfo(aip);
return listenPort;
#endif
}
-void Abstract_Socket::listen_port_opened(int /*port_number*/)
+void Abstract_Socket::listen_port_opened(int port_number)
{
// Intentionally blank
}
@@ -1084,9 +1064,7 @@ int Abstract_Socket::open_client_connection(const struct sockaddr_in & new_remot
Add_Fd_Read_Handler(socket_fd); // Done here - as in case of error: remove_client expects the handler as added
log_debug("Abstract_Socket::open_client_connection(). Handler set to socket fd %d", socket_fd);
client_data->fd_buff = new TTCN_Buffer;
-// client_data->clientAddr = *(struct sockaddr_storage*)&new_remote_addr;
- memset(&client_data->clientAddr,0,sizeof(client_data->clientAddr));
- memcpy(&client_data->clientAddr,&new_remote_addr,sizeof(new_remote_addr));
+ client_data->clientAddr = *(struct sockaddr_storage*)&new_remote_addr;
client_data->clientAddrlen = sizeof(new_remote_addr);
client_data->tcp_state = ESTABLISHED;
client_data->reading_state = STATE_NORMAL;
@@ -1259,22 +1237,22 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
);
+#include <netinet/sctp.h>
if(bind(socket_fd, aip2->ai_addr, aip2->ai_addrlen)<0) {
-/* if(use_connection_ASPs) // the if else branches are the same
- {*/
+ if(use_connection_ASPs)
+ {
log_debug("Cannot bind to port when trying to open client connection: %s", strerror(errno));
//client_connection_opened(-1);
//freeaddrinfo(localAddrinfo);
errno = 0;
continue; //aip2 cycle
//return -1;
-/* }
+ }
else {
//freeaddrinfo(localAddrinfo);
//log_error("Cannot bind to port.");
log_debug("Cannot bind to port when trying to open client connection: %s", strerror(errno));
errno = 0;
continue; //aip2 cycle
- }*/
+ }
}
log_debug("Bind successful on client.");
freeaddrinfo(localAddrinfo);
@@ -1358,7 +1336,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
}
char hname[NI_MAXHOST];
char sname[NI_MAXSERV];
-/* error = getnameinfo(aip->ai_addr, aip->ai_addrlen,
+ error = getnameinfo(aip->ai_addr, aip->ai_addrlen,
hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICSERV);
if (error) {
close(socket_fd);
@@ -1373,19 +1351,18 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
log_debug("Connection established (name): %s/%s -> %s/%s\n",
hname, sname,
remoteHostname, remoteServicename);
- }*/
+ }
error = getnameinfo(aip->ai_addr, aip->ai_addrlen,
hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICHOST|NI_NUMERICSERV);
if (error) {
-/* close(socket_fd);
+ close(socket_fd);
if(use_connection_ASPs)
{
log_warning("getnameinfo() system call failed on the client socket when trying to connect to server: %s", gai_strerror(error));
-// client_connection_opened(-1);
-// return -1;
+ client_connection_opened(-1);
+ return -1;
}
- else*/
- log_warning("getnameinfo() system call failed on the client socket when trying to connect to server: %s", gai_strerror(error));
+ else log_error("getnameinfo() system call failed on the client socket when trying to connect to server: %s", gai_strerror(error));
} else {
log_debug("Connection established (addr): %s/%s -> %s/%s\n",
hname, sname,
@@ -1421,20 +1398,18 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
return -1;
}
else log_error("Set blocking mode failed.");
- }
+ }
as_client_struct * client_data=peer_list_add_peer(socket_fd);
Add_Fd_Read_Handler(socket_fd); // Done here - as in case of error: remove_client expects the handler as added
log_debug("Abstract_Socket::open_client_connection(). Handler set to socket fd %d", socket_fd);
client_data->fd_buff = new TTCN_Buffer;
-// client_data->clientAddr = *(struct sockaddr_storage*)aip->ai_addr;
- memset(&client_data->clientAddr,0,sizeof(client_data->clientAddr));
- memcpy(&client_data->clientAddr,aip->ai_addr,sizeof(*aip->ai_addr));
+ client_data->clientAddr = *(struct sockaddr_storage*)aip->ai_addr;
client_data->clientAddrlen = aip->ai_addrlen;
client_data->tcp_state = ESTABLISHED;
client_data->reading_state = STATE_NORMAL;
#define AS_TCP_CHUNCK_SIZE 4096
#define AS_SSL_CHUNCK_SIZE 16384
@@ -171,6 +172,7 @@ Abstract_Socket::Abstract_Socket() {
remote_host_name = NULL;
remote_port_number = 0;
ai_family = AF_UNSPEC; // default: Auto
+ ip_proto = IPPROTO_TCP; // default
- freeaddrinfo(res);
+ freeaddrinfo(res);
if (!add_user_data(socket_fd)) {
remove_client(socket_fd);
@@ -1449,7 +1424,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
}
-void Abstract_Socket::client_connection_opened(int /*client_id*/)
+void Abstract_Socket::client_connection_opened(int client_id)
{
// Intentionally blank
}
@@ -1463,7 +1438,7 @@ void Abstract_Socket::unmap_user()
log_debug("leaving Abstract_Socket::unmap_user()");
}
-void Abstract_Socket::peer_disconnected(int /*fd*/)
+void Abstract_Socket::peer_disconnected(int fd)
{
// virtual peer_disconnected() needs to be overriden in test ports!
if(!use_connection_ASPs) {
@@ -1547,19 +1522,11 @@ void Abstract_Socket::send_outgoing(const unsigned char* send_par, int length, i
nrOfBytesSent = use_non_blocking_socket ? send_message_on_nonblocking_fd(dest_fd, send_par, length) :
send_message_on_fd(dest_fd, send_par, length);
- if (nrOfBytesSent == -1){
- log_debug("Client %d closed connection. Error: %d %s", client_id, errno, strerror(errno));
- report_unsent(dest_fd,length,nrOfBytesSent,send_par,"Client closed the connection");
-
- if(client_data->tcp_state == CLOSE_WAIT){
- log_debug("Client %d waiting for close ASP.", client_id);
- } else {
- errno = 0;
- log_debug("Client %d closed connection", client_id);
- client_data->tcp_state = CLOSE_WAIT;
- Remove_Fd_Read_Handler(dest_fd);
- peer_half_closed(dest_fd);
- }
+ if (nrOfBytesSent == -1 && errno == EPIPE){ // means connection was interrupted by peer
+ errno = 0;
+ log_debug("Client %d closed connection", client_id);
+ remove_client(dest_fd);
+ peer_disconnected(dest_fd);
}else if (nrOfBytesSent != length) {
char *error_text=mprintf("Send system call failed: %d bytes were sent instead of %d", nrOfBytesSent, length);
report_error(client_id,length,nrOfBytesSent,send_par,error_text);
@@ -1570,16 +1537,11 @@ void Abstract_Socket::send_outgoing(const unsigned char* send_par, int length, i
log_debug("leaving Abstract_Socket::send_outgoing()");
}
-void Abstract_Socket::report_error(int /*client_id*/, int /*msg_length*/, int /*sent_length*/, const unsigned char* /*msg*/, const char* error_text)
+void Abstract_Socket::report_error(int client_id, int msg_length, int sent_length, const unsigned char* msg, const char* error_text)
{
log_error("%s",error_text);
}
-void Abstract_Socket::report_unsent(int /*client_id*/, int /*msg_length*/, int /*sent_length*/, const unsigned char* /*msg*/, const char* error_text)
-{
- log_debug("%s",error_text);
-}
-
void Abstract_Socket::all_mandatory_configparameters_present()
{
if(!use_connection_ASPs)
@@ -1813,6 +1775,7 @@ void Abstract_Socket::peer_list_resize_list(int client_id) {
new_length++; // index starts from 0
log_debug("Abstract_Socket::peer_list_resize_list: Resizing to %d", new_length);
peer_list_root = (as_client_struct **)Realloc(peer_list_root, new_length*sizeof(as_client_struct *));
+ log_debug("Abstract_Socket::peer_list_resize_list: After Resizing: %p", peer_list_root);
// initialize new entries
for (int i = peer_list_length; i < new_length; i++)
@@ -1974,13 +1937,6 @@ SSL_Socket::SSL_Socket()
ssl_password=NULL;
test_port_type=NULL;
test_port_name=NULL;
ttcn_buffer_usercontrol=false;
@@ -199,6 +201,7 @@ Abstract_Socket::Abstract_Socket(const char *tp_type, const char *tp_name) {
remote_host_name = NULL;
remote_port_number = 0;
ai_family = AF_UNSPEC; // default: Auto
+ ip_proto = IPPROTO_TCP; // default
- ssl_ctx = NULL;
- ssl_current_ssl = NULL;
- SSLv2=true;
- SSLv3=true;
- TLSv1=true;
- TLSv1_1=true;
- TLSv1_2=true;
}
SSL_Socket::SSL_Socket(const char *tp_type, const char *tp_name)
@@ -1997,13 +1953,6 @@ SSL_Socket::SSL_Socket(const char *tp_type, const char *tp_name)
ssl_password=NULL;
test_port_type=tp_type;
test_port_name=tp_name;
ttcn_buffer_usercontrol=false;
@@ -261,6 +264,10 @@ bool Abstract_Socket::parameter_set(const char *parameter_name,
else if (strcasecmp(parameter_value,"IPv4")==0 || strcasecmp(parameter_value,"AF_INET")==0) ai_family = AF_INET;
else if (strcasecmp(parameter_value,"UNSPEC")==0 || strcasecmp(parameter_value,"AF_UNSPEC")==0) ai_family = AF_UNSPEC;
else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ai_family_name());
+ } else if(strcmp(parameter_name, ip_proto_name()) == 0){
+ if (strcasecmp(parameter_value,"IPPROTO_TCP")==0) ip_proto = IPPROTO_TCP;
+ else if (strcasecmp(parameter_value,"IPPROTO_SCTP")==0) ip_proto = IPPROTO_SCTP;
+ else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ip_proto_name());
} else if(strcmp(parameter_name, local_port_name()) == 0){
int a;
if (sscanf(parameter_value, "%d", &a)!=1) log_error("Invalid input as port number given: %s", parameter_value);
@@ -760,6 +767,7 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc
hints.ai_flags = /*AI_ALL|*/AI_ADDRCONFIG|AI_PASSIVE;
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = ai_family;
+ hints.ai_protocol = ip_proto;
error = getaddrinfo(localHostname, localServicename, &hints, &aip);
if (error != 0) {
@@ -1143,6 +1151,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
}
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = ai_family;
+ hints.ai_protocol = ip_proto;
error = getaddrinfo(remoteHostname, remoteServicename, &hints, &res);
if (error != 0) {
@@ -1191,9 +1200,11 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
}
}
- log_debug("Using address family for socket %d: %s",socket_fd,
+ log_debug("Using address family for socket %d: %s - %s",socket_fd,
((aip->ai_family==AF_INET)?"IPv4":
- ((aip->ai_family==AF_INET6)?"IPv6":"unknown"))
+ ((aip->ai_family==AF_INET6)?"IPv6":"unknown")),
+ ((aip->ai_protocol==IPPROTO_TCP)?"IPPROTO_TCP":
+ ((aip->ai_protocol==IPPROTO_SCTP)?"IPPROTO_SCTP":"unknown"))
);
- ssl_ctx = NULL;
- ssl_current_ssl = NULL;
- SSLv2=true;
- SSLv3=true;
- TLSv1=true;
- TLSv1_1=true;
- TLSv1_2=true;
}
SSL_Socket::~SSL_Socket()
@@ -2056,26 +2005,6 @@ bool SSL_Socket::parameter_set(const char *parameter_name,
if(strcasecmp(parameter_value, "yes") == 0) ssl_verify_certificate = true;
else if(strcasecmp(parameter_value, "no") == 0) ssl_verify_certificate = false;
else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_verifycertificate_name());
- } else if(strcasecmp(parameter_name, ssl_disable_SSLv2()) == 0) {
- if(strcasecmp(parameter_value, "yes") == 0) SSLv2= false;
- else if(strcasecmp(parameter_value, "no") == 0) SSLv2 = true;
- else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_SSLv2());
- } else if(strcasecmp(parameter_name, ssl_disable_SSLv3()) == 0) {
- if(strcasecmp(parameter_value, "yes") == 0) SSLv2 = false;
- else if(strcasecmp(parameter_value, "no") == 0) SSLv2 = true;
- else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_SSLv3());
- } else if(strcasecmp(parameter_name, ssl_disable_TLSv1()) == 0) {
- if(strcasecmp(parameter_value, "yes") == 0) TLSv1= false;
- else if(strcasecmp(parameter_value, "no") == 0) TLSv1 = true;
- else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_TLSv1());
- } else if(strcasecmp(parameter_name, ssl_disable_TLSv1_1()) == 0) {
- if(strcasecmp(parameter_value, "yes") == 0) TLSv1_1 = false;
- else if(strcasecmp(parameter_value, "no") == 0) TLSv1_1 = true;
- else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_TLSv1_1());
- } else if(strcasecmp(parameter_name, ssl_disable_TLSv1_2()) == 0) {
- if(strcasecmp(parameter_value, "yes") == 0) TLSv1_2 = false;
- else if(strcasecmp(parameter_value, "no") == 0) TLSv1_2 = true;
- else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_TLSv1_2());
} else {
log_debug("leaving SSL_Socket::parameter_set(%s, %s)", parameter_name, parameter_value);
return Abstract_Socket::parameter_set(parameter_name, parameter_value);
@@ -2102,32 +2031,6 @@ bool SSL_Socket::add_user_data(int client_id) {
@@ -1225,6 +1236,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
hints.ai_flags = AI_PASSIVE;
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = ai_family;//aip->ai_family; // NOTE: On solaris 10 if is set to aip->ai_family, getaddrinfo will crash for IPv4-mapped addresses!
+ hints.ai_protocol = ip_proto;
error = getaddrinfo(localHostname, localServicename, &hints, &localAddrinfo);
if (error != 0) {
@@ -1390,10 +1402,13 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch
}
log_debug(
- "connected to: host %s service %s via address family %s\n",
+ "connected to: host %s service %s via address family %s with ip_proto %s\n",
remoteHostname, remoteServicename,
((aip->ai_family==AF_INET)?"IPv4":
- ((aip->ai_family==AF_INET6)?"IPv6":"unknown")));
+ ((aip->ai_family==AF_INET6)?"IPv6":"unknown")),
+ ((aip->ai_protocol==IPPROTO_TCP)?"IPPROTO_TCP":
+ ((aip->ai_protocol==IPPROTO_SCTP)?"IPPROTO_SCTP":"unknown"))
+ );
break;
}
if (aip==NULL) {
@@ -1774,18 +1789,19 @@ const char* Abstract_Socket::remote_address_name() { return "destIPAddr
const char* Abstract_Socket::local_address_name() { return "serverIPAddr";}
const char* Abstract_Socket::remote_port_name() { return "destPort";}
const char* Abstract_Socket::ai_family_name() { return "ai_family";}
+const char* Abstract_Socket::ip_proto_name() { return "ip_proto";}
const char* Abstract_Socket::use_connection_ASPs_name() { return "use_connection_ASPs";}
const char* Abstract_Socket::halt_on_connection_reset_name(){ return "halt_on_connection_reset";}
-const char* Abstract_Socket::client_TCP_reconnect_name() { return "client_TCP_reconnect";}
+const char* Abstract_Socket::client_TCP_reconnect_name() { return "client_TCP_reconnect";}
const char* Abstract_Socket::TCP_reconnect_attempts_name() { return "TCP_reconnect_attempts";}
-const char* Abstract_Socket::TCP_reconnect_delay_name() { return "TCP_reconnect_delay";}
+const char* Abstract_Socket::TCP_reconnect_delay_name() { return "TCP_reconnect_delay";}
const char* Abstract_Socket::server_mode_name() { return "server_mode";}
const char* Abstract_Socket::socket_debugging_name() { return "socket_debugging";}
const char* Abstract_Socket::nagling_name() { return "nagling";}
const char* Abstract_Socket::use_non_blocking_socket_name() { return "use_non_blocking_socket";}
const char* Abstract_Socket::server_backlog_name() { return "server_backlog";}
-bool Abstract_Socket::add_user_data(int) {return true;}
-bool Abstract_Socket::remove_user_data(int) {return true;}
+bool Abstract_Socket::add_user_data(int) {return true;}
+bool Abstract_Socket::remove_user_data(int) {return true;}
bool Abstract_Socket::user_all_mandatory_configparameters_present() { return true; }
if (ssl_current_ssl==NULL)
log_error("Creation of SSL object failed");
-#ifdef SSL_OP_NO_SSLv2
- if(!SSLv2){
- SSL_set_options(ssl_current_ssl,SSL_OP_NO_SSLv2);
- }
-#endif
-#ifdef SSL_OP_NO_SSLv3
- if(!SSLv3){
- SSL_set_options(ssl_current_ssl,SSL_OP_NO_SSLv3);
- }
-#endif
-#ifdef SSL_OP_NO_TLSv1
- if(!TLSv1){
- SSL_set_options(ssl_current_ssl,SSL_OP_NO_TLSv1);
- }
-#endif
-#ifdef SSL_OP_NO_TLSv1_1
- if(!TLSv1_1){
- SSL_set_options(ssl_current_ssl,SSL_OP_NO_TLSv1_1);
- }
-#endif
-#ifdef SSL_OP_NO_TLSv1_2
- if(!TLSv1_2){
- SSL_set_options(ssl_current_ssl,SSL_OP_NO_TLSv1_2);
- }
-#endif
-
set_user_data(client_id, ssl_current_ssl);
log_debug("New client added with key '%d'", client_id);
log_debug("Binding SSL to the socket");
@@ -2362,10 +2265,9 @@ int SSL_Socket::send_message_on_fd(int client_id, const unsigned char* send_par,
log_debug("SSL_ERROR_ZERO_RETURN is received, setting SSL SHUTDOWN mode to QUIET");
ssl_current_client=NULL;
log_debug("leaving SSL_Socket::send_message_on_fd()");
- return -1;
+ return 0;
default:
- log_debug("SSL error occured");
- return -1;
+ log_error("SSL error occured");
}
}
// avoid compiler warnings
@@ -2457,8 +2359,7 @@ int SSL_Socket::send_message_on_nonblocking_fd(int client_id, const unsigned cha
case SSL_ERROR_ZERO_RETURN:
goto client_closed_connection;
default:
- log_warning("SSL error occured");
- return -1;
+ log_error("SSL error occured");
}
}
@@ -2547,11 +2448,6 @@ const char* SSL_Socket::ssl_certificate_file_name() { return "ssl_certific
const char* SSL_Socket::ssl_password_name() { return "ssl_private_key_password";}
const char* SSL_Socket::ssl_cipher_list_name() { return "ssl_allowed_ciphers_list";}
const char* SSL_Socket::ssl_verifycertificate_name() { return "ssl_verify_certificate";}
-const char* SSL_Socket::ssl_disable_SSLv2() { return "ssl_disable_SSLv2";}
-const char* SSL_Socket::ssl_disable_SSLv3() { return "ssl_disable_SSLv3";}
-const char* SSL_Socket::ssl_disable_TLSv1() { return "ssl_disable_TLSv1";}
-const char* SSL_Socket::ssl_disable_TLSv1_1() { return "ssl_disable_TLSv1_1";}
-const char* SSL_Socket::ssl_disable_TLSv1_2() { return "ssl_disable_TLSv1_2";}
void SSL_Socket::ssl_actions_to_seed_PRNG() {
@@ -2654,10 +2550,10 @@ void SSL_Socket::ssl_init_SSL()
// check the other side's certificates
if (ssl_verify_certificate) {
- log_debug("Setting verification behaviour: verification required and do not allow to continue on failure..");
+ log_debug("Setting verification behaviour: verification required and do not allow to continue on failure");
SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, ssl_verify_callback);
} else {
- log_debug("Setting verification behaviour: verification not required and do allow to continue on failure..");
+ log_debug("Setting verification behaviour: verification not required and do allow to continue on failure");
SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_NONE, ssl_verify_callback);
}
@@ -2757,7 +2653,7 @@ int SSL_Socket::ssl_getresult(int res)
return err;
}
-int SSL_Socket::ssl_verify_certificates_at_handshake(int /*preverify_ok*/, X509_STORE_CTX */*ssl_ctx*/) {
+int SSL_Socket::ssl_verify_certificates_at_handshake(int preverify_ok, X509_STORE_CTX *ssl_ctx) {
// don't care by default
return -1;
}
@@ -2765,7 +2661,7 @@ int SSL_Socket::ssl_verify_certificates_at_handshake(int /*preverify_ok*/, X50
// Callback function used by OpenSSL.
// Called when a password is needed to decrypt the private key file.
// NOTE: not thread safe
-int SSL_Socket::ssl_password_cb(char *buf, int num, int /*rwflag*/,void */*userdata*/) {
+int SSL_Socket::ssl_password_cb(char *buf, int num, int rwflag,void *userdata) {
if (ssl_current_client!=NULL) {
char *ssl_client_password;
@@ -2795,23 +2691,18 @@ int SSL_Socket::ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ssl_ctx)
ctx_pointer = SSL_get_SSL_CTX(ssl_pointer);
if (ssl_current_client!=NULL) {
- // if ssl_verifiycertificate == "no", then always accept connections
- if(((SSL_Socket *)ssl_current_client)->ssl_verify_certificate) {
- user_result=((SSL_Socket *)ssl_current_client)->ssl_verify_certificates_at_handshake(preverify_ok, ssl_ctx);
- if (user_result>=0) return user_result;
- } else {
- return 1;
- }
+ user_result=((SSL_Socket *)ssl_current_client)->ssl_verify_certificates_at_handshake(preverify_ok, ssl_ctx);
+ if (user_result>=0) return user_result;
} else { // go on with default authentication
fprintf(stderr, "Warning: no current SSL object found but ssl_verify_callback is called, programming error\n");
}
// if ssl_verifiycertificate == "no", then always accept connections
- if (SSL_CTX_get_verify_mode(ctx_pointer) == SSL_VERIFY_NONE)
+ if (SSL_CTX_get_verify_mode(ctx_pointer) && SSL_VERIFY_NONE)
return 1;
// if ssl_verifiycertificate == "yes", then accept connections only if the
// certificate is valid
- else if (SSL_CTX_get_verify_mode(ctx_pointer) & SSL_VERIFY_PEER) {
+ else if (SSL_CTX_get_verify_mode(ctx_pointer) && SSL_VERIFY_PEER) {
return preverify_ok;
}
// something went wrong
diff --git a/src/Abstract_Socket.hh b/src/Abstract_Socket.hh
index 6d7bc3d..a068662 100644
--- a/src/Abstract_Socket.hh
+++ b/src/Abstract_Socket.hh
@@ -134,7 +134,7 @@ protected:
bool get_handle_half_close() const {return handle_half_close;}
int get_socket_fd() const;
int get_listen_fd() const {return listen_fd;}
-
+
//set non-blocking mode
int set_non_block_mode(int fd, bool enable_nonblock);
diff --git a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh
old mode 100644
new mode 100755
index 7de8446..ad2d65d
--- a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh
+++ b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh
@@ -1,28 +1,17 @@
/******************************************************************************
-* Copyright (c) 2000-2019 Ericsson Telecom AB
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Eclipse Public License v2.0
-* which accompanies this distribution, and is available at
-* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
-*
-* Contributors:
-* Zoltan Bibo - initial implementation and initial documentation
-* Gergely Futo
-* Oliver Ferenc Czerman
-* Balasko Jeno
-* Zoltan Bibo
-* Eduard Czimbalmos
-* Kulcsr Endre
-* Gabor Szalai
-* Jozsef Gyurusi
-* Csndes Tibor
-* Zoltan Jasz
-******************************************************************************/
+ * Copyright (c) 2000-2025 Ericsson Telecom AB
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ ******************************************************************************/
//
// File: Abstract_Socket.hh
// Description: Abstract_Socket header file
-// Rev: R9B
+// Rev: <RnXnn>
// Prodnr: CNL 113 384
+// Updated: 2010-11-24
+// Contact: http://ttcn.ericsson.se
//
@@ -120,7 +109,7 @@ protected:
// Shall be called from Handle_Fd_Event()
void Handle_Socket_Event(int fd, boolean is_readable, boolean is_writable, boolean is_error);
// Shall be called from Handle_Timeout() - for possible future development
- void Handle_Timeout_Event(double /*time_since_last_call*/) {};
+ void Handle_Timeout_Event(double time_since_last_call) {};
@@ -149,6 +149,8 @@ protected:
// Shall be called from outgoing_send()
void send_outgoing(const unsigned char* message_buffer, int length, int client_id = -1);
@@ -144,9 +133,9 @@ protected:
bool increase_send_buffer(int fd, int &old_size, int& new_size);
const char* get_local_host_name(){return local_host_name; };
- unsigned int get_local_port_number(){return local_port_number; };
+ const unsigned int get_local_port_number(){return local_port_number; };
const char* get_remote_host_name(){return remote_host_name; };
- unsigned int get_remote_port_number(){return remote_port_number; };
+ const unsigned int get_remote_port_number(){return remote_port_number; };
const struct sockaddr_in & get_remote_addr() {return remoteAddr; }; /* FIXME: This function is deprecated and should be removed! */
const struct sockaddr_in & get_local_addr() {return localAddr; }; /* FIXME: This function is deprecated and should be removed! */
const int& get_ai_family() const {return ai_family;}
void set_ai_family(int parameter_value) {ai_family=parameter_value;}
+ const int& get_ip_proto() const {return ip_proto;}
+ void set_ip_proto(int parameter_value) {ip_proto=parameter_value;}
bool get_ttcn_buffer_usercontrol() const {return ttcn_buffer_usercontrol; }
void set_nagling(bool parameter_value) {nagling=parameter_value;}
void set_server_mode(bool parameter_value) {server_mode=parameter_value;}
@@ -204,6 +206,7 @@ protected:
virtual const char* local_address_name();
virtual const char* remote_port_name();
virtual const char* ai_family_name();
+ virtual const char* ip_proto_name();
virtual const char* use_connection_ASPs_name();
virtual const char* halt_on_connection_reset_name();
virtual const char* client_TCP_reconnect_name();
@@ -269,6 +272,7 @@ private:
char* remote_host_name;
unsigned int remote_port_number;
int ai_family; // address family to use
+ int ip_proto; // protocol to use (e.g. IPPROTO_TCP, IPPROTO_SCTP)
// remoteAddr and localAddr is filled when map_user is called
struct sockaddr_in remoteAddr; /* FIXME: not used! should be removed */
struct sockaddr_in localAddr; /* FIXME: not used! should be removed */
@@ -190,15 +179,13 @@ protected:
virtual int send_message_on_nonblocking_fd(int client_id, const unsigned char *message_buffer, int message_length);
// Called after a peer is connected
virtual void peer_connected(int client_id, sockaddr_in& remote_addr); /* This function should be removed! deprecated by: */
- virtual void peer_connected(int /*client_id*/, const char * /*host*/, const int /*port*/) {};
+ virtual void peer_connected(int client_id, const char * host, const int port) {};
// Called after a peer is disconnected
virtual void peer_disconnected(int client_id);
// Called when a peer shut down its fd for writing
virtual void peer_half_closed(int client_id);
// Called after a send error
virtual void report_error(int client_id, int msg_length, int sent_length, const unsigned char* msg, const char* error_text);
- // Called after a unsent message
- virtual void report_unsent(int client_id, int msg_length, int sent_length, const unsigned char* msg, const char* error_text);
// Test port parameters
virtual const char* local_port_name();
@@ -365,11 +352,6 @@ protected:
virtual const char* ssl_password_name();
virtual const char* ssl_cipher_list_name();
virtual const char* ssl_verifycertificate_name();
- virtual const char* ssl_disable_SSLv2();
- virtual const char* ssl_disable_SSLv3();
- virtual const char* ssl_disable_TLSv1();
- virtual const char* ssl_disable_TLSv1_1();
- virtual const char* ssl_disable_TLSv1_2();
private:
bool ssl_verify_certificate; // verify other part's certificate or not
@@ -377,13 +359,6 @@ private:
bool ssl_initialized; // whether SSL already initialized or not
bool ssl_use_session_resumption; // use SSL sessions or not
- bool SSLv2;
- bool SSLv3;
- bool TLSv1;
- bool TLSv1_1;
- bool TLSv1_2;
-
-
char *ssl_key_file; // private key file
char *ssl_certificate_file; // own certificate file
char *ssl_trustedCAlist_file; // trusted CA list file