pio 0.30.0 → 0.30.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (442) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/README.md +6 -49
  4. data/Rakefile +4 -4
  5. data/features/{arp.feature → arp/arp.feature} +14 -30
  6. data/features/arp/arp_reply.feature +69 -0
  7. data/features/arp/arp_request.feature +67 -0
  8. data/features/dhcp.feature +157 -162
  9. data/features/ethernet_header.feature +149 -0
  10. data/features/icmp/icmp.feature +47 -0
  11. data/features/icmp/icmp_reply.feature +93 -0
  12. data/features/icmp/icmp_request.feature +89 -0
  13. data/features/ipv4_header.feature +89 -0
  14. data/features/lldp.feature +5 -8
  15. data/features/open_flow/header.feature +13 -0
  16. data/features/open_flow/nicira_resubmit.feature +4 -22
  17. data/features/open_flow/nicira_resubmit_table.feature +6 -16
  18. data/features/open_flow10/aggregate_stats_reply.feature +5 -7
  19. data/features/open_flow10/aggregate_stats_request.feature +12 -14
  20. data/features/open_flow10/bad_request.feature +7 -24
  21. data/features/open_flow10/barrier_reply.feature +14 -25
  22. data/features/open_flow10/barrier_request.feature +12 -25
  23. data/features/open_flow10/description_stats_reply.feature +9 -7
  24. data/features/open_flow10/description_stats_request.feature +12 -25
  25. data/features/open_flow10/echo_reply.feature +14 -35
  26. data/features/open_flow10/echo_request.feature +16 -39
  27. data/features/open_flow10/enqueue.feature +3 -4
  28. data/features/open_flow10/exact_match.feature +5 -5
  29. data/features/open_flow10/features_reply.feature +28 -73
  30. data/features/open_flow10/features_request.feature +10 -28
  31. data/features/open_flow10/flow_mod.feature +4 -188
  32. data/features/open_flow10/flow_removed.feature +28 -30
  33. data/features/open_flow10/flow_stats_reply.feature +5 -89
  34. data/features/open_flow10/flow_stats_request.feature +12 -42
  35. data/features/open_flow10/hello.feature +10 -32
  36. data/features/open_flow10/hello_failed.feature +7 -57
  37. data/features/open_flow10/packet_in.feature +130 -49
  38. data/features/open_flow10/packet_out.feature +29 -18
  39. data/features/open_flow10/port_stats_request.feature +8 -29
  40. data/features/open_flow10/port_status.feature +22 -21
  41. data/features/open_flow10/queue_stats_request.feature +12 -30
  42. data/features/open_flow10/send_out_port.feature +17 -25
  43. data/features/open_flow10/set_destination_mac_address.feature +3 -4
  44. data/features/open_flow10/set_ip_destination_address.feature +3 -4
  45. data/features/open_flow10/set_source_ip_address.feature +3 -4
  46. data/features/open_flow10/set_source_mac_address.feature +3 -4
  47. data/features/open_flow10/set_tos.feature +3 -4
  48. data/features/open_flow10/set_transport_destination_port.feature +3 -4
  49. data/features/open_flow10/set_transport_source_port.feature +3 -4
  50. data/features/open_flow10/set_vlan_priority.feature +3 -4
  51. data/features/open_flow10/set_vlan_vid.feature +3 -4
  52. data/features/open_flow10/strip_vlan_header.feature +3 -4
  53. data/features/open_flow10/table_stats_request.feature +11 -13
  54. data/features/open_flow10/vendor_action.feature +4 -5
  55. data/features/open_flow13/apply_actions.feature +15 -18
  56. data/features/open_flow13/bad_request.feature +7 -13
  57. data/features/open_flow13/copy_ttl_inwards.feature +13 -0
  58. data/features/open_flow13/copy_ttl_outwards.feature +13 -0
  59. data/features/open_flow13/decrement_ip_ttl.feature +11 -0
  60. data/features/open_flow13/echo_reply.feature +16 -42
  61. data/features/open_flow13/echo_request.feature +16 -42
  62. data/features/open_flow13/features_reply.feature +4 -25
  63. data/features/open_flow13/features_request.feature +7 -36
  64. data/features/open_flow13/flow_mod.feature +16 -76
  65. data/features/open_flow13/goto_table.feature +18 -20
  66. data/features/open_flow13/hello.feature +7 -37
  67. data/features/open_flow13/hello_failed.feature +7 -30
  68. data/features/open_flow13/match.feature +239 -248
  69. data/features/open_flow13/meter.feature +18 -20
  70. data/features/open_flow13/nicira_conjunction.feature +15 -0
  71. data/features/open_flow13/nicira_reg_load.feature +27 -42
  72. data/features/open_flow13/nicira_reg_move.feature +41 -35
  73. data/features/open_flow13/nicira_send_out_port.feature +21 -13
  74. data/features/open_flow13/nicira_stack_pop.feature +26 -0
  75. data/features/open_flow13/nicira_stack_push.feature +26 -0
  76. data/features/open_flow13/packet_in.feature +7 -34
  77. data/features/open_flow13/packet_out.feature +7 -45
  78. data/features/open_flow13/send_out_port.feature +19 -28
  79. data/features/open_flow13/set_arp_operation.feature +4 -5
  80. data/features/open_flow13/set_arp_sender_hardware_address.feature +3 -4
  81. data/features/open_flow13/set_arp_sender_protocol_address.feature +3 -4
  82. data/features/open_flow13/set_destination_mac_address.feature +3 -4
  83. data/features/open_flow13/set_ip_ttl.feature +12 -0
  84. data/features/open_flow13/set_metadata.feature +3 -4
  85. data/features/open_flow13/set_source_mac_address.feature +3 -4
  86. data/features/open_flow13/stats_request.feature +4 -7
  87. data/features/open_flow13/write_metadata.feature +20 -22
  88. data/features/open_flow_read.feature +24 -5
  89. data/features/open_flow_version.feature +1 -1
  90. data/features/parser.feature +8 -9
  91. data/features/step_definitions/open_flow_steps.rb +11 -16
  92. data/features/step_definitions/packet_data_steps.rb +16 -32
  93. data/features/step_definitions/ruby_steps.rb +7 -0
  94. data/features/step_definitions/show_stats_steps.rb +3 -3
  95. data/features/support/env.rb +1 -0
  96. data/features/support/hooks.rb +2 -2
  97. data/features/udp.feature +26 -27
  98. data/lib/pio.rb +1 -1
  99. data/lib/pio/arp.rb +9 -6
  100. data/lib/pio/arp/format.rb +3 -7
  101. data/lib/pio/arp/message.rb +8 -4
  102. data/lib/pio/arp/reply.rb +9 -32
  103. data/lib/pio/arp/request.rb +9 -33
  104. data/lib/pio/class_inspector.rb +18 -0
  105. data/lib/pio/dhcp.rb +2 -2
  106. data/lib/pio/dhcp/frame.rb +4 -4
  107. data/lib/pio/dhcp/optional_tlv.rb +3 -3
  108. data/lib/pio/ethernet_frame.rb +20 -0
  109. data/lib/pio/ethernet_header.rb +35 -13
  110. data/lib/pio/icmp.rb +8 -5
  111. data/lib/pio/icmp/format.rb +19 -22
  112. data/lib/pio/icmp/message.rb +18 -4
  113. data/lib/pio/icmp/reply.rb +8 -34
  114. data/lib/pio/icmp/request.rb +8 -43
  115. data/lib/pio/instance_inspector.rb +14 -0
  116. data/lib/pio/ipv4_address.rb +11 -11
  117. data/lib/pio/ipv4_header.rb +24 -2
  118. data/lib/pio/lldp/frame.rb +2 -2
  119. data/lib/pio/lldp/optional_tlv.rb +2 -2
  120. data/lib/pio/mac.rb +7 -3
  121. data/lib/pio/message.rb +50 -0
  122. data/lib/pio/monkey_patch/bindata_record.rb +6 -0
  123. data/lib/pio/monkey_patch/bindata_string.rb +10 -0
  124. data/lib/pio/monkey_patch/integer/base_conversions.rb +1 -1
  125. data/lib/pio/monkey_patch/uint.rb +9 -0
  126. data/lib/pio/monkey_patch/uint/base_conversions.rb +14 -0
  127. data/lib/pio/open_flow.rb +38 -52
  128. data/lib/pio/open_flow/action.rb +8 -4
  129. data/lib/pio/open_flow/buffer_id.rb +19 -0
  130. data/lib/pio/open_flow/datapath_id.rb +3 -3
  131. data/lib/pio/open_flow/error_message.rb +32 -0
  132. data/lib/pio/open_flow/flags.rb +15 -6
  133. data/lib/pio/open_flow/flow_match.rb +10 -0
  134. data/lib/pio/open_flow/header.rb +26 -0
  135. data/lib/pio/open_flow/hello_failed_code.rb +1 -1
  136. data/lib/pio/open_flow/instruction.rb +10 -0
  137. data/lib/pio/open_flow/message.rb +49 -14
  138. data/lib/pio/open_flow/nicira_resubmit.rb +13 -11
  139. data/lib/pio/open_flow/nicira_resubmit_table.rb +17 -10
  140. data/lib/pio/open_flow/parser.rb +19 -0
  141. data/lib/pio/open_flow/port.rb +2 -2
  142. data/lib/pio/open_flow/transaction_id.rb +2 -2
  143. data/lib/pio/open_flow/version.rb +22 -0
  144. data/lib/pio/open_flow10/actions.rb +16 -16
  145. data/lib/pio/open_flow10/aggregate_stats/reply.rb +2 -1
  146. data/lib/pio/open_flow10/aggregate_stats/request.rb +1 -3
  147. data/lib/pio/open_flow10/barrier/reply.rb +1 -1
  148. data/lib/pio/open_flow10/barrier/request.rb +1 -1
  149. data/lib/pio/open_flow10/description_stats/reply.rb +1 -1
  150. data/lib/pio/open_flow10/description_stats/request.rb +1 -3
  151. data/lib/pio/open_flow10/echo/reply.rb +3 -3
  152. data/lib/pio/open_flow10/echo/request.rb +3 -3
  153. data/lib/pio/open_flow10/enqueue.rb +3 -3
  154. data/lib/pio/open_flow10/error.rb +3 -13
  155. data/lib/pio/open_flow10/error/bad_request.rb +5 -29
  156. data/lib/pio/open_flow10/error/bad_request/bad_request_code.rb +35 -0
  157. data/lib/pio/open_flow10/error/error_type10.rb +1 -1
  158. data/lib/pio/open_flow10/error/hello_failed.rb +6 -4
  159. data/lib/pio/open_flow10/exact_match.rb +12 -10
  160. data/lib/pio/open_flow10/features/reply.rb +16 -31
  161. data/lib/pio/open_flow10/features/request.rb +1 -4
  162. data/lib/pio/open_flow10/flow_mod.rb +8 -33
  163. data/lib/pio/open_flow10/flow_mod/command.rb +28 -0
  164. data/lib/pio/open_flow10/flow_removed.rb +2 -17
  165. data/lib/pio/open_flow10/flow_removed/reason.rb +22 -0
  166. data/lib/pio/open_flow10/flow_stats/reply.rb +3 -4
  167. data/lib/pio/open_flow10/flow_stats/request.rb +1 -3
  168. data/lib/pio/open_flow10/hello.rb +1 -4
  169. data/lib/pio/open_flow10/match.rb +13 -12
  170. data/lib/pio/open_flow10/packet_in.rb +32 -28
  171. data/lib/pio/open_flow10/packet_in/reason.rb +25 -0
  172. data/lib/pio/open_flow10/packet_out.rb +5 -6
  173. data/lib/pio/open_flow10/phy_port16.rb +36 -58
  174. data/lib/pio/open_flow10/port_stats/request.rb +1 -3
  175. data/lib/pio/open_flow10/port_status.rb +23 -30
  176. data/lib/pio/open_flow10/port_status/reason.rb +21 -0
  177. data/lib/pio/open_flow10/queue_stats/request.rb +1 -3
  178. data/lib/pio/open_flow10/send_out_port.rb +2 -2
  179. data/lib/pio/open_flow10/set_tos.rb +2 -2
  180. data/lib/pio/open_flow10/set_transport_port.rb +4 -2
  181. data/lib/pio/open_flow10/set_vlan_priority.rb +1 -1
  182. data/lib/pio/open_flow10/set_vlan_vid.rb +1 -1
  183. data/lib/pio/open_flow10/stats_reply.rb +7 -10
  184. data/lib/pio/open_flow10/stats_request.rb +16 -15
  185. data/lib/pio/open_flow10/stats_type.rb +1 -1
  186. data/lib/pio/open_flow10/table_stats/request.rb +1 -3
  187. data/lib/pio/open_flow10/vendor_action.rb +22 -20
  188. data/lib/pio/open_flow13.rb +7 -0
  189. data/lib/pio/open_flow13/actions.rb +34 -32
  190. data/lib/pio/open_flow13/apply.rb +25 -22
  191. data/lib/pio/open_flow13/copy_ttl_inwards.rb +15 -0
  192. data/lib/pio/open_flow13/copy_ttl_outwards.rb +15 -0
  193. data/lib/pio/open_flow13/decrement_ip_ttl.rb +15 -0
  194. data/lib/pio/open_flow13/echo/reply.rb +3 -3
  195. data/lib/pio/open_flow13/echo/request.rb +3 -3
  196. data/lib/pio/open_flow13/error.rb +7 -18
  197. data/lib/pio/open_flow13/error/bad_request.rb +4 -3
  198. data/lib/pio/open_flow13/error/error_type13.rb +1 -1
  199. data/lib/pio/open_flow13/error/hello_failed.rb +3 -2
  200. data/lib/pio/open_flow13/features/reply.rb +9 -16
  201. data/lib/pio/open_flow13/features/request.rb +1 -1
  202. data/lib/pio/open_flow13/flow_mod.rb +14 -19
  203. data/lib/pio/open_flow13/goto_table.rb +26 -24
  204. data/lib/pio/open_flow13/hello.rb +3 -4
  205. data/lib/pio/open_flow13/match.rb +173 -9
  206. data/lib/pio/open_flow13/meter.rb +23 -20
  207. data/lib/pio/open_flow13/nicira_conjunction.rb +26 -0
  208. data/lib/pio/open_flow13/nicira_reg_load.rb +44 -24
  209. data/lib/pio/open_flow13/nicira_reg_move.rb +77 -35
  210. data/lib/pio/open_flow13/nicira_send_out_port.rb +37 -21
  211. data/lib/pio/open_flow13/nicira_stack_pop.rb +49 -0
  212. data/lib/pio/open_flow13/nicira_stack_push.rb +49 -0
  213. data/lib/pio/open_flow13/packet_in.rb +11 -8
  214. data/lib/pio/open_flow13/packet_out.rb +9 -8
  215. data/lib/pio/open_flow13/set_ip_ttl.rb +16 -0
  216. data/lib/pio/open_flow13/stats_request.rb +2 -4
  217. data/lib/pio/open_flow13/write_metadata.rb +40 -38
  218. data/lib/pio/options.rb +8 -3
  219. data/lib/pio/parser.rb +7 -16
  220. data/lib/pio/ruby_dumper.rb +69 -0
  221. data/lib/pio/type/ether_type.rb +31 -0
  222. data/lib/pio/type/ip_address.rb +8 -0
  223. data/lib/pio/type/mac_address.rb +10 -0
  224. data/lib/pio/udp.rb +3 -3
  225. data/lib/pio/udp_header.rb +1 -1
  226. data/lib/pio/version.rb +1 -1
  227. data/pio.gemspec +5 -38
  228. data/spec/pio/arp/reply_spec.rb +0 -4
  229. data/spec/pio/arp/request_spec.rb +0 -4
  230. data/spec/pio/arp_spec.rb +0 -4
  231. data/spec/pio/icmp/reply_spec.rb +4 -8
  232. data/spec/pio/icmp/request_spec.rb +6 -10
  233. data/spec/pio/icmp_spec.rb +8 -12
  234. data/spec/pio/monkey_patch/integer_spec.rb +23 -0
  235. data/spec/pio/open_flow/nicira_resubmit_spec.rb +19 -0
  236. data/spec/pio/open_flow/nicira_resubmit_table_spec.rb +20 -0
  237. data/spec/pio/open_flow10/error/hello_failed_spec.rb +2 -2
  238. data/spec/pio/open_flow10/flow_mod_spec.rb +24 -24
  239. data/spec/pio/open_flow10/flow_stats_request_spec.rb +3 -3
  240. data/spec/pio/open_flow10/hello_spec.rb +0 -2
  241. data/spec/pio/open_flow10/match_spec.rb +38 -38
  242. data/spec/pio/open_flow10/packet_out_spec.rb +0 -349
  243. data/spec/pio/open_flow10/phy_port16_spec.rb +5 -5
  244. data/spec/pio/open_flow13/error/hello_failed_spec.rb +2 -2
  245. data/spec/pio/open_flow13/goto_table_spec.rb +2 -2
  246. data/spec/pio/open_flow13/hello_spec.rb +15 -15
  247. data/spec/pio/open_flow13/match_spec.rb +29 -29
  248. data/spec/pio/open_flow13/meter_spec.rb +2 -2
  249. data/spec/pio/open_flow13/nicira_reg_load_spec.rb +71 -0
  250. data/spec/pio/open_flow13/nicira_reg_move_spec.rb +40 -0
  251. data/spec/pio/open_flow13/nicira_send_out_port_spec.rb +29 -0
  252. data/spec/pio/open_flow13/write_metadata_spec.rb +3 -3
  253. data/spec/pio/open_flow_spec.rb +6 -6
  254. data/spec/spec_helper.rb +1 -1
  255. data/spec/support/shared_examples_for_openflow_messages.rb +5 -13
  256. metadata +191 -790
  257. data/LICENSE +0 -674
  258. data/bin/_guard-core +0 -16
  259. data/bin/byebug +0 -16
  260. data/bin/cc-tddium-post-worker +0 -16
  261. data/bin/cdiff +0 -16
  262. data/bin/coderay +0 -16
  263. data/bin/colortab +0 -16
  264. data/bin/coveralls +0 -16
  265. data/bin/cucumber +0 -16
  266. data/bin/decolor +0 -16
  267. data/bin/flay +0 -16
  268. data/bin/flog +0 -16
  269. data/bin/guard +0 -16
  270. data/bin/htmldiff +0 -16
  271. data/bin/inch +0 -16
  272. data/bin/ldiff +0 -16
  273. data/bin/listen +0 -16
  274. data/bin/minitar +0 -16
  275. data/bin/pry +0 -16
  276. data/bin/rake +0 -16
  277. data/bin/reek +0 -16
  278. data/bin/relish +0 -16
  279. data/bin/restclient +0 -16
  280. data/bin/rspec +0 -16
  281. data/bin/rubocop +0 -16
  282. data/bin/ruby-parse +0 -16
  283. data/bin/ruby-rewrite +0 -16
  284. data/bin/ruby_parse +0 -16
  285. data/bin/ruby_parse_extract_error +0 -16
  286. data/bin/sparkr +0 -16
  287. data/bin/term_display +0 -16
  288. data/bin/term_mandel +0 -16
  289. data/bin/terminal-notifier +0 -16
  290. data/bin/thor +0 -16
  291. data/bin/unparser +0 -16
  292. data/bin/yard +0 -16
  293. data/bin/yardoc +0 -16
  294. data/bin/yri +0 -16
  295. data/features/arp-storm.pcap +0 -0
  296. data/features/arp.pcap +0 -0
  297. data/features/dhcp.pcap +0 -0
  298. data/features/icmp.feature +0 -130
  299. data/features/icmp.pcap +0 -0
  300. data/features/icmpv6.pcap +0 -0
  301. data/features/lldp.detailed.pcap +0 -0
  302. data/features/lldp.minimal.pcap +0 -0
  303. data/features/open_flow10/aggregate_stats_reply.raw +0 -0
  304. data/features/open_flow10/aggregate_stats_request.raw +0 -0
  305. data/features/open_flow10/bad_request.raw +0 -0
  306. data/features/open_flow10/barrier_reply.raw +0 -0
  307. data/features/open_flow10/barrier_request.raw +0 -0
  308. data/features/open_flow10/description_stats_reply.raw +0 -0
  309. data/features/open_flow10/description_stats_request.raw +0 -0
  310. data/features/open_flow10/echo_reply.raw +0 -0
  311. data/features/open_flow10/echo_request.raw +0 -0
  312. data/features/open_flow10/error.raw +0 -0
  313. data/features/open_flow10/features_reply.raw +0 -0
  314. data/features/open_flow10/features_request.raw +0 -0
  315. data/features/open_flow10/flow_mod_add.raw +0 -0
  316. data/features/open_flow10/flow_mod_delete.raw +0 -0
  317. data/features/open_flow10/flow_mod_delete_strict.raw +0 -0
  318. data/features/open_flow10/flow_mod_modify.raw +0 -0
  319. data/features/open_flow10/flow_mod_modify_strict.raw +0 -0
  320. data/features/open_flow10/flow_removed.raw +0 -0
  321. data/features/open_flow10/flow_stats_reply.raw +0 -0
  322. data/features/open_flow10/flow_stats_request.raw +0 -0
  323. data/features/open_flow10/get_config_reply.raw +0 -0
  324. data/features/open_flow10/get_config_request.raw +0 -0
  325. data/features/open_flow10/hello.raw +0 -0
  326. data/features/open_flow10/hello_failed.raw +0 -0
  327. data/features/open_flow10/nx_flow_mod_add.raw +0 -0
  328. data/features/open_flow10/nx_flow_mod_delete.raw +0 -0
  329. data/features/open_flow10/nx_flow_mod_delete_strict.raw +0 -0
  330. data/features/open_flow10/nx_flow_mod_modify.raw +0 -0
  331. data/features/open_flow10/nx_flow_mod_modify_strict.raw +0 -0
  332. data/features/open_flow10/nxast_learn.raw +0 -0
  333. data/features/open_flow10/packet_in.raw +0 -0
  334. data/features/open_flow10/packet_in_arp_reply.raw +0 -0
  335. data/features/open_flow10/packet_in_arp_request.raw +0 -0
  336. data/features/open_flow10/packet_in_cbench.raw +0 -0
  337. data/features/open_flow10/packet_out.raw +0 -0
  338. data/features/open_flow10/port_mod.raw +0 -0
  339. data/features/open_flow10/port_stats_reply.raw +0 -0
  340. data/features/open_flow10/port_stats_request.raw +0 -0
  341. data/features/open_flow10/port_status.raw +0 -0
  342. data/features/open_flow10/queue_get_config_reply.raw +0 -0
  343. data/features/open_flow10/queue_get_config_request.raw +0 -0
  344. data/features/open_flow10/queue_stats_request.raw +0 -0
  345. data/features/open_flow10/set_config.raw +0 -0
  346. data/features/open_flow10/table_stats_reply.raw +0 -0
  347. data/features/open_flow10/table_stats_request.raw +0 -0
  348. data/features/open_flow10/vendor.raw +0 -0
  349. data/features/open_flow10/vendor_stats_request.raw +0 -0
  350. data/features/open_flow13/action_copy_ttl_in.raw +0 -0
  351. data/features/open_flow13/action_copy_ttl_out.raw +0 -0
  352. data/features/open_flow13/action_dec_mpls_ttl.raw +0 -0
  353. data/features/open_flow13/action_dec_nw_ttl.raw +0 -0
  354. data/features/open_flow13/action_group.raw +0 -0
  355. data/features/open_flow13/action_pop_mpls.raw +0 -0
  356. data/features/open_flow13/action_pop_pbb.raw +0 -0
  357. data/features/open_flow13/action_pop_vlan.raw +0 -0
  358. data/features/open_flow13/action_push_mpls.raw +0 -0
  359. data/features/open_flow13/action_push_pbb.raw +0 -0
  360. data/features/open_flow13/action_push_vlan.raw +0 -0
  361. data/features/open_flow13/action_set_field.raw +0 -0
  362. data/features/open_flow13/action_set_mpls_ttl.raw +0 -0
  363. data/features/open_flow13/action_set_nw_ttl.raw +0 -0
  364. data/features/open_flow13/action_set_queue.raw +0 -0
  365. data/features/open_flow13/apply_actions.raw +0 -0
  366. data/features/open_flow13/bad_request.raw +0 -0
  367. data/features/open_flow13/echo_reply_body.raw +0 -0
  368. data/features/open_flow13/echo_reply_no_body.raw +0 -0
  369. data/features/open_flow13/echo_request_body.raw +0 -0
  370. data/features/open_flow13/echo_request_no_body.raw +0 -0
  371. data/features/open_flow13/features_reply.raw +0 -0
  372. data/features/open_flow13/features_request.raw +0 -0
  373. data/features/open_flow13/flow_add_apply_no_match.raw +0 -0
  374. data/features/open_flow13/flow_mod_add_apply_no_match.raw +0 -0
  375. data/features/open_flow13/flow_mod_no_match_or_instructions.raw +0 -0
  376. data/features/open_flow13/hello_failed.raw +0 -0
  377. data/features/open_flow13/hello_no_version_bitmap.raw +0 -0
  378. data/features/open_flow13/hello_version_bitmap.raw +0 -0
  379. data/features/open_flow13/instruction_clear_actions.raw +0 -0
  380. data/features/open_flow13/instruction_goto_table.raw +0 -0
  381. data/features/open_flow13/instruction_meter.raw +0 -0
  382. data/features/open_flow13/instruction_write_actions.raw +0 -0
  383. data/features/open_flow13/instruction_write_metadata.raw +0 -0
  384. data/features/open_flow13/oxm_arp_op_field.raw +0 -0
  385. data/features/open_flow13/oxm_arp_sha_field.raw +0 -0
  386. data/features/open_flow13/oxm_arp_spa_field.raw +0 -0
  387. data/features/open_flow13/oxm_arp_tha_field.raw +0 -0
  388. data/features/open_flow13/oxm_arp_tpa_field.raw +0 -0
  389. data/features/open_flow13/oxm_ether_destination_field.raw +0 -0
  390. data/features/open_flow13/oxm_ether_source_field.raw +0 -0
  391. data/features/open_flow13/oxm_ether_type_field.raw +0 -0
  392. data/features/open_flow13/oxm_experimenter_stratos_basic_dot11.raw +0 -0
  393. data/features/open_flow13/oxm_icmpv4_code_field.raw +0 -0
  394. data/features/open_flow13/oxm_icmpv4_type_field.raw +0 -0
  395. data/features/open_flow13/oxm_in_phy_port_field.raw +0 -0
  396. data/features/open_flow13/oxm_in_port_field.raw +0 -0
  397. data/features/open_flow13/oxm_invalid_field.raw +0 -0
  398. data/features/open_flow13/oxm_ip_dscp_field.raw +0 -0
  399. data/features/open_flow13/oxm_ip_ecn_field.raw +0 -0
  400. data/features/open_flow13/oxm_ipv4_destination_field.raw +0 -0
  401. data/features/open_flow13/oxm_ipv4_source_field.raw +0 -0
  402. data/features/open_flow13/oxm_ipv6_destination_field.raw +0 -0
  403. data/features/open_flow13/oxm_ipv6_source_field.raw +0 -0
  404. data/features/open_flow13/oxm_masked_arp_sha_field.raw +0 -0
  405. data/features/open_flow13/oxm_masked_arp_spa_field.raw +0 -0
  406. data/features/open_flow13/oxm_masked_arp_tha_field.raw +0 -0
  407. data/features/open_flow13/oxm_masked_arp_tpa_field.raw +0 -0
  408. data/features/open_flow13/oxm_masked_ether_destination_field.raw +0 -0
  409. data/features/open_flow13/oxm_masked_ether_source_field.raw +0 -0
  410. data/features/open_flow13/oxm_masked_ipv4_destination_field.raw +0 -0
  411. data/features/open_flow13/oxm_masked_ipv4_source_field.raw +0 -0
  412. data/features/open_flow13/oxm_masked_ipv6_destination_field.raw +0 -0
  413. data/features/open_flow13/oxm_masked_ipv6_source_field.raw +0 -0
  414. data/features/open_flow13/oxm_masked_tunnel_id_field.raw +0 -0
  415. data/features/open_flow13/oxm_metadata_field.raw +0 -0
  416. data/features/open_flow13/oxm_metadata_masked_field.raw +0 -0
  417. data/features/open_flow13/oxm_no_fields.raw +0 -0
  418. data/features/open_flow13/oxm_sctp_destination_field.raw +0 -0
  419. data/features/open_flow13/oxm_sctp_source_field.raw +0 -0
  420. data/features/open_flow13/oxm_tcp_destination_field.raw +0 -0
  421. data/features/open_flow13/oxm_tcp_field.raw +0 -0
  422. data/features/open_flow13/oxm_tcp_source_field.raw +0 -0
  423. data/features/open_flow13/oxm_tunnel_id_field.raw +0 -0
  424. data/features/open_flow13/oxm_udp_destination_field.raw +0 -0
  425. data/features/open_flow13/oxm_udp_field.raw +0 -0
  426. data/features/open_flow13/oxm_udp_source_field.raw +0 -0
  427. data/features/open_flow13/oxm_vlan_pcp_field.raw +0 -0
  428. data/features/open_flow13/oxm_vlan_vid_field.raw +0 -0
  429. data/features/open_flow13/packet_in.raw +0 -0
  430. data/features/open_flow13/packet_out.raw +0 -0
  431. data/features/open_flow13/send_out_port.raw +0 -0
  432. data/features/open_flow13/table_stats_reply.raw +0 -0
  433. data/features/open_flow13/table_stats_request.raw +0 -0
  434. data/features/step_definitions/LICENSE +0 -675
  435. data/features/udp_no_payload.raw +0 -0
  436. data/features/udp_with_payload.raw +0 -0
  437. data/lib/pio/icmp/options.rb +0 -21
  438. data/lib/pio/open_flow/error.rb +0 -19
  439. data/lib/pio/open_flow/open_flow_header.rb +0 -31
  440. data/lib/pio/open_flow13/buffer_id.rb +0 -17
  441. data/spec/pio/arp/reply/options_spec.rb +0 -143
  442. data/spec/pio/arp/request/options_spec.rb +0 -113
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b5753a6115af1e4780aa485bf53e666cd071903
4
- data.tar.gz: 14fa545e8f983b2694dcff0afafb7c1afeb91624
3
+ metadata.gz: fdea8ee5cb716f9d6dd67083baf361c3b3b706b0
4
+ data.tar.gz: 76628fc9d6845d884d7c366adf51861572e8683e
5
5
  SHA512:
