Documentation ¶
Index ¶
- Constants
- func DisableTxOffload(n *NodeConfig) error
- type ConfigDispatcher
- type ContainerDetails
- type ContainerMount
- type Endpoint
- type Extras
- type GenericContainer
- type GenericFilter
- type GenericMgmtIPs
- type HostRequirements
- type LabData
- type Link
- type LinkConfig
- type MgmtNet
- type MySocketIoEntry
- type NodeConfig
- type NodeDefinition
- func (n *NodeDefinition) GetAutoRemove() *bool
- func (n *NodeDefinition) GetBinds() []string
- func (n *NodeDefinition) GetCmd() string
- func (n *NodeDefinition) GetConfigDispatcher() *ConfigDispatcher
- func (n *NodeDefinition) GetEnforceStartupConfig() bool
- func (n *NodeDefinition) GetEntrypoint() string
- func (n *NodeDefinition) GetEnv() map[string]string
- func (n *NodeDefinition) GetEnvFiles() []string
- func (n *NodeDefinition) GetExec() []string
- func (n *NodeDefinition) GetExtras() *Extras
- func (n *NodeDefinition) GetGroup() string
- func (n *NodeDefinition) GetImage() string
- func (n *NodeDefinition) GetKind() string
- func (n *NodeDefinition) GetLabels() map[string]string
- func (n *NodeDefinition) GetLicense() string
- func (n *NodeDefinition) GetMgmtIPv4() string
- func (n *NodeDefinition) GetMgmtIPv6() string
- func (n *NodeDefinition) GetNetworkMode() string
- func (n *NodeDefinition) GetNodeCPU() float64
- func (n *NodeDefinition) GetNodeCPUSet() string
- func (n *NodeDefinition) GetNodeKernel() string
- func (n *NodeDefinition) GetNodeMemory() string
- func (n *NodeDefinition) GetNodeRuntime() string
- func (n *NodeDefinition) GetNodeSandbox() string
- func (n *NodeDefinition) GetPorts() []string
- func (n *NodeDefinition) GetPostion() string
- func (n *NodeDefinition) GetPublish() []string
- func (n *NodeDefinition) GetSANs() []string
- func (n *NodeDefinition) GetStartupConfig() string
- func (n *NodeDefinition) GetStartupDelay() uint
- func (n *NodeDefinition) GetSysctls() map[string]string
- func (n *NodeDefinition) GetType() string
- func (n *NodeDefinition) GetUser() string
- func (n *NodeDefinition) GetWaitFor() []string
- func (n *NodeDefinition) ImportEnvs()
- type Topology
- func (t *Topology) GetDefaults() *NodeDefinition
- func (t *Topology) GetKind(kind string) *NodeDefinition
- func (t *Topology) GetKinds() map[string]*NodeDefinition
- func (t *Topology) GetNodeAutoRemove(name string) *bool
- func (t *Topology) GetNodeBinds(name string) []string
- func (t *Topology) GetNodeCPU(name string) float64
- func (t *Topology) GetNodeCPUSet(name string) string
- func (t *Topology) GetNodeCmd(name string) string
- func (t *Topology) GetNodeConfigDispatcher(name string) *ConfigDispatcher
- func (t *Topology) GetNodeEnforceStartupConfig(name string) bool
- func (t *Topology) GetNodeEntrypoint(name string) string
- func (t *Topology) GetNodeEnv(name string) map[string]string
- func (t *Topology) GetNodeEnvFiles(name string) []string
- func (t *Topology) GetNodeExec(name string) []string
- func (t *Topology) GetNodeExtras(name string) *Extras
- func (t *Topology) GetNodeGroup(name string) string
- func (t *Topology) GetNodeImage(name string) string
- func (t *Topology) GetNodeKernel(name string) string
- func (t *Topology) GetNodeKind(name string) string
- func (t *Topology) GetNodeLabels(name string) map[string]string
- func (t *Topology) GetNodeLicense(name string) (string, error)
- func (t *Topology) GetNodeMemory(name string) string
- func (t *Topology) GetNodeNetworkMode(name string) string
- func (t *Topology) GetNodePorts(name string) (nat.PortSet, nat.PortMap, error)
- func (t *Topology) GetNodePosition(name string) string
- func (t *Topology) GetNodePublish(name string) []string
- func (t *Topology) GetNodeRuntime(name string) string
- func (t *Topology) GetNodeSandbox(name string) string
- func (t *Topology) GetNodeStartupConfig(name string) (string, error)
- func (t *Topology) GetNodeStartupDelay(name string) uint
- func (t *Topology) GetNodeType(name string) string
- func (t *Topology) GetNodeUser(name string) string
- func (t *Topology) GetSANs(name string) []string
- func (t *Topology) GetSysCtl(name string) map[string]string
- func (t *Topology) GetWaitFor(name string) []string
- func (t *Topology) ImportEnvs()
Constants ¶
const (
// env var containing the expected number of interfaces injected into every container.
CLAB_ENV_INTFS = "CLAB_INTFS"
)
Variables ¶
This section is empty.
Functions ¶
func DisableTxOffload ¶ added in v0.15.0
func DisableTxOffload(n *NodeConfig) error
Types ¶
type ConfigDispatcher ¶ added in v0.15.0
type ConfigDispatcher struct {
Vars map[string]interface{} `yaml:"vars,omitempty"`
}
ConfigDispatcher represents the config of a configuration machine that is responsible to execute configuration commands on the nodes after they started.
func (*ConfigDispatcher) GetVars ¶ added in v0.15.0
func (cd *ConfigDispatcher) GetVars() map[string]interface{}
type ContainerDetails ¶ added in v0.25.0
type ContainerDetails struct { LabName string `json:"lab_name,omitempty"` LabPath string `json:"labPath,omitempty"` Name string `json:"name,omitempty"` ContainerID string `json:"container_id,omitempty"` Image string `json:"image,omitempty"` Kind string `json:"kind,omitempty"` Group string `json:"group,omitempty"` State string `json:"state,omitempty"` IPv4Address string `json:"ipv4_address,omitempty"` IPv6Address string `json:"ipv6_address,omitempty"` }
ContainerDetails contains information that is commonly outputted to tables or graphs.
type ContainerMount ¶ added in v0.31.0
type Endpoint ¶
type Endpoint struct { Node *NodeConfig // e1-x, eth, etc EndpointName string // mac address MAC string }
Endpoint is a struct that contains information of a link endpoint.
type Extras ¶ added in v0.18.0
type Extras struct { SRLAgents []string `yaml:"srl-agents,omitempty"` // Nokia SR Linux agents. As of now just the agents spec files can be provided here MysocketProxy string `yaml:"mysocket-proxy,omitempty"` // Proxy address that mysocketctl will use CeosCopyToFlash []string `yaml:"ceos-copy-to-flash,omitempty"` }
Extras contains extra node parameters which are not entitled to be part of a generic node config.
type GenericContainer ¶
type GenericContainer struct { Names []string ID string ShortID string // trimmed ID for display purposes Image string State string Status string Labels map[string]string Pid int NetworkSettings GenericMgmtIPs Mounts []ContainerMount }
GenericContainer stores generic container data.
func (*GenericContainer) GetContainerIPv4 ¶ added in v0.25.0
func (ctr *GenericContainer) GetContainerIPv4() string
func (*GenericContainer) GetContainerIPv6 ¶ added in v0.25.0
func (ctr *GenericContainer) GetContainerIPv6() string
type GenericFilter ¶ added in v0.15.0
type GenericFilter struct { // defined by now "label" FilterType string // defines e.g. the label name for FilterType "label" Field string // = | != | exists Operator string // match value Match string }
func FilterFromLabelStrings ¶ added in v0.15.0
func FilterFromLabelStrings(labels []string) []*GenericFilter
type GenericMgmtIPs ¶
type HostRequirements ¶ added in v0.26.0
type LabData ¶ added in v0.31.0
type LabData struct { Containers []ContainerDetails `json:"containers"` MySocketIo []*MySocketIoEntry `json:"mysocketio"` }
type Link ¶
type Link struct { A *Endpoint B *Endpoint MTU int Labels map[string]string Vars map[string]interface{} }
Link is a struct that contains the information of a link between 2 containers.
type LinkConfig ¶ added in v0.15.0
type MgmtNet ¶
type MgmtNet struct { Network string `yaml:"network,omitempty" json:"network,omitempty"` // container runtime network name Bridge string `yaml:"bridge,omitempty" json:"bridge,omitempty"` // linux bridge backing the runtime network IPv4Subnet string `yaml:"ipv4_subnet,omitempty" json:"ipv4-subnet,omitempty"` IPv4Gw string `yaml:"ipv4-gw,omitempty" json:"ipv4-gw,omitempty"` IPv6Subnet string `yaml:"ipv6_subnet,omitempty" json:"ipv6-subnet,omitempty"` IPv6Gw string `yaml:"ipv6-gw,omitempty" json:"ipv6-gw,omitempty"` MTU string `yaml:"mtu,omitempty" json:"mtu,omitempty"` ExternalAccess *bool `yaml:"external-access,omitempty" json:"external-access,omitempty"` }
MgmtNet struct defines the management network options.
type MySocketIoEntry ¶ added in v0.31.0
type MySocketIoEntry struct { SocketId *string `json:"socket_id,omitempty"` DnsName *string `json:"dns_name,omitempty"` Ports []int `json:"ports,omitempty"` Type *string `json:"type,omitempty"` CloudAuth bool `json:"cloud_auth,omitempty"` Name *string `json:"name,omitempty"` LabName *string `json:"lab_name,omitempty"` }
type NodeConfig ¶ added in v0.15.0
type NodeConfig struct { // name of the Node inside topology YAML ShortName string `json:"shortname,omitempty"` // containerlab-prefixed unique container name LongName string `json:"longname,omitempty"` Fqdn string `json:"fqdn,omitempty"` // LabDir is a directory related to the node, it contains config items and/or other persistent state LabDir string `json:"labdir,omitempty"` Index int `json:"index,omitempty"` Group string `json:"group,omitempty"` Kind string `json:"kind,omitempty"` // path to config template file that is used for startup config generation StartupConfig string `json:"startup-config,omitempty"` // optional delay (in seconds) to wait before creating this node StartupDelay uint `json:"startup-delay,omitempty"` // when set to true will enforce the use of startup-config, even when config is present in the lab directory EnforceStartupConfig bool `json:"enforce-startup-config,omitempty"` // when set to true will auto-remove a stopped/failed container AutoRemove *bool `json:"auto-remove,omitempty"` // path to config file that is actually mounted to the container and is a result of templation ResStartupConfig string `json:"startup-config-abs-path,omitempty"` Config *ConfigDispatcher `json:"config,omitempty"` // path to config file that is actually mounted to the container and is a result of templation ResConfig string `json:"config-abs-path,omitempty"` NodeType string `json:"type,omitempty"` Position string `json:"position,omitempty"` License string `json:"license,omitempty"` Image string `json:"image,omitempty"` Sysctls map[string]string `json:"sysctls,omitempty"` User string `json:"user,omitempty"` Entrypoint string `json:"entrypoint,omitempty"` Cmd string `json:"cmd,omitempty"` Exec []string `json:"exec,omitempty"` Env map[string]string `json:"env,omitempty"` // Bind mounts strings (src:dest:options). Binds []string `json:"binds,omitempty"` // PortBindings define the bindings between the container ports and host ports PortBindings nat.PortMap `json:"portbindings,omitempty"` // PortSet define the ports that should be exposed on a container PortSet nat.PortSet `json:"portset,omitempty"` // NetworkMode defines container networking mode. // If set to `host` the host networking will be used for this node, else bridged network NetworkMode string `json:"networkmode,omitempty"` // MgmtNet is the name of the docker network this node is connected to with its first interface MgmtNet string `json:"mgmt-net,omitempty"` // MgmtIntf can be used to be rendered by the default node template MgmtIntf string `json:"mgmt-intf,omitempty"` MgmtIPv4Address string `json:"mgmt-ipv4-address,omitempty"` MgmtIPv4PrefixLength int `json:"mgmt-ipv4-prefix-length,omitempty"` MgmtIPv6Address string `json:"mgmt-ipv6-address,omitempty"` MgmtIPv6PrefixLength int `json:"mgmt-ipv6-prefix-length,omitempty"` MgmtIPv4Gateway string `json:"mgmt-ipv4-gateway,omitempty"` MgmtIPv6Gateway string `json:"mgmt-ipv6-gateway,omitempty"` MacAddress string `json:"mac-address,omitempty"` ContainerID string `json:"containerid,omitempty"` TLSCert string `json:"tls-cert,omitempty"` TLSKey string `json:"-"` // Do not marshal into JSON - highly sensitive data TLSAnchor string `json:"tls-anchor,omitempty"` NSPath string `json:"nspath,omitempty"` // network namespace path for this node // list of ports to publish with mysocketctl Publish []string `json:"publish,omitempty"` // Extra /etc/hosts entries for all nodes. ExtraHosts []string `json:"extra-hosts,omitempty"` Labels map[string]string `json:"labels,omitempty"` // container labels // Slice of pointers to local endpoints, DO NOT marshal into JSON as it creates a cyclical error Endpoints []Endpoint `json:"-"` // List of Subject Alternative Names (SAN) to be added to the node's TLS certificate SANs []string `json:"SANs,omitempty"` // Ignite sandbox and kernel imageNames Sandbox string `json:"sandbox,omitempty"` Kernel string `json:"kernel,omitempty"` // Configured container runtime Runtime string `json:"runtime,omitempty"` // Resource limits CPU float64 `json:"cpu,omitempty"` CPUSet string `json:"cpuset,omitempty"` Memory string `json:"memory,omitempty"` // Host requirements HostRequirements HostRequirements `json:"host-requirements,omitempty"` // status that is set by containerlab to indicate deployment stage DeploymentStatus string `json:"deployment-status,omitempty"` // Extras Extras *Extras `json:"extras,omitempty"` // Extra node parameters WaitFor []string `json:"wait-for,omitempty"` }
NodeConfig is a struct that contains the information of a container element.
func (*NodeConfig) GenerateConfig ¶ added in v0.15.0
func (node *NodeConfig) GenerateConfig(dst, templ string) error
GenerateConfig generates configuration for the nodes out of the template based on the node configuration and saves the result to dst.
type NodeDefinition ¶ added in v0.15.0
type NodeDefinition struct { Kind string `yaml:"kind,omitempty"` Group string `yaml:"group,omitempty"` Type string `yaml:"type,omitempty"` StartupConfig string `yaml:"startup-config,omitempty"` StartupDelay uint `yaml:"startup-delay,omitempty"` EnforceStartupConfig bool `yaml:"enforce-startup-config,omitempty"` AutoRemove *bool `yaml:"auto-remove,omitempty"` Config *ConfigDispatcher `yaml:"config,omitempty"` Image string `yaml:"image,omitempty"` License string `yaml:"license,omitempty"` Position string `yaml:"position,omitempty"` Entrypoint string `yaml:"entrypoint,omitempty"` Cmd string `yaml:"cmd,omitempty"` // list of subject Alternative Names (SAN) to be added to the node's certificate SANs []string `yaml:"SANs,omitempty"` // list of commands to run in container Exec []string `yaml:"exec,omitempty"` // list of bind mount compatible strings Binds []string `yaml:"binds,omitempty"` // list of port bindings Ports []string `yaml:"ports,omitempty"` // user-defined IPv4 address in the management network MgmtIPv4 string `yaml:"mgmt_ipv4,omitempty"` // user-defined IPv6 address in the management network MgmtIPv6 string `yaml:"mgmt_ipv6,omitempty"` // list of ports to publish with mysocketctl Publish []string `yaml:"publish,omitempty"` // environment variables Env map[string]string `yaml:"env,omitempty"` // external file containing environment variables EnvFiles []string `yaml:"env-files,omitempty"` // linux user used in a container User string `yaml:"user,omitempty"` // container labels Labels map[string]string `yaml:"labels,omitempty"` // container networking mode. if set to `host` the host networking will be used for this node, else bridged network NetworkMode string `yaml:"network-mode,omitempty"` // Ignite sandbox and kernel imageNames Sandbox string `yaml:"sandbox,omitempty"` Kernel string `yaml:"kernel,omitempty"` // Override container runtime Runtime string `yaml:"runtime,omitempty"` // Set node CPU (cgroup or hypervisor) CPU float64 `yaml:"cpu,omitempty"` // Set node CPUs to use CPUSet string `yaml:"cpu-set,omitempty"` // Set node Memory (cgroup or hypervisor) Memory string `yaml:"memory,omitempty"` // Set the nodes Sysctl Sysctls map[string]string `yaml:"sysctls,omitempty"` // Extra options, may be kind specific Extras *Extras `yaml:"extras,omitempty"` // List of node names to wait for before satarting this particular node WaitFor []string `yaml:"wait-for,omitempty"` }
NodeDefinition represents a configuration a given node can have in the lab definition file.
func (*NodeDefinition) GetAutoRemove ¶ added in v0.32.2
func (n *NodeDefinition) GetAutoRemove() *bool
func (*NodeDefinition) GetBinds ¶ added in v0.15.0
func (n *NodeDefinition) GetBinds() []string
func (*NodeDefinition) GetCmd ¶ added in v0.15.0
func (n *NodeDefinition) GetCmd() string
func (*NodeDefinition) GetConfigDispatcher ¶ added in v0.15.0
func (n *NodeDefinition) GetConfigDispatcher() *ConfigDispatcher
func (*NodeDefinition) GetEnforceStartupConfig ¶ added in v0.17.0
func (n *NodeDefinition) GetEnforceStartupConfig() bool
func (*NodeDefinition) GetEntrypoint ¶ added in v0.18.0
func (n *NodeDefinition) GetEntrypoint() string
func (*NodeDefinition) GetEnv ¶ added in v0.15.0
func (n *NodeDefinition) GetEnv() map[string]string
func (*NodeDefinition) GetEnvFiles ¶ added in v0.26.0
func (n *NodeDefinition) GetEnvFiles() []string
func (*NodeDefinition) GetExec ¶ added in v0.18.0
func (n *NodeDefinition) GetExec() []string
func (*NodeDefinition) GetExtras ¶ added in v0.18.0
func (n *NodeDefinition) GetExtras() *Extras
func (*NodeDefinition) GetGroup ¶ added in v0.15.0
func (n *NodeDefinition) GetGroup() string
func (*NodeDefinition) GetImage ¶ added in v0.15.0
func (n *NodeDefinition) GetImage() string
func (*NodeDefinition) GetKind ¶ added in v0.15.0
func (n *NodeDefinition) GetKind() string
func (*NodeDefinition) GetLabels ¶ added in v0.15.0
func (n *NodeDefinition) GetLabels() map[string]string
func (*NodeDefinition) GetLicense ¶ added in v0.15.0
func (n *NodeDefinition) GetLicense() string
func (*NodeDefinition) GetMgmtIPv4 ¶ added in v0.15.0
func (n *NodeDefinition) GetMgmtIPv4() string
func (*NodeDefinition) GetMgmtIPv6 ¶ added in v0.15.0
func (n *NodeDefinition) GetMgmtIPv6() string
func (*NodeDefinition) GetNetworkMode ¶ added in v0.15.0
func (n *NodeDefinition) GetNetworkMode() string
func (*NodeDefinition) GetNodeCPU ¶ added in v0.16.2
func (n *NodeDefinition) GetNodeCPU() float64
func (*NodeDefinition) GetNodeCPUSet ¶ added in v0.20.0
func (n *NodeDefinition) GetNodeCPUSet() string
func (*NodeDefinition) GetNodeKernel ¶ added in v0.15.0
func (n *NodeDefinition) GetNodeKernel() string
func (*NodeDefinition) GetNodeMemory ¶ added in v0.20.0
func (n *NodeDefinition) GetNodeMemory() string
func (*NodeDefinition) GetNodeRuntime ¶ added in v0.15.0
func (n *NodeDefinition) GetNodeRuntime() string
func (*NodeDefinition) GetNodeSandbox ¶ added in v0.15.0
func (n *NodeDefinition) GetNodeSandbox() string
func (*NodeDefinition) GetPorts ¶ added in v0.15.0
func (n *NodeDefinition) GetPorts() []string
func (*NodeDefinition) GetPostion ¶ added in v0.15.0
func (n *NodeDefinition) GetPostion() string
func (*NodeDefinition) GetPublish ¶ added in v0.15.0
func (n *NodeDefinition) GetPublish() []string
func (*NodeDefinition) GetSANs ¶ added in v0.31.0
func (n *NodeDefinition) GetSANs() []string
func (*NodeDefinition) GetStartupConfig ¶ added in v0.15.0
func (n *NodeDefinition) GetStartupConfig() string
func (*NodeDefinition) GetStartupDelay ¶ added in v0.17.0
func (n *NodeDefinition) GetStartupDelay() uint
func (*NodeDefinition) GetSysctls ¶ added in v0.26.0
func (n *NodeDefinition) GetSysctls() map[string]string
func (*NodeDefinition) GetType ¶ added in v0.15.0
func (n *NodeDefinition) GetType() string
func (*NodeDefinition) GetUser ¶ added in v0.15.0
func (n *NodeDefinition) GetUser() string
func (*NodeDefinition) GetWaitFor ¶ added in v0.32.0
func (n *NodeDefinition) GetWaitFor() []string
func (*NodeDefinition) ImportEnvs ¶ added in v0.17.0
func (n *NodeDefinition) ImportEnvs()
ImportEnvs imports all environment variales defined in the shell if __IMPORT_ENVS is set to true.
type Topology ¶ added in v0.15.0
type Topology struct { Defaults *NodeDefinition `yaml:"defaults,omitempty"` Kinds map[string]*NodeDefinition `yaml:"kinds,omitempty"` Nodes map[string]*NodeDefinition `yaml:"nodes,omitempty"` Links []*LinkConfig `yaml:"links,omitempty"` }
Topology represents a lab topology.
func NewTopology ¶ added in v0.15.0
func NewTopology() *Topology
func (*Topology) GetDefaults ¶ added in v0.15.0
func (t *Topology) GetDefaults() *NodeDefinition
func (*Topology) GetKind ¶ added in v0.15.0
func (t *Topology) GetKind(kind string) *NodeDefinition
func (*Topology) GetKinds ¶ added in v0.15.0
func (t *Topology) GetKinds() map[string]*NodeDefinition
func (*Topology) GetNodeAutoRemove ¶ added in v0.32.2
func (*Topology) GetNodeBinds ¶ added in v0.15.0
func (*Topology) GetNodeCPU ¶ added in v0.16.2
func (*Topology) GetNodeCPUSet ¶ added in v0.20.0
func (*Topology) GetNodeCmd ¶ added in v0.15.0
func (*Topology) GetNodeConfigDispatcher ¶ added in v0.15.0
func (t *Topology) GetNodeConfigDispatcher(name string) *ConfigDispatcher
func (*Topology) GetNodeEnforceStartupConfig ¶ added in v0.17.0
func (*Topology) GetNodeEntrypoint ¶ added in v0.18.0
func (*Topology) GetNodeEnv ¶ added in v0.15.0
func (*Topology) GetNodeEnvFiles ¶ added in v0.26.0
func (*Topology) GetNodeExec ¶ added in v0.18.0
func (*Topology) GetNodeExtras ¶ added in v0.18.0
GetNodeExtras returns the 'extras' section for the given node.
func (*Topology) GetNodeGroup ¶ added in v0.15.0
func (*Topology) GetNodeImage ¶ added in v0.15.0
func (*Topology) GetNodeKernel ¶ added in v0.15.0
func (*Topology) GetNodeKind ¶ added in v0.15.0
func (*Topology) GetNodeLabels ¶ added in v0.15.0
func (*Topology) GetNodeLicense ¶ added in v0.15.0
func (*Topology) GetNodeMemory ¶ added in v0.20.0
func (*Topology) GetNodeNetworkMode ¶ added in v0.15.0
func (*Topology) GetNodePorts ¶ added in v0.15.0
func (*Topology) GetNodePosition ¶ added in v0.15.0
func (*Topology) GetNodePublish ¶ added in v0.15.0
func (*Topology) GetNodeRuntime ¶ added in v0.15.0
func (*Topology) GetNodeSandbox ¶ added in v0.15.0
func (*Topology) GetNodeStartupConfig ¶ added in v0.15.0
func (*Topology) GetNodeStartupDelay ¶ added in v0.17.0
func (*Topology) GetNodeType ¶ added in v0.15.0
func (*Topology) GetNodeUser ¶ added in v0.15.0
func (*Topology) GetSANs ¶ added in v0.31.0
GetSANs return the Subject Alternative Name configuration for the given node.
func (*Topology) GetSysCtl ¶ added in v0.26.0
GetSysCtl return the Sysctl configuration for the given node.
func (*Topology) GetWaitFor ¶ added in v0.32.0
GetWaitFor return the wait-for configuration for the given node.
func (*Topology) ImportEnvs ¶ added in v0.17.0
func (t *Topology) ImportEnvs()