module openflow-switch-connection-config {
    yang-version 1;
    namespace "urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:config";
    prefix "openflow-switch-connection-config";

    import ietf-inet-types {prefix ietf-inet; revision-date 2013-07-15; }
    import openflow-configuration {prefix of-config; revision-date 2014-06-30; }

    description
        "Configuration for an Openflow switch connection.";

    revision "2016-05-06" {
        description
            "Initial revision";
    }

    list switch-connection-config {
        key "instance-name";

        leaf instance-name {
            description "Name of the switch connection instance.";
            type string;
        }

        leaf port {
            description "local listening port";
            type uint16;
            mandatory true;
        }

        leaf transport-protocol {
            description "Transport protocol used for communication.";
            type of-config:transport-protocol;
            mandatory true;
        }

        leaf channel-outbound-queue-size {
            description "Channel outbound queue size";
            type uint16;
            default 1024;
        }

        leaf address {
            description "address of local listening interface";
            type ietf-inet:ip-address;
        }

        leaf use-barrier {
            description "Enable barrier in Openflow java";
            type boolean;
            default true;
        }

        leaf group-add-mod-enabled {
            description "Group Add Mod Enabled";
            type boolean;
            default false;
        }

        leaf switch-idle-timeout {
            description "idle timeout in [ms]";
            type uint32;
            default 15000;
        }

        container tls {
            leaf keystore {
                description "keystore location";
                type string;
            }

            leaf keystore-type {
                description "keystore type (JKS or PKCS12)";
                type of-config:keystore-type;
            }

            leaf keystore-path-type {
                description "keystore path type (CLASSPATH or PATH)";
                type of-config:path-type;
            }

            leaf keystore-password {
                description "password protecting keystore";
                type string;
            }

            leaf certificate-password {
                description "password protecting certificate";
                type string;
            }

            leaf truststore {
                description "truststore location";
                type string;
            }

            leaf truststore-type {
                description "truststore type (JKS or PKCS12)";
                type of-config:keystore-type;
            }

            leaf truststore-path-type {
                description "truststore path type (CLASSPATH or PATH)";
                type of-config:path-type;
            }

            leaf truststore-password {
                description "password protecting truststore";
                type string;
            }

            leaf-list cipher-suites {
                description "combination of cryptographic algorithms used by TLS connection";
                type string;
                ordered-by user;
            }
        }

        container threads {
            leaf boss-threads {
                type uint16;
            }

            leaf worker-threads {
                type uint16;
            }
        }
    }
}