6
- metadata.gz: c6db3f9249f15d5fcaec8af17d66fa36af5a222dfb4b8b082049ffb356a871a98572d8edafbd11e9416ed3a7aca21428116ca69200c153f4690487485cf708ef
7
- data.tar.gz: 44ccf71fb9db860a33706942d947a110464c2f809263543dca73c977888180ca4cfeb1646297a722cfcb777e027fa40566d80eb08410412ab8d76e4b627ccf75
6
+ metadata.gz: 2c8641f225a53391fa3c7a861ea52755d55e1a2e4f335af6da27eb4cb5a727e51eb10d7ec4cd2ce640cda4078d2f33006ba7bf8c5a8261040b055564c95a4241
7
+ data.tar.gz: 34af6da3d91113ea51c87725791d2d9a313988133e51d14aeb085dd8f09a7b497a713f7be09129bfa7018c8c5f89f7a5fd0e52666f9781fe1fda97b27142ad21
@@ -1,6 +1,9 @@
1
1
  # Changelog
2
2
 
3
3
  ## develop (unreleased)
4
+ ### New features
5
+ * [#301](https://github.com/trema/pio/pull/301): Add `NiciraConjunction` action.
6
+ * [#300](https://github.com/trema/pio/pull/300): Add new classes `Pio::Match::PacketReg{0..3}`.
4
7
 
5
8
  ## 0.30.0 (11/17/2015)
6
9
  ### New features
data/README.md CHANGED
@@ -8,8 +8,6 @@
8
8
  <a href='https://gitter.im/trema/pio'><img src='https://badges.gitter.im/Join Chat.svg?style=flat' alt='Gitter Chat' /></a>
9
9
  <a href="http://inch-pages.github.io/github/trema/pio"><img src="http://inch-pages.github.io/github/trema/pio.svg" alt="Inline docs"></a>
10
10
 
11
- <a href="http://www.flickr.com/photos/mongogushi/4226014070/" title="pio pencil by mongo gushi, on Flickr"><img src="http://farm5.staticflickr.com/4022/4226014070_cdeb7c1e5d_n.jpg" width="320" height="290" alt="pio pencil"></a>
12
-
13
11
  Pio is a ruby gem to easily parse and generate network packets.
14
12
 
15
13
  ## Features Overview
@@ -22,47 +20,9 @@ Pio is a ruby gem to easily parse and generate network packets.
22
20
  [BinData](https://github.com/dmendel/bindata)'s declarative binary
23
21
  format DSL so that it is easy to read and debug by human beings.
24
22
 
25
- ## Supported packet formats
26
-
27
- Pio supports the following packet formats:
28
-
29
- - [ICMP](https://relishapp.com/trema/pio/docs/pio-icmp)
30
- - [ARP](https://relishapp.com/trema/pio/docs/pio-arp)
31
- - [LLDP](https://relishapp.com/trema/pio/docs/pio-lldp)
32
- - [DHCP](https://relishapp.com/trema/pio/docs/pio-dhcp)
33
- - [UDP](https://relishapp.com/trema/pio/docs/pio-udp)
34
- - OpenFlow 1.0
35
- - [Hello](https://relishapp.com/trema/pio/docs/open-flow10/pio-hello)
36
- - [HelloFailed](https://relishapp.com/trema/pio/docs/open-flow10/pio-error-hellofailed)
37
- - [BadRequest](https://relishapp.com/trema/pio/docs/open-flow10/pio-error-badrequest)
38
- - [Echo Request](https://relishapp.com/trema/pio/docs/open-flow10/pio-echo-request)
39
- - [Echo Reply](https://relishapp.com/trema/pio/docs/open-flow10/pio-echo-reply)
40
- - [Features Request](https://relishapp.com/trema/pio/docs/open-flow10/pio-features-request)
41
- - [Features Reply](https://relishapp.com/trema/pio/docs/open-flow10/pio-features-reply)
42
- - [Packet In](https://relishapp.com/trema/pio/docs/open-flow10/pio-packetin)
43
- - [Packet Out](https://relishapp.com/trema/pio/docs/open-flow10/pio-packetout)
44
- - [Flow Mod](https://relishapp.com/trema/pio/docs/open-flow10/pio-flowmod)
45
- - [Port Status](https://relishapp.com/trema/pio/docs/open-flow10/pio-portstatus)
46
- - [Exact Match](https://relishapp.com/trema/pio/docs/open-flow10/pio-exactmatch)
47
- - [Barrier Request](https://relishapp.com/trema/pio/docs/open-flow10/pio-barrier-request)
48
- - [Barrier Reply](https://relishapp.com/trema/pio/docs/open-flow10/pio-barrier-reply)
49
- - [Description Stats Request](https://relishapp.com/trema/pio/docs/open-flow10/pio-descriptionstats-request)
50
- - [Description Stats Reply](https://relishapp.com/trema/pio/docs/open-flow10/pio-descriptionstats-reply)
51
- - [Flow Stats Request](https://relishapp.com/trema/pio/docs/open-flow10/pio-flowstats-request)
52
- - [Flow Stats Reply](https://relishapp.com/trema/pio/docs/open-flow10/pio-flowstats-reply)
53
- - [Aggregate Stats Request](https://relishapp.com/trema/pio/docs/open-flow10/pio-aggregatestats-request)
54
- - [Aggregate Stats Reply](https://relishapp.com/trema/pio/docs/open-flow10/pio-aggregatestats-reply)
55
- - OpenFlow 1.3
56
- - [Hello](https://relishapp.com/trema/pio/docs/open-flow13/pio-hello)
57
- - [HelloFailed](https://relishapp.com/trema/pio/docs/open-flow13/pio-error-hellofailed)
58
- - [BadRequest](https://relishapp.com/trema/pio/docs/open-flow13/pio-error-badrequest)
59
- - [Echo Request](https://relishapp.com/trema/pio/docs/open-flow13/pio-echo-request)
60
- - [Echo Reply](https://relishapp.com/trema/pio/docs/open-flow13/pio-echo-reply)
61
- - [Features Request](https://relishapp.com/trema/pio/docs/open-flow13/pio-features-request)
62
- - [Features Reply](https://relishapp.com/trema/pio/docs/open-flow13/pio-features-reply)
63
- - [Packet In](https://relishapp.com/trema/pio/docs/open-flow13/pio-packetin)
64
- - [Packet Out](https://relishapp.com/trema/pio/docs/open-flow13/pio-packetout)
65
- - [Flow Mod](https://relishapp.com/trema/pio/docs/open-flow13/pio-flowmod)
23
+ ## Documentation
24
+
25
+ See https://relishapp.com/trema/pio/docs for links to documentation for all APIs.
66
26
 
67
27
  ## Installation
68
28
 
@@ -80,10 +40,6 @@ and install it by running Bundler:
80
40
  bundle
81
41
  ```
82
42
 
83
- ## Documents
84
-
85
- - [API document](https://relishapp.com/trema/pio/docs)
86
-
87
43
  ## Team
88
44
 
89
45
  - [Yasuhito Takamiya](https://github.com/yasuhito) ([@yasuhito](https://twitter.com/yasuhito))
@@ -100,6 +56,7 @@ bundle
100
56
 
101
57
  ## License
102
58
 
103
- Pio is released under the GNU General Public License version 3.0:
59
+ Pio is released under the GNU General Public License version 2.0 or MIT License:
104
60
 
105
- - <http://www.gnu.org/licenses/gpl.html>
61
+ * http://www.gnu.org/licenses/gpl-2.0.html
62
+ * http://www.opensource.org/licenses/MIT
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
2
 
3
- RELISH_PROJECT = 'trema/pio'
4
- FLAY_THRESHOLD = 1343
3
+ RELISH_PROJECT = 'trema/pio'.freeze
4
+ FLAY_THRESHOLD = 1446
5
5
 
6
6
  task default: :travis
7
7
  task test: [:spec, :cucumber]
@@ -24,7 +24,7 @@ end
24
24
  desc 'Dump packet data file in Array'
25
25
  task :dump do
26
26
  unless ENV['PACKET_FILE']
27
- fail 'Usage: rake PACKET_FILE="foobar.{pcap,raw}" dump'
27
+ raise 'Usage: rake PACKET_FILE="foobar.{pcap,raw}" dump'
28
28
  end
29
29
  packet_file =
30
30
  File.join(File.dirname(__FILE__), 'features/', ENV['PACKET_FILE'])
@@ -38,6 +38,6 @@ task :dump do
38
38
  end
39
39
  end
40
40
  else
41
- fail "Unsupported file extension: #{ENV['PACKET_FILE']}"
41
+ raise "Unsupported file extension: #{ENV['PACKET_FILE']}"
42
42
  end
43
43
  end
@@ -1,15 +1,13 @@
1
- Feature: Pio::Arp
2
- Scenario: create an ARP request
3
- When I try to create a packet with:
4
- """
5
- Pio::Arp::Request.new(
6
- source_mac: '00:26:82:eb:ea:d1',
7
- sender_protocol_address: '192.168.83.3',
8
- target_protocol_address: '192.168.83.254'
9
- )
1
+ Feature: Arp
2
+ Background:
3
+ Given I use the fixture "arp"
4
+
5
+ Scenario: read an ARP request packet
6
+ When I create a packet with:
7
+ """ruby
8
+ Pio::Arp.read(eval(IO.read('arp_request.rb')))
10
9
  """
11
- Then it should finish successfully
12
- And the packet has the following fields and values:
10
+ Then the packet has the following fields and values:
13
11
  | field | value |
14
12
  | class | Pio::Arp::Request |
15
13
  | destination_mac | ff:ff:ff:ff:ff:ff |
@@ -25,18 +23,12 @@ Feature: Pio::Arp
25
23
  | target_hardware_address | 00:00:00:00:00:00 |
26
24
  | target_protocol_address | 192.168.83.254 |
27
25
 
28
- Scenario: create an ARP reply
29
- When I try to create a packet with:
30
- """
31
- Pio::Arp::Reply.new(
32
- source_mac: '00:16:9d:1d:9c:c4',
33
- destination_mac: '00:26:82:eb:ea:d1',
34
- sender_protocol_address: '192.168.83.254',
35
- target_protocol_address: '192.168.83.3'
36
- )
26
+ Scenario: read an ARP reply packet
27
+ When I create a packet with:
28
+ """ruby
29
+ Pio::Arp.read(eval(IO.read('arp_reply.rb')))
37
30
  """
38
- Then it should finish successfully
39
- And the packet has the following fields and values:
31
+ Then the packet has the following fields and values:
40
32
  | field | value |
41
33
  | class | Pio::Arp::Reply |
42
34
  | destination_mac | 00:26:82:eb:ea:d1 |
@@ -51,11 +43,3 @@ Feature: Pio::Arp
51
43
  | sender_protocol_address | 192.168.83.254 |
52
44
  | target_hardware_address | 00:26:82:eb:ea:d1 |
53
45
  | target_protocol_address | 192.168.83.3 |
54
-
55
- Scenario: parse arp.pcap
56
- When I try to parse a file named "arp.pcap" with "Pio::Arp" class
57
- Then it should finish successfully
58
-
59
- Scenario: parse arp-storm.pcap
60
- When I try to parse a file named "arp-storm.pcap" with "Pio::Arp" class
61
- Then it should finish successfully
@@ -0,0 +1,69 @@
1
+ Feature: Arp::Reply
2
+ Scenario: create an ARP reply
3
+ When I create a packet with:
4
+ """ruby
5
+ Pio::Arp::Reply.new(
6
+ destination_mac: '00:26:82:eb:ea:d1',
7
+ source_mac: '00:16:9d:1d:9c:c4',
8
+ sender_protocol_address: '192.168.83.254',
9
+ target_protocol_address: '192.168.83.3'
10
+ )
11
+ """
12
+ Then the packet has the following fields and values:
13
+ | field | value |
14
+ | class | Pio::Arp::Reply |
15
+ | destination_mac | 00:26:82:eb:ea:d1 |
16
+ | source_mac | 00:16:9d:1d:9c:c4 |
17
+ | ether_type | 2054 |
18
+ | hardware_type | 1 |
19
+ | protocol_type | 2048 |
20
+ | hardware_length | 6 |
21
+ | protocol_length | 4 |
22
+ | operation | 2 |
23
+ | sender_hardware_address | 00:16:9d:1d:9c:c4 |
24
+ | sender_protocol_address | 192.168.83.254 |
25
+ | target_hardware_address | 00:26:82:eb:ea:d1 |
26
+ | target_protocol_address | 192.168.83.3 |
27
+
28
+ Scenario: convert to Ruby code
29
+ When I eval the following Ruby code:
30
+ """ruby
31
+ Pio::Arp::Reply.new(
32
+ destination_mac: '00:26:82:eb:ea:d1',
33
+ source_mac: '00:16:9d:1d:9c:c4',
34
+ sender_protocol_address: '192.168.83.254',
35
+ target_protocol_address: '192.168.83.3'
36
+ ).to_ruby
37
+ """
38
+ Then the result of eval should be:
39
+ """ruby
40
+ [
41
+ 0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1, # destination_mac
42
+ 0x00, 0x16, 0x9d, 0x1d, 0x9c, 0xc4, # source_mac
43
+ 0x08, 0x06, # ether_type
44
+ 0x00, 0x01, # hardware_type
45
+ 0x08, 0x00, # protocol_type
46
+ 0x06, # hardware_length
47
+ 0x04, # protocol_length
48
+ 0x00, 0x02, # operation
49
+ 0x00, 0x16, 0x9d, 0x1d, 0x9c, 0xc4, # sender_hardware_address
50
+ 0xc0, 0xa8, 0x53, 0xfe, # sender_protocol_address
51
+ 0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1, # target_hardware_address
52
+ 0xc0, 0xa8, 0x53, 0x03, # target_protocol_address
53
+ ].pack('C42')
54
+ """
55
+
56
+ Scenario: ARP reply inspection
57
+ When I eval the following Ruby code:
58
+ """ruby
59
+ Pio::Arp::Reply.new(
60
+ destination_mac: '00:26:82:eb:ea:d1',
61
+ source_mac: '00:16:9d:1d:9c:c4',
62
+ sender_protocol_address: '192.168.83.254',
63
+ target_protocol_address: '192.168.83.3'
64
+ ).inspect
65
+ """
66
+ Then the result of eval should be:
67
+ """ruby
68
+ #<Pio::Arp::Reply destination_mac: "00:26:82:eb:ea:d1", source_mac: "00:16:9d:1d:9c:c4", ether_type: 0x0806, hardware_type: 1, protocol_type: 2048, hardware_length: 6, protocol_length: 4, operation: 2, sender_hardware_address: "00:16:9d:1d:9c:c4", sender_protocol_address: "192.168.83.254", target_hardware_address: "00:26:82:eb:ea:d1", target_protocol_address: "192.168.83.3">
69
+ """
@@ -0,0 +1,67 @@
1
+ Feature: Arp::Request
2
+ Scenario: create an ARP request
3
+ When I create a packet with:
4
+ """ruby
5
+ Pio::Arp::Request.new(
6
+ source_mac: '00:26:82:eb:ea:d1',
7
+ sender_protocol_address: '192.168.83.3',
8
+ target_protocol_address: '192.168.83.254'
9
+ )
10
+ """
11
+ Then the packet has the following fields and values:
12
+ | field | value |
13
+ | class | Pio::Arp::Request |
14
+ | destination_mac | ff:ff:ff:ff:ff:ff |
15
+ | source_mac | 00:26:82:eb:ea:d1 |
16
+ | ether_type | 2054 |
17
+ | hardware_type | 1 |
18
+ | protocol_type | 2048 |
19
+ | hardware_length | 6 |
20
+ | protocol_length | 4 |
21
+ | operation | 1 |
22
+ | sender_hardware_address | 00:26:82:eb:ea:d1 |
23
+ | sender_protocol_address | 192.168.83.3 |
24
+ | target_hardware_address | 00:00:00:00:00:00 |
25
+ | target_protocol_address | 192.168.83.254 |
26
+
27
+ Scenario: convert to Ruby code
28
+ When I eval the following Ruby code:
29
+ """ruby
30
+ Pio::Arp::Request.new(
31
+ source_mac: '00:26:82:eb:ea:d1',
32
+ sender_protocol_address: '192.168.83.3',
33
+ target_protocol_address: '192.168.83.254'
34
+ ).to_ruby
35
+ """
36
+ Then the result of eval should be:
37
+ """ruby
38
+ [
39
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, # destination_mac
40
+ 0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1, # source_mac
41
+ 0x08, 0x06, # ether_type
42
+ 0x00, 0x01, # hardware_type
43
+ 0x08, 0x00, # protocol_type
44
+ 0x06, # hardware_length
45
+ 0x04, # protocol_length
46
+ 0x00, 0x01, # operation
47
+ 0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1, # sender_hardware_address
48
+ 0xc0, 0xa8, 0x53, 0x03, # sender_protocol_address
49
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # target_hardware_address
50
+ 0xc0, 0xa8, 0x53, 0xfe, # target_protocol_address
51
+ ].pack('C42')
52
+ """
53
+
54
+ Scenario: ARP request inspection
55
+ When I eval the following Ruby code:
56
+ """ruby
57
+ Pio::Arp::Request.new(
58
+ source_mac: '00:26:82:eb:ea:d1',
59
+ sender_protocol_address: '192.168.83.3',
60
+ target_protocol_address: '192.168.83.254'
61
+ ).inspect
62
+ """
63
+ Then the result of eval should be:
64
+ """
65
+ #<Pio::Arp::Request destination_mac: "ff:ff:ff:ff:ff:ff", source_mac: "00:26:82:eb:ea:d1", ether_type: 0x0806, hardware_type: 1, protocol_type: 2048, hardware_length: 6, protocol_length: 4, operation: 1, sender_hardware_address: "00:26:82:eb:ea:d1", sender_protocol_address: "192.168.83.3", target_hardware_address: "00:00:00:00:00:00", target_protocol_address: "192.168.83.254">
66
+ """
67
+
@@ -1,6 +1,6 @@
1
- Feature: Pio::Dhcp
1
+ Feature: Dhcp
2
2
  Scenario: create a DHCP Ack
3
- When I try to create a packet with:
3
+ When I create a packet with:
4
4
  """
5
5
  Pio::Dhcp::Ack.new(
6
6
  source_mac: 'aa:bb:cc:dd:ee:ff',
@@ -14,95 +14,93 @@ Feature: Pio::Dhcp
14
14
  subnet_mask: '255.255.255.0'
15
15
  )
16
16
  """
17
- Then it should finish successfully
18
- And the packet has the following fields and values:
19
- | field | value |
20
- | class | Pio::Dhcp::Ack |
21
- | destination_mac | 11:22:33:44:55:66 |
22
- | source_mac | aa:bb:cc:dd:ee:ff |
23
- | ether_type | 2048 |
24
- | ip_version | 4 |
25
- | ip_header_length | 5 |
26
- | ip_type_of_service | 0 |
27
- | ip_total_length | 328 |
28
- | ip_identifier | 0 |
29
- | ip_flag | 0 |
30
- | ip_fragment | 0 |
31
- | ip_ttl | 128 |
32
- | ip_protocol | 17 |
33
- | ip_header_checksum | 47177 |
34
- | source_ip_address | 192.168.0.10 |
35
- | destination_ip_address | 192.168.0.1 |
36
- | udp_source_port | 67 |
37
- | udp_destination_port | 68 |
38
- | udp_length | 308 |
39
- | udp_checksum | 7012 |
40
- | message_type | 5 |
41
- | hw_addr_type | 1 |
42
- | hw_addr_len | 6 |
43
- | hops | 0 |
44
- | transaction_id | 3735928559 |
45
- | seconds | 0 |
46
- | bootp_flags | 0 |
47
- | client_ip_address | 0.0.0.0 |
48
- | your_ip_address | 192.168.0.1 |
49
- | next_server_ip_address | 0.0.0.0 |
50
- | relay_agent_ip_address | 0.0.0.0 |
51
- | client_mac_address | aa:bb:cc:dd:ee:ff |
52
- | subnet_mask | 255.255.255.0 |
53
- | server_identifier | 192.168.0.10 |
54
- | renewal_time_value | 3735928559 |
55
- | rebinding_time_value | 3735928559 |
56
- | ip_address_lease_time | 3735928559 |
17
+ Then the packet has the following fields and values:
18
+ | field | value |
19
+ | class | Pio::Dhcp::Ack |
20
+ | destination_mac | 11:22:33:44:55:66 |
21
+ | source_mac | aa:bb:cc:dd:ee:ff |
22
+ | ether_type | 2048 |
23
+ | ip_version | 4 |
24
+ | ip_header_length | 5 |
25
+ | ip_type_of_service | 0 |
26
+ | ip_total_length | 328 |
27
+ | ip_identifier | 0 |
28
+ | ip_flag | 0 |
29
+ | ip_fragment | 0 |
30
+ | ip_ttl | 128 |
31
+ | ip_protocol | 17 |
32
+ | ip_header_checksum | 47177 |
33
+ | source_ip_address | 192.168.0.10 |
34
+ | destination_ip_address | 192.168.0.1 |
35
+ | udp_source_port | 67 |
36
+ | udp_destination_port | 68 |
37
+ | udp_length | 308 |
38
+ | udp_checksum | 7012 |
39
+ | message_type | 5 |
40
+ | hw_addr_type | 1 |
41
+ | hw_addr_len | 6 |
42
+ | hops | 0 |
43
+ | transaction_id | 3735928559 |
44
+ | seconds | 0 |
45
+ | bootp_flags | 0 |
46
+ | client_ip_address | 0.0.0.0 |
47
+ | your_ip_address | 192.168.0.1 |
48
+ | next_server_ip_address | 0.0.0.0 |
49
+ | relay_agent_ip_address | 0.0.0.0 |
50
+ | client_mac_address | aa:bb:cc:dd:ee:ff |
51
+ | subnet_mask | 255.255.255.0 |
52
+ | server_identifier | 192.168.0.10 |
53
+ | renewal_time_value | 3735928559 |
54
+ | rebinding_time_value | 3735928559 |
55
+ | ip_address_lease_time | 3735928559 |
57
56
 
58
57
  Scenario: create a DHCP Discover
59
- When I try to create a packet with:
58
+ When I create a packet with:
60
59
  """
61
60
  Pio::Dhcp::Discover.new(
62
61
  source_mac: '24:db:ac:41:e5:5b',
63
62
  transaction_id: 0xdeadbeef
64
63
  )
65
64
  """
66
- Then it should finish successfully
67
- And the packet has the following fields and values:
68
- | field | value |
69
- | class | Pio::Dhcp::Discover |
70
- | destination_mac | ff:ff:ff:ff:ff:ff |
71
- | source_mac | 24:db:ac:41:e5:5b |
72
- | ether_type | 2048 |
73
- | ip_version | 4 |
74
- | ip_header_length | 5 |
75
- | ip_type_of_service | 0 |
76
- | ip_total_length | 328 |
77
- | ip_identifier | 0 |
78
- | ip_flag | 0 |
79
- | ip_fragment | 0 |
80
- | ip_ttl | 128 |
81
- | ip_protocol | 17 |
82
- | ip_header_checksum | 14758 |
83
- | source_ip_address | 0.0.0.0 |
84
- | destination_ip_address | 255.255.255.255 |
85
- | udp_source_port | 68 |
86
- | udp_destination_port | 67 |
87
- | udp_length | 308 |
88
- | udp_checksum | 34836 |
89
- | message_type | 1 |
90
- | hw_addr_type | 1 |
91
- | hw_addr_len | 6 |
92
- | hops | 0 |
93
- | transaction_id | 3735928559 |
94
- | seconds | 0 |
95
- | bootp_flags | 0 |
96
- | client_ip_address | 0.0.0.0 |
97
- | your_ip_address | 0.0.0.0 |
98
- | next_server_ip_address | 0.0.0.0 |
99
- | relay_agent_ip_address | 0.0.0.0 |
100
- | client_mac_address | 24:db:ac:41:e5:5b |
101
- | parameters_list | [1, 3, 6, 42] |
102
- | client_identifier | 24:db:ac:41:e5:5b |
65
+ Then the packet has the following fields and values:
66
+ | field | value |
67
+ | class | Pio::Dhcp::Discover |
68
+ | destination_mac | ff:ff:ff:ff:ff:ff |
69
+ | source_mac | 24:db:ac:41:e5:5b |
70
+ | ether_type | 2048 |
71
+ | ip_version | 4 |
72
+ | ip_header_length | 5 |
73
+ | ip_type_of_service | 0 |
74
+ | ip_total_length | 328 |
75
+ | ip_identifier | 0 |
76
+ | ip_flag | 0 |
77
+ | ip_fragment | 0 |
78
+ | ip_ttl | 128 |
79
+ | ip_protocol | 17 |
80
+ | ip_header_checksum | 14758 |
81
+ | source_ip_address | 0.0.0.0 |
82
+ | destination_ip_address | 255.255.255.255 |
83
+ | udp_source_port | 68 |
84
+ | udp_destination_port | 67 |
85
+ | udp_length | 308 |
86
+ | udp_checksum | 34836 |
87
+ | message_type | 1 |
88
+ | hw_addr_type | 1 |
89
+ | hw_addr_len | 6 |
90
+ | hops | 0 |
91
+ | transaction_id | 3735928559 |
92
+ | seconds | 0 |
93
+ | bootp_flags | 0 |
94
+ | client_ip_address | 0.0.0.0 |
95
+ | your_ip_address | 0.0.0.0 |
96
+ | next_server_ip_address | 0.0.0.0 |
97
+ | relay_agent_ip_address | 0.0.0.0 |
98
+ | client_mac_address | 24:db:ac:41:e5:5b |
99
+ | parameters_list | [1, 3, 6, 42] |
100
+ | client_identifier | 24:db:ac:41:e5:5b |
103
101
 
104
102
  Scenario: create a DHCP Request
105
- When I try to create a packet with:
103
+ When I create a packet with:
106
104
  """
107
105
  Pio::Dhcp::Request.new(
108
106
  source_mac: '24:db:ac:41:e5:5b',
@@ -111,47 +109,46 @@ Feature: Pio::Dhcp
111
109
  requested_ip_address: '192.168.0.10'
112
110
  )
113
111
  """
114
- Then it should finish successfully
115
- And the packet has the following fields and values:
116
- | field | value |
117
- | class | Pio::Dhcp::Request |
118
- | destination_mac | ff:ff:ff:ff:ff:ff |
119
- | source_mac | 24:db:ac:41:e5:5b |
120
- | ether_type | 2048 |
121
- | ip_version | 4 |
122
- | ip_header_length | 5 |
123
- | ip_type_of_service | 0 |
124
- | ip_total_length | 328 |
125
- | ip_identifier | 0 |
126
- | ip_flag | 0 |
127
- | ip_fragment | 0 |
128
- | ip_ttl | 128 |
129
- | ip_protocol | 17 |
130
- | ip_header_checksum | 14758 |
131
- | source_ip_address | 0.0.0.0 |
132
- | destination_ip_address | 255.255.255.255 |
133
- | udp_source_port | 68 |
134
- | udp_destination_port | 67 |
135
- | udp_length | 308 |
136
- | udp_checksum | 52915 |
137
- | message_type | 3 |
138
- | hw_addr_type | 1 |
139
- | hw_addr_len | 6 |
140
- | hops | 0 |
141
- | transaction_id | 3735928559 |
142
- | seconds | 0 |
143
- | bootp_flags | 0 |
144
- | client_ip_address | 0.0.0.0 |
145
- | your_ip_address | 0.0.0.0 |
146
- | next_server_ip_address | 0.0.0.0 |
147
- | relay_agent_ip_address | 0.0.0.0 |
148
- | client_mac_address | 24:db:ac:41:e5:5b |
149
- | parameters_list | [1, 3, 6, 42] |
150
- | client_identifier | 24:db:ac:41:e5:5b |
151
- | requested_ip_address | 192.168.0.10 |
112
+ Then the packet has the following fields and values:
113
+ | field | value |
114
+ | class | Pio::Dhcp::Request |
115
+ | destination_mac | ff:ff:ff:ff:ff:ff |
116
+ | source_mac | 24:db:ac:41:e5:5b |
117
+ | ether_type | 2048 |
118
+ | ip_version | 4 |
119
+ | ip_header_length | 5 |
120
+ | ip_type_of_service | 0 |
121
+ | ip_total_length | 328 |
122
+ | ip_identifier | 0 |
123
+ | ip_flag | 0 |
124
+ | ip_fragment | 0 |
125
+ | ip_ttl | 128 |
126
+ | ip_protocol | 17 |
127
+ | ip_header_checksum | 14758 |
128
+ | source_ip_address | 0.0.0.0 |
129
+ | destination_ip_address | 255.255.255.255 |
130
+ | udp_source_port | 68 |
131
+ | udp_destination_port | 67 |
132
+ | udp_length | 308 |
133
+ | udp_checksum | 52915 |
134
+ | message_type | 3 |
135
+ | hw_addr_type | 1 |
136
+ | hw_addr_len | 6 |
137
+ | hops | 0 |
138
+ | transaction_id | 3735928559 |
139
+ | seconds | 0 |
140
+ | bootp_flags | 0 |
141
+ | client_ip_address | 0.0.0.0 |
142
+ | your_ip_address | 0.0.0.0 |
143
+ | next_server_ip_address | 0.0.0.0 |
144
+ | relay_agent_ip_address | 0.0.0.0 |
145
+ | client_mac_address | 24:db:ac:41:e5:5b |
146
+ | parameters_list | [1, 3, 6, 42] |
147
+ | client_identifier | 24:db:ac:41:e5:5b |
148
+ | requested_ip_address | 192.168.0.10 |
152
149
 
153
150
  Scenario: create a DHCP Offer
154
- When I try to create a packet with:
151
+ When I create a packet with:
155
152
  """
156
153
  Pio::Dhcp::Offer.new(
157
154
  source_mac: 'aa:bb:cc:dd:ee:ff',
@@ -165,47 +162,45 @@ Feature: Pio::Dhcp
165
162
  subnet_mask: '255.255.255.0'
166
163
  )
167
164
  """
168
- Then it should finish successfully
169
- And the packet has the following fields and values:
170
- | field | value |
171
- | class | Pio::Dhcp::Offer |
172
- | destination_mac | 11:22:33:44:55:66 |
173
- | source_mac | aa:bb:cc:dd:ee:ff |
174
- | ether_type | 2048 |
175
- | ip_version | 4 |
176
- | ip_header_length | 5 |
177
- | ip_type_of_service | 0 |
178
- | ip_total_length | 328 |
179
- | ip_identifier | 0 |
180
- | ip_flag | 0 |
181
- | ip_fragment | 0 |
182
- | ip_ttl | 128 |
183
- | ip_protocol | 17 |
184
- | ip_header_checksum | 47177 |
185
- | source_ip_address | 192.168.0.10 |
186
- | destination_ip_address | 192.168.0.1 |
187
- | udp_source_port | 67 |
188
- | udp_destination_port | 68 |
189
- | udp_length | 308 |
190
- | udp_checksum | 7780 |
191
- | message_type | 2 |
192
- | hw_addr_type | 1 |
193
- | hw_addr_len | 6 |
194
- | hops | 0 |
195
- | transaction_id | 3735928559 |
196
- | seconds | 0 |
197
- | bootp_flags | 0 |
198
- | client_ip_address | 0.0.0.0 |
199
- | your_ip_address | 192.168.0.1 |
200
- | next_server_ip_address | 0.0.0.0 |
201
- | relay_agent_ip_address | 0.0.0.0 |
202
- | client_mac_address | aa:bb:cc:dd:ee:ff |
203
- | subnet_mask | 255.255.255.0 |
204
- | server_identifier | 192.168.0.10 |
205
- | renewal_time_value | 3735928559 |
206
- | rebinding_time_value | 3735928559 |
207
- | ip_address_lease_time | 3735928559 |
165
+ Then the packet has the following fields and values:
166
+ | field | value |
167
+ | class | Pio::Dhcp::Offer |
168
+ | destination_mac | 11:22:33:44:55:66 |
169
+ | source_mac | aa:bb:cc:dd:ee:ff |
170
+ | ether_type | 2048 |
171
+ | ip_version | 4 |
172
+ | ip_header_length | 5 |
173
+ | ip_type_of_service | 0 |
174
+ | ip_total_length | 328 |
175
+ | ip_identifier | 0 |
176
+ | ip_flag | 0 |
177
+ | ip_fragment | 0 |
178
+ | ip_ttl | 128 |
179
+ | ip_protocol | 17 |
180
+ | ip_header_checksum | 47177 |
181
+ | source_ip_address | 192.168.0.10 |
182
+ | destination_ip_address | 192.168.0.1 |
183
+ | udp_source_port | 67 |
184
+ | udp_destination_port | 68 |
185
+ | udp_length | 308 |
186
+ | udp_checksum | 7780 |
187
+ | message_type | 2 |
188
+ | hw_addr_type | 1 |
189
+ | hw_addr_len | 6 |
190
+ | hops | 0 |
191
+ | transaction_id | 3735928559 |
192
+ | seconds | 0 |
193
+ | bootp_flags | 0 |
194
+ | client_ip_address | 0.0.0.0 |
195
+ | your_ip_address | 192.168.0.1 |
196
+ | next_server_ip_address | 0.0.0.0 |
197
+ | relay_agent_ip_address | 0.0.0.0 |
198
+ | client_mac_address | aa:bb:cc:dd:ee:ff |
199
+ | subnet_mask | 255.255.255.0 |
200
+ | server_identifier | 192.168.0.10 |
201
+ | renewal_time_value | 3735928559 |
202
+ | rebinding_time_value | 3735928559 |
203
+ | ip_address_lease_time | 3735928559 |
208
204
 
209
205
  Scenario: parse dhcp.pcap
210
- When I try to parse a file named "dhcp.pcap" with "Pio::Dhcp" class
211
- Then it should finish successfully
206
+ Then I parse a file named "dhcp.pcap" with "Pio::Dhcp" class