Guest User

Untitled

a guest
Aug 25th, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module packetcapture {
  2. yang-version 1.1;
  3. namespace "http://polycube.network/packetcapture";
  4. prefix "packetcapture";
  5.  
  6. import polycube-base { prefix "polycube-base"; }
  7. import ietf-inet-types { prefix "inet"; }
  8. import ietf-yang-types { prefix "yang"; }
  9. import polycube-transparent-base { prefix "polycube-transparent-base"; }
  10.  
  11. organization "Polycube open source project";
  12. description "YANG data model for the Polycube Transparent-Packetcapture service";
  13.  
  14. polycube-base:service-description "Transparent-Packetcapture Service";
  15. polycube-base:service-version "2.0";
  16. polycube-base:service-name "packetcapture";
  17. polycube-base:service-min-kernel-version "4.14.0";
  18.  
  19. uses "polycube-transparent-base:transparent-base-yang-module";
  20.  
  21.  
  22. leaf capture {
  23. type enumeration {
  24. enum INGRESS;
  25. enum EGRESS;
  26. enum BIDIRECTIONAL;
  27. enum OFF;
  28. }
  29. default OFF;
  30. description "Packet capture status";
  31. }
  32.  
  33. leaf snaplen {
  34. type uint32;
  35. default 68;
  36. description "Snapshot length";
  37. }
  38.  
  39. leaf src {
  40. type inet:ipv4-prefix;
  41. description "IP source filter";
  42. }
  43.  
  44. leaf dst {
  45. type inet:ipv4-prefix;
  46. description "IP destination filter";
  47. }
  48.  
  49. leaf l4proto {
  50. type string;
  51. description "Level 4 protocol filter";
  52. }
  53.  
  54. leaf sport {
  55. type uint16;
  56. description "Source port filter";
  57. }
  58.  
  59. leaf dport {
  60. type uint16;
  61. description "Destination port filter";
  62. }
  63.  
  64. leaf anomimize {
  65. type boolean;
  66. default false;
  67. }
  68.  
  69. leaf savepath {
  70. type string;
  71. description "Path where the file .pcap will be stored";
  72. }
  73.  
  74. leaf linktype {
  75. type uint32;
  76. description "Capture linktype (eg. ethernet, wifi..)";
  77. }
  78.  
  79. container pcap {
  80. config false;
  81. list dump {
  82. description "packet info";
  83. key "capturelen";
  84. config false;
  85.  
  86. leaf capturelen {
  87. type uint32;
  88. description "Capture length";
  89. mandatory true;
  90. }
  91.  
  92. leaf packetlen {
  93. type uint32;
  94. description "Packet length";
  95. mandatory true;
  96. }
  97.  
  98. leaf timestamp-seconds {
  99. type uint32;
  100. units seconds;
  101. description "timestamp - seconds";
  102. mandatory true;
  103. }
  104.  
  105. leaf timestamp-milliseconds {
  106. type uint32;
  107. units milliseconds;
  108. description "timestamp - milliseconds";
  109. mandatory true;
  110. }
  111. }
  112. }
  113. }
RAW Paste Data