这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions appendix_trema_api_reference.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[appendix]
= Tremaリファレンス

== ハンドラ

=== start(args)

コントローラの起動イベントを捕捉するハンドラ。引数 `args` は trema run で `--` の後に渡した引数の配列。

==== 凡例
==== 概要

[source,ruby,subs="verbatim,attributes"]
----
Expand Down
43 changes: 43 additions & 0 deletions appendix_trema_command_reference.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
== trema コマンド
=== trema dump_flows

指定したスイッチのすべてのフローエントリを表示する。

----
$ trema dump_flows [コマンドオプション] スイッチ名
----

=== 使い方

仮想ネットワーク設定で `of_switch` という名前のスイッチを定義し、コントローラを実行したとする。

[source,ruby,subs="verbatim,attributes"]
.trema.conf
----
vswitch('of_switch') { datapath_id 0xabc }
----

.コントローラを実行する
----
$ trema run my_controller.rb -c trema.conf
----

このときコントローラがスイッチ `of_switch` に書き込んだフローエントリを表示するには、次のように `trema dump_flows of_switch` を実行する。

// TODO 最初の行の OFPST_FLOW reply... の行はいらないので、Trema を変更して表示されないようにする

----
$ trema dump_flows of_switch
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=10.727s, table=0, n_packets=0, n_bytes=0, priority=0 actions=drop
----

出力フォーマットは Open vSwitch の `ovs-ofctl dump-flows` コマンドと同じ。詳しくは `man ovs-ofctl` の Table Entry Output を参照。

=== コマンドオプション一覧

|===
| コマンドオプション | 説明 | デフォルト値

| `-S`, `--socket_dir` | コントローラプロセスのソケットファイル (`trema.コントローラ名.ctl`) があるディレクトリを指定する。これは `trema run` コマンドの `-S`, `--socket_dir` オプションで指定した値を指定すればよい | `/tmp`
|===
4 changes: 4 additions & 0 deletions appendix_trema_reference.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[appendix]
= Tremaリファレンス
include::appendix_trema_command_reference.adoc[]
include::appendix_trema_api_reference.adoc[]
4 changes: 2 additions & 2 deletions base.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ include::appendix_rvm.adoc[]
[[openflow_spec]]
include::appendix_openflow_spec.adoc[]

[[trema_api_reference]]
include::appendix_trema_api_reference.adoc[]
[[trema_reference]]
include::appendix_trema_reference.adoc[]

include::appendix_copyright_and_license.adoc[]

2 changes: 1 addition & 1 deletion sliceable_switch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Packets sent:
== REST API を使う

スライス機能付きスイッチは OpenStack など
のミドルウェアと連携するための REST API を提供しています。REST API はプログラミング言語を問わず使えるため、スライス機能付きスイッチの持つ仮装ネットワーク機能をさまざまなミドルウェアに簡単に組込めます
のミドルウェアと連携するための REST API を提供しています。REST API はプログラミング言語を問わず使えるため、スライス機能付きスイッチの持つ仮想ネットワーク機能をさまざまなミドルウェアに簡単に組込めます

スライス機能付きスイッチの REST API は Rack (http://rack.github.io) で動作します (<<rest_overview,図16-2>>)。外部ミドルウェアから HTTP で Rack にアクセスすると、リクエストをスライス機能付きスイッチへ送信し、スライス機能付きスイッチはこの内容をネットワークへと反映します。

Expand Down