Subject: [netmod] 6991bis: host

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 29 Mar 2019 15:29:05 +0100

Hi,

the inet:host type should not use the inet:domain-name as its member because the
latter type doesn't satisfy the requirements of RFC 952 and 1123 on host names.
For example, the type now permits a single dot (".") as the value or the
underscore character.

I propose to change the "host" type as follows:

OLD

    typedef host {
      type union {
        type inet:ip-address;
        type inet:domain-name;
      }
      ...
    }

NEW

    typedef host {
      type union {
        type inet:ip-address;
        type inet:host-name;
      }
      ...
    }

A reasonable definition of "host-name" is IMO a domain name whose labels are NR-
LDH (non-registered letter-digit-hyphen label) [RFC 5890]:

    typedef host-name {
      type string {
        pattern
          '((([a-zA-Z0-9]([a-zA-Z0-9\-]){0,61})?[a-zA-Z0-9]\.)*'
        + '([a-zA-Z0-9]([a-zA-Z0-9\-]){0,61})?[a-zA-Z0-9]\.?)';
        pattern '(.*\.)?..\-\-.*' {
          modifier invert-match;
        }
        length "2..253";
        ...
      }
    }

Lada

-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67