Skip to content

yamatchan/hello_trema

 
 

Repository files navigation

hello_trema

Build Status Coverage Status Code Climate Dependency Status Inline docs

The "Hello Trema!" example is one of the simplest OpenFlow controller implementation. The basic functionality of this controller is to establish an OpenFlow channel connection with an OpenFlow switch and output the "Hello 0xabc! (switch's datapath ID)" message.

This example demonstrates a minimum template for Trema applications written in Ruby. Hence, it's a good starting point to learn about Trema programming.

課題

HelloTrema (./lib/hello_trema.rb) を改造して次の 2 つの機能を実装しよう。

その1

スイッチを停止したら次のメッセージを表示するようにしてみよう:

Bye 0xabc

その2

HelloTrema が起動したら次のメッセージを表示するようにしてみよう:

HelloTrema started.

ただし、次の回答ではダメ (なぜダメか?も考えよう)

class HelloTrema < Trema::Controller
  def start(_args)
    logger.info 'HelloTrema started.'
  end
  ...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 90.7%
  • Gherkin 9.3%