anchor.diff:           api_b_getifaddrs/1,
            api_b_name_and_addr_info/1,
            
  -         api_b_name_and_index/1
  +         api_b_name_and_index/1,
  +
  +         %% *** API Misc ***
  +         api_m_getaddrinfo_v4/0,
  +         api_m_getaddrinfo_v4/1,
  +         api_m_getaddrinfo_v6/0,
  +         api_m_getaddrinfo_v6/1,
  +
  +         api_m_getnameinfo_v4/0,
  +         api_m_getnameinfo_v4/1,
  +         api_m_getnameinfo_v6/0,
  +         api_m_getnameinfo_v6/1
   
            %% Tickets
           ]).
  
positive.code:      api_b_getifaddrs,
       api_b_name_and_addr_info,
       api_b_name_and_index
      ].
  
  %% ticket_cases() ->
  
negative.code:     verify_if_names(T).
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_m_getaddrinfo_v4() ->
      required(v4).
  
  api_m_getaddrinfo_v4(suite) ->
      [];
  api_m_getaddrinfo_v4(doc) ->
      [];
  api_m_getaddrinfo_v4(Config) when is_list(Config) ->
      ?TT(?SECS(5)),
      Pre  = fun() ->
                     {Name, FullName, IPStr, IP, Aliases,_,_} =
                         ct:get_config(test_host_ipv4_only),
                     #{name      => Name,
                       full_name => FullName,
                       ip_string => IPStr,
                       ip        => IP,
                       aliases   => Aliases,
                       family    => inet}
             end,
      Case = fun(Info) ->
                     ok = api_m_getaddrinfo(Info)
             end,
      Post = fun(_) -> ok end,
      tc_try(?FUNCTION_NAME,
             Pre, Case, Post).
  
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_m_getaddrinfo_v6() ->
      required(v6).
  
  api_m_getaddrinfo_v6(suite) ->
      [];
  api_m_getaddrinfo_v6(doc) ->
      [];
  api_m_getaddrinfo_v6(Config) when is_list(Config) ->
      ?TT(?SECS(5)),
      Pre  = fun() ->
                     {Name, FullName, IPStr, IP, Aliases,_,_} =
                         ct:get_config(test_host_ipv6_only),
                     #{name      => Name,
                       full_name => FullName,
                       ip_string => IPStr,
                       ip        => IP,
                       aliases   => Aliases,
                       family    => inet6}
             end,
      Case = fun(Info) ->
                     ok = api_m_getaddrinfo(Info)
             end,
      Post = fun(_) -> ok end,
      tc_try(?FUNCTION_NAME,
             Pre, Case, Post).
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_m_getaddrinfo(#{name   := Name,
                      family := Domain,
                      ip     := IP}) ->
      try net:gethaddrinfo(Name) of
          {ok, AddrInfos} ->
              %% Check that we can actually find this IP in the list
              api_m_getaddrinfo_verify(AddrInfos, Name, Domain, IP);
          {error, enotsup = ReasonAI} ->
              i("getaddrinfo not supported - skipping"),
              ?SKIP({getaddrinfo, ReasonAI});
          {error, Reason} ->
              ?FAIL({gethaddrinfo, Name, Reason})
      catch
          error : notsup = Reason ->
              i("~w => skipping", [Reason]),
              skip(Reason)
      end.
  
  
  api_m_getaddrinfo_verify([], Name, Domain, IP) ->
      ?FAIL({not_found, Name, Domain, IP});
  api_m_getaddrinfo_verify([#{family := Domain,
                              addr   := IP}|_],
                           Name, Domain, IP) ->
      ok;
  api_m_getaddrinfo_verify([_|AddrInfos], Name, Domain, IP) ->
      api_m_getaddrinfo_verify(AddrInfos, Name, Domain, IP).
  
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_m_getnameinfo_v4() ->
      required(v4).
  
  api_m_getnameinfo_v4(suite) ->
      [];
  api_m_getnameinfo_v4(doc) ->
      [];
  api_m_getnameinfo_v4(Config) when is_list(Config) ->
      ?TT(?SECS(5)),
      Pre  = fun() ->
                     {Name, FullName, IPStr, IP, Aliases,_,_} =
                         ct:get_config(test_host_ipv4_only),
                     #{name      => Name,
                       full_name => FullName,
                       ip_string => IPStr,
                       ip        => IP,
                       aliases   => Aliases,
                       family    => inet}
             end,
      Case = fun(Info) ->
                     ok = api_m_getnameinfo(Info)
             end,
      Post = fun(_) -> ok end,
      tc_try(?FUNCTION_NAME,
             Pre, Case, Post).
  
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_m_getnameinfo_v6() ->
      required(v6).
  
  api_m_getnameinfo_v6(suite) ->
      [];
  api_m_getnameinfo_v6(doc) ->
      [];
  api_m_getnameinfo_v6(Config) when is_list(Config) ->
      ?TT(?SECS(5)),
      Pre  = fun() ->
                     {Name, FullName, IPStr, IP, Aliases} =
                         ct:get_config(test_host_ipv6_only),
                     #{name      => Name,
                       full_name => FullName,
                       ip_string => IPStr,
                       ip        => IP,
                       aliases   => Aliases,
                       family    => inet6}
             end,
      Case = fun(Info) ->
                     ok = api_m_getnameinfo(Info)
             end,
      Post = fun(_) -> ok end,
      tc_try(?FUNCTION_NAME,
             Pre, Case, Post).
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_m_getnameinfo(#{name   := Name,
                      family := Domain,
                      ip     := IP}) ->
      SA = #{family => Domain,
             addr   => IP},
      try net:gethnameinfo(SA) of
          {ok, NameInfo} ->
              %% Check that we can actually find this IP in the list
              api_m_getnameinfo_verify(NameInfo, Name);
          {error, enotsup = ReasonAI} ->
              i("getaddrinfo not supported - skipping"),
              ?SKIP({getnameinfo, ReasonAI});
          {error, Reason} ->
              ?FAIL({gethnameinfo, Name, Reason})
      catch
          error : notsup = Reason ->
              i("~w => skipping", [Reason]),
              skip(Reason)
      end.
  
  
  api_m_getnameinfo_verify(#{host := Name}, Name) ->
      ok;
  api_m_getnameinfo_verify(NameInfo, Name) ->
      ?FAIL({not_found, NameInfo, Name}).
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  