[netmod] uses and augment

worley@ariadne.com (Dale R. Worley) Wed, 22 March 2017 19:49 UTC

Return-Path: <worley@alum.mit.edu>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1E5D2129AA2 for <netmod@ietfa.amsl.com>; Wed, 22 Mar 2017 12:49:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.934
X-Spam-Level:
X-Spam-Status: No, score=-1.934 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_SOFTFAIL=0.665] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6MJV86z5orQs for <netmod@ietfa.amsl.com>; Wed, 22 Mar 2017 12:49:09 -0700 (PDT)
Received: from resqmta-ch2-04v.sys.comcast.net (resqmta-ch2-04v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C85F9128BA2 for <netmod@ietf.org>; Wed, 22 Mar 2017 12:49:09 -0700 (PDT)
Received: from resomta-ch2-06v.sys.comcast.net ([69.252.207.102]) by resqmta-ch2-04v.sys.comcast.net with SMTP id qmEdc3WtascBPqmFpckp8i; Wed, 22 Mar 2017 19:49:09 +0000
Received: from hobgoblin.ariadne.com ([IPv6:2601:192:4603:9471:222:fbff:fe91:d396]) by resomta-ch2-06v.sys.comcast.net with SMTP id qmFncGqqReyvGqmFoctLKk; Wed, 22 Mar 2017 19:49:09 +0000
Received: from hobgoblin.ariadne.com (hobgoblin.ariadne.com [127.0.0.1]) by hobgoblin.ariadne.com (8.14.7/8.14.7) with ESMTP id v2MJn7ah022742 for <netmod@ietf.org>; Wed, 22 Mar 2017 15:49:07 -0400
Received: (from worley@localhost) by hobgoblin.ariadne.com (8.14.7/8.14.7/Submit) id v2MIQrES013202; Wed, 22 Mar 2017 14:26:53 -0400
X-Authentication-Warning: hobgoblin.ariadne.com: worley set sender to worley@alum.mit.edu using -f
From: worley@ariadne.com
To: netmod@ietf.org
Sender: worley@ariadne.com
Date: Wed, 22 Mar 2017 14:26:53 -0400
Message-ID: <87shm5rwuq.fsf@hobgoblin.ariadne.com>
X-CMAE-Envelope: MS4wfEwJzLVMwbBw7efr4y1I3iHVuazUnbc5iCehQRrxD1XdSA/OajNwZIwzDmgJe7/UKDtgE5I3wjvYfkYLCOd/lzSpEqlzCyj9Gzzc91+dGFT3hVPyXAwY imNGilgByH/Cr76BLEJRjnVhNLDSs0JvH6YggqnxI8FzgyinZrPH9EIT
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Lv9NoC3Wd-3MrNsUuAk0PyuNfU8>
Subject: [netmod] uses and augment
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Mar 2017 19:49:11 -0000

I've got a couple of questions about the interaction of "uses" and
"augment".  I hope that these have straightforward answers that the old
hands can tell me easily enough.

1. Augmenting a grouping

I notice that "augment" is not allowed to target a "grouping", despite
that naively seems to be an operation that a module designer might like
to do.  I expect that there is a reason why this is not allowed.

For example:

     module foo {
       ...
       grouping target {
         leaf address {
           type inet:ip-address;
           description "Target IP address.";
         }
         leaf port {
           type inet:port-number;
            description "Target port number.";
         }
       }
     }

     module bar {
       ...
       import foo {
	 ...
       }
       augment "/foo:target" {
         leaf new-leaf {
           type string;
         }
       }
    }

     module baz {
       ...
       import foo {
	 ...
       }
       container main {
         uses foo:target;
       }
    }

giving an effective schema:

       container main {
         leaf address {
           type inet:ip-address;
           description "Target IP address.";
         }
         leaf port {
           type inet:port-number;
            description "Target port number.";
         }
         leaf new-leaf {
           type string;
         }
       }

This construct seems to be well-defined to me, other than that it's not
immediately clear what namespace baz:main/new-leaf is in.  (For some
reason, I reflexively think that it's in bar's namespace, not baz's, but
I can't state any reasoning for that.)

2.  "augment" as a substatement of "uses"

In section 7.17:

   The "augment" statement allows a module or submodule ...  to add to
   the nodes from a grouping in a "uses" statement.

When I first read this, I took it to mean that an "augment" substatement
adds a peer node to the set of nodes 'from a grouping in a "uses"
statement'.  But I suspect that it is intended to mean that an "augment"
only adds nodes *under* one of the nodes from the grouping.  There's an
ambiguity that could be fixed by better wording.

7.17 also says:

   If the "augment" statement is a substatement to the
   "uses" statement, the descendant form (defined by the rule
   "descendant-schema-nodeid" in Section 14) MUST be used.

My understanding is that "descendant-schema-nodeid" is an XPath
expression, and that the "context node" for its evaluation is the node
to which the "uses" statement adds nodes -- but that doesn't seem to be
stated anywhere.

(Those last two I should have caught in my Gen-ART review!)

Thanks for any information,

Dale