firewall linux

C++
$ sudo firewall-cmd --get-active-zones
Source

Also in C++: