module Bindings.LXC.AttachOptions (
c'LXC_ATTACH_KEEP_ENV,
c'LXC_ATTACH_CLEAR_ENV,
c'LXC_ATTACH_MOVE_TO_CGROUP,
c'LXC_ATTACH_DROP_CAPABILITIES,
c'LXC_ATTACH_SET_PERSONALITY,
c'LXC_ATTACH_LSM_EXEC,
c'LXC_ATTACH_REMOUNT_PROC_SYS,
c'LXC_ATTACH_LSM_NOW,
c'LXC_ATTACH_DEFAULT,
c'LXC_ATTACH_LSM,
C'lxc_attach_options_t(..),
p'lxc_attach_options_t'attach_flags,
p'lxc_attach_options_t'namespaces,
p'lxc_attach_options_t'personality,
p'lxc_attach_options_t'initial_cwd,
p'lxc_attach_options_t'uid,
p'lxc_attach_options_t'gid,
p'lxc_attach_options_t'env_policy,
p'lxc_attach_options_t'extra_env_vars,
p'lxc_attach_options_t'extra_keep_env,
p'lxc_attach_options_t'stdin_fd,
p'lxc_attach_options_t'stdout_fd,
p'lxc_attach_options_t'stderr_fd,
C'lxc_attach_command_t(..),
p'lxc_attach_command_t'program,
p'lxc_attach_command_t'argv,
C_lxc_attach_exec_t(..),
c'lxc_attach_run_command,
p'lxc_attach_run_command,
c'lxc_attach_run_shell,
p'lxc_attach_run_shell,
) where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
import Bindings.LXC.Sys.Types
type C_lxc_attach_exec_t = FunPtr (Ptr () -> IO CInt)
type C'lxc_attach_env_policy_t = CUInt
c'LXC_ATTACH_KEEP_ENV = 0
c'LXC_ATTACH_KEEP_ENV :: (Num a) => a
c'LXC_ATTACH_CLEAR_ENV = 1
c'LXC_ATTACH_CLEAR_ENV :: (Num a) => a
c'LXC_ATTACH_MOVE_TO_CGROUP = 1
c'LXC_ATTACH_MOVE_TO_CGROUP :: (Num a) => a
c'LXC_ATTACH_DROP_CAPABILITIES = 2
c'LXC_ATTACH_DROP_CAPABILITIES :: (Num a) => a
c'LXC_ATTACH_SET_PERSONALITY = 4
c'LXC_ATTACH_SET_PERSONALITY :: (Num a) => a
c'LXC_ATTACH_LSM_EXEC = 8
c'LXC_ATTACH_LSM_EXEC :: (Num a) => a
c'LXC_ATTACH_REMOUNT_PROC_SYS = 65536
c'LXC_ATTACH_REMOUNT_PROC_SYS :: (Num a) => a
c'LXC_ATTACH_LSM_NOW = 131072
c'LXC_ATTACH_LSM_NOW :: (Num a) => a
c'LXC_ATTACH_DEFAULT = 65535
c'LXC_ATTACH_DEFAULT :: (Num a) => a
c'LXC_ATTACH_LSM = 131080
c'LXC_ATTACH_LSM :: (Num a) => a
data C'lxc_attach_options_t = C'lxc_attach_options_t{
c'lxc_attach_options_t'attach_flags :: CInt,
c'lxc_attach_options_t'namespaces :: CInt,
c'lxc_attach_options_t'personality :: CLong,
c'lxc_attach_options_t'initial_cwd :: CString,
c'lxc_attach_options_t'uid :: C'uid_t,
c'lxc_attach_options_t'gid :: C'gid_t,
c'lxc_attach_options_t'env_policy :: C'lxc_attach_env_policy_t,
c'lxc_attach_options_t'extra_env_vars :: Ptr CString,
c'lxc_attach_options_t'extra_keep_env :: Ptr CString,
c'lxc_attach_options_t'stdin_fd :: CInt,
c'lxc_attach_options_t'stdout_fd :: CInt,
c'lxc_attach_options_t'stderr_fd :: CInt
} deriving (Eq,Show)
p'lxc_attach_options_t'attach_flags p = plusPtr p 0
p'lxc_attach_options_t'attach_flags :: Ptr (C'lxc_attach_options_t) -> Ptr (CInt)
p'lxc_attach_options_t'namespaces p = plusPtr p 4
p'lxc_attach_options_t'namespaces :: Ptr (C'lxc_attach_options_t) -> Ptr (CInt)
p'lxc_attach_options_t'personality p = plusPtr p 8
p'lxc_attach_options_t'personality :: Ptr (C'lxc_attach_options_t) -> Ptr (CLong)
p'lxc_attach_options_t'initial_cwd p = plusPtr p 16
p'lxc_attach_options_t'initial_cwd :: Ptr (C'lxc_attach_options_t) -> Ptr (CString)
p'lxc_attach_options_t'uid p = plusPtr p 24
p'lxc_attach_options_t'uid :: Ptr (C'lxc_attach_options_t) -> Ptr (C'uid_t)
p'lxc_attach_options_t'gid p = plusPtr p 28
p'lxc_attach_options_t'gid :: Ptr (C'lxc_attach_options_t) -> Ptr (C'gid_t)
p'lxc_attach_options_t'env_policy p = plusPtr p 32
p'lxc_attach_options_t'env_policy :: Ptr (C'lxc_attach_options_t) -> Ptr (C'lxc_attach_env_policy_t)
p'lxc_attach_options_t'extra_env_vars p = plusPtr p 40
p'lxc_attach_options_t'extra_env_vars :: Ptr (C'lxc_attach_options_t) -> Ptr (Ptr CString)
p'lxc_attach_options_t'extra_keep_env p = plusPtr p 48
p'lxc_attach_options_t'extra_keep_env :: Ptr (C'lxc_attach_options_t) -> Ptr (Ptr CString)
p'lxc_attach_options_t'stdin_fd p = plusPtr p 56
p'lxc_attach_options_t'stdin_fd :: Ptr (C'lxc_attach_options_t) -> Ptr (CInt)
p'lxc_attach_options_t'stdout_fd p = plusPtr p 60
p'lxc_attach_options_t'stdout_fd :: Ptr (C'lxc_attach_options_t) -> Ptr (CInt)
p'lxc_attach_options_t'stderr_fd p = plusPtr p 64
p'lxc_attach_options_t'stderr_fd :: Ptr (C'lxc_attach_options_t) -> Ptr (CInt)
instance Storable C'lxc_attach_options_t where
sizeOf _ = 72
alignment _ = 8
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
v3 <- peekByteOff p 16
v4 <- peekByteOff p 24
v5 <- peekByteOff p 28
v6 <- peekByteOff p 32
v7 <- peekByteOff p 40
v8 <- peekByteOff p 48
v9 <- peekByteOff p 56
v10 <- peekByteOff p 60
v11 <- peekByteOff p 64
return $ C'lxc_attach_options_t v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11
poke p (C'lxc_attach_options_t v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
pokeByteOff p 16 v3
pokeByteOff p 24 v4
pokeByteOff p 28 v5
pokeByteOff p 32 v6
pokeByteOff p 40 v7
pokeByteOff p 48 v8
pokeByteOff p 56 v9
pokeByteOff p 60 v10
pokeByteOff p 64 v11
return ()
data C'lxc_attach_command_t = C'lxc_attach_command_t{
c'lxc_attach_command_t'program :: CString,
c'lxc_attach_command_t'argv :: Ptr CString
} deriving (Eq,Show)
p'lxc_attach_command_t'program p = plusPtr p 0
p'lxc_attach_command_t'program :: Ptr (C'lxc_attach_command_t) -> Ptr (CString)
p'lxc_attach_command_t'argv p = plusPtr p 8
p'lxc_attach_command_t'argv :: Ptr (C'lxc_attach_command_t) -> Ptr (Ptr CString)
instance Storable C'lxc_attach_command_t where
sizeOf _ = 16
alignment _ = 8
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 8
return $ C'lxc_attach_command_t v0 v1
poke p (C'lxc_attach_command_t v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 8 v1
return ()
foreign import ccall "lxc_attach_run_command" c'lxc_attach_run_command
:: Ptr () -> IO CInt
foreign import ccall "&lxc_attach_run_command" p'lxc_attach_run_command
:: FunPtr (Ptr () -> IO CInt)
foreign import ccall "lxc_attach_run_shell" c'lxc_attach_run_shell
:: Ptr () -> IO CInt
foreign import ccall "&lxc_attach_run_shell" p'lxc_attach_run_shell
:: FunPtr (Ptr () -> IO CInt)