module kea-types {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:kea-types";
  prefix "kea-types";

  organization "Internet Systems Consortium";
  contact "kea-dev@lists.isc.org";
  description "This file defines some commonly used Kea types and groupings.";

  revision 2018-11-20 {
    description "Initial revision";
    reference "";
  }

  /*
  * Typedef
  */
  typedef user-context {
    type string;
    description "User context (JSON map).";
  }

  /*
  * Grouping
  */
  grouping user-context {
    description "User context grouping.";
    leaf user-context {
      type user-context;
      description "User context entry.";
    }
  }

  grouping control-socket {
    description "Control socket.";
    leaf socket-name {
      type string;
      mandatory true;
      description "Path to the UNIX socket.";
    }
    leaf socket-type {
      type enumeration {
        enum "unix" {
          description "Unix socket type.";
        }
      }
      mandatory true;
      description "Socket type.";
    }
    leaf user-context {
      type user-context;
      description "Control socket user context.";
    }
  }

  grouping hooks-libraries {
    description "Hooks libraries grouping.";
    list hook-library {
      key library;
      description "List of hook library.";
      leaf library {
        type string;
        mandatory true;
        description "Path to the DSO.";
      }
      leaf parameters {
        type string;
        description "Parameters (JSON value).";
      }
    }
  }
}
