# -*- text -*-
#
#  $Id: 2a1e130d315daa247167372773c1994e3200f332 $

#
#  This module is useful only for 'xlat'.  To use it,
#  add it to the raddb/mods-enabled/ directory.  Then,
#  use it on the right-hand side of a variable assignment.
#
#  ... = "%{unpack:data 1 integer}"
#
#  The arguments are three fields:
#
#	data
#		Either &Attribute-Name
#		the name of the attribute to unpack.
#		MUST be a "string" or "octets" type.
#
#		or 0xabcdef
#		e.g. hex data.
#
#	1
#		The offset into the string from which
#		it starts unpacking.  The offset starts
#		at zero, for the first attribute.
#
#	integer
#		the data type to unpack at that offset.
#		e.g. integer, ipaddr, byte, short, etc.
#
#  e.g. if we have Class = 0x00000001020304, then
#
#	%{unpack:&Class 4 short}
#
#  will unpack octets 4 and 5 as a "short", which has
#  value 0x0304.
#
#  This module is used when vendors put multiple fields
#  into one attribute of type "octets".
#
unpack {
}
