Skip to content

Commit

Permalink
Merge pull request #30 from Billy99/billy99-const-strings
Browse files Browse the repository at this point in the history
For device-info-spec updates, add const strings
  • Loading branch information
dougbtv authored Nov 17, 2020
2 parents 68e4924 + 6013323 commit b127697
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/apis/k8s.cni.cncf.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ type DNS struct {
Options []string `json:"options,omitempty"`
}

const (
DeviceInfoTypePCI = "pci"
DeviceInfoTypeVHostUser = "vhost-user"
DeviceInfoTypeMemif = "memif"
DeviceInfoTypeVDPA = "vdpa"
DeviceInfoVersion = "v0.1.0"
)

// DeviceInfo contains the information of the device associated
// with this network (if any)
type DeviceInfo struct {
Expand All @@ -64,11 +72,24 @@ type VdpaDevice struct {
PfPciAddress string `json:"pf-pci-address,omitempty"`
}

const (
VhostDeviceModeClient = "client"
VhostDeviceModeServer = "server"
)

type VhostDevice struct {
Mode string `json:"mode,omitempty"`
Path string `json:"path,omitempty"`
}

const (
MemifDeviceRoleMaster = "master"
MemitDeviceRoleSlave = "slave"
MemifDeviceModeEthernet = "ethernet"
MemitDeviceModeIP = "ip"
MemitDeviceModePunt = "punt"
)

type MemifDevice struct {
Role string `json:"role,omitempty"`
Path string `json:"path,omitempty"`
Expand Down

0 comments on commit b127697

Please sign in to comment.