diff --git a/.golangci.yml b/.golangci.yml index 59b7a9e043..6cc9719a0d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -102,7 +102,7 @@ linters-settings: cyclop: max-complexity: 20 gocognit: - min-complexity: 30 + min-complexity: 35 nestif: min-complexity: 15 errcheck: diff --git a/Cargo.lock b/Cargo.lock index 5988ec2516..43989555c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -282,6 +282,7 @@ dependencies = [ "multimap", "nix 0.25.0", "notify", + "once_cell", "opentelemetry", "opentelemetry-otlp", "opentelemetry-semantic-conventions", @@ -291,6 +292,7 @@ dependencies = [ "serde", "serde_json", "shadow-rs", + "signal-hook", "strum", "tempfile", "time", @@ -1789,6 +1791,16 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" diff --git a/conmon-rs/common/proto/conmon.capnp b/conmon-rs/common/proto/conmon.capnp index 411b9c0bab..6361c73480 100644 --- a/conmon-rs/common/proto/conmon.capnp +++ b/conmon-rs/common/proto/conmon.capnp @@ -57,6 +57,7 @@ interface Conmon { struct CreateContainerResponse { containerPid @0 :UInt32; + namespacesPath @1 :Text; } createContainer @1 (request: CreateContainerRequest) -> (response: CreateContainerResponse); @@ -120,4 +121,31 @@ interface Conmon { } setWindowSizeContainer @5 (request: SetWindowSizeRequest) -> (response: SetWindowSizeResponse); + + ############################################### + # CreateNamespaces + struct CreateNamespacesRequest { + metadata @0 :Data; # Standard metadata to carry. + namespaces @1 :List(Namespace); # The list of namespaces to unshare. + } + + enum Namespace { + ipc @0; # Unshare the IPC namespace. + net @1; # Unshare the network namespace. + pid @2; # Unshare the PID namespace. + user @3; # Unshare the user namespace. + uts @4; # Unshare the UTS namespace. + } + + struct CreateNamespacesResponse { + namespaces @0 :List(NamespaceResponse); # The list of created namespaces. + } + + # Available namespaces. + struct NamespaceResponse { + type @0 :Namespace; # The type of the namespace. + path @1 :Text; # Path to the directory for the unshared namespaces. + } + + createNamespaces @6 (request: CreateNamespacesRequest) -> (response: CreateNamespacesResponse); } diff --git a/conmon-rs/server/Cargo.toml b/conmon-rs/server/Cargo.toml index 7aa6390c71..4736128d1b 100644 --- a/conmon-rs/server/Cargo.toml +++ b/conmon-rs/server/Cargo.toml @@ -22,6 +22,7 @@ memchr = "2.5.0" multimap = "0.8.3" nix = "0.25.0" notify = "5.0.0" +once_cell = "1.16.0" opentelemetry = { version = "0.18.0", features = ["rt-tokio"] } opentelemetry-otlp = "0.11.0" opentelemetry-semantic-conventions = "0.10.0" @@ -31,6 +32,7 @@ sendfd = { version = "0.4.3", features = ["tokio"] } serde = { version = "1.0.147", features = ["derive"] } serde_json = "1.0.88" shadow-rs = "=0.16.1" +signal-hook = "0.3.14" strum = { version = "0.24.1", features = ["derive"] } tempfile = "3.3.0" tokio = { version = "1.21.2", features = ["fs", "io-std", "io-util", "macros", "net", "process", "rt", "rt-multi-thread", "signal", "time"] } diff --git a/conmon-rs/server/src/config.rs b/conmon-rs/server/src/config.rs index 98f99edcfa..8770752ac3 100644 --- a/conmon-rs/server/src/config.rs +++ b/conmon-rs/server/src/config.rs @@ -1,6 +1,6 @@ //! Configuration related structures use anyhow::{bail, Result}; -use clap::{ArgEnum, Parser}; +use clap::{ArgEnum, Parser, Subcommand}; use getset::{CopyGetters, Getters, Setters}; use serde::{Deserialize, Serialize}; use std::{fs, path::PathBuf}; @@ -18,9 +18,13 @@ macro_rules! prefix { after_help("More info at: https://github.com/containers/conmon-rs"), disable_version_flag(true) )] - /// An OCI container runtime monitor. pub struct Config { + #[get = "pub"] + #[clap(subcommand)] + /// Possible subcommands. + command: Option, + #[get_copy = "pub"] #[clap( default_missing_value("default"), @@ -129,6 +133,42 @@ pub struct Config { tracing_endpoint: String, } +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, Subcommand)] +/// Possible subcommands. +pub enum Commands { + /// Run pause instead of the server. + Pause { + #[clap( + env(concat!(prefix!(), "PAUSE_PATH")), + long("path"), + short('p'), + value_name("PATH") + )] + /// The base path for pinning the namespaces. + path: PathBuf, + + #[clap(long("ipc"))] + /// Unshare the IPC namespace. + ipc: bool, + + #[clap(long("pid"))] + /// Unshare the PID namespace. + pid: bool, + + #[clap(long("net"))] + /// Unshare the network namespace. + net: bool, + + #[clap(long("user"))] + /// Unshare the user namespace. + user: bool, + + #[clap(long("uts"))] + /// Unshare the UTS namespace. + uts: bool, + }, +} + #[derive( ArgEnum, AsRefStr, diff --git a/conmon-rs/server/src/lib.rs b/conmon-rs/server/src/lib.rs index 35645b796e..796f044caa 100644 --- a/conmon-rs/server/src/lib.rs +++ b/conmon-rs/server/src/lib.rs @@ -15,6 +15,7 @@ mod init; mod journal; mod listener; mod oom_watcher; +mod pause; mod rpc; mod server; mod streams; diff --git a/conmon-rs/server/src/listener.rs b/conmon-rs/server/src/listener.rs index 5b8f703a46..b68d95ccbb 100644 --- a/conmon-rs/server/src/listener.rs +++ b/conmon-rs/server/src/listener.rs @@ -73,7 +73,7 @@ pub struct DefaultListener; impl ListenerImpl for DefaultListener { fn bind(&self, path: &Path) -> io::Result { - UnixListener::bind(&path) + UnixListener::bind(path) } fn create_dir_all(&self, path: &Path) -> io::Result<()> { diff --git a/conmon-rs/server/src/pause.rs b/conmon-rs/server/src/pause.rs new file mode 100644 index 0000000000..3c56b7b42a --- /dev/null +++ b/conmon-rs/server/src/pause.rs @@ -0,0 +1,255 @@ +use anyhow::{bail, Context, Result}; +use capnp::enum_list::Reader; +use conmon_common::conmon_capnp::conmon; +use getset::{CopyGetters, Getters}; +use libc::pid_t; +use nix::{ + mount::{mount, umount, MsFlags}, + sched::{unshare, CloneFlags}, + sys::signal::{kill, Signal}, + unistd::{fork, ForkResult, Pid}, +}; +use once_cell::sync::OnceCell; +use signal_hook::{consts::TERM_SIGNALS, iterator::Signals}; +use std::{ + env, + fs::{self, File}, + io::Write, + path::{Path, PathBuf}, + process::{exit, Command}, +}; +use strum::{AsRefStr, Display, EnumIter, EnumString, IntoEnumIterator, IntoStaticStr}; +use tracing::{debug, error, info}; +use uuid::Uuid; + +/// The main structure for this module. +#[derive(Debug, CopyGetters, Getters)] +pub struct Pause { + #[get = "pub"] + path: PathBuf, + + #[get = "pub"] + namespaces: Vec, + + #[get_copy] + pid: Pid, +} + +/// The global shared multiple pause instance. +static PAUSE: OnceCell = OnceCell::new(); + +/// The global path for storing bin mounted namespaces. +const PAUSE_PATH: &str = "/var/run/conmonrs"; + +/// The file path for storing the pause PID. +const PAUSE_PID_FILE: &str = ".pause_pid"; + +impl Pause { + /// Retrieve the global instance of pause + pub fn init_shared(namespaces: Reader) -> Result<&'static Pause> { + PAUSE.get_or_try_init(|| Self::init(namespaces).context("init pause")) + } + + /// Retrieve the global instance of pause if initialized. + pub fn maybe_shared() -> Option<&'static Pause> { + PAUSE.get() + } + + /// Stop the global pause instance. + pub fn stop(&self) { + info!("Stopping pause"); + for namespace in Namespace::iter() { + if let Err(e) = namespace.umount(self.path()) { + debug!("Unable to umount namespace {namespace}: {:#}", e); + } + } + if let Err(e) = fs::remove_dir_all(self.path()) { + error!( + "Unable to remove pause path {}: {:#}", + self.path().display(), + e + ); + } + + info!("Killing pause PID: {}", self.pid()); + if let Err(e) = kill(self.pid(), Signal::SIGTERM) { + error!("Unable to kill pause PID {}: {:#}", self.pid(), e); + } + } + + /// Initialize a new pause instance. + fn init(init_namespaces: Reader) -> Result { + debug!("Initializing pause"); + + let mut args = vec![]; + let mut namespaces = vec![]; + for namespace in init_namespaces.iter() { + match namespace? { + conmon::Namespace::Ipc => { + args.push("--ipc"); + namespaces.push(Namespace::Ipc); + } + conmon::Namespace::Net => { + args.push("--net"); + namespaces.push(Namespace::Net); + } + conmon::Namespace::Pid => { + args.push("--pid"); + namespaces.push(Namespace::Pid); + } + conmon::Namespace::Uts => { + args.push("--uts"); + namespaces.push(Namespace::Uts); + } + conmon::Namespace::User => { + args.push("--user"); + namespaces.push(Namespace::User); + } + } + } + + let path = PathBuf::from(PAUSE_PATH).join(Uuid::new_v4().to_string()); + fs::create_dir_all(&path).context("create base path")?; + + let program = env::args().next().context("no args set")?; + let mut child = Command::new(program) + .arg("pause") + .arg("--path") + .arg(&path) + .args(args) + .spawn() + .context("run pause")?; + + let status = child.wait().context("wait for pause child")?; + if !status.success() { + bail!("exit status not ok: {status}") + } + + let pid = fs::read_to_string(path.join(PAUSE_PID_FILE)) + .context("read pause PID path")? + .trim() + .parse::() + .context("parse pause PID")?; + info!("Pause PID is: {pid}"); + + Ok(Self { + path, + namespaces, + pid: Pid::from_raw(pid as pid_t), + }) + } + + /// Run a new pause instance. + pub fn run>( + path: T, + ipc: bool, + pid: bool, + net: bool, + user: bool, + uts: bool, + ) -> Result<()> { + let mut flags = CloneFlags::empty(); + if ipc { + flags.insert(CloneFlags::CLONE_NEWIPC); + } + if pid { + flags.insert(CloneFlags::CLONE_NEWPID); + } + if net { + flags.insert(CloneFlags::CLONE_NEWNET); + } + if user { + flags.insert(CloneFlags::CLONE_NEWUSER); + } + if uts { + flags.insert(CloneFlags::CLONE_NEWUTS); + } + + unshare(flags).context("unshare with clone flags")?; + + match unsafe { fork().context("forking process")? } { + ForkResult::Parent { child } => { + let mut file = File::create(path.as_ref().join(PAUSE_PID_FILE)) + .context("create pause PID file")?; + write!(file, "{child}").context("write child to pause file")?; + exit(0); + } + ForkResult::Child => (), + } + + for namespace in Namespace::iter() { + namespace + .bind(path.as_ref()) + .context("bind namespace to {path}")?; + } + + let mut signals = Signals::new(TERM_SIGNALS).context("register signals")?; + signals.forever().next().context("no signal number")?; + Ok(()) + } +} + +#[derive( + AsRefStr, Clone, Copy, Debug, Display, EnumIter, EnumString, Eq, IntoStaticStr, PartialEq, +)] +#[strum(serialize_all = "lowercase")] +/// All available linux namespaces. +pub enum Namespace { + /// IPC namespace. This creates new namespace for System V IPC POSIX message queues and + /// similar. + Ipc, + + /// The PID namespace. The child process becomes PID 1. + Pid, + + /// The network namespace. The namespace is empty and has no conectivity, even localhost + /// network, unless some setup is done afterwards. + Net, + + /// The user namespace, which allows to segregate the user ID. + User, + + /// The UTS namespace, which allows to change hostname of the new container. + Uts, +} + +impl Namespace { + /// Bind the namespace to the provided base path. + pub fn bind>(&self, path: T) -> Result<()> { + let bind_path = self.path(path); + File::create(&bind_path).context("create namespace bind path")?; + let source_path = PathBuf::from("/proc/self/ns").join(self.as_ref()); + + mount( + Some(&source_path), + &bind_path, + None::<&Path>, + MsFlags::MS_BIND, + None::<&[u8]>, + ) + .context("mount namespace")?; + + Ok(()) + } + + /// Umount the namespace. + pub fn umount>(&self, path: T) -> Result<()> { + let bind_path = self.path(path); + umount(&bind_path).context("umount namespace") + } + + /// Retrieve the bind path of the namespace for the provided base path. + pub fn path>(&self, path: T) -> PathBuf { + path.as_ref().join(self.as_ref()) + } + + pub fn to_capnp_namespace(&self) -> conmon::Namespace { + match self { + Namespace::Ipc => conmon::Namespace::Ipc, + Namespace::Pid => conmon::Namespace::Pid, + Namespace::Net => conmon::Namespace::Net, + Namespace::User => conmon::Namespace::User, + Namespace::Uts => conmon::Namespace::Uts, + } + } +} diff --git a/conmon-rs/server/src/rpc.rs b/conmon-rs/server/src/rpc.rs index 4f3910da01..71644ce6d5 100644 --- a/conmon-rs/server/src/rpc.rs +++ b/conmon-rs/server/src/rpc.rs @@ -2,6 +2,7 @@ use crate::{ child::Child, container_io::{ContainerIO, SharedContainerIO}, container_log::ContainerLog, + pause::Pause, server::Server, telemetry::Telemetry, version::Version, @@ -11,6 +12,7 @@ use capnp::{capability::Promise, Error}; use capnp_rpc::pry; use conmon_common::conmon_capnp::conmon; use std::{ + convert::TryInto, path::{Path, PathBuf}, process, str, time::Duration, @@ -349,4 +351,36 @@ impl conmon::Server for Server { .instrument(debug_span!("promise")), ) } + + /// Create a new set of namespaces. + fn create_namespaces( + &mut self, + params: conmon::CreateNamespacesParams, + mut results: conmon::CreateNamespacesResults, + ) -> Promise<(), capnp::Error> { + debug!("Got a create namespaces request"); + let req = pry!(pry!(params.get()).get_request()); + + let span = debug_span!( + "create_namespaces", + uuid = Uuid::new_v4().to_string().as_str() + ); + let _enter = span.enter(); + pry_err!(Telemetry::set_parent_context(pry!(req.get_metadata()))); + + let init_namespaces = pry!(req.get_namespaces()); + let pause = pry_err!(Pause::init_shared(init_namespaces)); + + let response = results.get().init_response(); + let mut namespaces = + response.init_namespaces(pry_err!(pause.namespaces().len().try_into())); + + for (idx, namespace) in pause.namespaces().iter().enumerate() { + let mut ns = namespaces.reborrow().get(pry_err!(idx.try_into())); + ns.set_path(&namespace.path(pause.path()).display().to_string()); + ns.set_type(namespace.to_capnp_namespace()); + } + + Promise::ok(()) + } } diff --git a/conmon-rs/server/src/server.rs b/conmon-rs/server/src/server.rs index 964678151c..1c77a42417 100644 --- a/conmon-rs/server/src/server.rs +++ b/conmon-rs/server/src/server.rs @@ -2,11 +2,12 @@ use crate::{ child_reaper::ChildReaper, - config::{CgroupManager, Config, LogDriver, Verbosity}, + config::{CgroupManager, Commands, Config, LogDriver, Verbosity}, container_io::{ContainerIO, ContainerIOType}, init::{DefaultInit, Init}, journal::Journal, listener::{DefaultListener, Listener}, + pause::Pause, telemetry::Telemetry, version::Version, }; @@ -62,6 +63,19 @@ impl Server { process::exit(0); } + if let Some(Commands::Pause { + path, + ipc, + pid, + net, + user, + uts, + }) = server.config().command() + { + Pause::run(path, *ipc, *pid, *net, *user, *uts).context("run pause")?; + process::exit(0); + } + server.config().validate().context("validate config")?; Self::init().context("init self")?; @@ -207,6 +221,10 @@ impl Server { } }; + if let Some(pause) = Pause::maybe_shared() { + pause.stop(); + } + debug!("Starting grandchildren cleanup task"); reaper .kill_grandchildren(handled_sig) diff --git a/internal/proto/conmon.capnp.go b/internal/proto/conmon.capnp.go index 06fc36c94e..f9028b4b28 100644 --- a/internal/proto/conmon.capnp.go +++ b/internal/proto/conmon.capnp.go @@ -113,6 +113,22 @@ func (c Conmon) SetWindowSizeContainer(ctx context.Context, params func(Conmon_s ans, release := capnp.Client(c).SendCall(ctx, s) return Conmon_setWindowSizeContainer_Results_Future{Future: ans.Future()}, release } +func (c Conmon) CreateNamespaces(ctx context.Context, params func(Conmon_createNamespaces_Params) error) (Conmon_createNamespaces_Results_Future, capnp.ReleaseFunc) { + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xb737e899dd6633f1, + MethodID: 6, + InterfaceName: "conmon-rs/common/proto/conmon.capnp:Conmon", + MethodName: "createNamespaces", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 1} + s.PlaceArgs = func(s capnp.Struct) error { return params(Conmon_createNamespaces_Params(s)) } + } + ans, release := capnp.Client(c).SendCall(ctx, s) + return Conmon_createNamespaces_Results_Future{Future: ans.Future()}, release +} // String returns a string that identifies this capability for debugging // purposes. Its format should not be depended on: in particular, it @@ -192,6 +208,8 @@ type Conmon_Server interface { ReopenLogContainer(context.Context, Conmon_reopenLogContainer) error SetWindowSizeContainer(context.Context, Conmon_setWindowSizeContainer) error + + CreateNamespaces(context.Context, Conmon_createNamespaces) error } // Conmon_NewServer creates a new Server from an implementation of Conmon_Server. @@ -210,7 +228,7 @@ func Conmon_ServerToClient(s Conmon_Server) Conmon { // This can be used to create a more complicated Server. func Conmon_Methods(methods []server.Method, s Conmon_Server) []server.Method { if cap(methods) == 0 { - methods = make([]server.Method, 0, 6) + methods = make([]server.Method, 0, 7) } methods = append(methods, server.Method{ @@ -285,6 +303,18 @@ func Conmon_Methods(methods []server.Method, s Conmon_Server) []server.Method { }, }) + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xb737e899dd6633f1, + MethodID: 6, + InterfaceName: "conmon-rs/common/proto/conmon.capnp:Conmon", + MethodName: "createNamespaces", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.CreateNamespaces(ctx, Conmon_createNamespaces{call}) + }, + }) + return methods } @@ -390,6 +420,23 @@ func (c Conmon_setWindowSizeContainer) AllocResults() (Conmon_setWindowSizeConta return Conmon_setWindowSizeContainer_Results(r), err } +// Conmon_createNamespaces holds the state for a server call to Conmon.createNamespaces. +// See server.Call for documentation. +type Conmon_createNamespaces struct { + *server.Call +} + +// Args returns the call's arguments. +func (c Conmon_createNamespaces) Args() Conmon_createNamespaces_Params { + return Conmon_createNamespaces_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c Conmon_createNamespaces) AllocResults() (Conmon_createNamespaces_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_createNamespaces_Results(r), err +} + // Conmon_List is a list of Conmon. type Conmon_List = capnp.CapList[Conmon] @@ -446,6 +493,14 @@ func (s Conmon_VersionRequest) Message() *capnp.Message { func (s Conmon_VersionRequest) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } +func (s Conmon_VersionRequest) Verbose() bool { + return capnp.Struct(s).Bit(0) +} + +func (s Conmon_VersionRequest) SetVerbose(v bool) { + capnp.Struct(s).SetBit(0, v) +} + func (s Conmon_VersionRequest) Metadata() ([]byte, error) { p, err := capnp.Struct(s).Ptr(0) return []byte(p.Data()), err @@ -459,14 +514,6 @@ func (s Conmon_VersionRequest) SetMetadata(v []byte) error { return capnp.Struct(s).SetData(0, v) } -func (s Conmon_VersionRequest) Verbose() bool { - return capnp.Struct(s).Bit(0) -} - -func (s Conmon_VersionRequest) SetVerbose(v bool) { - capnp.Struct(s).SetBit(0, v) -} - // Conmon_VersionRequest_List is a list of Conmon_VersionRequest. type Conmon_VersionRequest_List = capnp.StructList[Conmon_VersionRequest] @@ -479,9 +526,9 @@ func NewConmon_VersionRequest_List(s *capnp.Segment, sz int32) (Conmon_VersionRe // Conmon_VersionRequest_Future is a wrapper for a Conmon_VersionRequest promised by a client call. type Conmon_VersionRequest_Future struct{ *capnp.Future } -func (p Conmon_VersionRequest_Future) Struct() (Conmon_VersionRequest, error) { - s, err := p.Future.Struct() - return Conmon_VersionRequest(s), err +func (f Conmon_VersionRequest_Future) Struct() (Conmon_VersionRequest, error) { + p, err := f.Future.Ptr() + return Conmon_VersionRequest(p.Struct()), err } type Conmon_VersionResponse capnp.Struct @@ -531,19 +578,6 @@ func (s Conmon_VersionResponse) Message() *capnp.Message { func (s Conmon_VersionResponse) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } -func (s Conmon_VersionResponse) Metadata() ([]byte, error) { - p, err := capnp.Struct(s).Ptr(8) - return []byte(p.Data()), err -} - -func (s Conmon_VersionResponse) HasMetadata() bool { - return capnp.Struct(s).HasPtr(8) -} - -func (s Conmon_VersionResponse) SetMetadata(v []byte) error { - return capnp.Struct(s).SetData(8, v) -} - func (s Conmon_VersionResponse) ProcessId() uint32 { return capnp.Struct(s).Uint32(0) } @@ -696,6 +730,19 @@ func (s Conmon_VersionResponse) SetCargoTree(v string) error { return capnp.Struct(s).SetText(7, v) } +func (s Conmon_VersionResponse) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(8) + return []byte(p.Data()), err +} + +func (s Conmon_VersionResponse) HasMetadata() bool { + return capnp.Struct(s).HasPtr(8) +} + +func (s Conmon_VersionResponse) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(8, v) +} + // Conmon_VersionResponse_List is a list of Conmon_VersionResponse. type Conmon_VersionResponse_List = capnp.StructList[Conmon_VersionResponse] @@ -708,9 +755,9 @@ func NewConmon_VersionResponse_List(s *capnp.Segment, sz int32) (Conmon_VersionR // Conmon_VersionResponse_Future is a wrapper for a Conmon_VersionResponse promised by a client call. type Conmon_VersionResponse_Future struct{ *capnp.Future } -func (p Conmon_VersionResponse_Future) Struct() (Conmon_VersionResponse, error) { - s, err := p.Future.Struct() - return Conmon_VersionResponse(s), err +func (f Conmon_VersionResponse_Future) Struct() (Conmon_VersionResponse, error) { + p, err := f.Future.Ptr() + return Conmon_VersionResponse(p.Struct()), err } type Conmon_CreateContainerRequest capnp.Struct @@ -760,19 +807,6 @@ func (s Conmon_CreateContainerRequest) Message() *capnp.Message { func (s Conmon_CreateContainerRequest) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } -func (s Conmon_CreateContainerRequest) Metadata() ([]byte, error) { - p, err := capnp.Struct(s).Ptr(8) - return []byte(p.Data()), err -} - -func (s Conmon_CreateContainerRequest) HasMetadata() bool { - return capnp.Struct(s).HasPtr(8) -} - -func (s Conmon_CreateContainerRequest) SetMetadata(v []byte) error { - return capnp.Struct(s).SetData(8, v) -} - func (s Conmon_CreateContainerRequest) Id() (string, error) { p, err := capnp.Struct(s).Ptr(0) return p.Text(), err @@ -848,7 +882,6 @@ func (s Conmon_CreateContainerRequest) NewExitPaths(n int32) (capnp.TextList, er err = capnp.Struct(s).SetPtr(2, l.ToPtr()) return l, err } - func (s Conmon_CreateContainerRequest) OomExitPaths() (capnp.TextList, error) { p, err := capnp.Struct(s).Ptr(3) return capnp.TextList(p.List()), err @@ -872,7 +905,6 @@ func (s Conmon_CreateContainerRequest) NewOomExitPaths(n int32) (capnp.TextList, err = capnp.Struct(s).SetPtr(3, l.ToPtr()) return l, err } - func (s Conmon_CreateContainerRequest) LogDrivers() (Conmon_LogDriver_List, error) { p, err := capnp.Struct(s).Ptr(4) return Conmon_LogDriver_List(p.List()), err @@ -896,7 +928,6 @@ func (s Conmon_CreateContainerRequest) NewLogDrivers(n int32) (Conmon_LogDriver_ err = capnp.Struct(s).SetPtr(4, l.ToPtr()) return l, err } - func (s Conmon_CreateContainerRequest) CleanupCmd() (capnp.TextList, error) { p, err := capnp.Struct(s).Ptr(5) return capnp.TextList(p.List()), err @@ -920,7 +951,6 @@ func (s Conmon_CreateContainerRequest) NewCleanupCmd(n int32) (capnp.TextList, e err = capnp.Struct(s).SetPtr(5, l.ToPtr()) return l, err } - func (s Conmon_CreateContainerRequest) GlobalArgs() (capnp.TextList, error) { p, err := capnp.Struct(s).Ptr(6) return capnp.TextList(p.List()), err @@ -944,7 +974,6 @@ func (s Conmon_CreateContainerRequest) NewGlobalArgs(n int32) (capnp.TextList, e err = capnp.Struct(s).SetPtr(6, l.ToPtr()) return l, err } - func (s Conmon_CreateContainerRequest) CommandArgs() (capnp.TextList, error) { p, err := capnp.Struct(s).Ptr(7) return capnp.TextList(p.List()), err @@ -968,6 +997,18 @@ func (s Conmon_CreateContainerRequest) NewCommandArgs(n int32) (capnp.TextList, err = capnp.Struct(s).SetPtr(7, l.ToPtr()) return l, err } +func (s Conmon_CreateContainerRequest) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(8) + return []byte(p.Data()), err +} + +func (s Conmon_CreateContainerRequest) HasMetadata() bool { + return capnp.Struct(s).HasPtr(8) +} + +func (s Conmon_CreateContainerRequest) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(8, v) +} // Conmon_CreateContainerRequest_List is a list of Conmon_CreateContainerRequest. type Conmon_CreateContainerRequest_List = capnp.StructList[Conmon_CreateContainerRequest] @@ -981,9 +1022,9 @@ func NewConmon_CreateContainerRequest_List(s *capnp.Segment, sz int32) (Conmon_C // Conmon_CreateContainerRequest_Future is a wrapper for a Conmon_CreateContainerRequest promised by a client call. type Conmon_CreateContainerRequest_Future struct{ *capnp.Future } -func (p Conmon_CreateContainerRequest_Future) Struct() (Conmon_CreateContainerRequest, error) { - s, err := p.Future.Struct() - return Conmon_CreateContainerRequest(s), err +func (f Conmon_CreateContainerRequest_Future) Struct() (Conmon_CreateContainerRequest, error) { + p, err := f.Future.Ptr() + return Conmon_CreateContainerRequest(p.Struct()), err } type Conmon_LogDriver capnp.Struct @@ -1079,9 +1120,9 @@ func NewConmon_LogDriver_List(s *capnp.Segment, sz int32) (Conmon_LogDriver_List // Conmon_LogDriver_Future is a wrapper for a Conmon_LogDriver promised by a client call. type Conmon_LogDriver_Future struct{ *capnp.Future } -func (p Conmon_LogDriver_Future) Struct() (Conmon_LogDriver, error) { - s, err := p.Future.Struct() - return Conmon_LogDriver(s), err +func (f Conmon_LogDriver_Future) Struct() (Conmon_LogDriver, error) { + p, err := f.Future.Ptr() + return Conmon_LogDriver(p.Struct()), err } type Conmon_LogDriver_Type uint16 @@ -1129,12 +1170,12 @@ type Conmon_CreateContainerResponse capnp.Struct const Conmon_CreateContainerResponse_TypeID = 0xde3a625e70772b9a func NewConmon_CreateContainerResponse(s *capnp.Segment) (Conmon_CreateContainerResponse, error) { - st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) return Conmon_CreateContainerResponse(st), err } func NewRootConmon_CreateContainerResponse(s *capnp.Segment) (Conmon_CreateContainerResponse, error) { - st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) return Conmon_CreateContainerResponse(st), err } @@ -1178,21 +1219,39 @@ func (s Conmon_CreateContainerResponse) SetContainerPid(v uint32) { capnp.Struct(s).SetUint32(0, v) } +func (s Conmon_CreateContainerResponse) NamespacesPath() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s Conmon_CreateContainerResponse) HasNamespacesPath() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Conmon_CreateContainerResponse) NamespacesPathBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s Conmon_CreateContainerResponse) SetNamespacesPath(v string) error { + return capnp.Struct(s).SetText(0, v) +} + // Conmon_CreateContainerResponse_List is a list of Conmon_CreateContainerResponse. type Conmon_CreateContainerResponse_List = capnp.StructList[Conmon_CreateContainerResponse] // NewConmon_CreateContainerResponse creates a new list of Conmon_CreateContainerResponse. func NewConmon_CreateContainerResponse_List(s *capnp.Segment, sz int32) (Conmon_CreateContainerResponse_List, error) { - l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) return capnp.StructList[Conmon_CreateContainerResponse](l), err } // Conmon_CreateContainerResponse_Future is a wrapper for a Conmon_CreateContainerResponse promised by a client call. type Conmon_CreateContainerResponse_Future struct{ *capnp.Future } -func (p Conmon_CreateContainerResponse_Future) Struct() (Conmon_CreateContainerResponse, error) { - s, err := p.Future.Struct() - return Conmon_CreateContainerResponse(s), err +func (f Conmon_CreateContainerResponse_Future) Struct() (Conmon_CreateContainerResponse, error) { + p, err := f.Future.Ptr() + return Conmon_CreateContainerResponse(p.Struct()), err } type Conmon_ExecSyncContainerRequest capnp.Struct @@ -1242,19 +1301,6 @@ func (s Conmon_ExecSyncContainerRequest) Message() *capnp.Message { func (s Conmon_ExecSyncContainerRequest) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } -func (s Conmon_ExecSyncContainerRequest) Metadata() ([]byte, error) { - p, err := capnp.Struct(s).Ptr(2) - return []byte(p.Data()), err -} - -func (s Conmon_ExecSyncContainerRequest) HasMetadata() bool { - return capnp.Struct(s).HasPtr(2) -} - -func (s Conmon_ExecSyncContainerRequest) SetMetadata(v []byte) error { - return capnp.Struct(s).SetData(2, v) -} - func (s Conmon_ExecSyncContainerRequest) Id() (string, error) { p, err := capnp.Struct(s).Ptr(0) return p.Text(), err @@ -1304,7 +1350,6 @@ func (s Conmon_ExecSyncContainerRequest) NewCommand(n int32) (capnp.TextList, er err = capnp.Struct(s).SetPtr(1, l.ToPtr()) return l, err } - func (s Conmon_ExecSyncContainerRequest) Terminal() bool { return capnp.Struct(s).Bit(64) } @@ -1313,6 +1358,19 @@ func (s Conmon_ExecSyncContainerRequest) SetTerminal(v bool) { capnp.Struct(s).SetBit(64, v) } +func (s Conmon_ExecSyncContainerRequest) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(2) + return []byte(p.Data()), err +} + +func (s Conmon_ExecSyncContainerRequest) HasMetadata() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s Conmon_ExecSyncContainerRequest) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(2, v) +} + // Conmon_ExecSyncContainerRequest_List is a list of Conmon_ExecSyncContainerRequest. type Conmon_ExecSyncContainerRequest_List = capnp.StructList[Conmon_ExecSyncContainerRequest] @@ -1325,9 +1383,9 @@ func NewConmon_ExecSyncContainerRequest_List(s *capnp.Segment, sz int32) (Conmon // Conmon_ExecSyncContainerRequest_Future is a wrapper for a Conmon_ExecSyncContainerRequest promised by a client call. type Conmon_ExecSyncContainerRequest_Future struct{ *capnp.Future } -func (p Conmon_ExecSyncContainerRequest_Future) Struct() (Conmon_ExecSyncContainerRequest, error) { - s, err := p.Future.Struct() - return Conmon_ExecSyncContainerRequest(s), err +func (f Conmon_ExecSyncContainerRequest_Future) Struct() (Conmon_ExecSyncContainerRequest, error) { + p, err := f.Future.Ptr() + return Conmon_ExecSyncContainerRequest(p.Struct()), err } type Conmon_ExecSyncContainerResponse capnp.Struct @@ -1431,9 +1489,9 @@ func NewConmon_ExecSyncContainerResponse_List(s *capnp.Segment, sz int32) (Conmo // Conmon_ExecSyncContainerResponse_Future is a wrapper for a Conmon_ExecSyncContainerResponse promised by a client call. type Conmon_ExecSyncContainerResponse_Future struct{ *capnp.Future } -func (p Conmon_ExecSyncContainerResponse_Future) Struct() (Conmon_ExecSyncContainerResponse, error) { - s, err := p.Future.Struct() - return Conmon_ExecSyncContainerResponse(s), err +func (f Conmon_ExecSyncContainerResponse_Future) Struct() (Conmon_ExecSyncContainerResponse, error) { + p, err := f.Future.Ptr() + return Conmon_ExecSyncContainerResponse(p.Struct()), err } type Conmon_AttachRequest capnp.Struct @@ -1483,19 +1541,6 @@ func (s Conmon_AttachRequest) Message() *capnp.Message { func (s Conmon_AttachRequest) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } -func (s Conmon_AttachRequest) Metadata() ([]byte, error) { - p, err := capnp.Struct(s).Ptr(3) - return []byte(p.Data()), err -} - -func (s Conmon_AttachRequest) HasMetadata() bool { - return capnp.Struct(s).HasPtr(3) -} - -func (s Conmon_AttachRequest) SetMetadata(v []byte) error { - return capnp.Struct(s).SetData(3, v) -} - func (s Conmon_AttachRequest) Id() (string, error) { p, err := capnp.Struct(s).Ptr(0) return p.Text(), err @@ -1558,6 +1603,19 @@ func (s Conmon_AttachRequest) SetStopAfterStdinEof(v bool) { capnp.Struct(s).SetBit(0, v) } +func (s Conmon_AttachRequest) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(3) + return []byte(p.Data()), err +} + +func (s Conmon_AttachRequest) HasMetadata() bool { + return capnp.Struct(s).HasPtr(3) +} + +func (s Conmon_AttachRequest) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(3, v) +} + // Conmon_AttachRequest_List is a list of Conmon_AttachRequest. type Conmon_AttachRequest_List = capnp.StructList[Conmon_AttachRequest] @@ -1570,9 +1628,9 @@ func NewConmon_AttachRequest_List(s *capnp.Segment, sz int32) (Conmon_AttachRequ // Conmon_AttachRequest_Future is a wrapper for a Conmon_AttachRequest promised by a client call. type Conmon_AttachRequest_Future struct{ *capnp.Future } -func (p Conmon_AttachRequest_Future) Struct() (Conmon_AttachRequest, error) { - s, err := p.Future.Struct() - return Conmon_AttachRequest(s), err +func (f Conmon_AttachRequest_Future) Struct() (Conmon_AttachRequest, error) { + p, err := f.Future.Ptr() + return Conmon_AttachRequest(p.Struct()), err } type Conmon_AttachResponse capnp.Struct @@ -1635,9 +1693,9 @@ func NewConmon_AttachResponse_List(s *capnp.Segment, sz int32) (Conmon_AttachRes // Conmon_AttachResponse_Future is a wrapper for a Conmon_AttachResponse promised by a client call. type Conmon_AttachResponse_Future struct{ *capnp.Future } -func (p Conmon_AttachResponse_Future) Struct() (Conmon_AttachResponse, error) { - s, err := p.Future.Struct() - return Conmon_AttachResponse(s), err +func (f Conmon_AttachResponse_Future) Struct() (Conmon_AttachResponse, error) { + p, err := f.Future.Ptr() + return Conmon_AttachResponse(p.Struct()), err } type Conmon_ReopenLogRequest capnp.Struct @@ -1687,19 +1745,6 @@ func (s Conmon_ReopenLogRequest) Message() *capnp.Message { func (s Conmon_ReopenLogRequest) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } -func (s Conmon_ReopenLogRequest) Metadata() ([]byte, error) { - p, err := capnp.Struct(s).Ptr(1) - return []byte(p.Data()), err -} - -func (s Conmon_ReopenLogRequest) HasMetadata() bool { - return capnp.Struct(s).HasPtr(1) -} - -func (s Conmon_ReopenLogRequest) SetMetadata(v []byte) error { - return capnp.Struct(s).SetData(1, v) -} - func (s Conmon_ReopenLogRequest) Id() (string, error) { p, err := capnp.Struct(s).Ptr(0) return p.Text(), err @@ -1718,6 +1763,19 @@ func (s Conmon_ReopenLogRequest) SetId(v string) error { return capnp.Struct(s).SetText(0, v) } +func (s Conmon_ReopenLogRequest) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s Conmon_ReopenLogRequest) HasMetadata() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s Conmon_ReopenLogRequest) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + // Conmon_ReopenLogRequest_List is a list of Conmon_ReopenLogRequest. type Conmon_ReopenLogRequest_List = capnp.StructList[Conmon_ReopenLogRequest] @@ -1730,9 +1788,9 @@ func NewConmon_ReopenLogRequest_List(s *capnp.Segment, sz int32) (Conmon_ReopenL // Conmon_ReopenLogRequest_Future is a wrapper for a Conmon_ReopenLogRequest promised by a client call. type Conmon_ReopenLogRequest_Future struct{ *capnp.Future } -func (p Conmon_ReopenLogRequest_Future) Struct() (Conmon_ReopenLogRequest, error) { - s, err := p.Future.Struct() - return Conmon_ReopenLogRequest(s), err +func (f Conmon_ReopenLogRequest_Future) Struct() (Conmon_ReopenLogRequest, error) { + p, err := f.Future.Ptr() + return Conmon_ReopenLogRequest(p.Struct()), err } type Conmon_ReopenLogResponse capnp.Struct @@ -1795,9 +1853,9 @@ func NewConmon_ReopenLogResponse_List(s *capnp.Segment, sz int32) (Conmon_Reopen // Conmon_ReopenLogResponse_Future is a wrapper for a Conmon_ReopenLogResponse promised by a client call. type Conmon_ReopenLogResponse_Future struct{ *capnp.Future } -func (p Conmon_ReopenLogResponse_Future) Struct() (Conmon_ReopenLogResponse, error) { - s, err := p.Future.Struct() - return Conmon_ReopenLogResponse(s), err +func (f Conmon_ReopenLogResponse_Future) Struct() (Conmon_ReopenLogResponse, error) { + p, err := f.Future.Ptr() + return Conmon_ReopenLogResponse(p.Struct()), err } type Conmon_SetWindowSizeRequest capnp.Struct @@ -1847,19 +1905,6 @@ func (s Conmon_SetWindowSizeRequest) Message() *capnp.Message { func (s Conmon_SetWindowSizeRequest) Segment() *capnp.Segment { return capnp.Struct(s).Segment() } -func (s Conmon_SetWindowSizeRequest) Metadata() ([]byte, error) { - p, err := capnp.Struct(s).Ptr(1) - return []byte(p.Data()), err -} - -func (s Conmon_SetWindowSizeRequest) HasMetadata() bool { - return capnp.Struct(s).HasPtr(1) -} - -func (s Conmon_SetWindowSizeRequest) SetMetadata(v []byte) error { - return capnp.Struct(s).SetData(1, v) -} - func (s Conmon_SetWindowSizeRequest) Id() (string, error) { p, err := capnp.Struct(s).Ptr(0) return p.Text(), err @@ -1894,6 +1939,19 @@ func (s Conmon_SetWindowSizeRequest) SetHeight(v uint16) { capnp.Struct(s).SetUint16(2, v) } +func (s Conmon_SetWindowSizeRequest) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s Conmon_SetWindowSizeRequest) HasMetadata() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s Conmon_SetWindowSizeRequest) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + // Conmon_SetWindowSizeRequest_List is a list of Conmon_SetWindowSizeRequest. type Conmon_SetWindowSizeRequest_List = capnp.StructList[Conmon_SetWindowSizeRequest] @@ -1906,9 +1964,9 @@ func NewConmon_SetWindowSizeRequest_List(s *capnp.Segment, sz int32) (Conmon_Set // Conmon_SetWindowSizeRequest_Future is a wrapper for a Conmon_SetWindowSizeRequest promised by a client call. type Conmon_SetWindowSizeRequest_Future struct{ *capnp.Future } -func (p Conmon_SetWindowSizeRequest_Future) Struct() (Conmon_SetWindowSizeRequest, error) { - s, err := p.Future.Struct() - return Conmon_SetWindowSizeRequest(s), err +func (f Conmon_SetWindowSizeRequest_Future) Struct() (Conmon_SetWindowSizeRequest, error) { + p, err := f.Future.Ptr() + return Conmon_SetWindowSizeRequest(p.Struct()), err } type Conmon_SetWindowSizeResponse capnp.Struct @@ -1971,42 +2029,380 @@ func NewConmon_SetWindowSizeResponse_List(s *capnp.Segment, sz int32) (Conmon_Se // Conmon_SetWindowSizeResponse_Future is a wrapper for a Conmon_SetWindowSizeResponse promised by a client call. type Conmon_SetWindowSizeResponse_Future struct{ *capnp.Future } -func (p Conmon_SetWindowSizeResponse_Future) Struct() (Conmon_SetWindowSizeResponse, error) { - s, err := p.Future.Struct() - return Conmon_SetWindowSizeResponse(s), err +func (f Conmon_SetWindowSizeResponse_Future) Struct() (Conmon_SetWindowSizeResponse, error) { + p, err := f.Future.Ptr() + return Conmon_SetWindowSizeResponse(p.Struct()), err } -type Conmon_version_Params capnp.Struct +type Conmon_CreateNamespacesRequest capnp.Struct -// Conmon_version_Params_TypeID is the unique identifier for the type Conmon_version_Params. -const Conmon_version_Params_TypeID = 0xcc2f70676afee4e7 +// Conmon_CreateNamespacesRequest_TypeID is the unique identifier for the type Conmon_CreateNamespacesRequest. +const Conmon_CreateNamespacesRequest_TypeID = 0x8b5b1693940f607e -func NewConmon_version_Params(s *capnp.Segment) (Conmon_version_Params, error) { - st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) - return Conmon_version_Params(st), err +func NewConmon_CreateNamespacesRequest(s *capnp.Segment) (Conmon_CreateNamespacesRequest, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return Conmon_CreateNamespacesRequest(st), err } -func NewRootConmon_version_Params(s *capnp.Segment) (Conmon_version_Params, error) { - st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) - return Conmon_version_Params(st), err +func NewRootConmon_CreateNamespacesRequest(s *capnp.Segment) (Conmon_CreateNamespacesRequest, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return Conmon_CreateNamespacesRequest(st), err } -func ReadRootConmon_version_Params(msg *capnp.Message) (Conmon_version_Params, error) { +func ReadRootConmon_CreateNamespacesRequest(msg *capnp.Message) (Conmon_CreateNamespacesRequest, error) { root, err := msg.Root() - return Conmon_version_Params(root.Struct()), err + return Conmon_CreateNamespacesRequest(root.Struct()), err } -func (s Conmon_version_Params) String() string { - str, _ := text.Marshal(0xcc2f70676afee4e7, capnp.Struct(s)) +func (s Conmon_CreateNamespacesRequest) String() string { + str, _ := text.Marshal(0x8b5b1693940f607e, capnp.Struct(s)) return str } -func (s Conmon_version_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { +func (s Conmon_CreateNamespacesRequest) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { return capnp.Struct(s).EncodeAsPtr(seg) } -func (Conmon_version_Params) DecodeFromPtr(p capnp.Ptr) Conmon_version_Params { - return Conmon_version_Params(capnp.Struct{}.DecodeFromPtr(p)) +func (Conmon_CreateNamespacesRequest) DecodeFromPtr(p capnp.Ptr) Conmon_CreateNamespacesRequest { + return Conmon_CreateNamespacesRequest(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Conmon_CreateNamespacesRequest) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Conmon_CreateNamespacesRequest) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Conmon_CreateNamespacesRequest) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Conmon_CreateNamespacesRequest) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Conmon_CreateNamespacesRequest) Metadata() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s Conmon_CreateNamespacesRequest) HasMetadata() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Conmon_CreateNamespacesRequest) SetMetadata(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s Conmon_CreateNamespacesRequest) Namespaces() (Conmon_Namespace_List, error) { + p, err := capnp.Struct(s).Ptr(1) + return Conmon_Namespace_List(p.List()), err +} + +func (s Conmon_CreateNamespacesRequest) HasNamespaces() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s Conmon_CreateNamespacesRequest) SetNamespaces(v Conmon_Namespace_List) error { + return capnp.Struct(s).SetPtr(1, v.ToPtr()) +} + +// NewNamespaces sets the namespaces field to a newly +// allocated Conmon_Namespace_List, preferring placement in s's segment. +func (s Conmon_CreateNamespacesRequest) NewNamespaces(n int32) (Conmon_Namespace_List, error) { + l, err := NewConmon_Namespace_List(capnp.Struct(s).Segment(), n) + if err != nil { + return Conmon_Namespace_List{}, err + } + err = capnp.Struct(s).SetPtr(1, l.ToPtr()) + return l, err +} + +// Conmon_CreateNamespacesRequest_List is a list of Conmon_CreateNamespacesRequest. +type Conmon_CreateNamespacesRequest_List = capnp.StructList[Conmon_CreateNamespacesRequest] + +// NewConmon_CreateNamespacesRequest creates a new list of Conmon_CreateNamespacesRequest. +func NewConmon_CreateNamespacesRequest_List(s *capnp.Segment, sz int32) (Conmon_CreateNamespacesRequest_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[Conmon_CreateNamespacesRequest](l), err +} + +// Conmon_CreateNamespacesRequest_Future is a wrapper for a Conmon_CreateNamespacesRequest promised by a client call. +type Conmon_CreateNamespacesRequest_Future struct{ *capnp.Future } + +func (f Conmon_CreateNamespacesRequest_Future) Struct() (Conmon_CreateNamespacesRequest, error) { + p, err := f.Future.Ptr() + return Conmon_CreateNamespacesRequest(p.Struct()), err +} + +type Conmon_Namespace uint16 + +// Conmon_Namespace_TypeID is the unique identifier for the type Conmon_Namespace. +const Conmon_Namespace_TypeID = 0xd61491b560a8f3a3 + +// Values of Conmon_Namespace. +const ( + Conmon_Namespace_ipc Conmon_Namespace = 0 + Conmon_Namespace_net Conmon_Namespace = 1 + Conmon_Namespace_pid Conmon_Namespace = 2 + Conmon_Namespace_user Conmon_Namespace = 3 + Conmon_Namespace_uts Conmon_Namespace = 4 +) + +// String returns the enum's constant name. +func (c Conmon_Namespace) String() string { + switch c { + case Conmon_Namespace_ipc: + return "ipc" + case Conmon_Namespace_net: + return "net" + case Conmon_Namespace_pid: + return "pid" + case Conmon_Namespace_user: + return "user" + case Conmon_Namespace_uts: + return "uts" + + default: + return "" + } +} + +// Conmon_NamespaceFromString returns the enum value with a name, +// or the zero value if there's no such value. +func Conmon_NamespaceFromString(c string) Conmon_Namespace { + switch c { + case "ipc": + return Conmon_Namespace_ipc + case "net": + return Conmon_Namespace_net + case "pid": + return Conmon_Namespace_pid + case "user": + return Conmon_Namespace_user + case "uts": + return Conmon_Namespace_uts + + default: + return 0 + } +} + +type Conmon_Namespace_List = capnp.EnumList[Conmon_Namespace] + +func NewConmon_Namespace_List(s *capnp.Segment, sz int32) (Conmon_Namespace_List, error) { + return capnp.NewEnumList[Conmon_Namespace](s, sz) +} + +type Conmon_CreateNamespacesResponse capnp.Struct + +// Conmon_CreateNamespacesResponse_TypeID is the unique identifier for the type Conmon_CreateNamespacesResponse. +const Conmon_CreateNamespacesResponse_TypeID = 0x9887a60f577a1ecb + +func NewConmon_CreateNamespacesResponse(s *capnp.Segment) (Conmon_CreateNamespacesResponse, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_CreateNamespacesResponse(st), err +} + +func NewRootConmon_CreateNamespacesResponse(s *capnp.Segment) (Conmon_CreateNamespacesResponse, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_CreateNamespacesResponse(st), err +} + +func ReadRootConmon_CreateNamespacesResponse(msg *capnp.Message) (Conmon_CreateNamespacesResponse, error) { + root, err := msg.Root() + return Conmon_CreateNamespacesResponse(root.Struct()), err +} + +func (s Conmon_CreateNamespacesResponse) String() string { + str, _ := text.Marshal(0x9887a60f577a1ecb, capnp.Struct(s)) + return str +} + +func (s Conmon_CreateNamespacesResponse) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Conmon_CreateNamespacesResponse) DecodeFromPtr(p capnp.Ptr) Conmon_CreateNamespacesResponse { + return Conmon_CreateNamespacesResponse(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Conmon_CreateNamespacesResponse) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Conmon_CreateNamespacesResponse) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Conmon_CreateNamespacesResponse) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Conmon_CreateNamespacesResponse) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Conmon_CreateNamespacesResponse) Namespaces() (Conmon_NamespaceResponse_List, error) { + p, err := capnp.Struct(s).Ptr(0) + return Conmon_NamespaceResponse_List(p.List()), err +} + +func (s Conmon_CreateNamespacesResponse) HasNamespaces() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Conmon_CreateNamespacesResponse) SetNamespaces(v Conmon_NamespaceResponse_List) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewNamespaces sets the namespaces field to a newly +// allocated Conmon_NamespaceResponse_List, preferring placement in s's segment. +func (s Conmon_CreateNamespacesResponse) NewNamespaces(n int32) (Conmon_NamespaceResponse_List, error) { + l, err := NewConmon_NamespaceResponse_List(capnp.Struct(s).Segment(), n) + if err != nil { + return Conmon_NamespaceResponse_List{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} + +// Conmon_CreateNamespacesResponse_List is a list of Conmon_CreateNamespacesResponse. +type Conmon_CreateNamespacesResponse_List = capnp.StructList[Conmon_CreateNamespacesResponse] + +// NewConmon_CreateNamespacesResponse creates a new list of Conmon_CreateNamespacesResponse. +func NewConmon_CreateNamespacesResponse_List(s *capnp.Segment, sz int32) (Conmon_CreateNamespacesResponse_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[Conmon_CreateNamespacesResponse](l), err +} + +// Conmon_CreateNamespacesResponse_Future is a wrapper for a Conmon_CreateNamespacesResponse promised by a client call. +type Conmon_CreateNamespacesResponse_Future struct{ *capnp.Future } + +func (f Conmon_CreateNamespacesResponse_Future) Struct() (Conmon_CreateNamespacesResponse, error) { + p, err := f.Future.Ptr() + return Conmon_CreateNamespacesResponse(p.Struct()), err +} + +type Conmon_NamespaceResponse capnp.Struct + +// Conmon_NamespaceResponse_TypeID is the unique identifier for the type Conmon_NamespaceResponse. +const Conmon_NamespaceResponse_TypeID = 0xa93853d6a4e3fa16 + +func NewConmon_NamespaceResponse(s *capnp.Segment) (Conmon_NamespaceResponse, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Conmon_NamespaceResponse(st), err +} + +func NewRootConmon_NamespaceResponse(s *capnp.Segment) (Conmon_NamespaceResponse, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Conmon_NamespaceResponse(st), err +} + +func ReadRootConmon_NamespaceResponse(msg *capnp.Message) (Conmon_NamespaceResponse, error) { + root, err := msg.Root() + return Conmon_NamespaceResponse(root.Struct()), err +} + +func (s Conmon_NamespaceResponse) String() string { + str, _ := text.Marshal(0xa93853d6a4e3fa16, capnp.Struct(s)) + return str +} + +func (s Conmon_NamespaceResponse) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Conmon_NamespaceResponse) DecodeFromPtr(p capnp.Ptr) Conmon_NamespaceResponse { + return Conmon_NamespaceResponse(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Conmon_NamespaceResponse) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Conmon_NamespaceResponse) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Conmon_NamespaceResponse) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Conmon_NamespaceResponse) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Conmon_NamespaceResponse) Type() Conmon_Namespace { + return Conmon_Namespace(capnp.Struct(s).Uint16(0)) +} + +func (s Conmon_NamespaceResponse) SetType(v Conmon_Namespace) { + capnp.Struct(s).SetUint16(0, uint16(v)) +} + +func (s Conmon_NamespaceResponse) Path() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s Conmon_NamespaceResponse) HasPath() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Conmon_NamespaceResponse) PathBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s Conmon_NamespaceResponse) SetPath(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +// Conmon_NamespaceResponse_List is a list of Conmon_NamespaceResponse. +type Conmon_NamespaceResponse_List = capnp.StructList[Conmon_NamespaceResponse] + +// NewConmon_NamespaceResponse creates a new list of Conmon_NamespaceResponse. +func NewConmon_NamespaceResponse_List(s *capnp.Segment, sz int32) (Conmon_NamespaceResponse_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return capnp.StructList[Conmon_NamespaceResponse](l), err +} + +// Conmon_NamespaceResponse_Future is a wrapper for a Conmon_NamespaceResponse promised by a client call. +type Conmon_NamespaceResponse_Future struct{ *capnp.Future } + +func (f Conmon_NamespaceResponse_Future) Struct() (Conmon_NamespaceResponse, error) { + p, err := f.Future.Ptr() + return Conmon_NamespaceResponse(p.Struct()), err +} + +type Conmon_version_Params capnp.Struct + +// Conmon_version_Params_TypeID is the unique identifier for the type Conmon_version_Params. +const Conmon_version_Params_TypeID = 0xcc2f70676afee4e7 + +func NewConmon_version_Params(s *capnp.Segment) (Conmon_version_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_version_Params(st), err +} + +func NewRootConmon_version_Params(s *capnp.Segment) (Conmon_version_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_version_Params(st), err +} + +func ReadRootConmon_version_Params(msg *capnp.Message) (Conmon_version_Params, error) { + root, err := msg.Root() + return Conmon_version_Params(root.Struct()), err +} + +func (s Conmon_version_Params) String() string { + str, _ := text.Marshal(0xcc2f70676afee4e7, capnp.Struct(s)) + return str +} + +func (s Conmon_version_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Conmon_version_Params) DecodeFromPtr(p capnp.Ptr) Conmon_version_Params { + return Conmon_version_Params(capnp.Struct{}.DecodeFromPtr(p)) } func (s Conmon_version_Params) ToPtr() capnp.Ptr { @@ -2059,11 +2455,10 @@ func NewConmon_version_Params_List(s *capnp.Segment, sz int32) (Conmon_version_P // Conmon_version_Params_Future is a wrapper for a Conmon_version_Params promised by a client call. type Conmon_version_Params_Future struct{ *capnp.Future } -func (p Conmon_version_Params_Future) Struct() (Conmon_version_Params, error) { - s, err := p.Future.Struct() - return Conmon_version_Params(s), err +func (f Conmon_version_Params_Future) Struct() (Conmon_version_Params, error) { + p, err := f.Future.Ptr() + return Conmon_version_Params(p.Struct()), err } - func (p Conmon_version_Params_Future) Request() Conmon_VersionRequest_Future { return Conmon_VersionRequest_Future{Future: p.Future.Field(0, nil)} } @@ -2151,11 +2546,10 @@ func NewConmon_version_Results_List(s *capnp.Segment, sz int32) (Conmon_version_ // Conmon_version_Results_Future is a wrapper for a Conmon_version_Results promised by a client call. type Conmon_version_Results_Future struct{ *capnp.Future } -func (p Conmon_version_Results_Future) Struct() (Conmon_version_Results, error) { - s, err := p.Future.Struct() - return Conmon_version_Results(s), err +func (f Conmon_version_Results_Future) Struct() (Conmon_version_Results, error) { + p, err := f.Future.Ptr() + return Conmon_version_Results(p.Struct()), err } - func (p Conmon_version_Results_Future) Response() Conmon_VersionResponse_Future { return Conmon_VersionResponse_Future{Future: p.Future.Field(0, nil)} } @@ -2243,11 +2637,10 @@ func NewConmon_createContainer_Params_List(s *capnp.Segment, sz int32) (Conmon_c // Conmon_createContainer_Params_Future is a wrapper for a Conmon_createContainer_Params promised by a client call. type Conmon_createContainer_Params_Future struct{ *capnp.Future } -func (p Conmon_createContainer_Params_Future) Struct() (Conmon_createContainer_Params, error) { - s, err := p.Future.Struct() - return Conmon_createContainer_Params(s), err +func (f Conmon_createContainer_Params_Future) Struct() (Conmon_createContainer_Params, error) { + p, err := f.Future.Ptr() + return Conmon_createContainer_Params(p.Struct()), err } - func (p Conmon_createContainer_Params_Future) Request() Conmon_CreateContainerRequest_Future { return Conmon_CreateContainerRequest_Future{Future: p.Future.Field(0, nil)} } @@ -2335,11 +2728,10 @@ func NewConmon_createContainer_Results_List(s *capnp.Segment, sz int32) (Conmon_ // Conmon_createContainer_Results_Future is a wrapper for a Conmon_createContainer_Results promised by a client call. type Conmon_createContainer_Results_Future struct{ *capnp.Future } -func (p Conmon_createContainer_Results_Future) Struct() (Conmon_createContainer_Results, error) { - s, err := p.Future.Struct() - return Conmon_createContainer_Results(s), err +func (f Conmon_createContainer_Results_Future) Struct() (Conmon_createContainer_Results, error) { + p, err := f.Future.Ptr() + return Conmon_createContainer_Results(p.Struct()), err } - func (p Conmon_createContainer_Results_Future) Response() Conmon_CreateContainerResponse_Future { return Conmon_CreateContainerResponse_Future{Future: p.Future.Field(0, nil)} } @@ -2427,11 +2819,10 @@ func NewConmon_execSyncContainer_Params_List(s *capnp.Segment, sz int32) (Conmon // Conmon_execSyncContainer_Params_Future is a wrapper for a Conmon_execSyncContainer_Params promised by a client call. type Conmon_execSyncContainer_Params_Future struct{ *capnp.Future } -func (p Conmon_execSyncContainer_Params_Future) Struct() (Conmon_execSyncContainer_Params, error) { - s, err := p.Future.Struct() - return Conmon_execSyncContainer_Params(s), err +func (f Conmon_execSyncContainer_Params_Future) Struct() (Conmon_execSyncContainer_Params, error) { + p, err := f.Future.Ptr() + return Conmon_execSyncContainer_Params(p.Struct()), err } - func (p Conmon_execSyncContainer_Params_Future) Request() Conmon_ExecSyncContainerRequest_Future { return Conmon_ExecSyncContainerRequest_Future{Future: p.Future.Field(0, nil)} } @@ -2519,11 +2910,10 @@ func NewConmon_execSyncContainer_Results_List(s *capnp.Segment, sz int32) (Conmo // Conmon_execSyncContainer_Results_Future is a wrapper for a Conmon_execSyncContainer_Results promised by a client call. type Conmon_execSyncContainer_Results_Future struct{ *capnp.Future } -func (p Conmon_execSyncContainer_Results_Future) Struct() (Conmon_execSyncContainer_Results, error) { - s, err := p.Future.Struct() - return Conmon_execSyncContainer_Results(s), err +func (f Conmon_execSyncContainer_Results_Future) Struct() (Conmon_execSyncContainer_Results, error) { + p, err := f.Future.Ptr() + return Conmon_execSyncContainer_Results(p.Struct()), err } - func (p Conmon_execSyncContainer_Results_Future) Response() Conmon_ExecSyncContainerResponse_Future { return Conmon_ExecSyncContainerResponse_Future{Future: p.Future.Field(0, nil)} } @@ -2611,11 +3001,10 @@ func NewConmon_attachContainer_Params_List(s *capnp.Segment, sz int32) (Conmon_a // Conmon_attachContainer_Params_Future is a wrapper for a Conmon_attachContainer_Params promised by a client call. type Conmon_attachContainer_Params_Future struct{ *capnp.Future } -func (p Conmon_attachContainer_Params_Future) Struct() (Conmon_attachContainer_Params, error) { - s, err := p.Future.Struct() - return Conmon_attachContainer_Params(s), err +func (f Conmon_attachContainer_Params_Future) Struct() (Conmon_attachContainer_Params, error) { + p, err := f.Future.Ptr() + return Conmon_attachContainer_Params(p.Struct()), err } - func (p Conmon_attachContainer_Params_Future) Request() Conmon_AttachRequest_Future { return Conmon_AttachRequest_Future{Future: p.Future.Field(0, nil)} } @@ -2703,11 +3092,10 @@ func NewConmon_attachContainer_Results_List(s *capnp.Segment, sz int32) (Conmon_ // Conmon_attachContainer_Results_Future is a wrapper for a Conmon_attachContainer_Results promised by a client call. type Conmon_attachContainer_Results_Future struct{ *capnp.Future } -func (p Conmon_attachContainer_Results_Future) Struct() (Conmon_attachContainer_Results, error) { - s, err := p.Future.Struct() - return Conmon_attachContainer_Results(s), err +func (f Conmon_attachContainer_Results_Future) Struct() (Conmon_attachContainer_Results, error) { + p, err := f.Future.Ptr() + return Conmon_attachContainer_Results(p.Struct()), err } - func (p Conmon_attachContainer_Results_Future) Response() Conmon_AttachResponse_Future { return Conmon_AttachResponse_Future{Future: p.Future.Field(0, nil)} } @@ -2795,11 +3183,10 @@ func NewConmon_reopenLogContainer_Params_List(s *capnp.Segment, sz int32) (Conmo // Conmon_reopenLogContainer_Params_Future is a wrapper for a Conmon_reopenLogContainer_Params promised by a client call. type Conmon_reopenLogContainer_Params_Future struct{ *capnp.Future } -func (p Conmon_reopenLogContainer_Params_Future) Struct() (Conmon_reopenLogContainer_Params, error) { - s, err := p.Future.Struct() - return Conmon_reopenLogContainer_Params(s), err +func (f Conmon_reopenLogContainer_Params_Future) Struct() (Conmon_reopenLogContainer_Params, error) { + p, err := f.Future.Ptr() + return Conmon_reopenLogContainer_Params(p.Struct()), err } - func (p Conmon_reopenLogContainer_Params_Future) Request() Conmon_ReopenLogRequest_Future { return Conmon_ReopenLogRequest_Future{Future: p.Future.Field(0, nil)} } @@ -2887,11 +3274,10 @@ func NewConmon_reopenLogContainer_Results_List(s *capnp.Segment, sz int32) (Conm // Conmon_reopenLogContainer_Results_Future is a wrapper for a Conmon_reopenLogContainer_Results promised by a client call. type Conmon_reopenLogContainer_Results_Future struct{ *capnp.Future } -func (p Conmon_reopenLogContainer_Results_Future) Struct() (Conmon_reopenLogContainer_Results, error) { - s, err := p.Future.Struct() - return Conmon_reopenLogContainer_Results(s), err +func (f Conmon_reopenLogContainer_Results_Future) Struct() (Conmon_reopenLogContainer_Results, error) { + p, err := f.Future.Ptr() + return Conmon_reopenLogContainer_Results(p.Struct()), err } - func (p Conmon_reopenLogContainer_Results_Future) Response() Conmon_ReopenLogResponse_Future { return Conmon_ReopenLogResponse_Future{Future: p.Future.Field(0, nil)} } @@ -2979,11 +3365,10 @@ func NewConmon_setWindowSizeContainer_Params_List(s *capnp.Segment, sz int32) (C // Conmon_setWindowSizeContainer_Params_Future is a wrapper for a Conmon_setWindowSizeContainer_Params promised by a client call. type Conmon_setWindowSizeContainer_Params_Future struct{ *capnp.Future } -func (p Conmon_setWindowSizeContainer_Params_Future) Struct() (Conmon_setWindowSizeContainer_Params, error) { - s, err := p.Future.Struct() - return Conmon_setWindowSizeContainer_Params(s), err +func (f Conmon_setWindowSizeContainer_Params_Future) Struct() (Conmon_setWindowSizeContainer_Params, error) { + p, err := f.Future.Ptr() + return Conmon_setWindowSizeContainer_Params(p.Struct()), err } - func (p Conmon_setWindowSizeContainer_Params_Future) Request() Conmon_SetWindowSizeRequest_Future { return Conmon_SetWindowSizeRequest_Future{Future: p.Future.Field(0, nil)} } @@ -3071,170 +3456,379 @@ func NewConmon_setWindowSizeContainer_Results_List(s *capnp.Segment, sz int32) ( // Conmon_setWindowSizeContainer_Results_Future is a wrapper for a Conmon_setWindowSizeContainer_Results promised by a client call. type Conmon_setWindowSizeContainer_Results_Future struct{ *capnp.Future } -func (p Conmon_setWindowSizeContainer_Results_Future) Struct() (Conmon_setWindowSizeContainer_Results, error) { - s, err := p.Future.Struct() - return Conmon_setWindowSizeContainer_Results(s), err +func (f Conmon_setWindowSizeContainer_Results_Future) Struct() (Conmon_setWindowSizeContainer_Results, error) { + p, err := f.Future.Ptr() + return Conmon_setWindowSizeContainer_Results(p.Struct()), err } - func (p Conmon_setWindowSizeContainer_Results_Future) Response() Conmon_SetWindowSizeResponse_Future { return Conmon_SetWindowSizeResponse_Future{Future: p.Future.Field(0, nil)} } -const schema_ffaaf7385bc4adad = "x\xda\xb4X\x7f\x8c\x14W\x1d\xff~\xdf\xec\xde\xec\x9d" + - "\xdc\xed\xbe\xce^,\x97\x92C\x02\x0d\xbf\xda\x03\x96Z" + - "\xb8\x1c\xb9;\x8e\x0b\x82\xa0;\xbbP\x0d\xb4\xa4\xc3\xee" + - "\xe3n\xe8\xee\xcc\xde\xcc,wG\xdb\x00-\xc4Rm" + - "\x15\x821\x90\x92P\xb5M\xc1\"\xc5Z\xac\xa8M\xb0" + - "%*\x16-$mm\x13\x7fT\xc4\"1\xd5\xc66" + - "\x82A\xc7\xbc\x99\x9d\x1f\xb7wi\xf7\xee\xf4\xbf\xdb\xcf" + - "|\xe6\xfb\xde\xfb\xbc\xef\x8f\xcf\xdc\x82\xa3u]\x91\x85" + - "\x8d'\x1a\x80\xc8\x0fD\xebl\xf3\x9da\xe3\xe9\xc3+" + - "\x1f\x06:\x0f\x01\xa2(\x02\xa4\x96Eg\x10@i}" + - "\xb4\x13\xd0\xde\xf3\x97\xcf\x9dZ\xff\xf0\xdf\x8e\x84\x09\xe5" + - "\xe8\"Nx\xcc!\x1c\xdcx\xe5\xbe\xdeU\xf1or" + - "\x82\xfd~j\xcbo\x0f^\xb9\xf3\x07\x10\xe1\xbc\x93\xd1" + - "\xab(\x9d\x8f\x8a \xd83O\xbc|\xe1\xd1\x8e\xb6c" + - "\xe10G\xa37\xf10g\x9c0\x83\xf7\xfe\xfc\xc4v" + - "\xf9\xf2\xb3c\x84y'z\x11\xa5\x7f;a\xa4\x15\x0b" + - "~\xf8Fj\xeeq\x90\xe7a\x88\xe6\xc6{\x8b\xf3>" + - "\x8c\x8a\x00\xd2\xfb\xd1A@{\xf1\x93\xcf\x9fz\xfc\xbd" + - "\xa1\xefr6\xa9f\xcbu\xc7PR\xeb>\x09 \x0d" + - "\xd4\x9d\x00\xb4\xef\xbfp\xf5\x99\xc7\xbf\xdc\xfdBul" + - "\xc2\xd9\xf5\"!\xd2,\x91\xc7\xfe\x94\xf8.\x84\x9e\xd3" + - "\x99\x82}\xfc\xf8+\x1b\x97\xfc\xf3\x98\x0d\x80\xa9\xeb\xe2" + - "\x06\x94\x1aco\x02\xa4\xb0\xfeK(\xd1\x06\x11\xc0>" + - "w\xeah\xfb\xbf.\x0d\x9e\xae\x0e^\xcf\x83_\xaf\xbf" + - "\x89HS9/\xd5\xdc\xa0\x13@;\xb1\xf1\xd7\xcb\xfe" + - "\xba\xe9\xcfg\xc3r\xd1\xc6\x16.\xd7\x9cF.\xd7\xbb" + - "\xca\x8fH\xef\xf9\xc2\xcf\xc2\x84\xb5\x8d\xab9Au\x09" + - "\x7f\xfa\xcf\xd6\xbeR\xdb\xaba\xc2\xde\xc6\x8b\x08(\x1d" + - "v\x08\xd7\x9a_\xfaFK\xc7\xe9_\x85\x09?q\x97" + - "x\xdd!\xb4t_X\x1c\xd7V\xbe6\xf2F\\9" + - "\xae7\xfe\x11\xa5\xe6&.\x07m\xe2R\xdf\xd8\xd3\xb1" + - "s\xda\xb47\xde\x1aS\xbc\x81\xa6\xb9D\xda\xe7\xb0\x1f" + - "k\xe2\xe2\x1d\x9a7X\xda\xb4\xb9\xfdwUl\xe7\xb6" + - "\xd5x\x0b\x91\xf6\xc69yO\x9c\xef\xe3F\xfb\x8d\x97" + - "\x8et\x94~_\x1d\xdaa\x1f\x8d\x9fC\xe9,g\xa7" + - "\xce\xc4[\x11\xd0^_ZIo\xcd4\xfd!|\xae" + - "\xcb\x89\x0c?\x17R\x1eo\xc1\xfd+\x8fnR\xa5K" + - "a\xc2,\xfa6Wf\xa9C\xf8\xb4\xf4\xf2s\xda\xbe" + - "\xab\x97\xc3\x84{\xe8\\\x1e\xa1\xec\x10\xcelL\xa5\xdf" + - "\xbct\xeb\xdf\x81\xdeA\x82$\x03L}\x9d^D\xe9" + - "$\xe5{?N[\x01\xed\x0b\xef\xb5>\xfb\xcb\xcb\x9f" + - "\xfd\xc7\x98\xd7~\x9c\xbe\x8d\xd2/8;u\x96\xde\xc9" + - "\xaf\xfd\xe9\x81o}\xed\xda\x0c\xfaAu\xc2\x0a\x9c3" + - "59\x83HK\x93\xfc\xcf;\x92\xceQ_\x0d\x84\xae\x15" + - "y7\xe1\x17\xd5\x85v\xae\xa2>Vt\x84.\xb4\xbd" + - "\x99\x84\x9e\xbaht\xa1\xed\xf5\xdc0\xd3\xf0e\xabP" + - "\x05\xc6\xa9\xe6\x08\x89zt\xad\xd3}\xa5\x0b\xc7\xdb\xe8" + - "\xab\x13(\xd4<\xe7{u.\xcd\xc2\x16\x80\xect\x14" + - "0;\x1f+\xfd\x88\xe3sp\x03@v6\xc7\x17#" + - "A\x14\x9cj\x97\x16\xe2j\x80\xec\x02\x0ewpz\xc4" + - "\xadxi).\x02\xc8.\xe6x\x17\xc7\xa3$\x89\x11" + - "\x00i\x19f\x00\xb2\x1d\x1c\xff\"\xc7\xeb\x84$F\x01" + - "\xa4\xf5\xb8\x15 \xbb\x8e\xe3%\x8e\x8b\x91$\xd6\x01H" + - "Eg\xd9\x02\xc7\x1f\xe1x,\x9aD\xc7\x9e9\xf8n" + - "\x8e\x1f\xe1x}]\x12c\x00\xd2a\x07\x7f\x82\xe3/" + - "r\xbcALb=\x80\xf4\x02n\x06\xc8~\x9f\xe3\xaf" + - "!\xc1D,\x89\x0d\x00\xd2yg\xfb\xafr\xf878" + - "\xa27\xd9\x9b\xcbZ\xbe\xc0\xd2\x0a\x08A\x93\xb5-f" + - "\x14UM)\xf0\x9eT\x99\x1e\xad\xa6\x95W5\x7f\x96" + - "\xb0!\xd5J+V?\xa0\x89M\x80i\x01\x9d\x97\x9b" + - "\x00m]/\xf6\xf2\xa7\x10W\xac\xfeQO\x0b^\x19" + - "\x0b\x86\xff,\x11vx\x0e+W`\x8aV.\xf5\x80" + - "P\xccWG\xe8+\xe8\x9b\x95B\xb7\x01B\xdf\xa8\xe8" + - "<9\x14-\xdf\x0d\xa21\xfa\xe1Gu\xda\x898\x88" + - "\x0c3\xcb\x05\xa1V\xf7\xe3\xb7\xce*\x1b\x11\xabae" + - "3<\xb8\xaa,\x8c\x09\xf0\xf1\x1e\xc6o\xc8\x13\xf00" + - "\x95\xc2\xaf\xdd0\xf9\xc3h\x02&37\xb2x\xc7\xa9" + - "\xb1?\xd2&\xe70\x07\xca\"3\xab\xddVK\xe0\xb6" + - "\x128\xdam\x85kj\xb2\x896\xc6\x14\x0bL/7" + - "+\x15%\x94\xd5\x811\xf1\\V\xd8\x97\xf8.\xab\xc8" + - "\xc1~\x01e\x8b;\x98\xe9\xae[\x19\xe0o\x97\x04\x94" + - "\x1f n=\xf7\xe8yG\xc7\x08\x10\x8c\x00v\x9aV" + - "^/[\xde\x09\xf8Of\x18\xfe\x81,\xb5\xc8\xf2\x9f" + - "/[\xa1\x1e1\xb96\xcd/Rp\x8f\x18\xba\xec\xad" + - "\xa1\xcb\xceU\xc8\x107\xd2j\x1ec@06AC" + - "^\x19\xe2|\xb1\xa4\x7f\xc7\x0f\xf2;\x1e\x12P\xde\x1d" + - "L\x04\xbak\x03\x80\xbcS@\xf9+\\;\xe2\x0a\xba" + - "\xd7\x00\x90\x1f\x11P>@\x10#\xae\x9e\xfb\xf6\x03\xc8" + - "\x07\x04\x94\x8f\x10L\x08\xce\x1c\xa0\x87\xb9\xc6O\x08(" + - "?32CL=w\x1f\xb3\xaa\xba\xae3C\x99i" + - "B\xab\xaak\xabBdK/uo\xb1\x18\x1aY\xde" + - "\x83{u\xdcR\x93\xa7\x9fDgq\xca\xce\xc2\x1a\xcb" + - "\xcewx\x93\xe8.\xe3+t\xdf\xe2\xfeo\xbec\xd3" + - "J\xdc\xa8\xe9\xfb\xd9\xb7\xbc\x138\xa9g`\x8d\xdb\xd7" + - "\x0d\x97\xd0\xcds'\x99\xa2\x17\x01\xfc\xdc&F\xa6\xac" + - "\xf1\xdaZ\xa5Y\xcc\xd8\xa2\xe4\x90M\xec\x931TN" + - "\xb3}\xdbS\xef\xf8\x92\x187\x02I\xf4\xbfp$\x8a" + - "\xcb\x01\xb2S8|3\x06\x1f9R3\xce\x00\xc8&" + - "8~\x8bc{\x88k{\xa6b;@6\xc9\xf1\xe9" + - "\x8e\xedq\xd3]\x9a\xe6\x84\xbf\x85\xe3\xb3\x1d\xdb\x13q" + - "m\xcf,\x87\x1f\xb8-1\xea\xda\x9e9\x8e]\xf1\xdd" + - "\x16\x8d\xd5\xb9\xb6g\xa1c\x93\x02\xbbU/\xba\xb6g" + - "\xa9\x13\x7f\x09\xc7WT\xec\x0dw=\xdd\x8e\xbd\xe9\xe2" + - "\xf0\x1a$h\x97\x0c=\xc7Ls\x15\xa0\xdf$<\xfb" + - "\xea\x15\x95h)}\xde\xdf\x9d\\T\xd5\x0aY\"\xb5" + - "\x90_\xa1X\x80\xcc\xa7X\x8a\xd1\xc7\x02\x8aQ6-" + - "\xae4\x88\xa1\x98vN1\xfa\xf4\xbb\x98\x01qs\x14" + - "\xbc\xce`\xa1x\xff\x8f\x11\x11L\xad\xb1;\x9a\xf79" + - ";\xb2\xa1U&\xc4^\x9e\xef\xbb\xdd\xe6E#]n" + - "G\x0bw\xaf\x84\xebl\xe9S\x1c\xfb\xb6\x80\xf2s#" + - ";\x1aOY\xbdleA`9\xef\xe3|G\xc5\x8e" + - "U\x1b\xb11\xec\xe5\xa4\x05\xa96\x0e5\xbb\x15\xff\x03" + - "y\x02\xadd\xf4\x7f\xe22\xcc\x8c\xd7\xfe\x1f1\xffC" + - "{\x02kW\xfd3\xc3\x0b\x9bF\xfco\x00\x00\x00\xff" + - "\xff\x9e\x9f\xe5\xa3" +type Conmon_createNamespaces_Params capnp.Struct + +// Conmon_createNamespaces_Params_TypeID is the unique identifier for the type Conmon_createNamespaces_Params. +const Conmon_createNamespaces_Params_TypeID = 0x8b4c03a0662a38dc + +func NewConmon_createNamespaces_Params(s *capnp.Segment) (Conmon_createNamespaces_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_createNamespaces_Params(st), err +} + +func NewRootConmon_createNamespaces_Params(s *capnp.Segment) (Conmon_createNamespaces_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_createNamespaces_Params(st), err +} + +func ReadRootConmon_createNamespaces_Params(msg *capnp.Message) (Conmon_createNamespaces_Params, error) { + root, err := msg.Root() + return Conmon_createNamespaces_Params(root.Struct()), err +} + +func (s Conmon_createNamespaces_Params) String() string { + str, _ := text.Marshal(0x8b4c03a0662a38dc, capnp.Struct(s)) + return str +} + +func (s Conmon_createNamespaces_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Conmon_createNamespaces_Params) DecodeFromPtr(p capnp.Ptr) Conmon_createNamespaces_Params { + return Conmon_createNamespaces_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Conmon_createNamespaces_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Conmon_createNamespaces_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Conmon_createNamespaces_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Conmon_createNamespaces_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Conmon_createNamespaces_Params) Request() (Conmon_CreateNamespacesRequest, error) { + p, err := capnp.Struct(s).Ptr(0) + return Conmon_CreateNamespacesRequest(p.Struct()), err +} + +func (s Conmon_createNamespaces_Params) HasRequest() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Conmon_createNamespaces_Params) SetRequest(v Conmon_CreateNamespacesRequest) error { + return capnp.Struct(s).SetPtr(0, capnp.Struct(v).ToPtr()) +} + +// NewRequest sets the request field to a newly +// allocated Conmon_CreateNamespacesRequest struct, preferring placement in s's segment. +func (s Conmon_createNamespaces_Params) NewRequest() (Conmon_CreateNamespacesRequest, error) { + ss, err := NewConmon_CreateNamespacesRequest(capnp.Struct(s).Segment()) + if err != nil { + return Conmon_CreateNamespacesRequest{}, err + } + err = capnp.Struct(s).SetPtr(0, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// Conmon_createNamespaces_Params_List is a list of Conmon_createNamespaces_Params. +type Conmon_createNamespaces_Params_List = capnp.StructList[Conmon_createNamespaces_Params] + +// NewConmon_createNamespaces_Params creates a new list of Conmon_createNamespaces_Params. +func NewConmon_createNamespaces_Params_List(s *capnp.Segment, sz int32) (Conmon_createNamespaces_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[Conmon_createNamespaces_Params](l), err +} + +// Conmon_createNamespaces_Params_Future is a wrapper for a Conmon_createNamespaces_Params promised by a client call. +type Conmon_createNamespaces_Params_Future struct{ *capnp.Future } + +func (f Conmon_createNamespaces_Params_Future) Struct() (Conmon_createNamespaces_Params, error) { + p, err := f.Future.Ptr() + return Conmon_createNamespaces_Params(p.Struct()), err +} +func (p Conmon_createNamespaces_Params_Future) Request() Conmon_CreateNamespacesRequest_Future { + return Conmon_CreateNamespacesRequest_Future{Future: p.Future.Field(0, nil)} +} + +type Conmon_createNamespaces_Results capnp.Struct + +// Conmon_createNamespaces_Results_TypeID is the unique identifier for the type Conmon_createNamespaces_Results. +const Conmon_createNamespaces_Results_TypeID = 0x8aef91973dc8a4f5 + +func NewConmon_createNamespaces_Results(s *capnp.Segment) (Conmon_createNamespaces_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_createNamespaces_Results(st), err +} + +func NewRootConmon_createNamespaces_Results(s *capnp.Segment) (Conmon_createNamespaces_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return Conmon_createNamespaces_Results(st), err +} + +func ReadRootConmon_createNamespaces_Results(msg *capnp.Message) (Conmon_createNamespaces_Results, error) { + root, err := msg.Root() + return Conmon_createNamespaces_Results(root.Struct()), err +} + +func (s Conmon_createNamespaces_Results) String() string { + str, _ := text.Marshal(0x8aef91973dc8a4f5, capnp.Struct(s)) + return str +} + +func (s Conmon_createNamespaces_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Conmon_createNamespaces_Results) DecodeFromPtr(p capnp.Ptr) Conmon_createNamespaces_Results { + return Conmon_createNamespaces_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Conmon_createNamespaces_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Conmon_createNamespaces_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Conmon_createNamespaces_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Conmon_createNamespaces_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Conmon_createNamespaces_Results) Response() (Conmon_CreateNamespacesResponse, error) { + p, err := capnp.Struct(s).Ptr(0) + return Conmon_CreateNamespacesResponse(p.Struct()), err +} + +func (s Conmon_createNamespaces_Results) HasResponse() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Conmon_createNamespaces_Results) SetResponse(v Conmon_CreateNamespacesResponse) error { + return capnp.Struct(s).SetPtr(0, capnp.Struct(v).ToPtr()) +} + +// NewResponse sets the response field to a newly +// allocated Conmon_CreateNamespacesResponse struct, preferring placement in s's segment. +func (s Conmon_createNamespaces_Results) NewResponse() (Conmon_CreateNamespacesResponse, error) { + ss, err := NewConmon_CreateNamespacesResponse(capnp.Struct(s).Segment()) + if err != nil { + return Conmon_CreateNamespacesResponse{}, err + } + err = capnp.Struct(s).SetPtr(0, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// Conmon_createNamespaces_Results_List is a list of Conmon_createNamespaces_Results. +type Conmon_createNamespaces_Results_List = capnp.StructList[Conmon_createNamespaces_Results] + +// NewConmon_createNamespaces_Results creates a new list of Conmon_createNamespaces_Results. +func NewConmon_createNamespaces_Results_List(s *capnp.Segment, sz int32) (Conmon_createNamespaces_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[Conmon_createNamespaces_Results](l), err +} + +// Conmon_createNamespaces_Results_Future is a wrapper for a Conmon_createNamespaces_Results promised by a client call. +type Conmon_createNamespaces_Results_Future struct{ *capnp.Future } + +func (f Conmon_createNamespaces_Results_Future) Struct() (Conmon_createNamespaces_Results, error) { + p, err := f.Future.Ptr() + return Conmon_createNamespaces_Results(p.Struct()), err +} +func (p Conmon_createNamespaces_Results_Future) Response() Conmon_CreateNamespacesResponse_Future { + return Conmon_CreateNamespacesResponse_Future{Future: p.Future.Field(0, nil)} +} + +const schema_ffaaf7385bc4adad = "x\xda\xacX}pT\xe5\xd5?\xe7\xb9\x9b\xdc\x0do" + + "\xe2\xe6\xe1n\x142\xf2F3\xe0@P\xf9\x08\xbe\x02" + + "\x13'\x09\x90\xe1\x0dE\x9b\x9bE\xed\x80:\\v\x1f" + + "\x92\xc5\xec\xde\xe5\xde\x1b!X\x8bQ\x99\x0a\xb6\xb6P" + + "\x1c\x8bcf\xa0~\x8cP\xa9Z\x8b\x15\xda\xda\xf1k" + + "\xb4(\xada\xa6\xb48\xb5\xad\xa5\xd6\x8fi\xb5\x8e:" + + "\xa5\x8e\xed\xed\x9c\xe7\xe6~d\xb3\xa3\x9b\xa4\x7f%{" + + "\xee\xef\x9es\x9es\xces\xce\xef\xdc\xf9o\xaam\xb1" + + "\x055?\xaf\x06\xa6\xef\xad\xa8t\xed7\x07\xac\x87\x87" + + "V\xde\x0e|.\x02T\xa0\x0a\xd0\xdcQ\xd9\xc8\x00\xb5" + + "\xeb+[\x01\xddO\x1e|\xf9\x8a{w\x7f\xb0+\x0a" + + "\xb8\xc5\x03\xdc#\x01\xbf[\xdc\xb4q\xbf\xb2\xfa\xae(" + + "\xe0he=\x01\x86%\xe0k\xeb\x13{\xbfs\xee:" + + "\x09p?l\xde\xf8\xc6\xbew.\xff1T0\x02~" + + "XY\xcf4\xae\xaa\x00Z\x8d\xba\x05\xd0}\xe5\x7f\xb7" + + "]\x9bx\xf8\xeb\xdf-\x02K\xad\x83j#\xd3\x0eH" + + "\xf0\x90J\x9aw\xbc{\xd5SW\xdf\xfe\xc1\xfe\xa8\xe9" + + "au!\x99~W\x02\xf6\xad{\xe7\xc6\x8e\xce\xc4\xf7" + + "Fk\x8b\x11\xae&\xfe\x1ejs\xe2*(\xee\xb9\x9f" + + "\x9ey\xf0Tj\xf1A\xd0\xe7\xe2\x18\xa3\x15\x84\xbb0" + + "NFg\xc4\xc9\xc3\x99\x8f=?\xbc\xabe\xde\xa1\xa8" + + "\xd1\x81\xf8T2\xba;NF\xb7\xac\x7f\xf9\xb1m\xfa" + + "[\x8f\x960\xfaD\xfc$j'\xa4Qm\xc5\xfc\xa3" + + "\xa7\x9a\x9b\x0e\x974z\x90p/J\xa3\xcfJ\xa3\x8b" + + "\x0e<\xf9\xd4\xdd\xefo\xfd\x01\xa1Y1\xfa\xc2\xaaC" + + "\xa8-\xa9:\x0f@k\xafz\x0c\xd0\xbdy\xf8\xbdG" + + "\xee\xbe\xab\xfdH\xb1n\x19\xf2\xd3U\x8ci\x9fT\x91" + + "\xee\x0f\xab\xde\x86\xc8s>Sq\x0f\x1f~a\xdd\xe2" + + "\x7f\x1cr\x01\xb0\xf9\x17S\xd6b\xf3\x1bS\xceC\xb2" + + "Q\xfd\x12jF\x8d\x0a\xe0\x1e\x7f\xea\xe0\xd2O\xcfl" + + "9V\xac\x9dT6w\xd6LeZ\x96p\xcd\xa2\xc6" + + "d\x80n\xed\xba_]\xf1\xd7\x1b\xfe\xf2b4^F" + + "\xad\xac\x8f\x81Z\x8a\xd7\xdb\xc6OX\xc7\x89\xbe\x97\xa2" + + "\x80\xa1\xdaU\x048\xea\x01\xfe\xfc\xefM=\x85y\xaf" + + "F\x01\xa7kO\"\xa0\xf67\x098[\xf7\xcc\xbd\xf5" + + "-\xc7~\x19\x05\xd4pib\x16'@}\xfb\xf0\xa2" + + "D~\xe5k\xa5J\xb0\x93\xff\x095\xc1)\x1e\x06\xa7" + + "X?\xf0\xd1#\xeb\x8f\xecN\x9e\x02>7\x12j\xc0" + + "\xe6g\xf9!\xd4NK\xe4\xaf\xf9v@\xf7\xb3\x1d-" + + "\xb7\xce\x98q\xeat\xc98WMmb\xda\x9c\xa9\x84" + + "\x9e5\x95\xe2|\xdf\xdc-\x85\x1b6,\xfd}\xc9\x8c" + + "\xa3V\xcf\xb4\x0b5Yf\x1ay\xf1\xd9\xd2\xcf\x9e\xd9" + + "\xdfR\xf8C1Z\xd6\xd1\xa0v\x1c\xb5!B7\xef" + + "\xd3\x1a\x10\xd0\xbd\xba\xb0\x92_\xd4}\xce\x1f\xa3!\xf8" + + "Y\xb2\x9bBp:I!\x98\x7f\xf3\xca\x837d\xb5" + + "3Q\xc0\xbf\x92\xafS\x10y\x1d\x01\xfeO{\xfe\xf1" + + "\xfc\xee\xf7\xde\x8a\x02.\xabk\"\x0dWJ\xc0\xb3\xeb" + + "\x9a\xbb~s\xe6\xa2\xbf\x03\xbf\x8c\x85\x05\x09\xd8\x9c\xab" + + ";\x89\xda\xce:\xf2}G]\x03\xa0;\xfc~\xc3\xa3" + + "\xaf\xbc\xf5\xa5\x8fJV\xc8\x8e\xba\xd7Q;P'\xb3" + + "\\w9U\xc8\xc3\x9b\x1f\xf8\xf6\xd9F\xfeqqq" + + "+\xb2C\x9c\xd7\xc84>M\xa6t\x9a<\xea\xd3\xf7" + + "\xed\xfd\xd6\x0b\x0bW~\x1cut\xc9ty\x01\xf5\xe9" + + "\xe4\xe8O\xf1\xd0\xff\\\xb7\xe9\x9d\xb3Q\xc0\xe6\xe9\xf2" + + "$;%\xe0\xec\x81\xef7\xdfz\xe2\xc9\x7f\x96\xb8\xa1" + + "\x87\xa7Oa\xda\x89\xe9*\xccs\xd3f>g\xe6/" + + "\xb1T{^\xda\xcc\xe5\xcc\xfc\xbc\x82e:\xe6x[\xc8\xfb\xf8\xe0\xb1p\xfe" + + "\xf3\x1d\xdd!\xb3\xe1;\x9e\x0b\xe7\x19\xdfy+\xc2\x92\xf7m\x8b\xf0\xb3}" + + "\xbb\"\xa4}hOHe\xf9\x81C\x91\xb9\xfd\xd0\x0f" + + "#k\xc5\xc1\xe7\"\x9c\xedpwd\x878|<\xec" + + "\x9c\xfc\xc8\x1e\xd7\xbf\x06\xd0\xea\xe5,\x10(~\xc3\xf3" + + "Zvp\xb9\xbb}\xa0,\xd9\xecM\x02\xd0r}L" + + "\x85\x0f\xf2_\xee(f\x01~i\x80\xeb?b\x91g" + + "#w\xd9\xf5\xef64x\xb6\x82\xdf\xad\x9e^\xd7o" + + "\xa2\xd8\x13*\x8c\xca|E~Y\xa2_\x97\x09\xa9\xaf" + + "Xl7xj\xfd\xf1\xa4\x8c\x9a\xa6\xb6\x03~\xcb\xc5" + + "\x10\xc3F\xcd09\x1a\xdc\x10\x16\xb8\xa0\x9f\xafT\x00" + + "\x04\x8c\x1d}\xd6\xc9\x87\x97\x01\xe3/\xaa\x18\xd27\xf4" + + "Y;?z\x1b0\xfe\x84\x8a,\xd8F\xd1\xa7p\xfc" + + "\xa1=\xc0\xf8\x01\x15\x95`\xefB\x7f\xa1\xe0\xf7\xd0{" + + "\xdfT1\x16pW\xf47B>x\x1f0~\x8b\x8a" + + "\x15\xc1z\x81>E\xe6\x9b\x8f\x01\xe39\x15+\x83\xdd" + + "\x15\xfd-\x97\x1b\xbb\x80\xf1\xebUjyT\x18m\xe8" + + "\xa6G\xb2\x8d#y\x836t}\xba\x87~6\xd1j" + + "C\xd7\x1f\x0cQ\xa4\x15\xa4i\x04\xaa\x08\x82\xda\xa3R" + + "\xb2\xdc\xcc\xb7z\xaf\x04\xf6\xae2\xd0\x8f8@\x1bF" + + "\xfb}\xf9\xcc\xa3\xa8\x0e\xbd\xbe\x7f\xb1\xdf\xa2\xb4YX" + + "\x0f\x90\xba\x00\x15L]\x8c!S\xd2\xe6\xe0Z\x80\xd4" + + "l\x92/B\x86\xc8d\xa3\xd2\x16\xe0*\x80\xd4|\x12" + + "\xb7`\xd8\xab\xb4%\xb8\x10 \xb5\x88\xe4m$\x8f\xb1" + + "$\xc6\x00\xb4+\xb0\x1b \xd5B\xf2\xaf\x90\xbcBI" + + "b\x05\x80v5n\x02H\xad!y\x81\xe4\x95\xb1$" + + "V\x02h9i\xb6\x8f\xe4w\x92\\\xadH\xa2\xdc)" + + "\xa4\xfc\x0e\x92\xef'y\xbc2\x89q\x00mH\xca\xef" + + "'\xf9\xd3$\xafR\x93X\x05\xa0\x1d\xc1\x0d\x00\xa9\x1f" + + "\x91\xfc5\x92O\x89'q\x0a\x80vB\xfa\xff*\xc9" + + "\x7f\x8b\xa3\xda\xaa\xbb\xa1?\x9f\xe9\x13]\x06(\x11N" + + "\xe0\x08+\x97\xcd\x1b}\xd4NG&_\x83\xedd\xb2" + + "\xf9`\x0e\x8a\xadY\xa7\xcbpz\x01\x03\xaaF/\x13" + + "A3\xcd\\\x07=\x85\x84\xe1\xf4\x8ey\xda\xe7w\x13" + + "\xc5\x8a\x90\xbc\xc8N\xe5\x91\xbc>a\xe4\xfb\x0b\xcbA" + + "\xc9e\x8a5\xf4\xf4\x99\x1b\x8c\xbev\x0b\x94\x9e1\xda" + + "\xa9:\x8c|\xa6\x1dTk\xec\xc3\xcf\x1b\x12\x13a?" + + "\xb4q\xf4)\xe5R\xc9\xa0\xeb\x17Q\xa0x\x19\x96\xed" + + "\xe8\xd0-\xa2_6\xc0\x17\xf3\xaf`\x96L\x80\x7f\x8d" + + "\xf4\x83\xf2\xc9^0G'\xbc[M4\xc6\xc14\x9e" + + "\x1c]\xdf\xdc\xaf\x8a1\x8bU}\xc8\x14y)\xaa\x18" + + "\xbdT\x93e\x89r\xbc$\xa8\x05\x92\x13\x1eY\xba\xac" + + "\x91N\xc5/\xa1?\x8c\xcf\xa2?\x0a\x9f\xd1\x04\x801" + + "^\xd7\x08\xa0f\x0bi5/\x1c\xb5\x90\xcd$\xfam" + + "a\xa9\xfd\x8e=\xae\xd8\x97\x98\xe1\x91\xb5#\xc2\xefV" + + "\x85\\\xce\x8f\xc4(*\xe7\xf3\xbb\x1c\x09{\x15\xd4\x1d" + + "\xea\x99\x17x\xfcn3\xbd]PP\xff*\xf3\xda\xc8" + + "r3#\xd3\x17\x03\x861\xc0V\xdb\xc9\x98\xfd\x8e\x1f" + + "7\xfa),+\x08\xa3\x93\xcd\x89\xcc\x97\xfb\x9dHk" + + "\x9a\xdcx\xa0\xfaQ\xc6lV\x9b\xc2-*\xd8\xa2\xb7" + + "\x8dl\xd1-L\x9a\x94\x0a aue3\x18\x07\x86" + + "\xf1\xe8\"\xdd*\xec\xaeR[\xd6x\x16\x9e\x11\xbe#" + + "K \xf0\xec\x16\xaa\xc3\xad\x0a\xeawD\xeap\x90\xd6" + + "\xe8[\x15\xd4\xbfA\xd1\xf7\x86\x16\xdfi\x01\xe8w*" + + "\xa8\xefe\x88\x8a\x17\xfc\xdd{\x00\xf4\xbd\x0a\xea\xfbi" + + "Z)rZ\xf1!\xca\xc8\xfd\x0a\xea\x8f\x8c\xaeb\xdb" + + "L\xdf(\x9c\xa2\xd1 \xe7\xbf\xb0mh\xc8\x9a\xf9\xce" + + "\x08\xd81\x0b\xed\x1b\x1d\x81V\x8a\x06E\x87\x89\x1b\xcb" + + "Z\x9a&\xd1\xfedop\xb0\xcc\xde\x100\xe8I\xb4" + + "\xc0\xf1u\xa3`\x85\x98@\x1f,\xf1\xe5\xa2\xcbHX" + + "e}V\x0bV\x8a\x09\x9c\xd4'\xfb\xd6\xa5k\x06\x0a" + + "\xe8}\xad\x91\xd5Tq\x12 \xa8zfu\xf7\xe7\xe9" + + "&v\xe6\x1dam\x94tyB;y\xe4\xf2\xcd\x0e" + + "\xc8Y\x95dOqb+I\x0c\xee\x9f\xc6q\x19@" + + "\xaa\x9a\xc4\xd30\xec2Z\x1d6\x02\xa4jI~\xbe" + + "$g\xcc#g\xd3q)@*I\xf2\x0b0,w" + + "m\x86T\x7f>\xc9gKr\x16\xf3\xc8\xd9,\x89\x0f" + + "9ae\x85G\xce\xe6HR\x15pB\xaeVz\xe4" + + "l\x81$s!)\x8c\xab\x1e9[\"\xf5/&\xf9" + + "\x0aI\xce\xe2\x1e9k\x97$\xac\x8d\xe4\xab\x91\xa1[" + + "\xb0\xcc\xb4\xb0\xedN\xc0\xa0\x7f\xf8\xdc\xdb\xbfU\xaac" + + "\xf4\xf8\xff\xb7RT\xb3N\x84\xb8e\xfb2+\x0c\x07" + + "P\x04\x10\xc7\xb0zD\x08\xb1\xfam\x87B\x0djD" + + "\xa7\x9b6\xac\x1e\xf3\x1aaA\xc2\x1e#^c\x89\x88" + + "\xbeI3\xa6\x92[\xa1?[K\xf7\xb4\xd2-md" + + "\xa0\xec\xa4\x82\xbfc\xa4})m^O\x8b\xb6/\x9f" + + "\x81\xf3\x87H\xf8\xa0\x82\xfa\xe3\xa3{\x1a\x15\xad\xd9\xef" + + "\xa4@\x11i\xff\xfb\xc7\xf6\x11\xd6X\xcc\x17K\xb0\xe0" + + "IG\xa4\x98\xdf\x94M\xaa\x82O\x10\x13h&c?" + + "\xd1w\x0b;Q\xfeW\xd0\xe0S\xc6\x04l\x17}/" + + "\xf2\xd5v!\xfe'\x00\x00\xff\xff\xf5\xd9i\xd5" func init() { schemas.Register(schema_ffaaf7385bc4adad, 0x83479da67279e173, + 0x8aef91973dc8a4f5, + 0x8b4c03a0662a38dc, + 0x8b5b1693940f607e, + 0x9887a60f577a1ecb, 0xa0ef8355b64ee985, 0xa20f49456be85b99, + 0xa93853d6a4e3fa16, 0xaa2f3c8ad1c3af24, 0xace5517aafc86077, 0xad2a33d6b9304413, @@ -3247,6 +3841,7 @@ func init() { 0xcc2f70676afee4e7, 0xceba3c1a97be15f8, 0xd0476e0f34d1411a, + 0xd61491b560a8f3a3, 0xd9d61d1d803c85fc, 0xde3a625e70772b9a, 0xdf703ca0befc3afc, diff --git a/pkg/client/client.go b/pkg/client/client.go index 9d7b2d423a..303a49f85a 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -646,6 +646,9 @@ const ( type CreateContainerResponse struct { // PID is the container process identifier. PID uint32 + + // NamespacesPath is the base path where the namespaces are mounted. + NamespacesPath string } // CreateContainer can be used to create a new running container instance. @@ -1004,3 +1007,141 @@ func (c *ConmonClient) metadataBytes(ctx context.Context) ([]byte, error) { return metadata, nil } + +// CreateaNamespacesConfig is the configuration for calling the +// CreateNamespaces method. +type CreateaNamespacesConfig struct { + // Namespaces are the list of namespaces to unshare. + Namespaces []Namespace +} + +// CreateaNamespacesResponse is the response of the CreateNamespaces method. +type CreateaNamespacesResponse struct { + Namespaces []*NamespacesResponse +} + +// NamespacesResponse is the response data for the CreateaNamespacesResponse. +type NamespacesResponse struct { + // Namespace is the type of namespace. + Type Namespace + + // Path is the base path to the namespaces directory. + Path string +} + +// CreateNamespaces can be used to create a new set of namespaces. +func (c *ConmonClient) CreateNamespaces( + ctx context.Context, cfg *CreateaNamespacesConfig, +) (*CreateaNamespacesResponse, error) { + ctx, span := c.startSpan(ctx, "CreateNamespaces") + if span != nil { + defer span.End() + } + + conn, err := c.newRPCConn() + if err != nil { + return nil, fmt.Errorf("create RPC connection: %w", err) + } + defer conn.Close() + client := proto.Conmon(conn.Bootstrap(ctx)) + + future, free := client.CreateNamespaces(ctx, func(p proto.Conmon_createNamespaces_Params) error { + req, err := p.NewRequest() + if err != nil { + return fmt.Errorf("create request: %w", err) + } + + metadata, err := c.metadataBytes(ctx) + if err != nil { + return fmt.Errorf("get metadata: %w", err) + } + if err := req.SetMetadata(metadata); err != nil { + return fmt.Errorf("set metadata: %w", err) + } + + namespaces, err := req.NewNamespaces(int32(len(cfg.Namespaces))) + if err != nil { + return fmt.Errorf("init namespaces: %w", err) + } + + for i, namespace := range cfg.Namespaces { + switch namespace { + case NamespaceIPC: + namespaces.Set(i, proto.Conmon_Namespace_ipc) + + case NamespaceNet: + namespaces.Set(i, proto.Conmon_Namespace_net) + + case NamespacePID: + namespaces.Set(i, proto.Conmon_Namespace_pid) + + case NamespaceUser: + namespaces.Set(i, proto.Conmon_Namespace_user) + + case NamespaceUTS: + namespaces.Set(i, proto.Conmon_Namespace_uts) + } + } + + if err := req.SetNamespaces(namespaces); err != nil { + return fmt.Errorf("set namespaces: %w", err) + } + + return nil + }) + defer free() + + result, err := future.Struct() + if err != nil { + return nil, fmt.Errorf("create result: %w", err) + } + + response, err := result.Response() + if err != nil { + return nil, fmt.Errorf("set response: %w", err) + } + + namespaces, err := response.Namespaces() + if err != nil { + return nil, fmt.Errorf("set path: %w", err) + } + + namespacesResponse := []*NamespacesResponse{} + for i := 0; i < namespaces.Len(); i++ { + namespace := namespaces.At(i) + + var typ Namespace + switch namespace.Type() { + case proto.Conmon_Namespace_ipc: + typ = NamespaceIPC + + case proto.Conmon_Namespace_net: + typ = NamespaceNet + + case proto.Conmon_Namespace_pid: + typ = NamespacePID + + case proto.Conmon_Namespace_user: + typ = NamespaceUser + + case proto.Conmon_Namespace_uts: + typ = NamespaceUTS + } + + path, err := namespace.Path() + if err != nil { + return nil, fmt.Errorf("namespace has no path: %w", err) + } + + namespacesResponse = append(namespacesResponse, + &NamespacesResponse{ + Type: typ, + Path: path, + }, + ) + } + + return &CreateaNamespacesResponse{ + Namespaces: namespacesResponse, + }, nil +} diff --git a/pkg/client/consts.go b/pkg/client/consts.go index dbefac2cda..58c7fcc5e5 100644 --- a/pkg/client/consts.go +++ b/pkg/client/consts.go @@ -38,7 +38,7 @@ const ( type CgroupManager int const ( - // CgroupManagerSystemd specifies to use systemd to create and manage + // Name specifies to use systemd to create and manage // cgroups. CgroupManagerSystemd CgroupManager = iota @@ -46,3 +46,23 @@ const ( // and manage cgroups. CgroupManagerCgroupfs ) + +// Namespace is the enum for all available namespaces. +type Namespace int + +const ( + // NamespaceIPC is the reference to the IPC namespace. + NamespaceIPC Namespace = iota + + // NamespacePID is the reference to the PID namespace. + NamespacePID + + // NamespaceNet is the reference to the network namespace. + NamespaceNet + + // NamespaceUser is the reference to the user namespace. + NamespaceUser + + // NamespaceUTS is the reference to the UTS namespace. + NamespaceUTS +)