trema / trema-edge Goto Github PK
View Code? Open in Web Editor NEWTransient repository for Trema OF1.3 branch
Transient repository for Trema OF1.3 branch
switch_disconnectedが実装されていない
Some code contains switch statements where the opening brace of a case statement is on a separate line. For example:
case x:
{
do something here
}
break;
The above should be corrected to the following:
case X: {
do something
}
break;
Either use an extended version of trema command or even a browser to specify configuration commands that switch would act upon to facilitate ease of testing. One way to implement such function would be to use Redis but a simple control socket might be adequate enough.
OPF1.3 has many actions and most actions have some attributes therefore a common way to declare and validate attributes of such actions is needed. At the moment I am inclining to use the pattern used with activerecord validations. An example is always best.
class Action
include ActionHelper
end
class PushMpls < Action
def initialize ether_type
create_validate : :ether_type, :presence => true, :within => "ether_type_range", :validate_with => "unsigned_16bit_number", :value => ether_type
end
The above create_validate method would create the attribute ether_type
and raise an exception if no value is given and for example call the validation functions ether_type_range
and unsigned_16bit_number
.
In current implementation, ExactMatch.from just returns a match structure included in a Packet-In message. It it not desired behavior. ExactMatch.from should parse a packet and build a new match structure.
実行すると以下のとおり。
$ trema run dumper.rb -c dumper.conf
src/examples/dumper/dumper.rb:126:in 'port_status': undefined method 'phy_port' for #
<Trema::Messages::PortStatus:0x00000001972650> (NoMethodError)
phy_port がないと言われるので、Openflow v1.3 の 仕様書 [A.4.3 Port Status Message (P78)] をみると、
使用上定義されていないことがわかる。
そこで、dumper.rb の 126 行目を
dump_phy_port message
に変更して実行すると、今度は dump_phy_port でエラー
$ trema run dumper.rb -c dumper.conf
src/examples/dumper/dumper.rb:165:in `dump_phy_port': undefined method `number' for #
<Trema::Messages::PortStatus:0x00000001d1b7e8> (NoMethodError)
ruby/trema/messages/port.rb を見ると、確かに number はない。
Tremaでは変数名 "number" だったが、Trema-edgeDeha "port_no" に変更されていることが理由なので、
def numder
port_no
end
を追記することで、正しく動作することを確認。
Trema では PortStatus#number だったので、Trema-edge 変数名が異なっている。
Trema-edge でも Port#number に変更したほうが良いのでは…?
I found a problem.
In "ruby/trema/hello.c" of line 30, the argument of create_hello() is incorrect compared to the definition of "src/lib/openflow_message.c".
That is still in the old one of Trema.
Sending an MPLS packet which contains no IPv4 information the packet_parser asserts and aborts.
Hi,
Of particular interest in the new OF version are the flow groups. Wondering if we can get any examples of how these work, as well as other features?
RESTAPIを搭載したく、Sinatraと動かそうとしました。
その結果、trema-edgeとsinatraを使ってみようとしたところ、webアクセスをしようとすると以下のエラーが出ました。
Logger is not a class
※ ブラウザ上は、504 internal error になっていました
恐らく、trema-edgeではまだLogger用のモジュールがDefaultLoggerではなく、Loggerであるため、ぶつかったんだと思われます。
(sinatraのloggerがRac::CommonLogger のLoggerクラスであるため、これがtremaのLoggerモジュールとぶつかった)
trema のmodule名をTremaLoggerにしたところ、問題なくsinatraでWebアクセスできました。
(とりあえず、dpidのArrayを画面表示させるところまで出来ることを確認)
※ logger.cの内容とlogger.rb、controller.rbの内容を変更しています。(*.cも変えてますので、最後にrakeしてます。)
logger.c
mLogger = rb_define_module_under( mTrema, "Logger" ); //変更前
mLogger = rb_define_module_under( mTrema, "TremaLogger" ); //変更後
logger.rb
module Logger # 変更前
module TremaLogger # 変更後
Controller.rb
include Logger # 変更前
include TremaLogger # 変更後
※ ちなみにDefaultLoggerじゃなく、TremaLoggerにしたのは、絶対ぶつからないようにしたかったからです。
FlowMultipartReply does not have "insctuctions" and it is not possible to extract instructions from flow stats multipart reply.
I tried the following spec for the Hello message expecting that it returns its transaction_id (set by get_transaction_id()), but it returned nil:
module Trema
describe Hello, ".new" do
its( :transaction_id ) { should_not be_nil } # FAIL
end
end
I guess the reason is that all attributes is set when the message is sent by controllers, by pack_xxx method. My question is that is it possible to set the basic message attributes like the transaction_id on creation time, not on being sent? IMHO these attributes can be determined on the creation time, so it's more natural to me to be accessible right after it is created.
Most of the ground work is done. Waiting for a rake::builder gem release to confirm compiler errors abort the build as expected.
でかいので後で分割しましょう。
A packet can be matched against the following fields:
Define a class for each action set using ruby and can append those actions to openflow_actions
by calling append_action_set_field_xxx
. Where xxx would be the instance variable of each action, For example append_action_set_field_in_port. This results into a long else if statement to check for the type of action set to set.
$ ./trema run src/examples/learning_switch/learning-switch.rb -c src/examples/learning_switch/learning_switch.conf
/home/whoami/.rvm/rubies/ruby-2.0.0-rc2/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require': cannot load such file -- gli (LoadError)
from /home/whoami/.rvm/rubies/ruby-2.0.0-rc2/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
from ././bin/trema:25:in `<main>'
$ gem install gli
Fetching: gli-2.5.6.gem (100%)
Successfully installed gli-2.5.6
1 gem installed
Installing ri documentation for gli-2.5.6...
Building YARD (yri) index for gli-2.5.6...
Installing RDoc documentation for gli-2.5.6...
$ ./trema run src/examples/learning_switch/learning-switch.rb -c src/examples/learning_switch/learning_switch.conf
ERROR: Trema is not compiled yet!
Please try the following command:
% ./build.rb
error: exit
This issue also depends on the creation of trema shared library before it can be started.
Using ruby 1.9.3 the rcov gem become obsolete and I replaced with the simplecov gem. This task can not proceed unless we have a shared trema-edge library.
action buckets に複数の action を定義できないように見えます。
# Trema switch definition
trema_switch( "sw1" ) {
datapath_id "0x111"
}
# Host definition
vhost ( "host1" ) {
ip "192.168.0.1"
netmask "255.255.255.0"
}
vhost ( "host2" ) {
ip "192.168.0.2"
netmask "255.255.255.0"
}
vhost ( "host3" ) {
ip "192.168.0.3"
netmask "255.255.255.0"
}
vhost ( "host4" ) {
ip "192.168.0.4"
netmask "255.255.255.0"
}
# Link definition
link "sw1", "host1"
link "sw1", "host2"
link "sw1", "host3"
link "sw1", "host4"
src/examples/openflow_message/group-mod.rb をベースに以下のように定義
def switch_ready datapath_id
bucket1 = Bucket.new(
weight: 1,
watch_port: 2,
actions: [
SetField.new( action_set: [
EthDst.new( mac_address: Mac.new( "00:00:5E:00:42:01" ) ),
EthSrc.new( mac_address: Mac.new( "00:00:5E:00:42:02" ) )
] ),
SendOutPort.new(
port_number: 2,
max_len: OFPCML_NO_BUFFER
)]
)
bucket2 = Bucket.new(
weight: 1,
watch_port: 3,
actions: [
# SetField.new( action_set: [
# EthDst.new( mac_address: Mac.new( "00:00:5E:00:42:03" ) ),
# EthSrc.new( mac_address: Mac.new( "00:00:5E:00:42:04" ) )
# ] ),
SendOutPort.new(
port_number: 3,
max_len: OFPCML_NO_BUFFER
)]
)
bucket3 = Bucket.new(
weight: 1,
watch_port: 4,
actions: [
SetField.new( action_set: [
EthDst.new( mac_address: Mac.new( "00:00:5E:00:42:05" ) ),
EthSrc.new( mac_address: Mac.new( "00:00:5E:00:42:06" ) )
] ) ]
# SendOutPort.new(
# port_number: 4,
# max_len: OFPCML_NO_BUFFER
# )]
)
send_group_mod_add(
datapath_id,
type: OFPGT_SELECT,
group_id: 100,
buckets: [ bucket1, bucket2, bucket3 ]
)
send_group_desc_multipart_request datapath_id
action = GroupAction.new( group_id: 100 )
ins = Instructions::ApplyAction.new( actions: [ action ] )
send_flow_mod_add(
datapath_id,
match: Match.new( :in_port => 1 ),
instructions: [ ins ]
)
end
datapath_id: 0x111
transaction_id: 0x4f3c0005
type: 1
flags: 0
group_id: 100
type: 1
bucket:
weight: 1
watch_port: 2
watch_group: 0
action: Trema::Actions::SetField
bucket:
weight: 1
watch_port: 3
watch_group: 0
SendOutPort:
port_number: 3
max_len: 65535
bucket:
weight: 1
watch_port: 4
watch_group: 0
action: Trema::Actions::SetField
TremaEdgeで基底クラス(Objectクラス)に、arrayとかstringという
クラスメソッドが追加されているせいで、Pioが使えません。
↓以下みたいにして確認したら、ObjectクラスでarrayもstringもTrueでした。
class Fuga
end
p Fuga.superclass # => Object class
p Fuga.superclass.respond_to?("array") # => true
p Fuga.superclass.respond_to?("string") # => true
ここで、Objectクラスが編集されているせいで、Tremaに関係しないクラスでも
普通にarrayやらstringを常に保持しており、
Pio内部でやってるBinDataを使った宣言の箇所でエラーになりました。
以下のように、TremaEdgeが持っていない名前で宣言するように指定すれば、
正常に動作しました。
・ string
=> BinData::Stringを継承した自作Typeに変更
class PioString < BinData::String
end
※ stringからpio_string に宣言時に名前を変更
・ array
=> BinData::Arrayを継承した自作Typeに変更
class PioArray < BinData::Array
end
※ arrayからpio_array に宣言時に名前を変更
宣言名が紛らわしくなるため、出来ましたら修正をお願いします。
writeインストラクションのactionリストに複数のフィールドに対するset_fieldを
指定した場合、list中の最後に現れるset_fieldしか実行されない。
OF1.3.3の仕様上、writeインストラクションで書き換えを行うaction setには
各アクションは一つずつしか存在できないが、set_fieldアクションに関しては
書き換え対象のフィールドが異なれば、action set上に複数存在できる
(OF1.3.3 pp.24)。
例) flow modの内容が下記の場合、eth_srcは01:23:45:67:89:00にならず、
eth_dstのみeth_dst:01:23:44:55:66:77になる。
flow_mod cmd=add
table_id=0 prio=100
write: set_field=eth_src:01:23:45:67:89:00
set_field=eth_dst:01:23:44:55:66:77
output=1
#サンプルコードは以下の通りです。
def handle_arp_request( datapath_id, message )
@arp_table.learn message.arp_spa.to_s, message.arp_sha.to_s, message.in_port.to_i
daddr = message.arp_tpa
interface = @interface.find_by_ipaddr( daddr )
if interface.class.name != "SQLite3::Statement" and @interface.has?( message.eth_dst )
puts "send a arp reply to #{ message.arp_spa.to_s }"
packet_out datapath_id, create_arp_reply_from( message, interface["hwaddr"] ), Actions::SendOutPort.new( port_number: interface["port"] )
end
end
def packet_out datapath_id, message, action
send_packet_out(
p message
datapath_id,
data: message,
actions: action
)
end
#messageの内容は以下の通りです。
p message => "d1PT\x01\x14\0\x90\xFB-\xDCi\b\x06\0\x01\b\0\x06\x04\0\x02\0\x90\xFB-\xDCi\xC0\xA8\0\xFEd1PT\x01\x14\xC0\xA8\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
#出力されるエラーは以下の通りです。
An Ethernet frame must be provided if buffer_id is equal to 0xffffffff
send_list_switches_request が実装されていない
#79 のフロー取得がエラーになる件、素早い対応ありがとうございました。
EthSrc.new, EthDst.new で問題なくフローが取得できることを確認しました。
フロー取得を試みていたところ、Ipv4SrcAddr.new, Ipv4DstAddr.new でも同様のエラーが発生してしまいました。
class Sample < Controller
def switch_ready datapath_id
match = Match.new( eth_type: 0x0800 )
action = SetField.new( action_set: [ Ipv4DstAddr.new( ip_addr: IPAddr.new("10.0.0.1"))])
ins = ApplyAction.new( actions: [ action ] )
send_flow_mod_add( datapath_id, match: match, instructions: [ ins ] )
send_flow_multipart_request( datapath_id, cookie: 0 )
end
def flow_multipart_reply datapath_id, message
p message
end
end
以下のエラーが出力されます。
/home/common/trema-edge/ruby/trema/accessor.rb:161:in `block in initialize': Required option ip_addr is missing for Trema::Actions::Ipv4DstAddr (ArgumentError)
ご確認お願いできますでしょうか。
現在、trema-edgeによるコントローラ作成を行っていますが、
フローの削除が行えない事象が発生しました。
原因を調べたところ、以下の箇所で使用しているバイトオーダが異なる事により
正常に処理出来なかったように見えるため確認をお願い致します。
FLOW_MODを扱う側はcommandをネットワークバイトオーダから
■trema-edge/src/switch_manager/ofpmsg_send.cから引用
static int
update_flowmod_cookie( buffer *buf, char *service_name ) {
struct ofp_flow_mod *flow_mod = buf->data;
uint16_t command = ntohs( flow_mod->command ); ★1
uint16_t flags = ntohs( flow_mod->flags );
uint64_t cookie = ntohll( flow_mod->cookie );
switch ( command ) { ★2
case OFPFC_ADD:
{
uint64_t *new_cookie = insert_cookie_entry( &cookie, service_name, flags );
if ( new_cookie == NULL ) {
return -1;
}
flow_mod->cookie = htonll( *new_cookie );
flow_mod->flags = htons( flags | OFPFF_SEND_FLOW_REM );
}
break;
対してFLOW_MODを作成する側はcommandをホストバイトオーダのまま
■trema-edge/src/lib/openflow_message.cから引用
buffer *
create_flow_mod( const uint32_t transaction_id, const uint64_t cookie, const uint64_t cookie_mask,
const uint8_t table_id, const uint8_t command, const uint16_t idle_timeout,
const uint16_t hard_timeout, const uint16_t priority,
const uint32_t buffer_id, const uint32_t out_port, const uint32_t out_group,
const uint16_t flags, const oxm_matches *match,
const openflow_instructions *instructions ) {
(途中省略)
flow_mod = ( struct ofp_flow_mod * ) buffer->data;
flow_mod->cookie = htonll( cookie );
flow_mod->cookie_mask = htonll( cookie_mask );
flow_mod->table_id = table_id;
flow_mod->command = command; ★3
flow_mod->idle_timeout = htons( idle_timeout );
flow_mod->hard_timeout = htons( hard_timeout );
flow_mod->priority = htons( priority );
flow_mod->buffer_id = htonl( buffer_id );
flow_mod->out_port = htonl( out_port );
flow_mod->out_group = htonl( out_group );
flow_mod->flags = htons( flags );
memset( &flow_mod->pad, 0, sizeof( flow_mod->pad ) );
construct_ofp_match( &flow_mod->match, match );
FLOW_MODを作成する際に★3の箇所を以下のように変更が必要かと
flow_mod->command = command;
↓
OpenFlow1.3.3
Field | Bits | Bytes | Mask | Pre-requisite | Description |
---|---|---|---|---|---|
OXM_OF_PBB_ISID | 24 | 3 | Yes | ETH_TYPE=0x88E7 | The I-SID in the first PBB service instance tag. |
Table 12: Match fields details.
The following instructions should be created:
Trema::Match*_mask does not work
To be able to execute the new trema switch using the trema run command a new DSL needs to be created. The executable resides at objects/switch/switch and called switch. At least the following options should be passed as command line arguments to switch:
I cloned and build trema-edge Mar. 25. When I run learning_switch.sh an error occured, since the directory of objects/examples/learning_switch did not exists.
Thanks,
Hi there,
I have tried to use multiple tables with trema-edge base controller with trema-edge switch.
When I specify goto table instruction in table 0 which specifies table 1 as the destination table.
However, I got error message as below.
Goto table from 0 to 0 is not allowed.
Failed to apply instructions ( ret = 1 ).
Actually, I have specified table1 in table0, so the message seems strange.
Thanks for your help.
スイッチからフローを取得する以下のコードがエラーとなります。
class Sample < Controller
def switch_ready( datapath_id )
action = SetField.new( action_set:
[EthSrc.new(mac_address: Trema::Mac.new("00:00:00:00:00:01"))])
ins = ApplyAction.new( actions: [action] )
send_flow_mod_add( datapath_id, instructions: [ins])
send_message( datapath_id, FlowMultipartRequest.new(cookie: 0))
end
def flow_multipart_reply( datapath_id, message )
p message
end
end
以下のエラーが出力されます。
/home/fukui/trema-edge/ruby/trema/accessor.rb:161:in `block in initialize': Required option mac_address is missing for Trema::Actions::EthSrc (ArgumentError)
アクションに EthSrc.new を指定しなければ問題なく動作します。
【補足】
エラーの種類としては、EthSrc.new に mac_address: オプションを指定しなかった場合と同じ内容のエラーのようです。
class Sample < Controller
def start
# 正しくは EthSrc.new( mac_address: Trema::Mac.new("00:00:00:00:00:01") )
EthSrc.new( Trema::Mac.new("00:00:00:00:00:01") )
end
end
出力されるエラー。
/home/fukui/trema-edge/ruby/trema/accessor.rb:171:in `initialize': Required option mac_address missing for Trema::Actions::EthSrc (ArgumentError)
ご確認よろしくお願いします。
Hi Tream guys,
Simple problem,
I can not find trema-run.sh which is mentioned in README.md.
Thanks for your fix. ;-)
...hiroshi miyata
See trema/trema#259
As a way of relieving the workload of the C event loop if possible timers could be created in Ruby and run as such. At the moment this is not possible since the trema event loops locks the application waiting for an event to happen.
Currently a single trema-switch can run using the trema run command and configuration file. It is desirable to be able to configure and run multiple trema-switches.
Hi trema-team,
I tried ping6 on learning_switch with ofsoftswitch13, but it did not work well.
I could see NS in packet_in message, but cannot see packet_out message corresponding to it. Can trema-edge handle NS/NA?
Thanks,
learning switch example is not built with rake. Due to this problem, learning switch example cannot be run with the instruction shown in README.md.
TremaEdgeのソースにsend_flow_mod_deleteが無かったため、以下を追記して使用しています。
このメソッド(flow削除のメソッド)は非常に良く使うため、TremaEdgeにもあるとありがたいです。
def send_flow_mod_delete datapath_id, options
options[ :command ] = OFPFC_DELETE
options[ :table_id ] = OFPTT_ALL if options[ :table_id ].nil?
options[ :match ] = Match.new if options[ :match ].nil?
options[ :cookie ] = 0 if options[ :cookie ].nil?
options[ :cookie_mask ] = 0 if options[ :cookie_mask ].nil?
options[ :out_port ] = OFPP_ANY if options[ :out_port ].nil?
options[ :out_group ] = OFPG_ANY if options[ :out_group ].nil?
send_flow_mod datapath_id, options
end
Matchのcompareが実装されていない
trema-edge does not pass its unit tests run by 'rake run_unittests'. The detail was reported at https://groups.google.com/forum/#!topic/trema-dev/PcdfpydddBs .
現在、Trema-Edgeのインストールと動作確認を行なっております。
その中でlearning-switchのコンパイルおよび実行におきまして、
以下の様な問題を発見したのでご報告させて頂きます。
環境
Description: Ubuntu 12.10
Release: 12.10
Ruby: 2.0.0p0 (2013-02-24 revision 39474)
問題事象
①src配下でmakeを実行すると失敗する。
②learning_switch.sh実行でエラーになる
手順
(1)GitからTrema-Edgeを落としインストール実施
(2)/trema-edge/srcでmakeコマンド実行
$ make
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/lib'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/lib'
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/packetin_filter'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/packetin_filter'
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/switch_manager'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/switch_manager'
/bin/sh: 1: cd: can't cd to switchd
make[1]: Entering directory `/home/ikeuchi/trema-edge/src'
make[2]: Entering directory `/home/ikeuchi/trema-edge/src/lib'
make[2]: *** No rule to make target `all'. Stop.
make[2]: Leaving directory `/home/ikeuchi/trema-edge/src/lib'
make[2]: Entering directory `/home/ikeuchi/trema-edge/src/packetin_filter'
make[2]: *** No rule to make target `all'. Stop.
make[2]: Leaving directory `/home/ikeuchi/trema-edge/src/packetin_filter'
make[2]: Entering directory `/home/ikeuchi/trema-edge/src/switch_manager'
make[2]: *** No rule to make target `all'. Stop.
make[2]: Leaving directory `/home/ikeuchi/trema-edge/src/switch_manager'
/bin/sh: 1: cd: can't cd to switchd
make[2]: Entering directory `/home/ikeuchi/trema-edge/src'
(以下、無限ループ)
上記の通り無限ループしてしまい、makeが終了しません。(問題①)
★以下の3ファイルを修正し問題を回避できた事を報告いたします。
■/trema-edge/src/MakeFile
(修正前)
# Copyright (C) 2013 NEC Corporation
#
SUBDIRS = lib packetin_filter switch_manager switchd examples
.PHONY: all clean $(SUBDIRS)
all: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make all ); done
clean: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make clean ); done
(修正後)
#
# Copyright (C) 2013 NEC Corporation
#
SUBDIRS = lib packetin_filter switch_manager switch examples
.PHONY: all clean $(SUBDIRS)
all: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make all ); done
clean: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make clean ); done
SUBDIRSに記載された"switchd"を"switch"に修正。
■/trema-edge/src/examples/MakeFile
(修正前)
#
# Copyright (C) 2013 NEC Corporation
#
SUBDIRS = dumper dumper_debug learning_switch
.PHONY: all clean $(SUBDIRS)
all: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make all ); done
clean: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make clean ); done
(修正後)
#
# Copyright (C) 2013 NEC Corporation
#
SUBDIRS = dumper learning_switch
.PHONY: all clean $(SUBDIRS)
all: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make all ); done
clean: $(SUBDIRS)
@for DIR in $(SUBDIRS); do ( cd $$DIR; make clean ); done
SUBDIRSから"dumper_debug"を削除。
■/trema-edge/src/examples/learning_switch/MakeFile
(修正前)
#
# Copyright (C) 2013 NEC Corporation
#
CC = gcc
AR = ar
RANLIB = ranlib
CFLAGS = -I../../lib/ -g -std=gnu99 -D_GNU_SOURCE -fno-strict-aliasing -Wall -Werror -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith
LDFLAGS = -ltrema -lpthread -lsqlite3 -ldl -lrt
LIBDIR = ../../lib
(以下略)
(修正後)
#
# Copyright (C) 2013 NEC Corporation
#
CC = gcc
AR = ar
RANLIB = ranlib
CFLAGS = -I../../lib/ -g -std=gnu99 -D_GNU_SOURCE -fno-strict-aliasing -Wall -Werror -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith
LDFLAGS = -ltrema -lpthread -lsqlite3 -ldl -lrt
LIBDIR = ../../../objects/lib/
(以下略)
LIBDIRのパスを"../../lib"から"../../../objects/lib/"に変更
(3)make再実行
$ make
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/lib'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/lib'
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/packetin_filter'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/packetin_filter'
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/switch_manager'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/switch_manager'
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/switch'
make[1]: *** No rule to make target `all'. Stop.
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/switch'
make[1]: Entering directory `/home/ikeuchi/trema-edge/src/examples'
make[2]: Entering directory `/home/ikeuchi/trema-edge/src/examples/dumper'
gcc -MM -I./ -I../../lib -g -std=gnu99 -D_GNU_SOURCE -fno-strict-aliasing -Werror -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith dumper.c > .depends
make[2]: Leaving directory `/home/ikeuchi/trema-edge/src/examples/dumper'
make[2]: Entering directory `/home/ikeuchi/trema-edge/src/examples/learning_switch'
gcc -MM -I../../lib/ -g -std=gnu99 -D_GNU_SOURCE -fno-strict-aliasing -Wall -Werror -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith learning_switch.c > .depends
make[2]: Leaving directory `/home/ikeuchi/trema-edge/src/examples/learning_switch'
make[1]: Leaving directory `/home/ikeuchi/trema-edge/src/examples'
makeが成功
(4)/trema-edge/learning_switch.shの実行
$ ./learning_switch.sh start
./learning_switch.sh: 53: ./learning_switch.sh: ./objects/examples/learning_switch/learning_switch: not found
上記の通り起動に失敗する。(問題②)
★以下のファイルを修正し問題を回避できた事を報告いたします。
■/trema-edge/learning_switch.sh
(修正前)
(省略)
TREMA_SRC=.
OBJECTS="${TREMA_SRC}/objects"
APP_NAME="learning_switch"
APP="${OBJECTS}/examples/learning_switch/learning_switch"
(省略)
(修正後)
(省略)
TREMA_SRC=.
OBJECTS="${TREMA_SRC}/objects"
APP_NAME="learning_switch"
APP="${TREMA_SRC}/src/examples/learning_switch/learning_switch"
(省略)
APPのソースを"${OBJECTS}/examples/learning_switch/learning_switch"から
"${TREMA_SRC}/src/examples/learning_switch/learning_switch"に変更
(5)~/trema-edge/learning_switch.shの再実行
$ ./learning_switch.sh start
$
$ ps x
PID TTY STAT TIME COMMAND
1297 tty1 S+ 0:00 -bash
13543 ? Ss 0:00 ./objects/switch_manager/switch_manager -l debug --daemonize --switch=./objects/s
13550 ? Ss 0:00 ./src/examples/learning_switch/learning_switch -l debug --name learning_switch --
13551 pts/0 R+ 0:00 ps x
30479 ? S 0:03 sshd: ikeuchi@pts/0
30480 pts/0 Ss 0:00 -bash
$
$ ./learning_switch.sh stop
$
$ ps x
PID TTY STAT TIME COMMAND
1297 tty1 S+ 0:00 -bash
13555 pts/0 R+ 0:00 ps x
30479 ? S 0:03 sshd: ikeuchi@pts/0
30480 pts/0 Ss 0:00 -bash
問題なく実行、停止が出来た事を確認。
★上記の通り、以下のファイルの内容に誤りがある認識です。
ご確認と修正をお願い致します。
trema version コマンドでは以下のように出力されるが、無印 Trema の出力と見分けがつかない。
kazuya@callisto:~/proj/trema-edge/bin$ ./trema version
trema version 0.1.0
無印 Trema との見分けをできるようにした方がよいのでは?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.