module ethernet-packet { yang-version 1; namespace "urn:opendaylight:packet:ethernet"; prefix ethernet; import ietf-yang-types { prefix yang; revision-date 2013-07-15; } import base-packet { prefix bpacket; revision-date 2014-05-28; } revision 2014-05-28 { description "Copyright (c) 2014 Cisco 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 This module contains a YANG definition of the Ethernet protocol."; } /* Based on opendaylight-l2-types.yang, which needs to be fixed -- will import once that is done */ typedef known-ether-type { type enumeration { enum "ipv4" { value 2048; // 0x0800 description "Internet Protocol version 4 (IPv4)"; } enum "arp" { value 2054; // 0x0806 description "Address Resolution Protocol (ARP)"; } enum "wake-on-lan" { value 2114; // 0x0842 description "Wake-on-LAN[3]"; } enum "ietf-trill" { value 8947; // 0x22F3 description "IETF TRILL Protocol"; } enum "decnet-phase-iv" { value 24579; // 0x6003 description "DECnet Phase IV"; } enum "reverse-arp" { value 32821; // 0x8035 description "Reverse Address Resolution Protocol"; } enum "apple-talk" { value 32923; // 0x809B description "AppleTalk (Ethertalk)"; } enum "apple-talk-arp" { value 33011; // 0x80F3 description "AppleTalk Address Resolution Protocol (AARP)"; } enum "vlan-tagged" { value 33024; // 0x8100 description "VLAN-tagged frame (IEEE 802.1Q) & Shortest Path Bridging IEEE 802.1aq[4]"; } enum "ipx" { value 33079; // 0x8137 description "IPX"; } enum "ipx2" { value 33080; // 0x8138 description "IPX"; } enum "qnx-qnet" { value 33284; // 0x8204 description "QNX Qnet"; } enum "ipv6" { value 34525; // 0x86DD description "Internet Protocol Version 6 (IPv6)"; } enum "ethernet-flow-control" { value 34824; // 0x8808 description "Ethernet flow control"; } enum "slow-protocols" { value 34825; // 0x8809 description "Slow Protocols (IEEE 802.3)"; } enum "cobra-net" { value 34841; // 0x8819 description "CobraNet"; } enum "mpls-unicast" { value 34887; // 0x8847 description "MPLS unicast"; } enum "mpls-multicast" { value 34888; // 0x8848 description "MPLS multicast"; } enum "PPP-over-ethernet-discovery" { value 34915; // 0x8863 description "PPPoE Discovery Stage"; } enum "PPP-over-ethernet-session" { value 34916; // 0x8864 description "PPPoE Session Stage"; } enum "jumbo" { value 34928; // 0x8870 description "Jumbo Frames[2]"; } enum "homeplug" { value 34939; // 0x887B description "HomePlug 1.0 MME"; } enum "eap-over-lan" { value 34958; // 0x888E description "EAP over LAN (IEEE 802.1X)"; } enum "profinet" { value 34962; // 0x8892 description "PROFINET Protocol"; } enum "hyper-scsi" { value 34970; // 0x889A description "HyperSCSI (SCSI over Ethernet)"; } enum "ata-over-ethernet" { value 34978; // 0x88A2 description "ATA over Ethernet"; } enum "ethercat" { value 34980; // 0x88A4 description "EtherCAT Protocol"; } enum "provider-bridging" { value 34984; // 0x88A8 description "Provider Bridging (IEEE 802.1ad) & Shortest Path Bridging IEEE 802.1aq[5]"; } enum "ethernet-powerlink" { value 34987; // 0x88AB description "Ethernet Powerlink[citation needed]"; } enum "lldp" { value 35020; // 0x88CC description "Link Layer Discovery Protocol (LLDP)"; } enum "sercos-3" { value 35021; // 0x88CD description "SERCOS III"; } enum "homeplug-av-mme" { value 35041; // 0x88E1 description "HomePlug AV MME[citation needed]"; } enum "media-redudancy-protocol" { value 35043; // 0x88E3 description "Media Redundancy Protocol (IEC62439-2)"; } enum "mac-security" { value 35045; // 0x88E5 description "MAC security (IEEE 802.1AE)"; } enum "precision-time-protocol" { value 35063; // 0x88F7 description "Precision Time Protocol (IEEE 1588)"; } enum "connectivity-fault-management" { value 35074; // 0x8902 description "IEEE 802.1ag Connectivity Fault Management (CFM) Protocol / ITU-T Recommendation Y.1731 (OAM)"; } enum "fibre-channel-over-ethernet" { value 35078; // 0x8906 description "Fibre Channel over Ethernet (FCoE)"; } enum "fibre-channel-over-ethernet-initialization" { value 35092; // 0x8914 description "FCoE Initialization Protocol"; } enum "rmda-over-converged-ethernet" { value 35093; // 0x8915 description "RDMA over Converged Ethernet (RoCE)"; } enum "high-availability-seamless-redudancy" { value 35119; // 0x892F description "High-availability Seamless Redundancy (HSR)"; } enum "ethernet-configuration-testing-protocol" { value 36864; // 0x9000 description "Ethernet Configuration Testing Protocol[6]"; } enum "q-in-q" { value 37120; // 0x9100 description "Q-in-Q"; } enum "veritas-low-latency" { value 51966; // 0xCAFE description "Veritas Low Latency Transport (LLT)[7] for Veritas Cluster Server"; } } } typedef vlan-id { type uint16 { range "0..4095"; } } typedef header8021q-type { type enumeration { enum "vlan-tagged" { value 33024; // 0x8100 description "VLAN-tagged frame (IEEE 802.1Q) & Shortest Path Bridging IEEE 802.1aq[4]"; } enum "q-in-q" { value 37120; // 0x9100 description "Q-in-Q"; } enum "provider-bridging" { value 34984; // 0x88A8 description "802.1ad provider bridging"; } } } grouping header8021q { leaf TPID { type header8021q-type; mandatory true; } leaf priority-code { type uint8 { range "0..7"; } mandatory true; } leaf drop-eligible { type boolean; mandatory true; } leaf vlan { type vlan-id; mandatory true; } } grouping ethernet-packet-fields { leaf source-mac { type yang:mac-address; mandatory true; } leaf destination-mac { type yang:mac-address; mandatory true; } list header8021q { uses header8021q; } leaf ethertype { type known-ether-type; } leaf ethernet-length { type uint16; //Note: Length of Frame may be reported by a driver, but it is not strictly part of the protocol except for 802.3 } leaf crc { type uint32; } uses bpacket:packet-fields; } notification ethernet-packet-received { uses bpacket:packet-chain-grp { augment "packet-chain/packet" { case ethernet-packet { uses ethernet-packet-fields; } } } uses bpacket:packet-payload; } }