anchor.diff:  eaf($P, F) -> 2#00100000 bor F.
   
   vid(Name, Flags, Vs, Vid) ->
  -    v(lists:member('V', Flags), Name, Vs, Vid).
  +    v(lists:member($V, Flags), Name, Vs, Vid).
  +
  +v(true = T, Name, Vs, {module, Mod}) ->
  +    v(T, Name, Vs, {ok, {Mod:vendor_id(), Mod:vendor_name()}});
   
   v(true, Name, Vs, Vid) ->
  -    proplists:get_value(Name, Vs, Vid);
  +    case proplists:get_value(Name, Vs) of
  +        undefined ->
  +            {ok, {Id, _}} = Vid,
  +            Id;
  +        Id ->
  +            Id
  +    end;
   v(false, _, _, _) ->
       undefined.
   
  
positive.code: %%       allocated by IANA (see Section 11.1).
  
  avp_name(Spec) ->
      Avps = get_value(avp_types, Spec)
          ++ lists:flatmap(fun avps/1, get_value(import_avps, Spec)),
      {Vid, _} = orddict:fetch(vendor, Spec),
      Vs = lists:flatmap(fun({V,Ns}) -> [{N,V} || N <- Ns] end,
                         get_value(avp_vendor_id, Spec)),
  
      lists:map(fun(T) -> c_avp_name(T, Vid, Vs) end, Avps)
          ++ [{?clause, [?VAR('_'), ?VAR('_')], [], [?ATOM('AVP')]}].
  
  c_avp_name({Name, Code, Type, Flags}, Vid, Vs) ->
      c_avp_name({?A(Name), ?A(Type)},
                 Code,
                 lists:member('V', Flags),
                 Vid,
                 proplists:get_value(Name, Vs)).
  
  c_avp_name(T, Code, false, _, undefined = U) ->
      {?clause, [?INTEGER(Code), ?ATOM(U)],
       [],
       [?TERM(T)]};
  
  c_avp_name(T, Code, true, Vid, V)
    when is_integer(Vid) ->
      {?clause, [?INTEGER(Code), ?INTEGER(choose(V == undefined, Vid, V))],
       [],
       [?TERM(T)]}.
  
  %%% ------------------------------------------------------------------------
  %%% # avp_arity/2
  
negative.code: 
  %% ===========================================================================
  %% ===========================================================================
  
  get_value(Key, Plist) ->
      proplists:get_value(Key, Plist, []).
  