示例#1
0
// Make a snapshot of the current iptables rules
func NewIPTables(table string) (IPTable, error) {
	cname := C.CString(table)
	defer C.free(unsafe.Pointer(cname))
	s := new(IPTables)
	h, err := C.iptc_init(cname)

	if err != nil {
		return nil, err
	}
	s.h = h
	return s, nil
}
示例#2
0
func NewManager() *Manager {
	C.iptc_init(tableName)

	return &Manager{}
}