anchor.diff:  	 <<CD:16>> = <<C,D>>,
   	 {0, 0, 0, 0, 0, 16#ffff, AB, CD}
        end || {A,B,C,D} <- InetAddrs].
  -
  -f(F, A) ->
  -    lists:flatten(io_lib:format(F, A)).
   
   do_open_and_connect(ServerAddresses, AddressToConnectTo) ->
       Fun = fun (_, _, _, _, _, _) -> ok end,
  
positive.code:     S2 = ok(gen_sctp:open(0, [{active,false}])),
      Assoc = ok(gen_sctp:connect(S2, "localhost", S1Port, [])),
      ok = inet:setopts(S1, [{active,N}]),
      [{active,N}] = ok(inet:getopts(S1, [active])),
      LoopFun = fun(Count, Count, _Fn) ->
                        p("we are done - wait for passive"),
  		      receive
  			  {sctp_passive,S1} ->
                                p("received passive"),
  			      ok
  		      after
  			  5000 ->
                                p("UNEXPECTED TIMEOUT"),
  			      exit({error,timeout})
  		      end;
  		 (I, Count, Fn) ->
  		      Msg = list_to_binary("message "++integer_to_list(I)),
                        p("send message ~w:~w (on ~p)", [I, Count, S2]),
  		      ok = gen_sctp:send(S2, Assoc, 0, Msg),
  		      receive
  			  {sctp, S1, _, _, {[SR], Msg}}
                              when is_record(SR, sctp_sndrcvinfo) ->
                                p("recv (expected) data message (on ~p)~n", [S1]),
  			      Fn(I+1, Count, Fn);
  			  {sctp, S1, _FromIP, _FromPort, {_AncData, _Data}} ->
  			      %% ignore non-data messages
                                p("ignore non-data messages (on ~p):"
                                  "~n   From:    ~p:~p"
                                  "~n   AncData: ~p"
                                  "~n   Data:    ~p",
                                  [S1, _FromIP, _FromPort, _AncData, _Data]),
                                [{active,NX1}] = ok(inet:getopts(S1, [active])),
  			      ok = inet:setopts(S1, [{active,1}]),
                                [{active,NX2}] = ok(inet:getopts(S1, [active])),
                                p("active increment (of ~p) with 1 => "
                                  "~n   Before: ~w"
                                  "~n   After:  ~w", [S1, NX1, NX2]),
  			      Fn(I, Count, Fn);
  			  Other ->
                                p("UNEXPECTED: "
                                  "~n   Other: ~p"
                                  "~n   S1:    ~p"
                                  "~n   S2:    ~p", [Other, S1, S2]),
  			      exit({unexpected, Other})
  		      after
  			  5000 ->
  			      exit({error,timeout})
  		      end
  	      end,
      ok = LoopFun(1, N, LoopFun),
      S3 = ok(gen_sctp:open([{active,0}])),
      receive
          {sctp_passive,S3} ->
  
negative.code:     end,
      ok = gen_sctp:close(S2).
  
  %% Verify {active, N} socket management.
  %% This is difficult to do since we do not just receive data messages.
  %% Also, how do we know that sctp behaves the same way on all platforms?
  active_n(Config) when is_list(Config) ->
      try_tc(fun() -> do_active_n(Config) end).
  
  do_active_n(_Config) ->
      N = 3,
      S1 = ok(gen_sctp:open([{active,N}])),
      [{active,N}] = ok(inet:getopts(S1, [active])),
  