Subject: [netmod] SMIv2 to YANG mapping: OCTET STRING

From: David Reid <[email-masked]>
Date: Wed, 01 Apr 2009 14:18:00 -0400

When converting an SMIv2 OCTET STRING to YANG, should the YANG type be string
or binary? Juergen has a clever solution: if the OCTET STRING has a
DISPLAY-HINT, map to string, otherwise, map to binary. The only problem I
have with that approach is that it is legal to add a DISPLAY-HINTS clause
when revising a MIB module, but that would cause the YANG type to change,
which is not a legal revision.

Here are some possibilities. None of them are great. Hopefully, someone
else will have a better idea:

1. If it has DISPLAY-HINTS, use string, otherwise, use binary.

2. Always use binary

3. Use a union: type union { type string; type binary; } 

4. Require a human to read the MIB and decide since it is usually obvious 
   from the description clause (yuk)

-David Reid

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Wed, 1 Apr 2009 23:48:40 +0200

> which is not a legal revision.

Good catch. Too bad that this approach can fail...

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

---

From: David Reid <[email-masked]>
Date: Fri, 03 Apr 2009 17:06:09 -0400

> > When converting an SMIv2 OCTET STRING to YANG, should the YANG type be 
> > string or binary? Juergen has a clever solution: if the OCTET STRING has a

Does anyone have a better idea? We could always use binary in every case, but 
that's ugly.

-David Reid