1 //go:build linux 2 // +build linux 3 4 /* 5 Copyright 2017 The Kubernetes Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 */ 19 20 package testing 21 22 import ( 23 utilipset "k8s.io/kubernetes/pkg/proxy/ipvs/ipset" 24 ) 25 26 // ExpectedVirtualServer is the expected ipvs rules with VirtualServer and RealServer 27 // VSNum is the expected ipvs virtual server number 28 // IP:Port protocol is the expected ipvs vs info 29 // RS is the RealServer of this expected VirtualServer 30 type ExpectedVirtualServer struct { 31 VSNum int 32 IP string 33 Port uint16 34 Protocol string 35 RS []ExpectedRealServer 36 } 37 38 // ExpectedRealServer is the expected ipvs RealServer 39 type ExpectedRealServer struct { 40 IP string 41 Port uint16 42 } 43 44 // ExpectedIptablesChain is a map of expected iptables chain and jump rules 45 type ExpectedIptablesChain map[string][]ExpectedIptablesRule 46 47 // ExpectedIptablesRule is the expected iptables rules with jump chain and match ipset name 48 type ExpectedIptablesRule struct { 49 SourceAddress string 50 JumpChain string 51 MatchSet string 52 } 53 54 // ExpectedIPSet is the expected ipset with set name and entries name 55 type ExpectedIPSet map[string][]*utilipset.Entry 56