FreeRADIUS InkBridge

Summary of Built-in Functions

Table 1. File Handling Functions

Function

Description

file.cat

Returns the contents of a file.

file.escape

Returns an escaped or safe version of the input string.

file.exists

Checks to see if a file exists on the filesystem.

file.head

Returns the first line of the file.

file.mkdir

Create a directory on the filesystem.

file.rm

Removes a file from the filesystem.

file.rmdir

Removes a directory from the filesystem.

file.size

Returns the size of a file.

file.tail

Return the last line of a file or the last number(n) of lines of a file.

file.touch

Create a file if it does not already exist.

Miscellaneous Functions

Table 2. Miscellaneous Functions

Function

Description

Server Configuration

Examine configuration items.

length

Get the length of data.

Miscellaneous

Functions to execute. regular expression search on string, using pattern.

module.call

Call a virtual module

rand

Generate random integers.

Pair Manipulation

Table 3. Pair Manipulation

Function

Description

debug

Print attributes to the debug output.

immutable

Mark attributes as immutable (cannot be changed).

print

Print attribute name and value to string.

Table 4. Profiling Functions
Function Description

callgrind.start

Switch callgrind instrumentation on.

callgrind.stop

Switch callgrind instrumentation off.

callgrind.dump

Write a callgrind profile dump, then zero the costs.

callgrind.zero

Zero the callgrind costs without writing a dump.

gperftools.start

Start the gperftools CPU profiler, writing samples to a file.

gperftools.stop

Write buffered gperftools samples, then stop the profiler.

gperftools.flush

Write buffered gperftools samples and keep the profiler running.

String Manipulation

Table 5. String manipulation
Function Description

concat

Concatenate strings with delimiters.

split

Split a string based on delimiters.

length

Returns the size of the data.

lpad

Left pad a string.

rpad

Right pad a string.

rand

Return a random string .based on input format

lower

Convert the input string. to lowercase.

upper

Convert the input string. to uppercase

Time Management

Table 6. Time Management
Function Description

character

Single character. expansions

time

Generic (too complex). time function

is_dst

Is the system running in DST?.

now

Return the current time.

offset

Return UTC offset.

request

Return the time when the request was received.

IPv4 Handling

Table 7. IPv4 handling
Function Description

broadcast

Get the broadcast address from an IPv4 prefix

netmask

Get the netmask from an IPv4 prefix