Skip to content

Commit

Permalink
AUtomatically set table config to 'controller' upon switch connection
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkaplita committed Jun 11, 2012
1 parent 2383a0b commit 4bf6005
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/of_controller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ loop(Connections) ->
{ok, {Address, Port}} = inet:peername(Socket),
lager:info("Accepted connection from ~p {~p,~p}",
[Socket, Address, Port]),
%% Setting switch to route all frames to controller
Msg = of_controller:table_config(controller),
{ok, EncodedMessage} = of_protocol:encode(Msg),
ok = gen_tcp:send(Socket, EncodedMessage),

loop([{{Address, Port}, Socket, Pid} | Connections]);
{cast, Message, AddressPort} ->
NewConnections = filter_connections(Connections),
Expand Down

0 comments on commit 4bf6005

Please sign in to comment.