Sha256: 2140e08ae70ff8bf93acff48f33a60e31724cf5b20b8ac3d02b55194140176a9

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

#
# Dumps packet-in message.
#
# Author: Yasuhito Takamiya <yasuhito@gmail.com>
#
# Copyright (C) 2008-2012 NEC Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#


class PacketinDumper < Controller
  def packet_in datapath_id, event
    puts "received a packet_in"
    info "datapath_id: #{ datapath_id.to_hex }"
    info "transaction_id: #{ event.transaction_id.to_hex }"
    info "buffer_id: #{ event.buffer_id.to_hex }"
    info "total_len: #{ event.total_len }"
    info "in_port: #{ event.in_port }"
    info "reason: #{ event.reason.to_hex }"
    info "data: #{ event.data.unpack "H*" }"
  end
end


### Local variables:
### mode: Ruby
### coding: utf-8
### indent-tabs-mode: nil
### End:

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trema-0.2.5 src/examples/packet_in/packet-in.rb
trema-0.2.4 src/examples/packet_in/packet-in.rb
trema-0.2.3 src/examples/packet_in/packet-in.rb
trema-0.2.2.1 src/examples/packet_in/packet-in.rb
trema-0.2.2 src/examples/packet_in/packet-in.rb
trema-0.2.1 src/examples/packet_in/packet-in.rb