2017-02-12 13:03:39 +03:00
|
|
|
// Copyright 2017 Microsoft. All rights reserved.
|
|
|
|
// MIT License
|
2016-12-01 05:00:08 +03:00
|
|
|
|
|
|
|
package cni
|
|
|
|
|
|
|
|
import (
|
2016-12-10 05:05:33 +03:00
|
|
|
cniSkel "github.com/containernetworking/cni/pkg/skel"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-01-20 03:34:03 +03:00
|
|
|
// CNI commands.
|
2017-05-10 05:29:15 +03:00
|
|
|
Cmd = "CNI_COMMAND"
|
2016-12-10 05:05:33 +03:00
|
|
|
CmdAdd = "ADD"
|
|
|
|
CmdDel = "DEL"
|
2017-05-10 05:29:15 +03:00
|
|
|
|
2017-06-16 22:03:54 +03:00
|
|
|
// CNI errors.
|
|
|
|
ErrRuntime = 100
|
|
|
|
|
2017-05-10 05:29:15 +03:00
|
|
|
// DefaultVersion is the CNI version used when no version is specified in a network config file.
|
|
|
|
defaultVersion = "0.2.0"
|
2016-12-01 05:00:08 +03:00
|
|
|
)
|
|
|
|
|
2017-02-06 10:52:35 +03:00
|
|
|
// Supported CNI versions.
|
2017-05-10 05:29:15 +03:00
|
|
|
var supportedVersions = []string{"0.1.0", "0.2.0", "0.3.0", "0.3.1"}
|
2017-02-06 10:52:35 +03:00
|
|
|
|
2016-12-10 05:05:33 +03:00
|
|
|
// CNI contract.
|
2017-01-25 02:21:57 +03:00
|
|
|
type PluginApi interface {
|
2016-12-10 05:05:33 +03:00
|
|
|
Add(args *cniSkel.CmdArgs) error
|
|
|
|
Delete(args *cniSkel.CmdArgs) error
|
|
|
|
}
|