--- /dev/null
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+ module neutron-sfc-flow-classifier {
+
+ yang-version 1;
+
+ namespace "urn:opendaylight:neutron-sfc-flow-classifier";
+
+ prefix neutron-sfc-flow-classifier;
+
+ import ietf-yang-types { prefix "yang"; }
+ import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
+ import neutron-attrs { prefix "attrs"; }
+ import neutron-constants { prefix "constants"; }
+
+
+ organization "OpenDaylight Neutron Northbound Project";
+
+ contact "Anil Vishnoi <vishnoianil@gmail.com>";
+
+ description "This YANG module defines Openstack Neutron SFC Flow Classfier Models.These models are based on the
+ API's exposed by the OpenStack Neutron Networking SFC (networking-sfc) project. List of classifier APIs
+ are listed at following URL (http://docs.openstack.org/developer/networking-sfc/api.html)";
+
+ revision "2016-05-11" {
+ description
+ "OpenStack Neutron SFC Flow Classfier Models - Version 1.";
+ }
+
+ grouping flow-classifier-match-attributes {
+ leaf ethertype {
+ description "
+ Classify flows based on the provided ethertype.Currently OpenStack SFC only supports IPv4 and IPv6.";
+
+ type identityref {
+ base "constants:ethertype-base";
+ }
+ }
+ leaf protocol {
+ description "
+ Classify flows based on the provided protocol.Currently OpenStack SFC only supports TCP,UDP and ICMP";
+ type identityref {
+ base "constants:protocol-base";
+ }
+ }
+ leaf source-port-range-min {
+ description "Minimum source protocol port";
+ type uint16 {
+ range "0 .. 65535";
+ }
+ }
+ leaf source-port-range-max {
+ description "Maximum source protocol port.";
+ type uint16 {
+ range "0 .. 65535";
+ }
+ }
+ leaf destination-port-range-min {
+ description "Minimum destination protocol port.";
+ type uint16 {
+ range "0 .. 65535";
+ }
+ }
+ leaf destination-port-range-max {
+ description "Maximum destination protocol port.";
+ type uint16 {
+ range "0 .. 65535";
+ }
+ }
+ leaf source-ip-prefix {
+ description "Source IPv4 or IPv6 prefix.";
+ type inet:ip-prefix;
+ }
+ leaf destination-ip-prefix {
+ description "Destination IPv4 or IPv6 prefix.";
+ type inet:ip-prefix;
+ }
+ leaf logical-source-port {
+ description "Neutron source port.";
+ type yang:uuid;
+ }
+ leaf logical-destination-port {
+ description "Neutron destination port.";
+ type yang:uuid;
+ }
+ list l7-parameter {
+ description "List of Key-Value pair of L7 matching attributes";
+ key "match-parameter";
+ leaf match-parameter {
+ description "Name of the L7 parameter";
+ type string;
+ }
+ leaf match-parameter-value {
+ description "Value of the L7 parameter";
+ type string;
+ }
+ }
+ }
+
+ grouping sfc-flow-classifiers-attributes {
+ container flow-classifiers {
+ description "Contains list of Service Function Chaining flow classifiers";
+ list flow-classifier {
+ description "
+ Defines high level model of SFC Flow Classifier. This models is based on the flow classifier APIs
+ defined by OpenStack Neutron networking-sfc project.";
+
+ key "uuid";
+ uses attrs:base-attributes;
+ uses flow-classifier-match-attributes;
+ }
+ }
+ }
+ }
--- /dev/null
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+ module neutron-sfc {
+
+ yang-version 1;
+
+ namespace "urn:opendaylight:neutron-sfc";
+
+ prefix neutron-sfc;
+
+ import ietf-yang-types { prefix "yang"; }
+ import neutron-attrs { prefix "attrs"; }
+
+
+ organization "OpenDaylight Neutron Northbound Project";
+
+ contact "Anil Vishnoi <vishnoianil@gmail.com>";
+
+ description "This YANG module defines Openstack Neutron Service Function Chaining Models.These models are based on
+ the API's exposed by the OpenStack Neutron Networking SFC (networking-sfc) project. List of SFC related
+ APIs are listed at following URL (http://docs.openstack.org/developer/networking-sfc/api.html)";
+
+ revision "2016-05-11" {
+ description
+ "OpenStack Neutron Service Function Chaining Models - Version 1.";
+ }
+
+ grouping port-chain-attributes {
+ description "Grouping of port chain attributes";
+
+ leaf-list port-pair-groups {
+ description "List of ID of Port pair groups that is part of the SF chain";
+ type yang:uuid;
+ }
+
+ leaf-list flow-classifiers {
+ description "List of ID of flow classifiers associated to the SF chain";
+ type yang:uuid;
+ }
+
+ list chain-parameters {
+ description "
+ List of additional parameters related to the SF chain. Current only one parameter 'correlation' is
+ defined. The 'correlation' parameter is used to specify the type of chain correlation mechanism. This
+ parameter allows different correlation mechanism to be selected. This is currently set to 'mpls' as a
+ default correlation mechanism because that's the only mechanism OpenStack SFC API's supports. If this
+ parameter is not specified, it will default to 'mpls'";
+
+ key "chain-parameter";
+
+ leaf chain-parameter {
+ description "SF Chain parameter attribute name";
+ type string;
+ default "correlation";
+ }
+
+ leaf chain-parameter-value {
+ description "SF Chain parameter's value";
+ type string;
+ default "mpls";
+ }
+ }
+ }
+
+ grouping port-pair-group-attributes {
+ description "Grouping of port pair group attributes";
+
+ leaf-list port-pairs {
+ description "List of the port pair's ID that is part of the port pair group";
+ type yang:uuid;
+ }
+ }
+
+ grouping port-pair-attributes {
+ description "Grouping of port pair attributes";
+
+ leaf ingress {
+ description "Ingress neutron port ID of the Service Function";
+ type yang:uuid;
+ }
+
+ leaf egress {
+ description "Egress neutron port ID of the Service Function";
+ type yang:uuid;
+ }
+
+ list service-function-parameters {
+ description "
+ Service Function specific parameters. These parameters are generally used to pass the SF specific parameter
+ information to the data path. Currently OpenStack SFC defined only one parameter - 'correlation'. The
+ 'correlation' parameter is used to specify the type of chain correlation mechanism supported by a specific
+ SF. This is needed by the data plane switch to determine how to associate a packet with a chain. Currently
+ there is no default mechanism defined by OpenStack SFC API.";
+
+ key "service-function-parameter";
+
+ leaf service-function-parameter {
+ description "Name of parameter defined for service function ";
+ type string;
+ default "correlation";
+ }
+
+ leaf service-function-parameter-value {
+ description "Value of the service function parameter";
+ type string;
+ }
+ }
+ }
+
+ grouping sfc-attributes {
+
+ container port-chains {
+ description "List of Service Function Paths (Port Chain) created by OpenStack SFC";
+
+ list port-chain {
+ description "
+ A Port Chain (Service Function Path) consists of (1) a set of Neutron ports, to define the sequence
+ of service functions and (2)a set of flow classifiers, to specify the classified traffic flows to
+ enter the chain. (1) is defined using the port pair groups. If a chain consists of a sequence of
+ different types of Service Functions, then the chain will have multiple 'port-pair-group's. There
+ must be at least one 'port-pair-group' in the Port Chain. Each port chain can be associated with
+ multiple flow classifiers";
+
+ key "uuid";
+ uses attrs:base-attributes;
+ uses port-chain-attributes;
+ }
+ }
+
+ container port-pair-groups {
+ description "List of group of Service Functions (Port Pair Groups) created by OpenStack SFC";
+
+ list port-pair-group {
+ description "
+ Port Pair group defines the group of Service Fucntions (Port pair). Inside each 'port-pair-group',
+ there could be one or more port-pairs. Multiple port-pairs may be included in a 'port-pair-group to
+ allow the specification of a set of functionally equivalent SFs that can be be used for load
+ distribution, i.e., the 'port-pair' option may be repeated for multiple port-pairs of functionally
+ equivalent SFs.";
+
+ key "uuid";
+ uses attrs:base-attributes;
+ uses port-pair-group-attributes;
+ }
+ }
+
+ container port-pairs {
+ description "List of Service Function (Port Pair) created by OpenStack";
+
+ list port-pair {
+ description "
+ A Port Pair represents a service function instance. The ingress port and the egress port of the service
+ function are defined separately but if the service function has one bidirectional port, the ingress
+ port will have the same value as the egress port. ";
+
+ key "uuid";
+ uses attrs:base-attributes;
+ uses port-pair-attributes;
+ }
+ }
+ }
+ }