:code:`configctl` can be used to reload the firewall and test your plugin:
::
configctl filter reload
This will generate a rule like (in /tmp/rules.debug):
::
pass in quick proto udp from {any} to {any} port {9999}
-----------------
-----------------
Interface
Interface
-----------------
-----------------
To register new (virtual) interfaces, create a function called *<plugin>_interfaces()*, which should return a named array containing the unique interface name as key (enc0 for ipsec for example).
To register new (virtual) interfaces, create a function called :code:`<plugin>_interfaces()`, which should return a named array containing the unique interface name as key (enc0 for ipsec for example).
Every item should contain the following properties:
Every item should contain the following properties:
@ -107,8 +183,68 @@ Example:
}
}
-----------------
-----------------
Configure
Syslog
-----------------
To register syslog targets, the :code:`<plugin>_syslog()` function should return a structure containing targets and definitions.
::
function myplugin_syslog()
{
$logfacilities = array();
$logfacilities['myplugin'] = array(
'facility' => array('myplugin'),
'remote' => 'myplugin',
);
return $logfacilities;
}
..Note::
As of OPNsense 19.7 Syslog-NG is included in our base system and includes :code:`/usr/local/etc/syslog-ng.conf.d/*.conf`
when started. When not depending on circular logs, you might want to consider adding templates there instead of
using this legacy handler.
To test if a service registration functions properly, just restart the syslog facility:
::
pluginctl -s syslogd restart
-----------------
XMLRPC (HA) sync
-----------------
-----------------
When your plugin needs configuration after boot, you can create a function called *<plugin>_configure()* which will be called upon boot.
When a configuration section should be exposed to High Availability sync, you can use the xmlrpc plugin hook.
If a plugin exposes a configuration section to ha sync, it can be enabled separately in the synchronization