Commit 9622a3e9 authored by lengyelb's avatar lengyelb
Browse files

Merge branch '28.623_Rel17_CR0265_Improve_Distinguished_Name_pattern_in_YANG'...

Merge branch '28.623_Rel17_CR0265_Improve_Distinguished_Name_pattern_in_YANG' into 'Integration_Rel17_SA5_150_YANG'

28.623 rel17 cr0265 improve distinguished name pattern in yang into Integration

See merge request !680
parents 9c88da97 cfdcdbb0
Loading
Loading
Loading
Loading
Loading
+83 −27
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ module _3gpp-common-yang-types {
    network slicing.";
  reference "3GPP TS 28.623";

  revision 2023-08-09 { reference CR-0265; }
  revision 2023-05-09 { reference CR-0249; }
  revision 2022-11-03 { reference "CR-0193"; }
  revision 2022-10-31 { reference CR-0195;   }
@@ -710,34 +711,89 @@ module _3gpp-common-yang-types {
    }  
  }
  
  typedef DistinguishedName {    // TODO is this equivalent to TS 32.300 ?
  /* DistinguishedName pattern is built up based on the 
    EBNF in 32.300 clause 7.3  EBNF of DN String Representation
  
    leaf DN { type string {   //  Same pattern as LocalDN
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?(,[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?)*';      
    } }
  
    leaf fullLocalDN { type string {   // LocalRDN , { RDNSeparator , LocalRDN }    RDNSeparator is a single , no space or \R allowed   Me.mykey=1 allowed
      //  (fullLocalRDN)(,(fullLocalRDN))*
      pattern '(([A-Z][^,=+<>#;\\"\r\n*.]*|([A-Z][^,=+<>#;\\"\r\n*.]*\.[a-z][^,=+<>#;\\"\r\n*.]*))=(([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?))(,(([A-Z][^,=+<>#;\\"\r\n*.]*|([A-Z][^,=+<>#;\\"\r\n*.]*\.[a-z][^,=+<>#;\\"\r\n*.]*))=(([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?)))*';      
    } }
  
    leaf LocalDN { type string {   // LocalRDN , { RDNSeparator , LocalRDN }    RDNSeparator is a single , no space or \R allowed
      //  LocalRDN(,LocalRDN)*
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?(,[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?)*';      
    } }
  
    leaf fullLocalRDN { type string {   // same as fullLocalDNAttributeTypeAndValue
      pattern '([A-Z][^,=+<>#;\\"\r\n*.]*|([A-Z][^,=+<>#;\\"\r\n*.]*\.[a-z][^,=+<>#;\\"\r\n*.]*))=(([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?)';      
    } }
  
    leaf LocalRDN { type string {   // same as LocalDNAttributeTypeAndValue
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?';      
    } }
  
    leaf fullLocalDNAttributeTypeAndValue { type string { // LocalDNAttributeType , AttributeTypeAndValueSeparator , RegularAttributeValue 
      // pattern LocalDNAttributeType=RegularAttributeValue
      pattern '([A-Z][^,=+<>#;\\"\r\n*.]*|([A-Z][^,=+<>#;\\"\r\n*.]*\.[a-z][^,=+<>#;\\"\r\n*.]*))=(([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?)';      
    } }
    
      // limitation: NamesOfClassAndNamingAttributenot supported Me.mykey=1
    leaf LocalDNAttributeTypeAndValue { type string { 
      // ebnf1          LocalDNAttributeType , AttributeTypeAndValueSeparator , RegularAttributeValue
      // ebnf2-limited  NameOfClassWithIdAttribute , AttributeTypeAndValueSeparator , RegularAttributeValue
      // pattern        NameOfClassWithIdAttribute=RegularAttributeValue
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?';      
    } }

    leaf LocalDNAttributeType { type string {   // NameOfClassWithIdAttribute | NamesOfClassAndNamingAttribute  RDNSeparator is a single , no space or \R allowed
      //  NameOfClassWithIdAttribute|NamesOfClassAndNamingAttribute
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*|([A-Z][^,=+<>#;\\"\r\n*.]*\.[a-z][^,=+<>#;\\"\r\n*.]*)';      
    } }

    leaf RegularAttributeValue { type string {       // ( AttributeValueChar – SpaceChar ) , [ { AttributeValueChar } , ( AttributeValueChar – SpaceChar ) ]
      pattern '([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?' ; 
    } }
    
    leaf NamesOfClassAndNamingAttribute  { type string {  // ClassName , ClassNamingAttributeSeparator , NamingAttributeName
      // pattern: ClassName\.NamingAttributeName
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*\.[a-z][^,=+<>#;\\"\r\n*.]*' ; 
    } }
  
    leaf restrictiveClassName { type string {     // 
      pattern '[a-zA-Z][a-zA-Z0-9-_]*' ; 
    } }
  
    leaf ClassName { type string {     // CapitalLetterChar , { LocalDNAttributeTypeChar }
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*' ; 
    } }
  
    leaf NamingAttributeName { type string {   // SmallLetterChar , { LocalDNAttributeTypeChar }
      pattern '[a-z][^,=+<>#;\\"\r\n*.]*' ; 
    } }    
    
  */
  typedef DistinguishedName {    
    type string {
      pattern '([a-zA-Z][a-zA-Z0-9-]*=(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+,# ])'
        + '((\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+,])*'
        + '(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+, ]))?'
        + '[,\+])*[a-zA-Z][a-zA-Z0-9-]*=(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+,# ])'
        + '((\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})'
        + '|[^\\><;"+,])*(\\( |#|\\|>|<|;|"|\+|,|[a-fA-F0-9]{2})|[^\\><;"+, ]))?';  
    }
    description "Represents the international standard for the representation 
      of Distinguished Name (RFC 4512). 
      The format of the DistinguishedName REGEX is:
      {AttributeType = AttributeValue}   

      AttributeType consists of alphanumeric and hyphen (OIDs not allowed). 
      All other characters are restricted.
      The Attribute value cannot contain control characters or the 
        following characters : \\ > < ; \" + , (Comma) and White space
      The Attribute value can contain the following characters if they 
        are excaped : \\ > < ; \" + , (Comma) and White space
      The Attribute value can contain control characters if its an escaped 
        double digit hex number.
        Examples could be 
          UID=nobody@example.com,DC=example,DC=com
            CN=John Smith,OU=Sales,O=ACME Limited,L=Moab,ST=Utah,C=US";
    reference  "RFC 4512 Lightweight Directory Access Protocol (LDAP):
                      Directory Information Models";
  } // recheck regexp it doesn't handle posix [:cntrl:]
      pattern '[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|'
      + '(\\[a-fA-F0-9]{2}))(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*'
      + '([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?'
      + '(,[A-Z][^,=+<>#;\\"\r\n*.]*=([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2}))'
      + '(([^,=+<>#;\\"\r\n*]|(\\[a-fA-F0-9]{2}))*'
      + '([^,=+<>#;\\"\r\n* ]|(\\[a-fA-F0-9]{2})))?)*';      
    }
    description "Represents the 3GPP standard for DistinguishedName. 
      
      Limitations: 
      - RDNSeparator: don't allow SpaceChar or CarriageReturnChar
      - NullDN: Disallow nullDN that is the same as not providing a DN
      - NamesOfClassAndNamingAttribute format not allowed 
        (eg. ManagedElement.mykey=345436)";
    reference  "3GPP TS 32.300";
  } 
 
  typedef QOffsetRange  {
    type int8 {