NAME
WebService::OPNsense::Constants - Named constants for the OPNsense REST API
VERSION
version 0.003
SYNOPSIS
# Import only the constants you need
use WebService::OPNsense::Constants qw( $ACTION_PASS $PROTO_TCP $INTERFACE_WAN );
print $ACTION_PASS; # 'pass'
print $PROTO_TCP; # 'TCP'
print $INTERFACE_WAN; # 'wan'
# Selective import -- only listed names enter your namespace
use WebService::OPNsense::Constants qw( $ACTION_PASS $PROTO_TCP );
print $ACTION_PASS; # imported
print $PROTO_TCP; # imported
# Empty import list -- nothing imported, use fully-qualified names
use WebService::OPNsense::Constants ();
print $WebService::OPNsense::Constants::ACTION_PASS;
print $WebService::OPNsense::Constants::PROTO_TCP;
# Unknown import names die at compile time
# use WebService::OPNsense::Constants qw( $NONEXISTENT ); # dies
DESCRIPTION
Provides shared constant values used across the OPNsense API. Constants cover actions, protocols, interfaces, directions, state types, and other enum-like values that appear in multiple API controllers.
Nothing is exported by default. List the names you need in the use statement (e.g. use WebService::OPNsense::Constants qw($ACTION_PASS $PROTO_TCP)). Unknown names croak at compile time. Use use WebService::OPNsense::Constants () to import nothing and reference constants by their fully-qualified name.
CONSTANTS
Actions
Address families
Alias types
$ALIAS_ASN- BGP ASN$ALIAS_AUTHGROUP- OpenVPN group$ALIAS_DYNIPV6HOST- Dynamic IPv6 Host$ALIAS_EXTERNAL- External (advanced)$ALIAS_GEOIP- GeoIP$ALIAS_HOST- Host(s)$ALIAS_INTERNAL- Internal (automatic)$ALIAS_MAC- MAC address$ALIAS_NETWORK- Network(s)$ALIAS_NETWORK_GROUP- Network group$ALIAS_PORT- Port(s)$ALIAS_URL- URL (IPs)$ALIAS_URL_JSON- URL Table in JSON format (IPs)$ALIAS_URL_TABLE- URL Table (IPs)
Directions
Enabled / Disabled
Gateway
Interfaces
$INTERFACE_DMZ$INTERFACE_GUEST$INTERFACE_LAN$INTERFACE_LOOPBACK$INTERFACE_OPT1through$INTERFACE_OPT9$INTERFACE_WAN$INTERFACE_WAN2$INTERFACE_WAN_DHCP$INTERFACE_WAN_PPPOE
Interface groups
Log levels
One-to-one NAT types
Protocols
$PROTO_ANY$PROTO_ESP$PROTO_GRE$PROTO_ICMP$PROTO_OSPF$PROTO_PIM$PROTO_SCTP$PROTO_TCP$PROTO_TCP_UDP$PROTO_UDP$PROTO_VRRP
Rule sequence positions
SNAT modes
State types
TCP flags
$TCP_FLAG_ACK$TCP_FLAG_CWR$TCP_FLAG_ECE$TCP_FLAG_FIN$TCP_FLAG_PSH$TCP_FLAG_RST$TCP_FLAG_SYN$TCP_FLAG_URG
TLS versions
SEE ALSO
WebService::OPNsense - main client class
AUTHOR
Dean Hamstead <dean@fragfest.com.au>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2026 by Dean Hamstead.
This is free software, licensed under:
The MIT (X11) License