anchor.diff:  
   -define(THROW(T), throw({?MODULE, T})).
   
  -%%% ---------------------------------------------------------------------------
  -%%% # encode_avps/3
  -%%%
  -%%% Returns: binary()
  -%%% ---------------------------------------------------------------------------
  +-type parent_name()   :: atom().  %% parent = Message or AVP
  +-type parent_record() :: tuple(). %%
  +-type avp_name()   :: atom().
  +-type avp_record() :: tuple().
  +-type avp_values() :: [{avp_name(), term()}].
  +
  +-type non_grouped_avp() :: #diameter_avp{}.
  +-type grouped_avp() :: nonempty_improper_list(#diameter_avp{}, [avp()]).
  +-type avp() :: non_grouped_avp() | grouped_avp().
  +
  +%% ---------------------------------------------------------------------------
  +%% # encode_avps/2
  +%% ---------------------------------------------------------------------------
  +
  +-spec encode_avps(parent_name(), parent_record() | avp_values())
  +   -> binary()
  +    | no_return().
   
   encode_avps(Name, Vals)
     when is_list(Vals) ->
  
positive.code:     Bin = diameter_codec:pack_avp(avp_header(Name), empty_value(Name)),
      << <<0>> || <<_>> <= Bin >>.
  
  %%% ---------------------------------------------------------------------------
  %%% # empty/1
  %%% ---------------------------------------------------------------------------
  
  empty(AvpName) ->
      avp(encode, zero, AvpName).
  
negative.code:         orelse ?THROW([known_avp_as_AVP, Name, AvpName, Data]),
      e(AvpName, [Data]).
  
  %% ---------------------------------------------------------------------------
  %% # decode_avps/2
  %% ---------------------------------------------------------------------------
  
  -spec decode_avps(parent_name(), [#diameter_avp{}])
     -> {parent_record(), [avp()], Failed}
   when Failed :: [{5000..5999, #diameter_avp{}}].
  
  decode_avps(Name, Recs) ->
      d_rc(Name, lists:foldl(fun(T,A) -> decode(Name, T, A) end,
  