github.com/osrg/gobgp/v3@v3.30.0/pkg/zebra/zapi_windows.go (about) 1 // Copyright (C) 2014, 2015 Nippon Telegraph and Telephone Corporation. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 // implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 16 package zebra 17 18 import ( 19 "strings" 20 "syscall" 21 ) 22 23 func intfflag2string(flag uint64) string { 24 ss := make([]string, 0, 10) 25 if flag&syscall.IFF_UP > 0 { 26 ss = append(ss, "UP") 27 } 28 if flag&syscall.IFF_BROADCAST > 0 { 29 ss = append(ss, "BROADCAST") 30 } 31 if flag&syscall.IFF_LOOPBACK > 0 { 32 ss = append(ss, "LOOPBACK") 33 } 34 if flag&syscall.IFF_MULTICAST > 0 { 35 ss = append(ss, "MULTICAST") 36 } 37 return strings.Join(ss, " | ") 38 }