Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: Create a new package "types"
Browse files Browse the repository at this point in the history
Instead of relying on the kata agent to define generic structures,
the logic is to define those as virtcontainers "types" package.
This way, all consumers of those structures, such as kata-runtime,
kata-netmon, and kata-containerd-shim, don't have to import some
dependency from the kata-agent.

Fixes #876

Signed-off-by: Sebastien Boeuf <[email protected]>
  • Loading branch information
Sebastien Boeuf committed Nov 2, 2018
1 parent e90dc35 commit 39b95cc
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions virtcontainers/pkg/types/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2018 Intel Corporation.
//
// SPDX-License-Identifier: Apache-2.0
//

package types

// IPAddress describes an IP address.
type IPAddress struct {
Family int
Address string
Mask string
}

// Interface describes a network interface.
type Interface struct {
Device string
Name string
IPAddresses []*IPAddress
Mtu uint64
HwAddr string
// pciAddr is the PCI address in the format "bridgeAddr/deviceAddr".
// Here, bridgeAddr is the address at which the bridge is attached on the root bus,
// while deviceAddr is the address at which the network device is attached on the bridge.
PciAddr string
// LinkType defines the type of interface described by this structure.
// The expected values are the one that are defined by the netlink
// library, regarding each type of link. Here is a non exhaustive
// list: "veth", "macvtap", "vlan", "macvlan", "tap", ...
LinkType string
}

// Route describes a network route.
type Route struct {
Dest string
Gateway string
Device string
Source string
Scope uint32
}

0 comments on commit 39b95cc

Please sign in to comment.