Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
/
Configuration Templates - Parameters, Variables, Operators, and Functions
Published Aug 02, 2022

Configuration Templates - Parameters, Variables, Operators, and Functions

Aug 02, 2022
Subscribe

A Configuration Template consists of a choice of Configuration Units. Each Configuration Unit has a number of input parameters that have to be filled with values or references.

The types of these input parameters are defined in the Configuration Unit specification available in Campus XXX Link XXX and Swagger XXX Link REST XXX.

The Configuration Template defines how the inputs of the Configuration Units are filled. The following options are available:

  • Static values are defined in the Configuration Template. A static value of a certain input parameter type can be defined and is used for every instance based on the Configuration Template.

  • XXX Configuration Templates parameter references:

  • Configuration Template variable references: Variables can be defined in every Configuration Template. The idea of variables is to allow the user to define expressions (formulas) that derive values from the Configuration Template parameters.

Configuration Templates Variables

There are several operators and functions available to form variable expressions.

Binary Operators

Operator

Meaning

+

Arithmetic plus

-

Arithmetic minus

*

Arithmetic multiplication

/

Arithmetic division

%

Arithmetic modulo

|

Arithmetic OR

&

Bitwise AND

||

Logical OR

&&

Logical AND

>

Larger

<

Smaller

>=

Larger or equal

<=

Smaller or equal

==

Equal

!=

Not equal

++

Increment by one

--

Decrement by one

[ ]

Dereference

!

Logical not

~

Bitwise inverse

 

String Operators

Operator Example

Description

string + string

'Adding' strings is done by concatenating multiple strings to a single one.

 

Functions

Function Call

Description

int atoi(string val)

Convert a string to an integer.

string itoa(int i)

Convert an integer to a string.

int strcmp(string s1, string s2)

Compare two strings.

int strncmp( string s1, string s2, int length)

Compare two strings over a given length.

string ipadd(string ipString1, string ipString2)

"Adds" the "partial" values of two IPv4 addresses.
Example:
ipadd("10.0.4.0", "0.0.0.3")
returns
"10.0.4.3"

string ipor(string ipString1, string ipString2)

Applies the OR operator to two IPv4 addresses.
Example:
ipor("10.0.4.0", "0.0.0.3")
returns
"10.0.4.3"

string ipmask(string ipString, string maskString)

Applies the digital, bitwise AND operator to the partials of an IPv4 address.
Example:
ipmask("10.0.4.7", "255.255.255.0")
returns
"10.0.4.0"

string ipmask6(string ipString, string ipMaskString)

Applies the digital, bitwise AND operator to the partials of an IPv6 address.
Example:
ipmask6("2000:2000:4400:3::5", "ffff:ffff:ffff:ffff")
returns
"2000:2000:4400:3::"

string ipand(string ipString1, string ipString2)

Applies the digital, bitwise AND operator to the partials of an IPv4 address.
Example:
ipand("10.0.4.7", "255.255.255.0")
returns
"10.0.4.0"

string ipgetaddr(string ipmaskString)

Calculates the IP address from a given CIDR network address.
Example:
ipgetaddr("10.0.4.7/8")
returns
"10.0.4.7"

string ipgetmask(string ipmaskString)

Calculates the size of a network from a given CIDR network address.
Example:
ipgetaddr("10.0.4.7/8")
returns
"8"

string ipgetmaskaddr(string ipmaskString)

Calculates the mask from a given IPv4 network address.
Example:
ipgetaddr("10.0.4.7/8")
returns
"255.255.255.0"

string ipgetmaskaddr6(string ipmaskString)

Calculates the mask from a given IPv6 network address.
Example:
"2000:2000:4400:3::5"
returns
"ffff:ffff:ffff:ffff::"

int ipmatchnet(string addr, string network)

Calculates whether an IPv4 address matches a certain IPv4 network address.
Example:
ipmatchnet("10.0.66.2", "10.0.4.0/8")
returns
0

int ipmatchnet6(string addr, string network)

Calculates whether an IPv6 address matches a certain IPv6 network address.
Example:
ipmatchnet("2000:2000:4400:3::5", "2000:2000:4400:4::/64")
returns
0

int ipcmp(string ipString1, string ipString2)

Compares two given IPv4 addresses. If the addresses are equal, the function returns 0. Otherwise the function returns a value <> 0.
Example:
ipcmp("192.168.1.1", "192.168.1.1")
returns
0

int ipcmp6(string ipString1, string ipString2)

