1/* 2 Copyright The containerd Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15*/ 16 17package cni 18 19const ( 20 CNIPluginName = "cni" 21 DefaultNetDir = "/etc/cni/net.d" 22 DefaultCNIDir = "/opt/cni/bin" 23 DefaultMaxConfNum = 1 24 VendorCNIDirTemplate = "%s/opt/%s/bin" 25 DefaultPrefix = "eth" 26) 27 28type config struct { 29 pluginDirs []string 30 pluginConfDir string 31 pluginMaxConfNum int 32 prefix string 33} 34 35type PortMapping struct { 36 HostPort int32 37 ContainerPort int32 38 Protocol string 39 HostIP string 40} 41 42type IPRanges struct { 43 Subnet string 44 RangeStart string 45 RangeEnd string 46 Gateway string 47} 48 49// BandWidth defines the ingress/egress rate and burst limits 50type BandWidth struct { 51 IngressRate uint64 52 IngressBurst uint64 53 EgressRate uint64 54 EgressBurst uint64 55} 56 57// DNS defines the dns config 58type DNS struct { 59 // List of DNS servers of the cluster. 60 Servers []string 61 // List of DNS search domains of the cluster. 62 Searches []string 63 // List of DNS options. 64 Options []string 65} 66