1 # All attribute lengths are implicit, and are calculated automatically
3 # Input is of the form:
7 # The WORD is a keyword which indicates the format of the following text.
10 # raw - read the grammar defined below, and encode an attribute.
11 # The grammer supports a trivial way of describing RADIUS
12 # attributes, without reference to dictionaries or fancy
15 # encode - reads "Attribute-Name = value", encodes it, and prints
17 # use "-" to encode the output of the last command
19 # decode - reads hex, and decodes it "Attribute-Name = value"
20 # use "-" to decode the output of the last command
22 # data - the expected output of the previous command, in ASCII form.
23 # if the actual command output is different, an error message
24 # is produced, and the program terminates.
27 # The "raw" input satisfies the following grammar:
29 # Identifier = 1*DIGIT *( "." 1*DIGIT )
31 # HEXCHAR = HEXDIG HEXDIG
33 # STRING = DQUOTE *CHAR DQUOTE
35 # TLV = "{" 1*DIGIT DATA "}"
37 # DATA = 1*HEXCHAR / 1*TLV / STRING
39 # LINE = Identifier DATA
41 # The "Identifier" is a RADIUS attribute identifier, as given in the draft.
43 # e.g. 1 for User-Name
44 # 26.9.1 Vendor-Specific, Cisco, Cisco-AVPAir
45 # 241.1 Extended Attribute, number 1
46 # 241.2.3 Extended Attribute 2, data type TLV, TLV type 3
49 # The "DATA" portion is the contents of the RADIUS Attribute.
51 # 123456789abcdef hex string
52 # 12 34 56 ab with spaces for clarity
54 # { 1 abcdef } TLV, TLV-Type 1, data "abcdef"
58 # { tlv-type { tlv-type data } } { 3 { 4 01020304 } }
60 # TLVs can be concatencated
62 # {tlv-type data } { tlv-type data} { 3 040506 } { 8 aabbcc }
64 # The "raw" data is encoded without reference to dictionaries. Any
65 # valid string is parsed to a RADIUS attribute. The resulting RADIUS
66 # attribute *may not* be correctly formatted to the relevant RADIUS
67 # specifications. i.e. you can use this tool to create attribute 1
68 # (User-Name), which is encoded as a series of TLVs. That's up to you.
70 # The purpose of the "raw" command is to have a simple way of encoding
71 # attributes which is independent of any dictionaries or packet processing
74 # The output data is the hex version of the encoded attribute.
77 encode User-Name = bob
81 data User-Name = "bob"
84 data User-Name = "bob"
87 # The Type/Length is OK, but the attribute data is of the wrong size.
92 # Zero-length attributes
96 # don't encode zero-length attributes
97 #encode User-Name = ""
100 # except for CUI. Thank you, WiMAX!
102 data Chargeable-User-Identity = ""
104 # Hah! Thought you had it figured out, didn't you?
109 data 05 06 00 00 00 0a
114 walk 05 06 00 00 00 0a
117 walk 05 06 00 00 00 0a 02 06 00 00 00 0a
118 data v0 a5 l4,v0 a2 l4
120 walk 1a 0c 00 00 00 01 05 06 00 00 00 0a
123 walk 1a 12 00 00 00 01 05 06 00 00 00 0a 03 06 00 00 00 0a
124 data v1 a5 l4,v1 a3 l4
126 # Access-Request, code 1, authentication vector of zero
127 sign 05 06 00 00 00 0a
128 data 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
132 sign 05 06 00 00 00 0a
133 data 62 63 f1 db 80 70 a6 64 37 31 63 e4 aa 95 5a 68
135 sign 05 06 00 00 00 0a
136 data 62 63 f1 db 80 70 a6 64 37 31 63 e4 aa 95 5a 68
139 sign 05 06 00 00 00 0a
140 data 69 20 c0 b9 e1 2f 12 54 9f 92 16 5e f4 64 9b fd
143 sign 05 06 00 00 00 0a
144 data 62 63 f1 db 80 70 a6 64 37 31 63 e4 aa 95 5a 68