Compares two given IPv6 addresses. If the addresses are equal, the function returns 0. Otherwise the function returns a value <> 0.
Example:
ipcmp("2000:2000:4400:3::5", "2000:2000:4400:3::5")
returns
0

string date()

Get the current date from the system using the format "dd mm yyyy".

string time()

Get the current time from the system using the format "hh mm ss".

int unixsec()

Returns the time in Unix seconds.

string generaterandomstring(int size)

Returns a randomly generated string with the length of <size>.
The maximum length of the string must not exceed 128 characters.
Note: This function was introduced with firmware 7.2. If you are not sure whether this function is available, check using the function funcexist("generaterandomstring").

string dateinternational()

Returns the current date using the format "yyyy-mm-dd".
Note: This function was introduced with firmware 7.2. If you are not sure whether this function is available, check using the function funcexist("dateinternational").

 

Examples in TDL

TDL Script Content

Explanation

[parameters]
name type=string

[variables]
Boxname type=string expression='"The boxname is " + name'

Concatenates a static and a dynamic string set in a parameter.

[parameters]
id type=int
[variables]
mip type=ip expression='ipadd("10.0.10.0",itoa(id))'

Calculates an IP address based on an integer parameter and a static base-IP.
E.g., id=1 would result in mip=10.0.10.1

 

 


We value your feedback.
If you have questions, suggestions, or feedback on our documentation, contact the Campus Product Documentation team.
For general product inquiries or technical support, please contact the global Barracuda Support team.

🔍 Discover Our Product Documentation

Barracuda CloudGen Firewall 9.0
Results will update as you type.
  • Deployment
  • Get Started
  • Network
  • High Availability
  • Licensing
  • Administration
  • Authentication
  • Cloud Integration
  • Assigned Services
  • Services
  • Automated Critical Updates
  • Firewall Control Center
    • Getting Started - Control Center
    • Getting Started - Control Center for Public Cloud
    • Getting Started - Control Center without CC Setup Wizard
    • Central Management
      • How to Enable Dynamic Loading for Large Configuration Trees
      • How to Manage Ranges and Clusters
      • How to Configure Custom Box Descriptors and Filter Managed Firewalls in Different Data Views
      • Global Firewall Objects
      • How to Enable Firewall Objects on a Range or Cluster Level
      • How to Add a New/Clone an Existing CloudGen Firewall to/in the Control Center
      • How to Import an Existing CloudGen Firewall into a Control Center
      • How to Configure a Remote Management Tunnel for a CloudGen Firewall
      • How to Configure Management Tunnel Offloading Using an Access Controller
      • How to Move, Copy, and Delete CloudGen Firewalls in the Control Center
      • How to Display the Control Center Box Layer on the Status Map
      • Control Centers in a Parent-to-Child Relation
      • Configuration Templates
        • Configuration Template Manager
        • Configuration Templates - Parameters, Variables, Operators, and Functions
        • CGF Configuration Units
        • SC Configuration Units
        • Template Definition Language - TDL
        • Configuration Templates via REST
        • How to Work with Configuration Templates on Different Levels in the Configuration Tree
        • Transforming an Instance into a Standard Box Node and Vice Versa
        • Considerations for Managing Large Numbers of Configuration Template-Managed Appliances Based on the Configuration of a Single Standard Box Node
      • Licensing CloudGen Firewalls in the Control Center
      • Zero Touch Deployment
      • How to Update Control Center-Managed CloudGen Firewalls
      • How to Enable/Disable a Firewall to Receive Configuration Updates from CC
      • How to Bulk Enable/Disable Firewalls to Receive Configuration Updates from CC
      • How to Update Managed High Availability Clusters with Automatic Failover
      • How to Configure Offline Pattern Updates for the Control Center
      • Repositories
      • Authentication Sync to Trust Zone
    • Control Center Admins
    • GTI Editor
    • Control Center Statistics
    • Control Center Syslog Service
    • Shared Services
    • Control Center Eventing
    • Control Center CC Firewall
    • Control Center Troubleshooting
  • Barracuda Secure Connector
  • Best Practice
  • Implementation Guides
  • Monitoring and Reporting
  • Maintenance
  • Remote Access Clients
  • Management Interfaces, Tools, and Apps
  • TUFIN Integration API Service
  • Hardware Models
  • REST API

    You‘re viewing this with anonymous access, so some content might be blocked.
    {"serverDuration": 14, "requestCorrelationId": "a1f417794b4340baa3e3b7b29569c19b"}