/******************************************************************************
* Copyright (c) 2000-2023 Ericsson 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:
*   Gabor Szalai - initial implementation and initial documentation
******************************************************************************/
//
//  File:               TS29503_Nudm_UEAU.ttcn
//  Description:	      Type definitions for 3GPP TS29503
/////////////////////////////////////////////// 
module TS29503_Nudm_UEAU {

  import from TS29571_CommonData all

  external function f_enc_AuthenticationInfoRequest(in AuthenticationInfoRequest pdu) return octetstring 
  with { extension "prototype(convert) encode(JSON)" }

  external function f_dec_AuthenticationInfoRequest(in octetstring stream, out AuthenticationInfoRequest pdu) return integer 
  with { extension "prototype(backtrack) decode(JSON)" }

  external function f_enc_AuthenticationInfoResult(in AuthenticationInfoResult pdu) return octetstring 
  with { extension "prototype(convert) encode(JSON)" }

  external function f_dec_AuthenticationInfoResult(in octetstring stream, out AuthenticationInfoResult pdu) return integer 
  with { extension "prototype(backtrack) decode(JSON)" }

  external function f_enc_AuthEvent(in AuthEvent pdu) return octetstring 
  with { extension "prototype(convert) encode(JSON)" }

  external function f_dec_AuthEvent(in octetstring stream, out AuthEvent pdu) return integer 
  with { extension "prototype(backtrack) decode(JSON)" }


  type set AuthenticationInfoRequest {
    TS29571_CommonData.SupportedFeatures    supportedFeatures optional,
    ServingNetworkName    servingNetworkName,
    ResynchronizationInfo    resynchronizationInfo optional,
    TS29571_CommonData.NfInstanceId    ausfInstanceId
  }

  type set AuthenticationInfoResult {
    AuthType    authType,
    TS29571_CommonData.SupportedFeatures    supportedFeatures optional,
    AuthenticationVector    authenticationVector optional,
    TS29571_CommonData.Supi    supi optional
  }

  type union AuthenticationVector {
    AvEapAkaPrime    avEapAkaPrime,
    Av5GHeAka        av5GHeAka
  } with {
    variant "JSON: as value"
  }


  type set AvEapAkaPrime {
    AvType    avType,
    Rand    rand,
    Xres    xres,
    Autn    autn,
    CkPrime    ckPrime,
    IkPrime    ikPrime
  }

  type set Av5GHeAka {
    AvType    avType,
    Rand    rand,
    XresStar    xresStar,
    Autn    autn,
    Kausf    kausf
  }

  type set ResynchronizationInfo {
    Rand    rand,
    Auts    auts
  }

  type set AuthEvent {
    TS29571_CommonData.NfInstanceId    nfInstanceId,
    Success    success,
    TS29571_CommonData.DateTime    timeStamp,
    AuthType    authType
  }

  type charstring Autn // (pattern "^[A-Fa-f0-9]{32}$")

  type charstring Auts // (pattern "^[A-Fa-f0-9]{28}$")

  type charstring CkPrime // (pattern "^[A-Fa-f0-9]{32}$")

  type charstring IkPrime // (pattern "^[A-Fa-f0-9]{32}$")

  type charstring Kausf // (pattern "^[A-Fa-f0-9]{64}$")

  type charstring Rand // (pattern "^[A-Fa-f0-9]{32}$")

  type charstring Xres // (pattern "^[A-Fa-f0-9]{8,32}$")

  type charstring XresStar // (pattern "^[A-Fa-f0-9]{32}$")

  type charstring SupiOrSuci // (pattern "^(imsi-[0-9]{5,15}|nai-.+| suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$")

  type charstring ServingNetworkName // (pattern "^5G:mnc[0-9]{3}[.]mcc[0-9]{3}[.]3gppnetwork[.]org$")

  type boolean Success

  type enumerated AuthType_enum { FIVEG_AKA, EAP_AKA_PRIME, EAP_TLS}
    with {
      variant "text 'FIVEG_AKA' as '5G_AKA' "
    }

  type union AuthType {
    AuthType_enum  enum_val,
    charstring           other_val
  } with {
    variant "JSON: as value"
  }


  type enumerated AvType_enum { FIVEG_HE_AKA, EAP_AKA_PRIME}
    with {
      variant "text 'FIVEG_HE_AKA' as '5G_HE_AKA' "
    }

  type union AvType {
    AvType_enum  enum_val,
    charstring           other_val
  } with {
    variant "JSON: as value"
  }






} with {
  encode "JSON"
}