I'd like to be able to save the state of the internal pf
counters to disk, and then insert them upon the next boot.
Unfortunately, there seems to be no ioctl call for this,
according to pf(4). 

Would it be a good idea to implement an ioctl command for
arbitrarily setting the pf counters, effectively a
counterpart to DIOCGETSTATUS? While the system is running,
the statistics would periodically be saved to file, and upon
a system reboot or power outage, the statistics could be
read from the file, and be inserted into pf. This leaves a
margin of error between the last save and a power outage,
but it is better than losing all statistics.

If it is not a good idea to implement such an ioctl command,
which good alternatives exist? Of course, it is possible to
periodically store the counters in a database and increment
as appropriate, but I was hoping to avoid such third
parties. Any thoughts are welcome.

(For the record, I am aware of the http://ipa-system.sf.net/
"IP Accounting System" project.)

Kind regards,
Sven

Reply via email to