# User will not be rejected - an xlat will be called setting a reply attribute
&User-Name := 'bob'
+# Add two instances of a TLV - will result in an array of hashes in Perl
+&Vendor-Specific.3GPP2.Remote-IP = { &Address = 192.168.1.1, &Mask = 24 }
+&request.Vendor-Specific.3GPP2 += { &Remote-IP = { &Address = 172.16.1.1, &Mask = 16 } }
+
perl.authenticate
if (!ok) {
#if !(&reply.Vendor-Specific.Cisco.h323-credit-amount == 100) {
# test_fail
#}
-if !(&reply.Filter-Id == 'Hello') {
+if (&reply.Filter-Id != 'Hello 127.0.0.1 172.16.1.1') {
test_fail
}
# Verify that the change to the request and control lists are
# Function to handle authenticate
sub authenticate {
# For debugging purposes only
-# log_request_attributes();
+ log_request_attributes();
if ($RAD_REQUEST{'User-Name'} =~ /^baduser/i) {
# Reject user and tell him why
return RLM_MODULE_REJECT;
}
# $RAD_REPLY{'Vendor-Specific.Cisco.h323-credit-amount'} = "100";
- $RAD_REPLY{'Filter-Id'} = 'Hello';
+ $RAD_REPLY{'Filter-Id'} = 'Hello '.$RAD_REQUEST{'Net'}{'Src'}{'IP'}.' '.$RAD_REQUEST{'Vendor-Specific'}{'3GPP2'}{'Remote-IP'}[1]{'Address'};
$RAD_REQUEST{'User-Name'} = 'tim';
$RAD_CONFIG{'NAS-Identifier'} = 'dummy';
}