From 1066083d1ac5a4701c81a9b28d156eb747afa064 Mon Sep 17 00:00:00 2001 From: Yasuhito Takamiya Date: Mon, 9 Mar 2015 10:44:02 +0900 Subject: [PATCH] Pio::PacketIn#source_mac and Pio::PacketIn#destination_mac returns Pio::Mac. --- CHANGELOG.md | 1 + features/packet_in_read.feature | 30 ++++++++++++++++-------------- lib/pio/packet_in.rb | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 090fe484..28949af8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## develop (unreleased) ### Changes * Deprecated `Pio::Mac#== Integer`. +* `Pio::PacketIn#source_mac` and `Pio::PacketIn#destination_mac` returns `Pio::Mac`. ## 0.17.0 (3/6/2015) diff --git a/features/packet_in_read.feature b/features/packet_in_read.feature index 2e5fedcf..faacd6df 100644 --- a/features/packet_in_read.feature +++ b/features/packet_in_read.feature @@ -4,17 +4,19 @@ Feature: Pio::PacketIn.read When I try to parse the file with "PacketIn" class Then it should finish successfully And the parsed data have the following field and value: - | field | value | - | class | Pio::PacketIn | - | ofp_version | 1 | - | message_type | 10 | - | message_length | 78 | - | transaction_id | 0 | - | xid | 0 | - | buffer_id | 4294967040 | - | total_len | 60 | - | in_port | 1 | - | reason | no_match | - | raw_data.length | 60 | - | source_mac | ac:5d:10:31:37:79 | - | destination_mac | ff:ff:ff:ff:ff:ff | + | field | value | + | class | Pio::PacketIn | + | ofp_version | 1 | + | message_type | 10 | + | message_length | 78 | + | transaction_id | 0 | + | xid | 0 | + | buffer_id | 4294967040 | + | total_len | 60 | + | in_port | 1 | + | reason | no_match | + | raw_data.length | 60 | + | source_mac | ac:5d:10:31:37:79 | + | source_mac.class | Pio::Mac | + | destination_mac | ff:ff:ff:ff:ff:ff | + | destination_mac.class | Pio::Mac | diff --git a/lib/pio/packet_in.rb b/lib/pio/packet_in.rb index 11ef1489..483ce75a 100644 --- a/lib/pio/packet_in.rb +++ b/lib/pio/packet_in.rb @@ -109,7 +109,7 @@ def lldp? end def method_missing(method, *args) - data.__send__ method, *args + data.__send__(method, *args).snapshot end end end