SaiSujithReddy

Untitled

Jan 28th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.23 KB | None | 0 0
  1. module opendaylight-match-types {
  2. namespace "urn:opendaylight:model:match:types";
  3. prefix "match";
  4.  
  5. import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
  6. import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
  7. import opendaylight-l2-types {prefix l2t;revision-date "2013-08-27";}
  8. import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
  9.  
  10. revision "2013-10-26" {
  11. description "Initial revision of match types";
  12. }
  13.  
  14. grouping "mac-address-filter" {
  15. leaf address {
  16. mandatory true;
  17. type yang:mac-address;
  18. }
  19. leaf mask {
  20. type yang:mac-address;
  21. }
  22. }
  23.  
  24. grouping "of-metadata" {
  25. leaf metadata {
  26. type uint64;
  27. }
  28.  
  29. leaf metadata-mask {
  30. type uint64;
  31. }
  32. }
  33.  
  34. /** Match Groupings **/
  35. grouping "ethernet-match-fields" {
  36. container ethernet-source {
  37. description "Ethernet source address.";
  38. presence "Match field is active and set";
  39. uses mac-address-filter;
  40. }
  41. container ethernet-destination {
  42. description "Ethernet destination address.";
  43. presence "Match field is active and set";
  44. uses mac-address-filter;
  45. }
  46. container ethernet-type {
  47. description "Ethernet frame type.";
  48. presence "Match field is active and set";
  49.  
  50. leaf type {
  51. mandatory true;
  52. type l2t:ether-type; // Needs to define that as general model
  53. }
  54. }
  55. }
  56.  
  57. grouping "vlan-match-fields" {
  58. container vlan-id {
  59. description "VLAN id.";
  60. presence "Match field is active and set";
  61.  
  62. leaf vlan-id-present {
  63. type boolean;
  64. }
  65.  
  66. leaf vlan-id {
  67. type l2t:vlan-id;
  68. }
  69. }
  70. leaf vlan-pcp {
  71. description "VLAN priority.";
  72. type l2t:vlan-pcp;
  73. }
  74. }
  75.  
  76. grouping "ip-match-fields" {
  77. leaf ip-protocol {
  78. description "IP protocol.";
  79. type uint8;
  80. }
  81.  
  82. leaf ip-dscp {
  83. description "IP DSCP (6 bits in ToS field).";
  84. type inet:dscp;
  85. }
  86.  
  87. leaf ip-ecn {
  88. description "IP ECN (2 bits in ToS field).";
  89. type uint8;
  90. }
  91.  
  92. leaf ip-proto {
  93. description "IP Proto (IPv4 or IPv6 Protocol Number).";
  94. type inet:ip-version;
  95. }
  96. }
  97.  
  98. grouping "ipv4-match-fields" {
  99. leaf ipv4-source {
  100. description "IPv4 source address.";
  101. type inet:ipv4-prefix;
  102. }
  103.  
  104. leaf ipv4-destination {
  105. description "IPv4 destination address.";
  106. type inet:ipv4-prefix;
  107. }
  108.  
  109. }
  110.  
  111. grouping "ipv4-match-netmask-fields" {
  112. leaf ipv4-source-address {
  113. description "IPv4 source address without arbitrary subnet mask.";
  114. type inet:ipv4-address;
  115. }
  116.  
  117. leaf ipv4-destination-address {
  118. description "IPv4 destination address without arbitrary subnet mask.";
  119. type inet:ipv4-address;
  120. }
  121.  
  122. leaf ipv4-source-netmask{
  123. description "IPv4 source arbitrary subnet mask.";
  124. type yang:dotted-quad;
  125. }
  126.  
  127. leaf ipv4-destination-netmask{
  128. description "IPv4 destination arbitrary subnet mask.";
  129. type yang:dotted-quad;
  130. }
  131. }
  132.  
  133. grouping "ipv6-match-fields" {
  134. leaf ipv6-source {
  135. description "IPv6 source address.";
  136. type inet:ipv6-prefix;
  137. }
  138.  
  139. leaf ipv6-destination {
  140. description "IPv6 destination address.";
  141. type inet:ipv6-prefix;
  142. }
  143.  
  144. leaf ipv6-nd-target {
  145. description "IPv6 target address for neighbour discovery message";
  146. type inet:ipv6-address;
  147. }
  148.  
  149. container "ipv6-label" {
  150. leaf ipv6-flabel {
  151. type inet:ipv6-flow-label;
  152. }
  153.  
  154. leaf flabel-mask {
  155. type inet:ipv6-flow-label;
  156. }
  157. }
  158.  
  159. leaf ipv6-nd-sll {
  160. description "Link layer source address for neighbour discovery message";
  161. type yang:mac-address;
  162. }
  163.  
  164. leaf ipv6-nd-tll {
  165. description "Link layer target address for neighbour discovery message";
  166. type yang:mac-address;
  167. }
  168.  
  169. container "ipv6-ext-header" {
  170. leaf ipv6-exthdr {
  171. description "IPv6 Extension Header field";
  172. type uint16;
  173. }
  174.  
  175. leaf ipv6-exthdr-mask {
  176. type uint16 {
  177. range "0..512";
  178. }
  179. }
  180. }
  181. }
  182.  
  183. grouping "udp-match-fields" {
  184. leaf udp-source-port {
  185. description "UDP source port.";
  186. type inet:port-number;
  187. }
  188. leaf udp-destination-port {
  189. description "UDP destination port.";
  190. type inet:port-number;
  191. }
  192. }
  193.  
  194. grouping "protocol-match-fields" {
  195. leaf mpls-label {
  196. description "Label in the first MPLS shim header";
  197. type uint32;
  198. }
  199.  
  200. leaf mpls-tc {
  201. description "TC in the first MPLS shim header";
  202. type uint8;
  203. }
  204.  
  205. leaf mpls-bos {
  206. description "BoS bit in the first MPLS shim header";
  207. type uint8;
  208. }
  209.  
  210. container "pbb" {
  211. leaf pbb-isid {
  212. description "I-SID in the first PBB service instance tag";
  213. type uint32;
  214. }
  215.  
  216. leaf pbb-mask {
  217. type uint32 {
  218. range "0..16777216";
  219. }
  220. }
  221. }
  222. }
  223.  
  224. grouping "tcp-match-fields" {
  225. leaf tcp-source-port {
  226. description "TCP source port.";
  227. type inet:port-number;
  228. }
  229. leaf tcp-destination-port {
  230. description "TCP destination port.";
  231. type inet:port-number;
  232. }
  233. }
  234.  
  235. grouping "sctp-match-fields" {
  236. leaf sctp-source-port {
  237. description "SCTP source port.";
  238. type inet:port-number;
  239. }
  240. leaf sctp-destination-port {
  241. description "SCTP destination port.";
  242. type inet:port-number;
  243. }
  244. }
  245.  
  246. grouping "icmpv4-match-fields" {
  247. leaf icmpv4-type {
  248. description "ICMP type.";
  249. type uint8; // Define ICMP Type
  250. }
  251. description "ICMP code.";
  252. leaf icmpv4-code {
  253. type uint8; // Define ICMP Code
  254. }
  255. }
  256.  
  257. grouping "icmpv6-match-fields" {
  258. leaf icmpv6-type {
  259. description "ICMP type.";
  260. type uint8; // Define ICMP Type
  261. }
  262. description "ICMP code.";
  263. leaf icmpv6-code {
  264. type uint8; // Define ICMP Code
  265. }
  266. }
  267.  
  268. grouping "arp-match-fields" {
  269. leaf arp-op {
  270. type uint16;
  271. }
  272.  
  273. leaf arp-source-transport-address {
  274. description "ARP source IPv4 address.";
  275. type inet:ipv4-prefix;
  276. }
  277.  
  278. leaf arp-target-transport-address {
  279. description "ARP target IPv4 address.";
  280. type inet:ipv4-prefix;
  281. }
  282. container arp-source-hardware-address {
  283. description "ARP source hardware address.";
  284. presence "Match field is active and set";
  285. uses mac-address-filter;
  286. }
  287. container arp-target-hardware-address {
  288. description "ARP target hardware address.";
  289. presence "Match field is active and set";
  290. uses mac-address-filter;
  291. }
  292. }
  293.  
  294. grouping "tcp-flag-match-fields" {
  295. leaf tcp-flag {
  296. type uint16;
  297. }
  298. }
  299.  
  300. grouping "tunnel-ipv4-match-fields" {
  301. leaf tunnel-ipv4-source {
  302. description "IPv4 source tunnel endpoint address.";
  303. type inet:ipv4-prefix;
  304. }
  305. leaf tunnel-ipv4-destination {
  306. description "IPv4 destination tunnel endpoint address.";
  307. type inet:ipv4-prefix;
  308. }
  309. }
  310.  
  311. grouping match {
  312. leaf in-port {
  313. type inv:node-connector-id;
  314. }
  315.  
  316. leaf in-phy-port {
  317. type inv:node-connector-id;
  318. }
  319.  
  320. container "metadata" {
  321. uses of-metadata;
  322. }
  323.  
  324. container "tunnel" {
  325. leaf tunnel-id {
  326. description "Metadata associated in the logical port";
  327. type uint64;
  328. }
  329.  
  330. leaf tunnel-mask {
  331. type uint64;
  332. }
  333. }
  334.  
  335. container "ethernet-match" {
  336. uses "ethernet-match-fields";
  337. }
  338.  
  339. container "vlan-match" {
  340. uses "vlan-match-fields";
  341. }
  342.  
  343. container "ip-match" {
  344. uses "ip-match-fields";
  345. }
  346.  
  347. choice layer-3-match {
  348. case "ipv4-match" {
  349. uses "ipv4-match-fields";
  350. uses "ipv4-match-netmask-fields";
  351. }
  352. case "ipv6-match" {
  353. uses "ipv6-match-fields";
  354. }
  355. case "arp-match" {
  356. uses "arp-match-fields";
  357. }
  358. case "tunnel-ipv4-match" {
  359. uses "tunnel-ipv4-match-fields";
  360. }
  361. }
  362.  
  363. choice layer-4-match {
  364. case "udp-match" {
  365. uses "udp-match-fields";
  366. }
  367. case "tcp-match" {
  368. uses "tcp-match-fields";
  369. }
  370. case "sctp-match" {
  371. uses "sctp-match-fields";
  372. }
  373. }
  374.  
  375. container "icmpv4-match" {
  376. uses "icmpv4-match-fields";
  377. }
  378.  
  379. container "icmpv6-match" {
  380. uses "icmpv6-match-fields";
  381. }
  382.  
  383. container "protocol-match-fields" {
  384. uses "protocol-match-fields";
  385. }
  386.  
  387. container tcp-flag-match {
  388. uses "tcp-flag-match-fields";
  389. }
  390. }
  391. }
Advertisement
Add Comment
Please, Sign In to add comment