> ++[files] returns ok
> DHCP-Message-Type += DHCP-Discover
> DHCP-Client-Identifier += 00:19:c7:f9:fb:df
> DHCP-Vendor-Class-Identifier += "
dslforum.org"
> DHCP-DHCP-Maximum-Msg-Size += 576
> DHCP-Parameter-Request-List += DHCP-Subnet-Mask
> DHCP-Parameter-Request-List += DHCP-Router-Address
> DHCP-Parameter-Request-List += DHCP-Domain-Name-Server
> DHCP-Parameter-Request-List += DHCP-Hostname
> DHCP-Parameter-Request-List += DHCP-Domain-Name
> DHCP-Parameter-Request-List += DHCP-Broadcast-Address
> DHCP-Parameter-Request-List += DHCP-NTP-Servers
> DHCP-Parameter-Request-List += DHCP-Vendor
> DHCP-Parameter-Request-List += DHCP-TFTP-Server-Name
> DHCP-Relay-Circuit-Id = "WN-POLT01 eth 1/1/01/05/5/14/1:10"
> DHCP-Relay-Remote-Id = "CHORUS1634567895"
> expand: %{dhcp_options:ERX-Dhcp-Options} -> 15
> ++[request] returns ok
>
> Which is brilliant :)
Yeah it's a fun hack.
> Ideally I would like to reverse what the decode is doing, and be able to set TLV VSAs and have the regex preform the opposite. But my c fu isn't that strong so I am going to hunt down someone who may be able to help.
>
> IE going from:
>
> DHCP-Vendor-ACS = "
http://sip.config.co.nz:8080/openacs/acs"
> DHCP-Vendor-User = "USR1"
> DHCP-Vendor-Password = "USR1"
>
> With this in the dictionary.dhcp:
>
> # N Vendor Specific Information
> ATTRIBUTE DHCP-Vendor 43 tlv
> BEGIN-TLV DHCP-Vendor
> ATTRIBUTE DHCP-Vendor-ACS 1 string
> ATTRIBUTE DHCP-Vendor-User 2 string
> ATTRIBUTE DHCP-Vendor-Password 254 string
> END-TLV DHCP-Vendor
>
>
> Using something like:
>
> update reply {
> ERX-Dhcp-Options := "%{encode_dhcp_options:DHCP-Vendor-ACS,DHCP-Vendor-User,DHCP-Vendor-Password}"
> }
>
> Or just specify the top level VSA so the encode knows to take all the TLVs underneath so:
>
> update reply {
> ERX-Dhcp-Options := "%{encode_dhcp_options:DHCP-Vendor}"
> }
>
> Would suffice and end up with something like:
>
> ERX-Dhcp-Options := 0x2b360128687474703a2f2f7369702e636f6e6669672e636f2e6e7a3a383038302f6f70656e6163732f616373020455535231fe0455535231
>
> That would be handy :)
The best way to do it would probably be "0x%{dhcp_option:<attribute ref>}%{dhcp_option:<attribute ref>}".