[netmod] Does YANG allow forward references to groupings?

William Ivory <wivory@Brocade.com> Thu, 27 October 2016 10:49 UTC

Return-Path: <wivory@Brocade.com>
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 A69AD129C7D for <netmod@ietfa.amsl.com>; Thu, 27 Oct 2016 03:49:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham 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 qZKwucdko2Ar for <netmod@ietfa.amsl.com>; Thu, 27 Oct 2016 03:49:09 -0700 (PDT)
Received: from mx0a-000f0801.pphosted.com (mx0a-000f0801.pphosted.com [IPv6:2620:100:9001:7a::1]) (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 5C2C91294E5 for <netmod@ietf.org>; Thu, 27 Oct 2016 03:49:09 -0700 (PDT)
Received: from pps.filterd (m0048193.ppops.net [127.0.0.1]) by mx0a-000f0801.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9RAkK3r025883 for <netmod@ietf.org>; Thu, 27 Oct 2016 03:49:09 -0700
Received: from brmwp-exmb11.corp.brocade.com ([208.47.132.227]) by mx0a-000f0801.pphosted.com with ESMTP id 26bcbcs87t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for <netmod@ietf.org>; Thu, 27 Oct 2016 03:49:08 -0700
Received: from EMEAWP-EXMB12.corp.brocade.com (172.29.11.86) by BRMWP-EXMB11.corp.brocade.com (172.16.59.77) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 27 Oct 2016 04:49:07 -0600
Received: from EMEAWP-EXMB11.corp.brocade.com (172.29.11.85) by EMEAWP-EXMB12.corp.brocade.com (172.29.11.86) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 27 Oct 2016 12:49:06 +0200
Received: from EMEAWP-EXMB11.corp.brocade.com ([fe80::85ea:b7da:48dd:1640]) by EMEAWP-EXMB11.corp.brocade.com ([fe80::85ea:b7da:48dd:1640%21]) with mapi id 15.00.1210.000; Thu, 27 Oct 2016 12:49:06 +0200
From: William Ivory <wivory@Brocade.com>
To: "netmod@ietf. org netmod@ietf.org netmod@ietf. org (netmod@ietf.org)" <netmod@ietf.org>
Thread-Topic: Does YANG allow forward references to groupings?
Thread-Index: AdIwP2lR17nAPjz8QJyDvxBvqCCXiw==
Date: Thu, 27 Oct 2016 10:48:46 +0000
Deferred-Delivery: Thu, 27 Oct 2016 10:47:45 +0000
Message-ID: <d20fdada1dc243d18f4f097009f04b75@EMEAWP-EXMB11.corp.brocade.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [172.27.212.171]
Content-Type: multipart/alternative; boundary="_000_d20fdada1dc243d18f4f097009f04b75EMEAWPEXMB11corpbrocade_"
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-27_06:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610270170
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/AYtc7VkNdixBIntpFAY8Gwxtf-g>
Subject: [netmod] Does YANG allow forward references to groupings?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: Thu, 27 Oct 2016 10:49:10 -0000

Hi,

I'd appreciate clarification on whether a YANG grouping defined and used in the same file must have the grouping definition first, before the 'uses' statement.

On the one hand, RFC 6020 section 7.11 states: 'Once a grouping is defined, it can be referenced in a "uses" statement', suggesting a C / C++ -style which doesn't allow forward references.  (https://tools.ietf.org/html/rfc6020#section-7.11)

On the other hand, section 6.2 states 'Forward references are allowed in YANG.' (https://tools.ietf.org/html/rfc6020#section-6.2).

I am assuming that the second, more explicit, statement trumps the first, but would appreciate confirmation.

Thanks,

William