Chetan Gaonker | 7f4bf74 | 2016-05-04 15:56:08 -0700 | [diff] [blame] | 1 | # -*- text -*- |
| 2 | # |
| 3 | # $Id: 3d9428e69c08fbc281f9830beae1cd8b7a5e5c70 $ |
| 4 | |
| 5 | # Persistent, embedded Perl interpreter. |
| 6 | # |
| 7 | perl { |
| 8 | # |
| 9 | # The Perl script to execute on authorize, authenticate, |
| 10 | # accounting, xlat, etc. This is very similar to using |
| 11 | # 'rlm_exec' module, but it is persistent, and therefore |
| 12 | # faster. |
| 13 | # |
| 14 | filename = ${modconfdir}/${.:instance}/example.pl |
| 15 | |
| 16 | # |
| 17 | # The following hashes are given to the module and |
| 18 | # filled with value-pairs (Attribute names and values) |
| 19 | # |
| 20 | # %RAD_CHECK Check items |
| 21 | # %RAD_REQUEST Attributes from the request |
| 22 | # %RAD_REPLY Attributes for the reply |
| 23 | # %RAD_REQUEST_PROXY Attributes from the proxied request |
| 24 | # %RAD_REQUEST_PROXY_REPLY Attributes from the proxy reply |
| 25 | # |
| 26 | # The interface between FreeRADIUS and Perl is strings. |
| 27 | # That is, attributes of type "octets" are converted to |
| 28 | # printable strings, such as "0xabcdef". If you want to |
| 29 | # access the binary values of the attributes, you should |
| 30 | # call the Perl "pack" function. Then to send any binary |
| 31 | # data back to FreeRADIUS, call the Perl "unpack" function, |
| 32 | # so that the contents of the hashes are printable strings. |
| 33 | # |
| 34 | # IP addresses are sent as strings, e.g. "192.0.2.25", and |
| 35 | # not as a 4-byte binary value. The same applies to other |
| 36 | # attribute data types. |
| 37 | # |
| 38 | # Attributes of type "string" are copied to Perl as-is. |
| 39 | # They are not escaped or interpreted. |
| 40 | # |
| 41 | # The return codes from functions in the perl_script |
| 42 | # are passed directly back to the server. These |
| 43 | # codes are defined in mods-config/example.pl |
| 44 | # |
| 45 | |
| 46 | # You can define configuration items (and nested sub-sections) in perl "config" section. |
| 47 | # These items will be accessible in the perl script through %RAD_PERLCONF hash. |
| 48 | # For instance: $RAD_PERLCONF{'name'} $RAD_PERLCONF{'sub-config'}->{'name'} |
| 49 | # |
| 50 | #config { |
| 51 | # name = "value" |
| 52 | # sub-config { |
| 53 | # name = "value of name from config.sub-config" |
| 54 | # } |
| 55 | #} |
| 56 | |
| 57 | # |
| 58 | # List of functions in the module to call. |
| 59 | # Uncomment and change if you want to use function |
| 60 | # names other than the defaults. |
| 61 | # |
| 62 | #func_authenticate = authenticate |
| 63 | #func_authorize = authorize |
| 64 | #func_preacct = preacct |
| 65 | #func_accounting = accounting |
| 66 | #func_checksimul = checksimul |
| 67 | #func_pre_proxy = pre_proxy |
| 68 | #func_post_proxy = post_proxy |
| 69 | #func_post_auth = post_auth |
| 70 | #func_recv_coa = recv_coa |
| 71 | #func_send_coa = send_coa |
| 72 | #func_xlat = xlat |
| 73 | #func_detach = detach |
| 74 | |
| 75 | # |
| 76 | # Uncomment the following lines if you wish |
| 77 | # to use separate functions for Start and Stop |
| 78 | # accounting packets. In that case, the |
| 79 | # func_accounting function is not called. |
| 80 | # |
| 81 | #func_start_accounting = accounting_start |
| 82 | #func_stop_accounting = accounting_stop |
| 83 | } |