Subject: [netmod] default statement for binary data type

From: Andy Bierman <[email-masked]>
Date: Sun, 26 Oct 2008 11:09:40 -0700

Hi,

A default for a binary data type is probably
never going to happen, but it is legal YANG.
Is it worth the bother to use a different syntax
other than base64 for the default-stmt?

The base64 encoding is unreadable and unwritable by humans.
Should we use the hexadecimal notation defined in 8.1.1
for binary strings as well as numbers?  Maybe a different
start sequence than '0x' to make it easier to distinguish
a binary number from a binary string?

Currently allowed:

    leaf dead-mem-marker {
       type uint64;
       default 0xdeadbeef;
    }

Why not also allow:

    leaf dead-mem-marker {
       type binary;
       default 0xaa55deadbeefaa55;
    }

The draft (8.7.1) needs to say how a binary default-stmt
is encoded.

Andy

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

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 26 Oct 2008 21:44:35 +0100 (CET)

> a binary number from a binary string?

We can use the same hexadecimal syntax if we disallow the base64
syntax for defaults.  If we allow both, we need to use some othe
prefix for hex, since e.g. "0x11" is a valid base64 encoding.

> The draft (8.7.1) needs to say how a binary default-stmt

Currently, the draft only allows the base64 alos in defaults.  The
draft says:

  The lexicographic representation of a value of a certain type is
  used in the XML encoding over NETCONF, and when specifying default
  values in a YANG module.

/martin