func (ct *Container) AddController(ctype int) error { if ret := C.libct_controller_add(ct.ct, C.enum_ct_controller(ctype)); ret != 0 { return LibctError{int(ret)} } return nil }
func (ct *Container) ReadController(ctype int, param string) (string, error) { cparam := C.CString(param) defer C.free(unsafe.Pointer(cparam)) buf := make([]byte, 4096) ret := C.libct_controller_read(ct.ct, C.enum_ct_controller(ctype), cparam, unsafe.Pointer(&buf[0]), 4096) if ret < 0 { return "", LibctError{int(ret)} } return string(buf[:ret]), nil }
func (ct *Container) ConfigureController(ctype int, param string, value string) error { cparam := C.CString(param) defer C.free(unsafe.Pointer(cparam)) cvalue := C.CString(value) defer C.free(unsafe.Pointer(cvalue)) ret := C.libct_controller_configure(ct.ct, C.enum_ct_controller(ctype), cparam, cvalue) if ret != 0 { return LibctError{int(ret)} } return nil }