Re: [yang-doctors] Definition for base64

"Acee Lindem (acee)" <acee@cisco.com> Fri, 17 August 2018 18:05 UTC

Return-Path: <acee@cisco.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D25EA130E05 for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 11:05:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.509
X-Spam-Level:
X-Spam-Status: No, score=-14.509 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com
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 DsK2UFISZFeG for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 11:05:21 -0700 (PDT)
Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4424B130DC7 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 11:05:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=15966; q=dns/txt; s=iport; t=1534529121; x=1535738721; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=RbSe2OW2BEV8mIupQEuo/avUy2mZ5FRy/wROTpHrYNI=; b=dc5rGBAbvSSGvbvujlFH8/Ca62mO6SPHq2Qyk+lhIV8B6pa0OlD5ou+Z h5wxw3WGfn7oeO8vJ13ZPQvGnrRr1qkMjcXSMArWyTYcwauYLxextxXe+ 0yC9DEsBat9gKCLTESNW2tPRyaTtNsWw2HShUQn8hJNkrj/E602eKHISB U=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0DyAAB3DXdb/4QNJK1DGhoBAQEBAQIBAQEBCAEBAQGCV3hjfygKg2WICowcgWgliFGIG4UrgXoLGAEKhEkCF4MvITQYAQIBAQIBAQJtHAyFNwEBAQQBASFLCxACAQgOAwMBAigDAgICHwYLFAkIAgQBDQWDIgGBHUwDFQ80qHiBLoRogjcNgywFiRgXggCBOQwTgkyCVkUBAQGCABaCSzGCBCICiHWEAY1ZKwkCjE6DEBWOOItshxQCERSBJB04JoEscBU7KgGCPgmLDIU+bwGMV4EbAQE
X-IronPort-AV: E=Sophos;i="5.53,251,1531785600"; d="scan'208,217";a="439543495"
Received: from alln-core-10.cisco.com ([173.36.13.132]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Aug 2018 18:05:20 +0000
Received: from XCH-RTP-013.cisco.com (xch-rtp-013.cisco.com [64.101.220.153]) by alln-core-10.cisco.com (8.15.2/8.15.2) with ESMTPS id w7HI5JPC023507 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 17 Aug 2018 18:05:20 GMT
Received: from xch-rtp-015.cisco.com (64.101.220.155) by XCH-RTP-013.cisco.com (64.101.220.153) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 17 Aug 2018 14:05:19 -0400
Received: from xch-rtp-015.cisco.com ([64.101.220.155]) by XCH-RTP-015.cisco.com ([64.101.220.155]) with mapi id 15.00.1320.000; Fri, 17 Aug 2018 14:05:19 -0400
From: "Acee Lindem (acee)" <acee@cisco.com>
To: Mahesh Jethanandani <mjethanandani@gmail.com>, Andy Bierman <andy@yumaworks.com>
CC: YANG Doctors <yang-doctors@ietf.org>
Thread-Topic: [yang-doctors] Definition for base64
Thread-Index: AQHUNk9iWadQLbeYYEi+wnsyLHcrM6TEeRyAgAAB5oD//8IVAA==
Date: Fri, 17 Aug 2018 18:05:19 +0000
Message-ID: <38727EB3-941C-4077-874D-E57CE7149C0D@cisco.com>
References: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com> <CABCOCHT6vj+Y1L7CprHvcYNmLtF9P5UDRw8H_uuD7ZKgqwRJog@mail.gmail.com> <2AD31000-4E60-47E7-9329-3DD4D17DA49D@gmail.com>
In-Reply-To: <2AD31000-4E60-47E7-9329-3DD4D17DA49D@gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.116.152.204]
Content-Type: multipart/alternative; boundary="_000_38727EB3941C4077874DE57CE7149C0Dciscocom_"
MIME-Version: 1.0
X-Outbound-SMTP-Client: 64.101.220.153, xch-rtp-013.cisco.com
X-Outbound-Node: alln-core-10.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/bDrpdUMGJdEaFk_Mlgf9DZGFkOI>
Subject: Re: [yang-doctors] Definition for base64
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Aug 2018 18:05:27 -0000

Hi Mahesh,

As Andy states, the base64 encodings are type string in the existing YANG data nodes.

See search for base64:

https://www.yangcatalog.org/yang-search/yang-search.php
Thanks,
Acee

From: yang-doctors <yang-doctors-bounces@ietf.org> on behalf of Mahesh Jethanandani <mjethanandani@gmail.com>
Date: Friday, August 17, 2018 at 1:46 PM
To: Andy Bierman <andy@yumaworks.com>
Cc: YANG Doctors <yang-doctors@ietf.org>
Subject: Re: [yang-doctors] Definition for base64

I have a protocol (Babel) that defines router-id as a base64 string of 8 octets. I could define it as a string, but isn’t it the case that base64 includes only a set of printable characters defined by the regex below? Not all printable characters are included in the set.


On Aug 17, 2018, at 10:40 AM, Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>> wrote:

Hi,

Aren't you confusing YANG data types with message encoding?
A base64 string at the YANG level is just a string. There are no non-printable chars
like a binary string could have.  Not sure why the type base64 is interesting in YANG data models.


Andy


On Fri, Aug 17, 2018 at 10:26 AM, Mahesh Jethanandani <mjethanandani@gmail.com<mailto:mjethanandani@gmail.com>> wrote:
Is there a definition for base64 defined in one of the YANG models? I would prefer to use one if it defined. If not, I was going to define one as

 typedef base64 {
    type string {
      pattern '(([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|'
            + '[A-Za-z0-9+/]{2}==)?){1}';
    }
    description
      "A binary-to-text encoding scheme to represent binary data in
       an ASCII string format.";
    reference
      "RFC 4648, The Base16, Base32, and Base64 Data Encodings";
  }

Mahesh Jethanandani
mjethanandani@gmail.com<mailto:mjethanandani@gmail.com>

_______________________________________________
yang-doctors mailing list
yang-doctors@ietf.org<mailto:yang-doctors@ietf.org>
https://www.ietf.org/mailman/listinfo/yang-doctors


Mahesh Jethanandani
mjethanandani@gmail.com<mailto:mjethanandani@gmail.com>