+function add_service_entry(){
+ local port/proto
+ port=$(echo "${s}" | cut -d/ -f1)
+ proto=$(echo "${s}" | cut -d/ -f2)
+ $IPSET -exist add allowed_${proto} ${port}
+}
+
+function allow_services(){
+ local s proto port
+ for s in "$@"
+ do
+ case "${s}" in
+ */*) add_service_entry "${s}"
+ ;;
+ *) for svc in $(getent services "${s}" | awk '{print $2}')
+ do
+ add_service_entry "${svc}"
+ done
+ ;;
+ esac
+ done
+}
+