Subject: [netmod] yang-identifier type

From: Andy Bierman <[email-masked]>
Date: Thu, 31 May 2012 11:16:00 -0700

Hi,

I noticed in ietf-netconf-acm.yang that leafs such as "module-name"
"rpc-name", and "notification-name" are used to represent YANG identifiers,
but the data type is plain "string".  IMO, this is not correct.  The string should
be constrained to only valid YANG identifiers, which chould be a standard typedef.

I think the ietf-yang-types module needs to be updated with a typedef
for yang-identifier.  E.g.:

     typedef yang-identifier {
       type string {
         length "1..max";
         pattern '[a-z,A-Z,_][a-z,A-Z,0-9,\-,_,\.]*';
       }
       description
         "YANG identifier string";
     //An identifier MUST NOT start with (('X'|'x') ('M'|'m') ('L'|'l'))
          // identifier = (ALPHA / "_") *(ALPHA / DIGIT / "_" / "-" / ".")
        reference "RFC 6020, page 163";
      }

Does anybody know how to write a regex pattern for the must not start with "xml"
requirement that is not in the ABNF?

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 31 May 2012 22:44:47 +0200 (CEST)

Andy Bierman <[email-masked]> wrote:
> for yang-identifier.

+1.

I think Juergen has collected a few new typedefs / groupings to be
included in a new revision of this module.

/martin

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 1 Jun 2012 08:46:36 +0200

> included in a new revision of this module.

I added this to my list for now.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>