anchor.diff:          {error, _} = ERROR ->
               ERROR
       end.
  +
  +
  +win_gaa_index2name(Idx) ->
  +    case win_gaa_names() of
  +        {ok, Names} ->
  +            win_gaa_index2name(Idx, Names);
  +        {error, _} = ERROR ->
  +            ERROR
  +    end.
  +
  +win_gaa_index2name(Idx, Names) ->
  +    case lists:keysearch(Idx, 1, Names) of
  +        {value, {Idx, Name}} ->
  +            {ok, Name};
  +        false ->
  +            {error, enxio}
  +    end.
  +
  +
  +win_gaa_name2index(Name) ->
  +    case win_gaa_names() of
  +        {ok, Names} ->
  +            win_gaa_name2index(Name, Names);
  +        {error, _} = ERROR ->
  +            ERROR
  +    end.
  +
  +win_gaa_name2index(Name, Names) ->
  +    case lists:keysearch(Name, 2, Names) of
  +        {value, {Idx, Name}} ->
  +            {ok, Idx};
  +        false ->
  +            {error, enodev}
  +    end.
  +
  
positive.code:       Reason :: term().
  
  -ifdef(USE_ESOCK).
  if_name2index(If) when is_list(If) ->
      prim_net:if_name2index(If).
  -else.
  if_name2index(If) when is_list(If) ->
      erlang:error(notsup).
  
negative.code: 
  -ifdef(USE_ESOCK).
  if_index2name(Idx) when is_integer(Idx) ->
      try prim_net:if_index2name(Idx) of
          Result ->
              Result
      catch
          error : notsup : Stack ->
              %% This is *most likely* Windows, so try that.
              %% If not (another catch), raise the original catched error.
              try win_gaa_index2name(Idx)
              catch
                  _:_:_ ->
                      erlang:raise(error, notsup, Stack)
              end
      end.
  -else.
  if_index2name(Idx) when is_integer(Idx) ->
      erlang:error(notsup).
  