aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/safchain/ethtool/ethtool_msglvl.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-08-16 16:11:26 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-09-15 20:00:20 +0200
commit85e8fbf7f33717ef6a0d6cf9e2143b52c874c2de (patch)
tree82b0c29102d2779c18ea8a6f10df5dc1139e3817 /vendor/github.com/safchain/ethtool/ethtool_msglvl.go
parent218f132fdf4939d9e0374ef860d534f19e71df54 (diff)
downloadpodman-85e8fbf7f33717ef6a0d6cf9e2143b52c874c2de.tar.gz
podman-85e8fbf7f33717ef6a0d6cf9e2143b52c874c2de.tar.bz2
podman-85e8fbf7f33717ef6a0d6cf9e2143b52c874c2de.zip
Wire network interface into libpod
Make use of the new network interface in libpod. This commit contains several breaking changes: - podman network create only outputs the new network name and not file path. - podman network ls shows the network driver instead of the cni version and plugins. - podman network inspect outputs the new network struct and not the cni conflist. - The bindings and libpod api endpoints have been changed to use the new network structure. The container network status is stored in a new field in the state. The status should be received with the new `c.getNetworkStatus`. This will migrate the old status to the new format. Therefore old containers should contine to work correctly in all cases even when network connect/ disconnect is used. New features: - podman network reload keeps the ip and mac for more than one network. - podman container restore keeps the ip and mac for more than one network. - The network create compat endpoint can now use more than one ipam config. The man pages and the swagger doc are updated to reflect the latest changes. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'vendor/github.com/safchain/ethtool/ethtool_msglvl.go')
-rw-r--r--vendor/github.com/safchain/ethtool/ethtool_msglvl.go113
1 files changed, 0 insertions, 113 deletions
diff --git a/vendor/github.com/safchain/ethtool/ethtool_msglvl.go b/vendor/github.com/safchain/ethtool/ethtool_msglvl.go
deleted file mode 100644
index 91836f019..000000000
--- a/vendor/github.com/safchain/ethtool/ethtool_msglvl.go
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Package ethtool aims to provide a library giving a simple access to the
-// Linux SIOCETHTOOL ioctl operations. It can be used to retrieve informations
-// from a network device like statistics, driver related informations or
-// even the peer of a VETH interface.
-package ethtool
-
-import (
- "syscall"
- "unsafe"
-)
-
-type ethtoolValue struct { /* ethtool.c: struct ethtool_value */
- cmd uint32
- data uint32
-}
-
-// MsglvlGet returns the msglvl of the given interface.
-func (e *Ethtool) MsglvlGet(intf string) (uint32, error) {
- edata := ethtoolValue{
- cmd: ETHTOOL_GMSGLVL,
- }
-
- var name [IFNAMSIZ]byte
- copy(name[:], []byte(intf))
-
- ifr := ifreq{
- ifr_name: name,
- ifr_data: uintptr(unsafe.Pointer(&edata)),
- }
-
- _, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
- SIOCETHTOOL, uintptr(unsafe.Pointer(&ifr)))
- if ep != 0 {
- return 0, syscall.Errno(ep)
- }
-
- return edata.data, nil
-}
-
-// MsglvlSet returns the read-msglvl, post-set-msglvl of the given interface.
-func (e *Ethtool) MsglvlSet(intf string, valset uint32) (uint32, uint32, error) {
- edata := ethtoolValue{
- cmd: ETHTOOL_GMSGLVL,
- }
-
- var name [IFNAMSIZ]byte
- copy(name[:], []byte(intf))
-
- ifr := ifreq{
- ifr_name: name,
- ifr_data: uintptr(unsafe.Pointer(&edata)),
- }
-
- _, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
- SIOCETHTOOL, uintptr(unsafe.Pointer(&ifr)))
- if ep != 0 {
- return 0, 0, syscall.Errno(ep)
- }
-
- readval := edata.data
-
- edata.cmd = ETHTOOL_SMSGLVL
- edata.data = valset
-
- _, _, ep = syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
- SIOCETHTOOL, uintptr(unsafe.Pointer(&ifr)))
- if ep != 0 {
- return 0, 0, syscall.Errno(ep)
- }
-
- return readval, edata.data, nil
-}
-
-// MsglvlGet returns the msglvl of the given interface.
-func MsglvlGet(intf string) (uint32, error) {
- e, err := NewEthtool()
- if err != nil {
- return 0, err
- }
- defer e.Close()
- return e.MsglvlGet(intf)
-}
-
-// MsglvlSet returns the read-msglvl, post-set-msglvl of the given interface.
-func MsglvlSet(intf string, valset uint32) (uint32, uint32, error) {
- e, err := NewEthtool()
- if err != nil {
- return 0, 0, err
- }
- defer e.Close()
- return e.MsglvlSet(intf, valset)
-}