All Downloads are FREE. Search and download functionalities are using the official Maven repository.

[email protected] Maven / Gradle / Ivy

There is a newer version: 0.19.0
Show newest version
module nicira-action {
    yang-version 1;

    namespace "urn:opendaylight:openflowjava:nx:action";
    prefix "nicira-action";

    import openflow-extensible-match { prefix oxm;}
    import openflow-action {prefix ofaction; revision-date "2015-02-03";}
    import openflow-types {prefix oft;}
    import yang-ext {prefix ext; revision-date "2013-07-09";}
    import ietf-inet-types { prefix "inet"; revision-date "2013-07-15"; }

    description
        "Nicira openflow extensions of action.";

    revision "2014-04-21" {
        description "Initial revision";
    }

    identity nxm-nx-reg-load {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-reg-load2 {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-reg-move {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-output-reg {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-output-reg2 {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-resubmit {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-fin-timeout {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-multipath {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-conntrack {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-ct-clear {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-learn {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-encap {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-decap {
        base ofaction:experimenter-action-sub-type;
    }
    identity nxm-nx-dec-nsh-ttl {
        base ofaction:experimenter-action-sub-type;
    }

    grouping ofj-nx-action-reg-load-grouping {
        container nx-action-reg-load {
            leaf ofs_nbits {
                type uint16;
            }
            leaf dst {
                type uint32;
            }
            leaf value {
                type uint64;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-reg-load2-grouping {
        container nx-action-reg-load2 {
            uses oxm:match-entries-grouping;
        }
    }

    grouping ofj-nx-action-reg-move-grouping {
        container nx-action-reg-move {
                leaf n_bits {
                    type uint16;
                }
                leaf src_ofs {
                    type uint16;
                }
                leaf dst_ofs {
                    type uint16;
                }
                leaf src {
                    type uint64;
                }
                leaf dst {
                    type uint64;
                }
                leaf experimenter-id {
                    type oft:experimenter-id;
                }
        }
    }
    grouping ofj-nx-action-output-reg-grouping {
        container nx-action-output-reg {
            leaf n_bits {
                type uint16;
            }
            leaf src {
                type uint32;
            }
            leaf max_len {
                type uint16;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-output-reg2-grouping {
        container nx-action-output-reg2 {
            leaf n_bits {
                type uint16;
            }
            leaf src {
                type uint64;
            }
            leaf max_len {
                type uint16;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-resubmit-grouping {
        container nx-action-resubmit {
            leaf in-port {
                type uint16;
                default 0xfff8; // OFPP_INPORT
            }
            leaf table {
                type uint8 {
                    range "0 .. 255";
                }
                default 255; // Current Table
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-fin-timeout-grouping {
        container nx-action-fin-timeout {
            leaf fin-idle-timeout {
                type uint16;
            }
            leaf fin-hard-timeout  {
                type uint16;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    typedef ofj-nx-hash-fields {
        type enumeration {
            enum NX_HASH_FIELDS_ETH_SRC {
                value 0;
                description "eth src address only";
            }
            enum NX_HASH_FIELDS_SYMMETRIC_L4 {
                value 1;
                description "L2 through L4 fields";
            }
        }
    }

    typedef ofj-nx-mp-algorithm {
        type enumeration {
            enum NX_MP_ALG_MODULO_N {
                value 0;
            }
            enum NX_MP_ALG_HASH_THRESHOLD {
                value 1;
            }
            enum NX_MP_ALG_HRW {
                value 2;
            }
            enum NX_MP_ALG_ITER_HASH {
                value 3;
            }
        }
    }

    typedef nx-action-nat-range-present {
        type enumeration {
            enum NX_NAT_RANGE_IPV4_MIN {
                value 1;
                description "IPV4 minimum value is present";
            }
            enum NX_NAT_RANGE_IPV4_MAX {
                value 2;
                description "IPV4 maximum value is present";
            }
            enum NX_NAT_RANGE_IPV6_MIN {
                value 4;
                description "IPV6 minimum value is present in range";
            }
            enum NX_NAT_RANGE_IPV6_MAX {
                value 8;
                description "IPV6 maximum value is present in range";
            }
            enum NX_NAT_RANGE_PROTO_MIN {
                value 16;
                description "Port minimum value is present in range";
            }
            enum NX_NAT_RANGE_PROTO_MAX {
                value 32;
                description "Port maximum value is present in range";
            }
        }
    }

    typedef nx-action-nat-flags {
        type enumeration {
            enum NX_NAT_F_SRC {
                value 1;
                description "Source nat is selected ,Mutually exclusive with NX_NAT_F_DST";
            }
            enum NX_NAT_F_DST {
                value 2;
                description "Destination nat is selected";
            }
            enum NX_NAT_F_PERSISTENT {
                value 4;
                description "Persistant flag is selected";
            }
            enum NX_NAT_F_PROTO_HASH {
                value 8;
                description "Hash mode is selected for port mapping, Mutually exclusive with PROTO_RANDOM ";
            }
            enum NX_NAT_F_PROTO_RANDOM {
                value 16;
                description "Port mapping will be randomized";
            }
        }
    }

    grouping ofj-nx-action-multipath-grouping {
        container nx-action-multipath {
            leaf fields {
                type ofj-nx-hash-fields;
            }
            leaf basis {
                type uint16;
                default 0x400;
            }
            leaf algorithm {
                type ofj-nx-mp-algorithm;
            }
            leaf max-link {
                type uint16;
            }
            leaf arg {
                type uint32;
            }
            leaf ofs-nbits {
                type uint16;
            }
            leaf dst {
                type uint32;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-conntrack-grouping {
        container nx-action-conntrack {
            leaf flags {
                type uint16;
            }
            leaf zone-src {
                type uint32;
            }
            leaf conntrack-zone {
                type uint16;
            }
            leaf recirc-table {
                type uint8;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
            list ct-actions{
                uses ofpact-actions;
            }
        }
    }

    grouping ofj-nx-action-ct-clear-grouping {
        container nx-action-ct-clear {
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofpact-actions {
        description
           "Actions to be performed with conntrack.";
        choice ofpact-actions {
            case nx-action-nat-case {
                container nx-action-nat {
                    leaf flags {
                        type uint16;
                    }
                    leaf range_present {
                        type uint16;
                    }
                    leaf ip-address-min {
                        type inet:ip-address;
                    }
                    leaf ip-address-max {
                        type inet:ip-address;
                    }
                    leaf port-min {
                        type uint16;
                    }
                    leaf port-max {
                        type uint16;
                    }
                }
            }
            case nx-action-ct-mark-case {
                container nx-action-ct-mark {
                    leaf ct-mark {
                        type uint32;
                    }
                    // TODO: ct_mark mask is not supported yet
                }
            }
        }
    }

    grouping flow-mod-spec {
        description
           "flow mod spec indicates the actions that should be performed to create a new flow which was learned from learn action.";
        choice flow-mod-spec{
            case flow-mod-add-match-from-field-case{
                container flow-mod-add-match-from-field{
                        leaf flow-mod-num-bits{
                        type uint16;
                    }

                    leaf src-field{
                        type uint32;
                    }

                    leaf src-ofs{
                        type uint16;
                    }

                    leaf dst-field{
                        type uint32;
                    }

                    leaf dst-ofs{
                        type uint16;
                    }
                }
            }
            case flow-mod-add-match-from-value-case{
                container flow-mod-add-match-from-value{
                        leaf flow-mod-num-bits{
                        type uint16;
                    }

                    leaf value{
                        type uint16;
                    }

                    leaf src-field{
                        type uint32;
                    }

                    leaf src-ofs{
                        type uint16;
                    }
                }
            }
            case flow-mod-copy-field-into-field-case{
                container flow-mod-copy-field-into-field{
                        leaf flow-mod-num-bits{
                        type uint16;
                    }

                    leaf src-field{
                        type uint32;
                    }

                    leaf src-ofs{
                        type uint16;
                    }

                    leaf dst-field{
                        type uint32;
                    }

                    leaf dst-ofs{
                        type uint16;
                    }
                }
            }
            case flow-mod-copy-value-into-field-case{
                container flow-mod-copy-value-into-field{
                        leaf flow-mod-num-bits{
                        type uint16;
                    }

                    leaf value{
                        type uint16;
                    }

                    leaf dst-field{
                        type uint32;
                    }

                    leaf dst-ofs{
                        type uint16;
                    }
                }
            }
            case flow-mod-output-to-port-case{
                container flow-mod-output-to-port{
                        leaf flow-mod-num-bits{
                        type uint16;
                    }

                    leaf src-field{
                        type uint32;
                    }

                    leaf src-ofs{
                        type uint16;
                    }
                }
            }
        }
    }

    grouping ofj-nx-action-learn-grouping {
        container nx-action-learn {
            leaf idle-timeout {
                type uint16;
            }
            leaf hard-timeout {
                type uint16;
            }
            leaf priority {
                type uint16;
            }
            leaf cookie {
                type uint64;
            }
            leaf flags {
                type uint16;
            }
            leaf table-id {
                type uint8;
            }
            leaf fin-idle-timeout {
                type uint16;
            }
            leaf fin-hard-timeout {
                type uint16;
            }

            list flow-mods{
                uses flow-mod-spec;
            }
        }
    }

    grouping ofj-nx-action-encap-grouping {
        container nx-action-encap {
            leaf packet-type {
                type uint32;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-decap-grouping {
        container nx-action-decap {
            leaf packet-type {
                type uint32;
            }
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    grouping ofj-nx-action-dec-nsh-ttl-grouping {
        container nx-action-dec-nsh-ttl {
            leaf experimenter-id {
                type oft:experimenter-id;
            }
        }
    }

    augment "/ofaction:action-container/ofaction:action-choice" {
        ext:augment-identifier "ofj-aug-nx-action";
        case action-reg-load {
            uses ofj-nx-action-reg-load-grouping;
        }
        case action-reg-load2 {
            uses ofj-nx-action-reg-load2-grouping;
        }
        case action-reg-move {
            uses ofj-nx-action-reg-move-grouping;
        }
        case action-output-reg {
            uses ofj-nx-action-output-reg-grouping;
        }
        case action-output-reg2 {
            uses ofj-nx-action-output-reg2-grouping;
        }
        case action-resubmit {
            uses ofj-nx-action-resubmit-grouping;
        }
        case action-fin-timeout {
            uses ofj-nx-action-fin-timeout-grouping;
        }
        case action-multipath {
            uses ofj-nx-action-multipath-grouping;
        }
        case action-conntrack {
            uses ofj-nx-action-conntrack-grouping;
        }
        case action-ct-clear {
            uses ofj-nx-action-ct-clear-grouping;
        }
        case action-learn {
            uses ofj-nx-action-learn-grouping;
        }
        case action-encap {
            uses ofj-nx-action-encap-grouping;
        }
        case action-decap {
            uses ofj-nx-action-decap-grouping;
        }
        case action-dec-nsh-ttl {
            uses ofj-nx-action-dec-nsh-ttl-grouping;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy