dell-base-packet

This module contains a collection of YANG definitions provided by the platform to implement forwarding-table packet handling cri...

  • Version: 2018-08-17

    dell-base-packet@2018-08-17


    
      module dell-base-packet {
    
        yang-version 1;
    
        namespace
          "http://www.dellemc.com/networking/os10/dell-base-packet";
    
        prefix base-packet;
    
        import dell-base-common {
          prefix base-cmn;
        }
        import ietf-yang-types {
          prefix yang;
        }
    
        organization "Dell EMC";
    
        contact "http://www.dell.com/support";
    
        description
          "This module contains a collection of YANG definitions provided
             by the platform to implement forwarding-table packet handling criterion";
    
        revision "2018-08-17" {
          description
            "Fixing pyang IETF errors and adding documentiation to the model.";
          reference
            "Network Platform Abstraction";
    
        }
    
        revision "2016-03-23" {
          description "Initial revision";
          reference
            "Network Platform Abstraction";
    
        }
    
    
        typedef packet-match-type {
          type enumeration {
            enum "SRC_MAC" {
              value 1;
              description
                "Match based on Src MAC Address";
            }
            enum "DST_MAC" {
              value 2;
              description
                "Match based on Dst MAC Address";
            }
            enum "SRC_IPV6" {
              value 3;
              description
                "Match based on Src IPv6 Address";
            }
            enum "DST_IPV6" {
              value 4;
              description
                "Match based on Dst IPv6 Address";
            }
            enum "SRC_IP" {
              value 5;
              description
                "Match based on Src IPv4 Address";
            }
            enum "DST_IP" {
              value 6;
              description
                "Match based on Dst IPv4 Address";
            }
            enum "IN_PORTS" {
              value 7;
              description
                "Match packets incoming on any of the specified list of Ports";
            }
            enum "OUT_PORTS" {
              value 8;
              description
                "Match packets outgoing on any of the specified list of Ports";
            }
            enum "OUTER_VLAN_ID" {
              value 9;
              description
                "Match based on Outer Vlan-Id";
            }
            enum "INNER_VLAN_ID" {
              value 10;
              description
                "Match based on Inner Vlan-Id";
            }
            enum "ETHER_TYPE" {
              value 11;
              description
                "Match based on EtherType";
            }
            enum "IP_PROTOCOL" {
              value 12;
              description
                "Match based on IP Protocol";
            }
            enum "HOSTIF_TRAP_ID" {
              value 13;
              description
                "Match based on Host Intf Trap Id";
            }
            enum "HOSTIF_USER_TRAP_ID" {
              value 14;
              description
                "Match based on Host Intf User Trap Id";
            }
            enum "OFFSET" {
              value 15;
              description
                "Match based on Packet offset";
            }
          }
          description
            "Enumeration of all possible packet fields that can be
                         used to match packets.";
        }
    
        typedef packet-direction-type {
          type enumeration {
            enum "DIR_IN" {
              value 1;
              description
                "Match on Ingress Packet";
            }
            enum "DIR_OUT" {
              value 2;
              description
                "Match on Egress Packet";
            }
          }
          description
            "Enumeration of types of a packet based on its traffic direction";
        }
    
        typedef packet-action-type {
          type enumeration {
            enum "REDIRECT-IF" {
              value 1;
              description
                "Redirect the packet to a specified interface";
            }
            enum "REDIRECT-SOCK" {
              value 2;
              description
                "Redirect the packet to a specified socket. Not a valid action for DIR_OUT";
            }
            enum "COPY-TO-SOCK" {
              value 3;
              description
                "Copy the packet to a specified socket. Not a valid action for DIR_OUT";
            }
          }
          description
            "Enumeration of possible actions to be performed in case of packet match";
        }
    
        grouping offset-match {
          description
            "Match up to twelve bytes from a specified offset.
                         'len' number of bytes are matched starting from 'offset-pos'";
          leaf data {
            type binary {
              length "12";
            }
            description
              "Data field used for a match operation - up to 12 bytes";
          }
    
          leaf mask {
            type binary {
              length "12";
            }
            description
              "Bytes in the mask field used for a match operation - up to 12.
                            Must be same number of bytes as in the data field.";
          }
    
          leaf len {
            type uint32;
            description
              "Number of bytes to be scanned, starting from offset-pos";
          }
    
          leaf offset-pos {
            type uint32;
            description
              "Offset in a packet where a match operation starts from.";
          }
        }  // grouping offset-match
    
        grouping match-parameters {
          description
            "Specify the match-parameter. Only ONE field of packet-match-type must be
                         filled as part of one match criteria.
                         For e.g., if match-type is SRC_IPV6, then provide the leaf-attribute <ipv6>
                         Similarly if match-type is OUTER_VLAN_ID or TRAP_ID, then provide vlan-id or
                         trap-id value in leaf-attribute <data>";
          leaf type {
            type packet-match-type;
            description
              "Identifies the packet field to be used in a match operation";
          }
    
          leaf ipv4 {
            type base-cmn:ipv4-address;
            description
              "IPv4 address to be matched with the src/dest IPv4 address";
          }
    
          leaf ipv6 {
            type base-cmn:ipv6-address;
            description
              "IPv6 address to be matched against the source or destination IPv6 address field of a packet.";
          }
    
          leaf mac-addr {
            type base-cmn:mac-address;
            description
              "MAC address to be matched against the source or destination MAC address field of a packet.";
          }
    
          leaf-list ports {
            type base-cmn:logical-ifindex;
            description
              "Set of logical interface ids, on which the packet is received/sent";
          }
    
          leaf data {
            type uint64;
            description
              "Value to use for matching packet fields of integer type, such as vlan-id, trap-id etc.";
          }
    
          container offset-value {
            when "../type = OFFSET";
            description
              "Provide parameters for offset-match when OFFSET packet type matching is performed";
            uses offset-match;
          }  // container offset-value
        }  // grouping match-parameters
    
        grouping action-parameters {
          description
            "Group of attributes for action object";
          leaf type {
            type packet-action-type;
            description
              "Action performed when a packet match occurs";
          }
    
          leaf redirect-if {
            type base-cmn:logical-ifindex;
            description
              "Interface id where the packet is sent in case of match.";
          }
    
          container socket-address {
            description
              "Address that applications need to open UDP socket to receive matched packets
                     Applications must provide this while creating the rule with socket action";
            leaf ip {
              type base-cmn:ipv4-address;
              mandatory true;
              description
                "IP address of the UDP socket where matched packets are sent.";
            }
    
            leaf udp-port {
              type uint16;
              mandatory true;
              description
                "Port of the UDP socket where matched packets are sent.";
            }
          }  // container socket-address
        }  // grouping action-parameters
    
        list rule {
          key "id";
          description
            "List of control packet software filter entries. Every rule is intended to be matched
                         and corresponding action taken. Currently, there is no priority matching or any conflict
                         resolution. Each rule can have a list of match-parameters and a list of actions.
                         For e.g.:
                         <rule1> <match-1><match-2> <action-1>, then both match-1 AND 2 must match for action-1.
                         If you need an OR operation then create rules as below:
                         <rule1> <match-1> <action-1>
                         <rule2> <match-1> <atcion-1>
    
                         Default packet action is:
                          Ingress -> Forward packet to the kernel tap interface mapped to front-panel npu port
                          Egress  -> Forward packet to the npu port corresponding to the mapped tap interface
    
                         If the matched-rule has only action as COPY-TO-SOCK, then default action shall ALSO be applied.
                         In all other cases, the default action is NOT taken";
          leaf id {
            type uint32;
            description
              "Id to uniquely identify a packet match criteria.
                              A unique integer value shall be returned to the application and can
                              be used as the key for all further get and delete actions";
          }
    
          leaf direction {
            type packet-direction-type;
            default 'DIR_IN';
            description
              "Rule to be applied on either Ingress or Egress packets";
          }
    
          list match {
            key "type";
            min-elements 1;
            description "Match-filter list";
            uses match-parameters;
          }  // list match
    
          list action {
            key "type";
            description "List of actions";
            uses action-parameters;
          }  // list action
    
          leaf stop {
            type boolean;
            default 'true';
            description
              "Stop processing further rules";
          }
        }  // list rule
    
        container statistics {
          description
            "Collection of control packet statistics objects.";
          leaf sflow-pkts {
            type yang:counter64;
            description
              "Number of SFLOW sampled packets directed to the CPU.";
          }
    
          leaf in-pkts {
            type yang:counter64;
            description
              "Number of ingressed packets received by packet-IO";
          }
    
          leaf out-pkts {
            type yang:counter64;
            description
              "Number of egressed packets trasmitted by packet-IO";
          }
        }  // container statistics
      }  // module dell-base-packet
    

© 2023 YumaWorks, Inc. All rights reserved.