anchor.diff:  
   -module(tap_loom).
   
  +-include_lib("../lib/loom/deps/ofs_handler/include/ofs_handler.hrl").
  +-include_lib("../lib/loom/deps/of_protocol/include/of_protocol.hrl").
  +-include_lib("../lib/loom/deps/of_protocol/include/ofp_v4.hrl").
  +
   -compile([export_all]).
  +
  +-define(L_PRIORITY, 100).
  +-define(H_PRIORITY, 101).
  +-define(DNS_IP, {10,48,2,5}).
   
   start()->
       [code:add_pathz(Path) || Path <- filelib:wildcard("./lib/loom/ebin")],
  
positive.code: 	_ -> process_config(Rest)
      end.
  
  process_config([],IP)->
      ok;
  process_config([Config|Rest],IP) ->
      case Config of
  
negative.code:     
  
  
  dns_tap([],_Version,_Port1,_Port2,_IPTupleList)->
      ok;
  dns_tap(OFDPL,Version,Port1,Port2,IPTupleList)->
      [DatapathId|Rest] = OFDPL,
      IPList = [ list_to_binary(tuple_to_list(IPTuple)) || IPTuple <- IPTupleList ],
      error_logger:info_msg("dns_tap: ~p, ~p, ~p, ~p~n",[DatapathId,Port1,Port2,IPTupleList]),
      ofs_handler:send(DatapathId, remove_all_flows_mod(Version)),
      lists:foreach(fun(X)->ofs_handler:send(DatapathId, tap_dns_response(Version, Port1,Port2,controller,X)) end,IPList),
      ofs_handler:send(DatapathId, forward_mod(Version, Port1, [Port2])),
      ofs_handler:send(DatapathId, forward_mod(Version, Port2, [Port1])),
      dns_tap(Rest,Version,Port1,Port2,IPTupleList).
  
  
  %tap packets to controller for udp traffic from DNS server IP address
  tap_dns_response(Version, Port1, Port2, Port3, IPv4Src) ->
  %     Matches = [{in_port, <<Port1:32>>}, {eth_type, 2048}, {ip_proto, <<17:8>>}],
      Matches = [{in_port, <<Port1:32>>}, {eth_type, 2048}, {ip_proto, <<17:8>>}, {ipv4_src, IPv4Src} ],
      Instructions = [{apply_actions, [{output, Port2, no_buffer}, {output, Port3, no_buffer}] }],
      Opts = [{table_id,0}, {priority, ?H_PRIORITY}, {idle_timeout, 0}, {idle_timeout, 0},
              {cookie, <<0,0,0,0,0,0,0,10>>}, {cookie_mask, <<0,0,0,0,0,0,0,0>>}],
      of_msg_lib:flow_add(Version, Matches, Instructions, Opts).
  
  %forward packet on InPort to OutPorts using apply_actions
  forward_mod(Version,InPort,OutPorts)->
      Matches = [{in_port, <<InPort:32>>}],
      Instructions = [{apply_actions, [{output, OutPort, no_buffer} || OutPort <- OutPorts] } ],
      io:format("Instructions=~p~n", [Instructions]),
      Opts = [{table_id,0}, {priority,?L_PRIORITY}, {idle_timeout, 0}, {idle_timeout, 0},
              {cookie, <<0,0,0,0,0,0,0,10>>}, {cookie_mask, <<0,0,0,0,0,0,0,0>>}],
      of_msg_lib:flow_add(Version, Matches, Instructions, Opts).    
  
  % delete all flows in table 0
  remove_all_flows_mod(Version) ->
      of_msg_lib:flow_delete(Version, [], [{table_id, 0}]).
  