以编程方式添加防火墙规则 [英] Add firewall rule programmatically
问题描述
我正在为Mac开发一个应用程序,并且在我的应用程序启动时想添加防火墙规则,
I am developing an application for Mac, and wants to add firewall rule when my application launches,
想知道入口点,如果有任何想法,
我想,我需要修改
/Library/Preferences/com.apple.sharing.firewall.plist
但是此文件不存在我的机器
和任何有关此文件的结构的信息?
would like to know the entry point, if anyone has any idea,
I guess, i need to modify
/Library/Preferences/com.apple.sharing.firewall.plist
But this file is not present in my Machine
and any info about structure of this file ?
需求是这样的
运行时,浏览器不应允许打开一些详细信息网站,所以我相信,这将是一个应用级防火墙。
When it runs, then browser shouldn't allow to open some particulars website, so i believe, this is going to be a application level firewall.
推荐答案
感谢您查看它,
最后我使用ipfw这样做,
尚未清楚如何配置规则
Thanks for looking at it, Finally i am using ipfw to do so, but still not yet clear about how to configure the rule
这篇关于以编程方式添加防火墙规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!