mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-06 07:54:22 +01:00
runtime: consolidate types definition
We do not need the vc types translation for network data structures. Just use the protocol buffer definitions. Fixes: #415 Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
@@ -13,6 +13,10 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/vishvananda/netlink"
|
||||
|
||||
pbTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols"
|
||||
)
|
||||
|
||||
const cpBinaryName = "cp"
|
||||
@@ -318,3 +322,14 @@ func (p *ProgramLogger) StartLogger(output io.ReadCloser) error {
|
||||
func (p ProgramLogger) String() string {
|
||||
return p.cmd.Path
|
||||
}
|
||||
|
||||
func ConvertNetlinkFamily(netlinkFamily int32) pbTypes.IPFamily {
|
||||
switch netlinkFamily {
|
||||
case netlink.FAMILY_V6:
|
||||
return pbTypes.IPFamily_v6
|
||||
case netlink.FAMILY_V4:
|
||||
fallthrough
|
||||
default:
|
||||
return pbTypes.IPFamily_v4
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user