Re: [netmod] Does YANG allow forward references to groupings?

William Ivory <wivory@Brocade.com> Thu, 27 October 2016 13:10 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 91F8A126B6D for <netmod@ietfa.amsl.com>; Thu, 27 Oct 2016 06:10:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 2ldkkrsjzAgO for <netmod@ietfa.amsl.com>; Thu, 27 Oct 2016 06:10:13 -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 7F9D8129449 for <netmod@ietf.org>; Thu, 27 Oct 2016 06:10:12 -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 u9RD9mkl005767; Thu, 27 Oct 2016 06:10:12 -0700
Received: from brmwp-exmb12.corp.brocade.com ([208.47.132.227]) by mx0a-000f0801.pphosted.com with ESMTP id 26bcbct65h-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 27 Oct 2016 06:10:12 -0700
Received: from EMEAWP-EXMB12.corp.brocade.com (172.29.11.86) by BRMWP-EXMB12.corp.brocade.com (172.16.59.130) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 27 Oct 2016 07:10:10 -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 15:10:08 +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 15:10:08 +0200
From: William Ivory <wivory@Brocade.com>
To: Martin Bjorklund <mbj@tail-f.com>
Thread-Topic: [netmod] Does YANG allow forward references to groupings?
Thread-Index: AdIwP2lR17nAPjz8QJyDvxBvqCCXi///5LsA//+9QeA=
Date: Thu, 27 Oct 2016 13:09:50 +0000
Deferred-Delivery: Thu, 27 Oct 2016 13:09:13 +0000
Message-ID: <a454567fa9864b73bf58d081d9e49c5c@EMEAWP-EXMB11.corp.brocade.com>
References: <d20fdada1dc243d18f4f097009f04b75@EMEAWP-EXMB11.corp.brocade.com> <20161027.130910.1427642386163433591.mbj@tail-f.com>
In-Reply-To: <20161027.130910.1427642386163433591.mbj@tail-f.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: text/plain; charset="us-ascii"
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-27_08:, , 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-1610270220
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/-SIvSBlZvGrFwjsgsWN5YH8AL_c>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [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 13:10:17 -0000

Thanks for confirming,

William

-----Original Message-----
From: Martin Bjorklund [mailto:mbj@tail-f.com] 
Sent: 27 October 2016 12:09
To: William Ivory <wivory@Brocade.com>
Cc: netmod@ietf.org
Subject: Re: [netmod] Does YANG allow forward references to groupings?

William Ivory <wivory@Brocade.com> wrote:
> 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://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_h
> tml_rfc6020-23section-2D7.11&d=DQICAg&c=IL_XqQWOjubgfqINi2jTzg&r=GByLe
> g9jZvOv_AlgBo9uvdDrxizlOR7l_SnTXowyJU8&m=WaccLYiQTR3H0OaccbcvkoVdly-9B
> GDfTNinmMS_xB0&s=HWT6JMdt0mDXM1-aPiwzhZOp2qLAsYo2w4h9G2lnIP8&e= )
> 
> On the other hand, section 6.2 states 'Forward references are allowed 
> in YANG.' (https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_html_rfc6020-23section-2D6.2&d=DQICAg&c=IL_XqQWOjubgfqINi2jTzg&r=GByLeg9jZvOv_AlgBo9uvdDrxizlOR7l_SnTXowyJU8&m=WaccLYiQTR3H0OaccbcvkoVdly-9BGDfTNinmMS_xB0&s=AMlXnMqEUOMZ6Lb0HQ-Y97cHo7BR0n7xK7cewn51wq4&e= ).
> 
> I am assuming that the second, more explicit, statement trumps the 
> first, but would appreciate confirmation.

Correct.  YANG allows forward references to groupings.


/martin