Subject: [netmod] question about prefix

From: [email-masked]
Date: Tue, 6 May 2014 14:27:59 +0800

Hi all,
   I hava a question about prefix. when a module defined a prefix of 
module, can it be used to indicate submodoule's definition?

For example,

module a {
    include b;
    prefix a;
    ....
    leaf fooleaf {
         type a:foo;
    }

}

submodule b {
    belongsto a {
       prefix a;
    }

    typedef foo {
        type uint8;
    }
}

is is valid? 

/frank
--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s).  If you are not an intended recipient, any disclosure, reproduction, distribution or other dissemination or use of the information contained is strictly prohibited.  If you have received this mail in error, please delete it and notify us immediately.

---

From: Jernej Tuljak <[email-masked]>
Date: Tue, 06 May 2014 09:40:11 +0200

> module, can it be used to indicate submodoule's definition?

Definitions inside a submodule belong to the namespace of the including 
module. Therefore "foo" is a local definition from module's "a" 
perspective. So yes, you can refer to it inside module "a" with a fully 
qualified name using the prefix of module "a", much like you can inside 
submodule "b" using the prefix defined in the belongs-to statement. The 
concept is described in RFC6020, Section 5.1.

Jernej

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod