pio 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/pio/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Base module.
2
2
  module Pio
3
3
  # gem version.
4
- VERSION = '0.22.0'.freeze
4
+ VERSION = '0.23.0'.freeze
5
5
  end
@@ -403,6 +403,296 @@ describe Pio::OpenFlow13::Match do
403
403
  And { match.match_fields[2].masked? == false }
404
404
  And { match.match_fields[2].oxm_length == 1 }
405
405
  end
406
+
407
+ context 'with ether_type: 0x0806, arp_op: 1' do
408
+ When(:match) do
409
+ Pio::OpenFlow13::Match.new(
410
+ ether_type: 0x0806,
411
+ arp_op: 1
412
+ )
413
+ end
414
+ Then { match.ether_type == 0x0806 }
415
+ Then { match.arp_op == 1 }
416
+ And { match.class == Pio::OpenFlow13::Match }
417
+ And { match.length == 16 }
418
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
419
+ And { match.match_length == 16 }
420
+ And { match.match_fields.size == 2 }
421
+ And do
422
+ match.match_fields[1].oxm_class ==
423
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
424
+ end
425
+ And do
426
+ match.match_fields[1].oxm_field ==
427
+ Pio::OpenFlow13::Match::ArpOp::OXM_FIELD
428
+ end
429
+ And { match.match_fields[1].masked? == false }
430
+ And { match.match_fields[1].oxm_length == 2 }
431
+ end
432
+
433
+ context "with ether_type: 0x0806, arp_sender_protocol_address: '1.2.3.4'" do
434
+ When(:match) do
435
+ Pio::OpenFlow13::Match.new(
436
+ ether_type: 0x0806,
437
+ arp_sender_protocol_address: '1.2.3.4'
438
+ )
439
+ end
440
+ Then { match.ether_type == 0x0806 }
441
+ Then { match.arp_sender_protocol_address == '1.2.3.4' }
442
+ And { match.class == Pio::OpenFlow13::Match }
443
+ And { match.length == 24 }
444
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
445
+ And { match.match_length == 18 }
446
+ And { match.match_fields.size == 2 }
447
+ And do
448
+ match.match_fields[1].oxm_class ==
449
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
450
+ end
451
+ And do
452
+ match.match_fields[1].oxm_field ==
453
+ Pio::OpenFlow13::Match::ArpSenderProtocolAddress::OXM_FIELD
454
+ end
455
+ And { match.match_fields[1].masked? == false }
456
+ And { match.match_fields[1].oxm_length == 4 }
457
+ end
458
+
459
+ context "with ether_type: 0x0806, arp_sender_protocol_address: '1.2.3.4', arp_sender_protocol_address_mask: '255.255.0.0'" do
460
+ When(:match) do
461
+ Pio::OpenFlow13::Match.new(
462
+ ether_type: 0x0806,
463
+ arp_sender_protocol_address: '1.2.3.4',
464
+ arp_sender_protocol_address_mask: '255.255.0.0'
465
+ )
466
+ end
467
+ Then { match.ether_type == 0x0806 }
468
+ Then { match.arp_sender_protocol_address == '1.2.3.4' }
469
+ Then { match.arp_sender_protocol_address_mask == '255.255.0.0' }
470
+ And { match.class == Pio::OpenFlow13::Match }
471
+ And { match.length == 24 }
472
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
473
+ And { match.match_length == 22 }
474
+ And { match.match_fields.size == 2 }
475
+ And do
476
+ match.match_fields[1].oxm_class ==
477
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
478
+ end
479
+ And do
480
+ match.match_fields[1].oxm_field ==
481
+ Pio::OpenFlow13::Match::ArpSenderProtocolAddress::OXM_FIELD
482
+ end
483
+ And { match.match_fields[1].masked? == true }
484
+ And { match.match_fields[1].oxm_length == 8 }
485
+ end
486
+
487
+ context "with ether_type: 0x0806, arp_target_protocol_address: '1.2.3.4'" do
488
+ When(:match) do
489
+ Pio::OpenFlow13::Match.new(
490
+ ether_type: 0x0806,
491
+ arp_target_protocol_address: '1.2.3.4'
492
+ )
493
+ end
494
+ Then { match.ether_type == 0x0806 }
495
+ Then { match.arp_target_protocol_address == '1.2.3.4' }
496
+ And { match.class == Pio::OpenFlow13::Match }
497
+ And { match.length == 24 }
498
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
499
+ And { match.match_length == 18 }
500
+ And { match.match_fields.size == 2 }
501
+ And do
502
+ match.match_fields[1].oxm_class ==
503
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
504
+ end
505
+ And do
506
+ match.match_fields[1].oxm_field ==
507
+ Pio::OpenFlow13::Match::ArpTargetProtocolAddress::OXM_FIELD
508
+ end
509
+ And { match.match_fields[1].masked? == false }
510
+ And { match.match_fields[1].oxm_length == 4 }
511
+ end
512
+
513
+ context "with ether_type: 0x0806, arp_target_protocol_address: '1.2.3.4', arp_target_protocol_address_mask: '255.255.0.0'" do
514
+ When(:match) do
515
+ Pio::OpenFlow13::Match.new(
516
+ ether_type: 0x0806,
517
+ arp_target_protocol_address: '1.2.3.4',
518
+ arp_target_protocol_address_mask: '255.255.0.0'
519
+ )
520
+ end
521
+ Then { match.ether_type == 0x0806 }
522
+ Then { match.arp_target_protocol_address == '1.2.3.4' }
523
+ Then { match.arp_target_protocol_address_mask == '255.255.0.0' }
524
+ And { match.class == Pio::OpenFlow13::Match }
525
+ And { match.length == 24 }
526
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
527
+ And { match.match_length == 22 }
528
+ And { match.match_fields.size == 2 }
529
+ And do
530
+ match.match_fields[1].oxm_class ==
531
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
532
+ end
533
+ And do
534
+ match.match_fields[1].oxm_field ==
535
+ Pio::OpenFlow13::Match::ArpTargetProtocolAddress::OXM_FIELD
536
+ end
537
+ And { match.match_fields[1].masked? == true }
538
+ And { match.match_fields[1].oxm_length == 8 }
539
+ end
540
+
541
+ context "with ether_type: 0x0806, arp_sender_hardware_address: '11:22:33:44:55:66'" do
542
+ When(:match) do
543
+ Pio::OpenFlow13::Match.new(
544
+ ether_type: 0x0806,
545
+ arp_sender_hardware_address: '11:22:33:44:55:66'
546
+ )
547
+ end
548
+ Then { match.ether_type == 0x0806 }
549
+ Then { match.arp_sender_hardware_address == '11:22:33:44:55:66' }
550
+ And { match.class == Pio::OpenFlow13::Match }
551
+ And { match.length == 24 }
552
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
553
+ And { match.match_length == 20 }
554
+ And { match.match_fields.size == 2 }
555
+ And do
556
+ match.match_fields[1].oxm_class ==
557
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
558
+ end
559
+ And do
560
+ match.match_fields[1].oxm_field ==
561
+ Pio::OpenFlow13::Match::ArpSenderHardwareAddress::OXM_FIELD
562
+ end
563
+ And { match.match_fields[1].masked? == false }
564
+ And { match.match_fields[1].oxm_length == 6 }
565
+ end
566
+
567
+ context "with ether_type: 0x0806, arp_sender_hardware_address: '11:22:33:44:55:66', arp_sender_hardware_address_mask: 'ff:ff:ff:00:00:00'" do
568
+ When(:match) do
569
+ Pio::OpenFlow13::Match.new(
570
+ ether_type: 0x0806,
571
+ arp_sender_hardware_address: '11:22:33:44:55:66',
572
+ arp_sender_hardware_address_mask: 'ff:ff:ff:00:00:00'
573
+ )
574
+ end
575
+ Then { match.ether_type == 0x0806 }
576
+ Then { match.arp_sender_hardware_address == '11:22:33:44:55:66' }
577
+ Then { match.arp_sender_hardware_address_mask == 'ff:ff:ff:00:00:00' }
578
+ And { match.class == Pio::OpenFlow13::Match }
579
+ And { match.length == 32 }
580
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
581
+ And { match.match_length == 26 }
582
+ And { match.match_fields.size == 2 }
583
+ And do
584
+ match.match_fields[1].oxm_class ==
585
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
586
+ end
587
+ And do
588
+ match.match_fields[1].oxm_field ==
589
+ Pio::OpenFlow13::Match::ArpSenderHardwareAddress::OXM_FIELD
590
+ end
591
+ And { match.match_fields[1].masked? == true }
592
+ And { match.match_fields[1].oxm_length == 12 }
593
+ end
594
+
595
+ context "with ether_type: 0x0806, arp_target_hardware_address: '11:22:33:44:55:66'" do
596
+ When(:match) do
597
+ Pio::OpenFlow13::Match.new(
598
+ ether_type: 0x0806,
599
+ arp_target_hardware_address: '11:22:33:44:55:66'
600
+ )
601
+ end
602
+ Then { match.ether_type == 0x0806 }
603
+ Then { match.arp_target_hardware_address == '11:22:33:44:55:66' }
604
+ And { match.class == Pio::OpenFlow13::Match }
605
+ And { match.length == 24 }
606
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
607
+ And { match.match_length == 20 }
608
+ And { match.match_fields.size == 2 }
609
+ And do
610
+ match.match_fields[1].oxm_class ==
611
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
612
+ end
613
+ And do
614
+ match.match_fields[1].oxm_field ==
615
+ Pio::OpenFlow13::Match::ArpTargetHardwareAddress::OXM_FIELD
616
+ end
617
+ And { match.match_fields[1].masked? == false }
618
+ And { match.match_fields[1].oxm_length == 6 }
619
+ end
620
+
621
+ context "with ether_type: 0x0806, arp_target_hardware_address: '11:22:33:44:55:66', arp_target_hardware_address_mask: 'ff:ff:ff:00:00:00'" do
622
+ When(:match) do
623
+ Pio::OpenFlow13::Match.new(
624
+ ether_type: 0x0806,
625
+ arp_target_hardware_address: '11:22:33:44:55:66',
626
+ arp_target_hardware_address_mask: 'ff:ff:ff:00:00:00'
627
+ )
628
+ end
629
+ Then { match.ether_type == 0x0806 }
630
+ Then { match.arp_target_hardware_address == '11:22:33:44:55:66' }
631
+ Then { match.arp_target_hardware_address_mask == 'ff:ff:ff:00:00:00' }
632
+ And { match.class == Pio::OpenFlow13::Match }
633
+ And { match.length == 32 }
634
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
635
+ And { match.match_length == 26 }
636
+ And { match.match_fields.size == 2 }
637
+ And do
638
+ match.match_fields[1].oxm_class ==
639
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
640
+ end
641
+ And do
642
+ match.match_fields[1].oxm_field ==
643
+ Pio::OpenFlow13::Match::ArpTargetHardwareAddress::OXM_FIELD
644
+ end
645
+ And { match.match_fields[1].masked? == true }
646
+ And { match.match_fields[1].oxm_length == 12 }
647
+ end
648
+
649
+ context 'with tunnel_id: 1' do
650
+ When(:match) do
651
+ Pio::OpenFlow13::Match.new(tunnel_id: 1)
652
+ end
653
+ Then { match.tunnel_id == 1 }
654
+ And { match.class == Pio::OpenFlow13::Match }
655
+ And { match.length == 16 }
656
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
657
+ And { match.match_length == 16 }
658
+ And { match.match_fields.size == 1 }
659
+ And do
660
+ match.match_fields[0].oxm_class ==
661
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
662
+ end
663
+ And do
664
+ match.match_fields[0].oxm_field ==
665
+ Pio::OpenFlow13::Match::TunnelId::OXM_FIELD
666
+ end
667
+ And { match.match_fields[0].masked? == false }
668
+ And { match.match_fields[0].oxm_length == 8 }
669
+ end
670
+
671
+ context 'with tunnel_id: 1, tunnel_id_mask: 0x8000000000000000' do
672
+ When(:match) do
673
+ Pio::OpenFlow13::Match.new(
674
+ tunnel_id: 1,
675
+ tunnel_id_mask: 0x8000000000000000
676
+ )
677
+ end
678
+ Then { match.tunnel_id == 1 }
679
+ Then { match.tunnel_id_mask == 0x8000000000000000 }
680
+ And { match.class == Pio::OpenFlow13::Match }
681
+ And { match.length == 24 }
682
+ And { match.match_type == Pio::OpenFlow13::MATCH_TYPE_OXM }
683
+ And { match.match_length == 24 }
684
+ And { match.match_fields.size == 1 }
685
+ And do
686
+ match.match_fields[0].oxm_class ==
687
+ Pio::OpenFlow13::Match::OXM_CLASS_OPENFLOW_BASIC
688
+ end
689
+ And do
690
+ match.match_fields[0].oxm_field ==
691
+ Pio::OpenFlow13::Match::TunnelId::OXM_FIELD
692
+ end
693
+ And { match.match_fields[0].masked? == true }
694
+ And { match.match_fields[0].oxm_length == 16 }
695
+ end
406
696
  end
407
697
 
408
698
  def read_raw_data_file(name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhito Takamiya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-25 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -511,6 +511,11 @@ files:
511
511
  - features/open_flow13/instruction_write_metadata.raw
512
512
  - features/open_flow13/match.feature
513
513
  - features/open_flow13/meter.feature
514
+ - features/open_flow13/oxm_arp_op_field.raw
515
+ - features/open_flow13/oxm_arp_sha_field.raw
516
+ - features/open_flow13/oxm_arp_spa_field.raw
517
+ - features/open_flow13/oxm_arp_tha_field.raw
518
+ - features/open_flow13/oxm_arp_tpa_field.raw
514
519
  - features/open_flow13/oxm_ether_destination_field.raw
515
520
  - features/open_flow13/oxm_ether_source_field.raw
516
521
  - features/open_flow13/oxm_ether_type_field.raw
@@ -524,12 +529,17 @@ files:
524
529
  - features/open_flow13/oxm_ipv4_source_field.raw
525
530
  - features/open_flow13/oxm_ipv6_destination_field.raw
526
531
  - features/open_flow13/oxm_ipv6_source_field.raw
532
+ - features/open_flow13/oxm_masked_arp_sha_field.raw
533
+ - features/open_flow13/oxm_masked_arp_spa_field.raw
534
+ - features/open_flow13/oxm_masked_arp_tha_field.raw
535
+ - features/open_flow13/oxm_masked_arp_tpa_field.raw
527
536
  - features/open_flow13/oxm_masked_ether_destination_field.raw
528
537
  - features/open_flow13/oxm_masked_ether_source_field.raw
529
538
  - features/open_flow13/oxm_masked_ipv4_destination_field.raw
530
539
  - features/open_flow13/oxm_masked_ipv4_source_field.raw
531
540
  - features/open_flow13/oxm_masked_ipv6_destination_field.raw
532
541
  - features/open_flow13/oxm_masked_ipv6_source_field.raw
542
+ - features/open_flow13/oxm_masked_tunnel_id_field.raw
533
543
  - features/open_flow13/oxm_metadata_field.raw
534
544
  - features/open_flow13/oxm_metadata_masked_field.raw
535
545
  - features/open_flow13/oxm_no_fields.raw
@@ -538,6 +548,7 @@ files:
538
548
  - features/open_flow13/oxm_tcp_destination_field.raw
539
549
  - features/open_flow13/oxm_tcp_field.raw
540
550
  - features/open_flow13/oxm_tcp_source_field.raw
551
+ - features/open_flow13/oxm_tunnel_id_field.raw
541
552
  - features/open_flow13/oxm_udp_destination_field.raw
542
553
  - features/open_flow13/oxm_udp_field.raw
543
554
  - features/open_flow13/oxm_udp_source_field.raw
@@ -545,6 +556,7 @@ files:
545
556
  - features/open_flow13/oxm_vlan_vid_field.raw
546
557
  - features/open_flow13/packet_in.feature
547
558
  - features/open_flow13/packet_in.raw
559
+ - features/open_flow13/packet_out.feature
548
560
  - features/open_flow13/packet_out.raw
549
561
  - features/open_flow13/send_out_port.feature
550
562
  - features/open_flow13/send_out_port.raw
@@ -636,7 +648,9 @@ files:
636
648
  - lib/pio/open_flow10/set_vlan_vid.rb
637
649
  - lib/pio/open_flow10/strip_vlan_header.rb
638
650
  - lib/pio/open_flow13.rb
651
+ - lib/pio/open_flow13/actions.rb
639
652
  - lib/pio/open_flow13/apply.rb
653
+ - lib/pio/open_flow13/buffer_id.rb
640
654
  - lib/pio/open_flow13/echo.rb
641
655
  - lib/pio/open_flow13/features_reply.rb
642
656
  - lib/pio/open_flow13/features_request.rb
@@ -646,6 +660,7 @@ files:
646
660
  - lib/pio/open_flow13/match.rb
647
661
  - lib/pio/open_flow13/meter.rb
648
662
  - lib/pio/open_flow13/packet_in.rb
663
+ - lib/pio/open_flow13/packet_out.rb
649
664
  - lib/pio/open_flow13/send_out_port.rb
650
665
  - lib/pio/open_flow13/write_metadata.rb
651
666
  - lib/pio/options.rb
@@ -863,6 +878,11 @@ test_files:
863
878
  - features/open_flow13/instruction_write_metadata.raw
864
879
  - features/open_flow13/match.feature
865
880
  - features/open_flow13/meter.feature
881
+ - features/open_flow13/oxm_arp_op_field.raw
882
+ - features/open_flow13/oxm_arp_sha_field.raw
883
+ - features/open_flow13/oxm_arp_spa_field.raw
884
+ - features/open_flow13/oxm_arp_tha_field.raw
885
+ - features/open_flow13/oxm_arp_tpa_field.raw
866
886
  - features/open_flow13/oxm_ether_destination_field.raw
867
887
  - features/open_flow13/oxm_ether_source_field.raw
868
888
  - features/open_flow13/oxm_ether_type_field.raw
@@ -876,12 +896,17 @@ test_files:
876
896
  - features/open_flow13/oxm_ipv4_source_field.raw
877
897
  - features/open_flow13/oxm_ipv6_destination_field.raw
878
898
  - features/open_flow13/oxm_ipv6_source_field.raw
899
+ - features/open_flow13/oxm_masked_arp_sha_field.raw
900
+ - features/open_flow13/oxm_masked_arp_spa_field.raw
901
+ - features/open_flow13/oxm_masked_arp_tha_field.raw
902
+ - features/open_flow13/oxm_masked_arp_tpa_field.raw
879
903
  - features/open_flow13/oxm_masked_ether_destination_field.raw
880
904
  - features/open_flow13/oxm_masked_ether_source_field.raw
881
905
  - features/open_flow13/oxm_masked_ipv4_destination_field.raw
882
906
  - features/open_flow13/oxm_masked_ipv4_source_field.raw
883
907
  - features/open_flow13/oxm_masked_ipv6_destination_field.raw
884
908
  - features/open_flow13/oxm_masked_ipv6_source_field.raw
909
+ - features/open_flow13/oxm_masked_tunnel_id_field.raw
885
910
  - features/open_flow13/oxm_metadata_field.raw
886
911
  - features/open_flow13/oxm_metadata_masked_field.raw
887
912
  - features/open_flow13/oxm_no_fields.raw
@@ -890,6 +915,7 @@ test_files:
890
915
  - features/open_flow13/oxm_tcp_destination_field.raw
891
916
  - features/open_flow13/oxm_tcp_field.raw
892
917
  - features/open_flow13/oxm_tcp_source_field.raw
918
+ - features/open_flow13/oxm_tunnel_id_field.raw
893
919
  - features/open_flow13/oxm_udp_destination_field.raw
894
920
  - features/open_flow13/oxm_udp_field.raw
895
921
  - features/open_flow13/oxm_udp_source_field.raw
@@ -897,6 +923,7 @@ test_files:
897
923
  - features/open_flow13/oxm_vlan_vid_field.raw
898
924
  - features/open_flow13/packet_in.feature
899
925
  - features/open_flow13/packet_in.raw
926
+ - features/open_flow13/packet_out.feature
900
927
  - features/open_flow13/packet_out.raw
901
928
  - features/open_flow13/send_out_port.feature
902
929
  - features/open_flow13/send_out_port.raw