module opendaylight-ipv6-arbitrary-bitmask-fields {
    namespace "urn:opendaylight:opendaylight-ipv6-arbitrary-bitmask-fields";
    prefix "ipv6-arbitrary-bitmask";

    import ietf-inet-types {prefix inet; revision-date "2013-07-15";}


    revision 2016-02-24 {
        description "Initial revision";
    }

    typedef ipv6-arbitrary-mask {
        type string {
            pattern
                '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|'
              + '([0-9a-fA-F]{1,4}:){1,7}:|'
              + '([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|'
              + '([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|'
              + '([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|'
              + '([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|'
              + '([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|'
              + '[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|'
              + ':((:[0-9a-fA-F]{1,4}){1,7}|:))';
        }
    }

    grouping "ipv6-match-arbitrary-bitmask-fields" {

        leaf ipv6-source-address-no-mask {
            description "IPv6 source address with no mask.";
            type inet:ipv6-address;
        }

        leaf ipv6-source-arbitrary-bitmask {
            description "Arbitrary bit mask of IPv6 source address.";
            type ipv6-arbitrary-mask;
        }

        leaf ipv6-destination-address-no-mask {
            description "IPv6 destination address with no mask.";
            type inet:ipv6-address;
        }

        leaf ipv6-destination-arbitrary-bitmask {
            description "Arbitrary bit mask of IPv6 destination address.";
            type ipv6-arbitrary-mask;
        }
    }

}