anchor.diff:          orelse ?THROW([known_avp_as_AVP, Name, AvpName, Data]),
       e(AvpName, [Data]).
   
  -%%% ---------------------------------------------------------------------------
  -%%% # decode_avps/2
  -%%%
  -%%% Returns: {Rec, Avps, Failed}
  -%%%
  -%%%          Rec  = decoded message record
  -%%%          Avps = list of Avp
  -%%%          Failed = list of {ResultCode, #diameter_avp{}}
  -%%%
  -%%%          Avp = #diameter_avp{}    if type is not Grouped
  -%%%              | list of Avp        where first element has type Grouped
  -%%%                                   and following elements are its component
  -%%%                                   AVP's.
  -%%% ---------------------------------------------------------------------------
  +%% ---------------------------------------------------------------------------
  +%% # 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,
  
positive.code: value(_, Avp) ->
      Avp#diameter_avp.value.
  
  %%% ---------------------------------------------------------------------------
  %%% # grouped_avp/3
  %%% ---------------------------------------------------------------------------
  
  grouped_avp(decode, Name, Data) ->
      {Rec, Avps, []} = decode_avps(Name, diameter_codec:collect_avps(Data)),
      {Rec, Avps};
  %% Note that a failed match here will result in 5004. Note that this is
  %% the only AVP type that doesn't just return the decoded value, also
  %% returning the list of component #diameter_avp{}'s.
  
  grouped_avp(encode, Name, Data) ->
      encode_avps(Name, Data).
  
  %%% ---------------------------------------------------------------------------
  %%% # empty_group/1
  %%% ---------------------------------------------------------------------------
  
  empty_group(Name) ->
      list_to_binary(empty_body(Name)).
  
negative.code:     Bin = diameter_codec:pack_avp(avp_header(Name), empty_value(Name)),
      << <<0>> || <<_>> <= Bin >>.
  
  %% ---------------------------------------------------------------------------
  %% # empty/1
  %% ---------------------------------------------------------------------------
  
  empty(AvpName) ->
      avp(encode, zero, AvpName).
  