libs/core: use imatch() in firewall and network model