func (t APIType) ToEach(version uint8, softwareName string) APIType {
	if !t.doesNeedConversion(version, softwareName) {
		return t
	}
	apiMap := apiTypeMap(version, softwareName)
	backward, ok := apiMap[t]
	if !ok {
		backward = zebraError  
	}
	log.WithFields(log.Fields{
		"Topic": "Zebra",
	}).Debugf("zebra ToEach converts APIType: %d(%s) -> %d (version: %d, software: %s)",
		t, t.String(), backward, version, softwareName)
	return backward  
}
ToEach is referred in zclient_test
package zebra
import (
	"encoding/binary"
	"errors"
	"fmt"
	"github.com/osrg/gobgp/pkg/packet/bgp"
	log "github.com/sirupsen/logrus"
	"io"
	"math"
	"net"
	"strings"
	"syscall"
)
const (
	MinZapiVer uint8 = 2
	MaxZapiVer uint8 = 6
	DefaultVrf = 0
)
const (
	headerMarker      uint8 = 255
	frrHeaderMarker   uint8 = 254
	interfaceNameSize       = 20
	maxPathNum              = 64
	maxMplsLabel            = 16
)
type interfaceStatus uint8
const (
	interfaceActive        interfaceStatus = 0x01
	interfaceSub           interfaceStatus = 0x02
	interfaceLinkDetection interfaceStatus = 0x04
	interfaceVrfLoopback   interfaceStatus = 0x08
)
type linkType uint32
const (
	linkTypeUnknown linkType = iota
	linkTypeEther
	linkTypeEEther
	linkTypeAX25
	linkTypePRONET
	linkTypeIeee802
	linkTypeARCNET
	linkTypeAPPLETLK
	linkTypeDLCI
	linkTypeATM
	linkTypeMetricOM
	linkTypeIeee1394
	linkTypeEUI64
	linkTypeINFINIBAND
	linkTypeSLIP
	linkTypeCSLIP
	linkTypeSLIP6
	linkTypeCSLIP6
	linkTypeRSRVD
	linkTypeADAPT
	linkTypeROSE
	linkTypeX25
	linkTypePPP
	linkTypeCHDLC
	linkTypeLAPB
	linkTypeRAWHDLC
	linkTypeIPIP
	linkTypeIPIP6
	linkTypeFRAD
	linkTypeSKIP
	linkTypeLOOPBACK
	linkTypeLOCALTLK
	linkTypeFDDI
	linkTypeSIT
	linkTypeIPDDP
	linkTypeIPGRE
	linkTypeIP6GRE
	linkTypePIMREG
	linkTypeHIPPI
	linkTypeECONET
	linkTypeIRDA
	linkTypeFCPP
	linkTypeFCAL
	linkTypeFCPL
	linkTypeFCFABRIC
	linkTypeIeee802Tr
	linkTypeIeee80211
	linkTypeIeee80211RadioTap
	linkTypeIeee802154
	linkTypeIeee802154Phy
)
const softwareNameMinimumVersion uint8 = 5
var allowableSoftwareNameArrays = [][]string{
	{"frr4", "cumulus"},                   
	{"frr7.3", "frr7.2", "frr7", "frr6"},  
}
func IsAllowableSoftwareName(version uint8, softwareName string) bool {
	if softwareName == "" {
		return true
	} else if version < softwareNameMinimumVersion {  
		return false
	}
	for i, allowableSoftwareNames := range allowableSoftwareNameArrays {
		if version != uint8(i)+softwareNameMinimumVersion {
			continue
		}
		for _, allowableSoftwareName := range allowableSoftwareNames {
			if softwareName == allowableSoftwareName {
				return true
			}
		}
	}
	return false
}
func HeaderSize(version uint8) uint16 {
	switch version {
	case 3, 4:
		return 8
	case 5, 6:
		return 10
	}
	return 6  
}
func HeaderMarker(version uint8) uint8 {
	if version > 3 {
		return frrHeaderMarker
	}
	return headerMarker
}
func (t interfaceStatus) String() string {
	ss := make([]string, 0, 3)
	if t&interfaceActive > 0 {
		ss = append(ss, "Active")
	}
	if t&interfaceSub > 0 {
		ss = append(ss, "Sub")
	}
	if t&interfaceLinkDetection > 0 {
		ss = append(ss, "LinkDetection")
	}
	if t&interfaceVrfLoopback > 0 {
		ss = append(ss, "VrfLoopback")
	}
	return strings.Join(ss, "|")
}
type interfaceAddressFlag uint8
const (
	interfaceAddressSecondary  interfaceAddressFlag = 0x01
	interfaceAddressPeer       interfaceAddressFlag = 0x02
	interfaceAddressUnnumbered interfaceAddressFlag = 0x04
)
func (t interfaceAddressFlag) String() string {
	ss := make([]string, 0, 3)
	if t&interfaceAddressSecondary > 0 {
		ss = append(ss, "SECONDARY")
	}
	if t&interfaceAddressPeer > 0 {
		ss = append(ss, "PEER")
	}
	if t&interfaceAddressUnnumbered > 0 {
		ss = append(ss, "UNNUMBERED")
	}
	return strings.Join(ss, "|")
}
type afi uint8
const (
	afiIP    afi = 1
	afiIP6   afi = 2
	afiEther afi = 3
	afiMax   afi = 4
)
type Safi uint8
const (
	safiUnspec Safi = iota  
	SafiUnicast
	safiMulticast
	safiMplsVpn
	safiEncap
	safiEvpn
	safiLabeledUnicast
	safiFlowspec  
	safiMax
)
const (
	zapi4SafiMplsVpn Safi = iota + safiMulticast + 1  
	zapi3SafiMplsVpn                                  
	zapi4SafiEncap
	zapi4SafiEvpn
	zapi3SafiEncap  
)
var zapi3SafiMap = map[Safi]Safi{
	zapi3SafiMplsVpn: safiMplsVpn,
	zapi3SafiEncap:   safiEncap,
}
var zapi4SafiMap = map[Safi]Safi{
	zapi4SafiMplsVpn: safiMplsVpn,
	zapi4SafiEncap:   safiEncap,
	zapi4SafiEvpn:    safiEvpn,
}
var safiRouteFamilyIPv4Map = map[Safi]bgp.RouteFamily{
	safiUnspec:         bgp.RF_OPAQUE,
	SafiUnicast:        bgp.RF_IPv4_UC,
	safiMulticast:      bgp.RF_IPv4_MC,
	safiMplsVpn:        bgp.RF_IPv4_VPN,
	safiEncap:          bgp.RF_IPv4_ENCAP,
	safiLabeledUnicast: bgp.RF_IPv4_MPLS,
	safiFlowspec:       bgp.RF_FS_IPv4_UC,
}
var safiRouteFamilyIPv6Map = map[Safi]bgp.RouteFamily{
	safiUnspec:         bgp.RF_OPAQUE,
	SafiUnicast:        bgp.RF_IPv6_UC,
	safiMulticast:      bgp.RF_IPv6_MC,
	safiMplsVpn:        bgp.RF_IPv6_VPN,
	safiEncap:          bgp.RF_IPv6_ENCAP,
	safiLabeledUnicast: bgp.RF_IPv6_MPLS,
	safiFlowspec:       bgp.RF_FS_IPv6_UC,
}
type APIType uint16
const (
	interfaceAdd           APIType = iota  
	interfaceDelete                        
	interfaceAddressAdd                    
	interfaceAddressDelete                 
	interfaceUp                            
	interfaceDown                          
	_interfaceSetMaster
	_interfaceSetProtoDown  
	RouteAdd                
	RouteDelete             
	_routeNotifyOwner       
	redistributeAdd
	_redistributeDelete
	_redistributeDefaultAdd
	_redistributeDefaultDelete
	routerIDAdd
	_routerIDDelete
	routerIDUpdate
	hello
	_capabilities    
	nexthopRegister  
	nexthopUnregister
	nexthopUpdate
	_interfaceNBRAddressAdd
	_interfaceNBRAddressDelete
	_interfaceBFDDestUpdate
	_importRouteRegister
	_importRouteUnregister
	_importCheckUpdate
	_bfdDestRegister
	_bfdDestDeregister  
	_bfdDestUpdate
	_bfdDestReplay
	redistributeRouteAdd
	redistributeRouteDel
	_vrfUnregister
	_vrfAdd
	_vrfDelete
	vrfLabel  
	_interfaceVRFUpdate
	_bfdClientRegister  
	_bfdClientDeregister
	_interfaceEnableRADV
	_interfaceDisableRADV
	ipv4NexthopLookupMRIB
	_interfaceLinkParams
	_mplsLabelsAdd
	_mplsLabelsDelete
	_mplsLabelsReplace     
	_srPolicySet           
	_srPolicyDelete        
	_srPolicyNotifyStatus  
	_ipmrRouteStats
	labelManagerConnect       
	labelManagerConnectAsync  
	getLabelChunk
	releaseLabelChunk
	_fecRegister
	_fecUnregister
	_fecUpdate
	_advertiseDefaultGW  
	_advertiseSviMACIP   
	_advertiseSubnet
	_advertiseAllVNI  
	_localESAdd
	_localESDel       
	_remoteESVTEPAdd  
	_remoteESVTEPDel  
	_localESEVIAdd    
	_localESEVIDel    
	_vniAdd           
	_vniDel
	_l3VNIAdd
	_l3VNIDel
	_remoteVTEPAdd
	_remoteVTEPDel
	_macIPAdd
	_macIPDel  
	_ipPrefixRouteAdd
	_ipPrefixRouteDel
	_remoteMACIPAdd  
	_remoteMACIPDel
	_duplicateAddrDetection
	_pwAdd
	_pwDelete
	_pwSet
	_pwUnset
	_pwStatusUpdate  
	_ruleAdd
	_ruleDelete
	_ruleNotifyOwner  
	_tableManagerConnect
	_getTableChunk
	_releaseTableChunk
	_ipSetCreate
	_ipSetDestroy
	_ipSetEntryAdd
	_ipSetEntryDelete  
	_ipSetNotifyOwner
	_ipSetEntryNotifyOwner
	_ipTableAdd  
	_ipTableDelete
	_ipTableNotifyOwner
	_vxlanFloodControl
	_vxlanSgAdd
	_vxlanSgDel
	_vxlanSgReplay
	_mlagProcessUp         
	_mlagProcessDown       
	_mlagClientRegister    
	_mlagClientUnregister  
	_mlagClientForwardMsg  
	zebraError             
	_clientCapabilities    
	_opaqueMessage         
	_opaqueRegister        
	_opaqueUnregister      
	_neighDiscover         
	BackwardIPv6RouteAdd  
	BackwardIPv6RouteDelete  
)
const (
	zapi6Frr7dot3MinDifferentAPIType APIType = 49  
	zapi6Frr7dot2MinDifferentAPIType APIType = 48  
	zapi5ClMinDifferentAPIType       APIType = 19  
	zapi5MinDifferentAPIType         APIType = 7   
	zapi4MinDifferentAPIType         APIType = 6
	zapi3MinDifferentAPIType         APIType = 0
)
func minDifferentAPIType(version uint8, softwareName string) APIType {
	if version < 4 {
		return zapi3MinDifferentAPIType
	} else if version == 4 {
		return zapi4MinDifferentAPIType
	} else if version == 5 && softwareName == "cumulus" {
		return zapi5ClMinDifferentAPIType
	} else if version == 5 ||
		(version == 6 && (softwareName == "frr6" || softwareName == "frr7")) {
		return zapi5MinDifferentAPIType
	} else if version == 6 && softwareName == "frr7.2" {
		return zapi6Frr7dot2MinDifferentAPIType
	}
	return zapi6Frr7dot3MinDifferentAPIType
}
const (
	zapi6Frr7dot3LabelManagerConnect      APIType = 50  
	zapi6Frr7dot3LabelManagerConnectAsync APIType = 51  
	zapi6Frr7dot3GetLabelChunk            APIType = 52  
	zapi6Frr7dot3ReleaseLabelChunk        APIType = 53  
)
var apiTypeZapi6Frr7dot3Map = map[APIType]APIType{
	labelManagerConnect:      zapi6Frr7dot3LabelManagerConnect,
	labelManagerConnectAsync: zapi6Frr7dot3LabelManagerConnectAsync,
	getLabelChunk:            zapi6Frr7dot3GetLabelChunk,
	releaseLabelChunk:        zapi6Frr7dot3ReleaseLabelChunk,
}
const (
	zapi6Frr7dot2LabelManagerConnect      APIType = 49  
	zapi6Frr7dot2LabelManagerConnectAsync APIType = 50  
	zapi6Frr7dot2GetLabelChunk            APIType = 51  
	zapi6Frr7dot2ReleaseLabelChunk        APIType = 52  
)
var apiTypeZapi6Frr7dot2Map = map[APIType]APIType{
	labelManagerConnect:      zapi6Frr7dot2LabelManagerConnect,
	labelManagerConnectAsync: zapi6Frr7dot2LabelManagerConnectAsync,
	getLabelChunk:            zapi6Frr7dot2GetLabelChunk,
	releaseLabelChunk:        zapi6Frr7dot2ReleaseLabelChunk,
}
const (  
	zapi6Frr7RouteAdd                 APIType = 7
	zapi6Frr7RouteDelete              APIType = 8
	zapi6Frr7RedistributAdd           APIType = 10
	zapi6Frr7RouterIDAdd              APIType = 14
	zapi6Frr7RouterIDUpdate           APIType = 16
	zapi6Frr7Hello                    APIType = 17
	zapi6Frr7NexthopRegister          APIType = 19
	zapi6Frr7NexthopUnregister        APIType = 20
	zapi6Frr7NexthopUpdate            APIType = 21
	zapi6Frr7RedistributeRouteAdd     APIType = 32
	zapi6Frr7RedistributeRouteDel     APIType = 33
	zapi6Frr7VrfLabel                 APIType = 37
	zapi6Frr7Ipv4NexthopLookupMRIB    APIType = 43
	zapi6Frr7LabelManagerConnect      APIType = 48
	zapi6Frr7LabelManagerConnectAsync APIType = 49
	zapi6Frr7GetLabelChunk            APIType = 50
	zapi6Frr7ReleaseLabelChunk        APIType = 51
)
var apiTypeZapi6Frr7Map = map[APIType]APIType{  
	RouteAdd:                 zapi6Frr7RouteAdd,
	RouteDelete:              zapi6Frr7RouteDelete,
	redistributeAdd:          zapi6Frr7RedistributAdd,
	routerIDAdd:              zapi6Frr7RouterIDAdd,
	routerIDUpdate:           zapi6Frr7RouterIDUpdate,
	hello:                    zapi6Frr7Hello,
	nexthopRegister:          zapi6Frr7NexthopRegister,
	nexthopUnregister:        zapi6Frr7NexthopUnregister,
	nexthopUpdate:            zapi6Frr7NexthopUpdate,
	redistributeRouteAdd:     zapi6Frr7RedistributeRouteAdd,
	redistributeRouteDel:     zapi6Frr7RedistributeRouteDel,
	vrfLabel:                 zapi6Frr7VrfLabel,
	ipv4NexthopLookupMRIB:    zapi6Frr7Ipv4NexthopLookupMRIB,
	labelManagerConnect:      zapi6Frr7LabelManagerConnect,
	labelManagerConnectAsync: zapi6Frr7LabelManagerConnectAsync,
	getLabelChunk:            zapi6Frr7GetLabelChunk,
	releaseLabelChunk:        zapi6Frr7ReleaseLabelChunk,
}
var apiTypeZapi6Frr6Map = map[APIType]APIType{
	RouteAdd:                 zapi6Frr7RouteAdd,                      
	RouteDelete:              zapi6Frr7RouteDelete,                   
	redistributeAdd:          zapi6Frr7RedistributAdd,                
	routerIDAdd:              zapi6Frr7RouterIDAdd,                   
	routerIDUpdate:           zapi6Frr7RouterIDUpdate,                
	hello:                    zapi6Frr7Hello,                         
	nexthopRegister:          zapi6Frr7NexthopRegister,               
	nexthopUnregister:        zapi6Frr7NexthopUnregister,             
	nexthopUpdate:            zapi6Frr7NexthopUpdate,                 
	redistributeRouteAdd:     redistributeRouteAdd,                   
	redistributeRouteDel:     redistributeRouteDel,                   
	vrfLabel:                 vrfLabel,                               
	ipv4NexthopLookupMRIB:    ipv4NexthopLookupMRIB,                  
	labelManagerConnect:      zapi6Frr7dot2LabelManagerConnect,       
	labelManagerConnectAsync: zapi6Frr7dot2LabelManagerConnectAsync,  
	getLabelChunk:            zapi6Frr7dot2GetLabelChunk,             
	releaseLabelChunk:        zapi6Frr7dot2ReleaseLabelChunk,         
}
const (  
	zapi5ClIpv4NexthopLookupMRIB APIType = 42
	zapi5ClLabelManagerConnect   APIType = 47
	zapi5ClGetLabelChunk         APIType = 48
	zapi5ClReleaseLabelChunk     APIType = 49
)
var apiTypeZapi5ClMap = map[APIType]APIType{
	nexthopRegister:      zapi6Frr7NexthopRegister,       
	nexthopUnregister:    zapi6Frr7NexthopUnregister,     
	nexthopUpdate:        zapi6Frr7NexthopUpdate,         
	redistributeRouteAdd: zapi6Frr7RedistributeRouteAdd,  
	redistributeRouteDel: zapi6Frr7RedistributeRouteDel,  
	vrfLabel:             zapi6Frr7VrfLabel,              
	labelManagerConnect:  zapi5ClLabelManagerConnect,
	getLabelChunk:        zapi5ClGetLabelChunk,
	releaseLabelChunk:    zapi5ClReleaseLabelChunk,
}
const (
	zapi5RedistributAdd               APIType = 14
	zapi5RouterIDAdd                  APIType = 18
	zapi5RouterIDUpdate               APIType = 20
	zapi5Hello                        APIType = 21
	zapi5Frr5NexthopRegister          APIType = 23
	zapi5Frr5NexthopUnregister        APIType = 24
	zapi5Frr5NexthopUpdate            APIType = 25
	zapi5Frr5RedistributeRouteAdd     APIType = 37
	zapi5Frr5RedistributeRouteDel     APIType = 38
	zapi5Frr5VrfLabel                 APIType = 42
	zapi5Frr5Ipv4NexthopLookupMRIB    APIType = 47
	zapi5Frr5LabelManagerConnect      APIType = 52
	zapi5Frr5LabelManagerConnectAsync APIType = 53
	zapi5Frr5GetLabelChunk            APIType = 54
	zapi5Frr5ReleaseLabelChunk        APIType = 55
)
var apiTypeZapi5Frr5Map = map[APIType]APIType{
	RouteAdd:                 zapi6Frr7RouteAdd,     
	RouteDelete:              zapi6Frr7RouteDelete,  
	redistributeAdd:          zapi5RedistributAdd,
	routerIDAdd:              zapi5RouterIDAdd,
	routerIDUpdate:           zapi5RouterIDUpdate,
	hello:                    zapi5Hello,
	nexthopRegister:          zapi5Frr5NexthopRegister,
	nexthopUnregister:        zapi5Frr5NexthopUnregister,
	nexthopUpdate:            zapi5Frr5NexthopUpdate,
	redistributeRouteAdd:     zapi5Frr5RedistributeRouteAdd,
	redistributeRouteDel:     zapi5Frr5RedistributeRouteDel,
	vrfLabel:                 zapi5Frr5VrfLabel,
	ipv4NexthopLookupMRIB:    zapi5Frr5Ipv4NexthopLookupMRIB,
	labelManagerConnect:      zapi5Frr5LabelManagerConnect,
	labelManagerConnectAsync: zapi5Frr5LabelManagerConnectAsync,
	getLabelChunk:            zapi5Frr5GetLabelChunk,
	releaseLabelChunk:        zapi5Frr5ReleaseLabelChunk,
}
const (
	zapi5Frr4NexthopRegister       APIType = 22
	zapi5Frr4NexthopUnregister     APIType = 23
	zapi5Frr4NexthopUpdate         APIType = 24
	zapi5Frr4RedistributeRouteAdd  APIType = 36
	zapi5Frr4RedistributeRouteDel  APIType = 37
	zapi5Frr4Ipv4NexthopLookupMRIB APIType = 45
	zapi5Frr4LabelManagerConnect   APIType = 50
	zapi5Frr4GetLabelChunk         APIType = 51
	zapi5Frr4ReleaseLabelChunk     APIType = 52
)
var apiTypeZapi5Frr4Map = map[APIType]APIType{
	RouteAdd:              zapi6Frr7RouteAdd,     
	RouteDelete:           zapi6Frr7RouteDelete,  
	redistributeAdd:       zapi5RedistributAdd,
	routerIDAdd:           zapi5RouterIDAdd,
	routerIDUpdate:        zapi5RouterIDUpdate,
	hello:                 zapi5Hello,
	nexthopRegister:       zapi5Frr4NexthopRegister,
	nexthopUnregister:     zapi5Frr4NexthopUnregister,
	nexthopUpdate:         zapi5Frr4NexthopUpdate,
	redistributeRouteAdd:  zapi5Frr4RedistributeRouteAdd,
	redistributeRouteDel:  zapi5Frr4RedistributeRouteDel,
	ipv4NexthopLookupMRIB: zapi5Frr4Ipv4NexthopLookupMRIB,
	labelManagerConnect:   zapi5Frr4LabelManagerConnect,
	getLabelChunk:         zapi5Frr4GetLabelChunk,
	releaseLabelChunk:     zapi5Frr4ReleaseLabelChunk,
}
const (
	zapi4IPv4RouteAdd        APIType = 6  
	zapi4IPv4RouteDelete     APIType = 7  
	zapi4IPv6RouteAdd        APIType = 8  
	zapi4IPv6RouteDelete     APIType = 9  
	zapi4RedistributAdd      APIType = 10
	zapi4RouterIDAdd         APIType = 14
	zapi4RouterIDUpdate      APIType = 16
	zapi4Hello               APIType = 17
	zapi4NexthopRegister     APIType = 18
	zapi4NexthopUnregister   APIType = 19
	zapi4NexthopUpdate       APIType = 20
	zapi4RedistributeIPv4Add APIType = 32  
	zapi4RedistributeIPv4Del APIType = 33  
	zapi4RedistributeIPv6Add APIType = 34  
	zapi4RedistributeIPv6Del APIType = 35  
	zapi4LabelManagerConnect APIType = 52
	zapi4GetLabelChunk       APIType = 53
	zapi4ReleaseLabelChunk   APIType = 54
)
var apiTypeZapi4Map = map[APIType]APIType{
	RouteAdd:                zapi4IPv4RouteAdd,     
	RouteDelete:             zapi4IPv4RouteDelete,  
	redistributeAdd:         zapi4RedistributAdd,
	routerIDAdd:             zapi4RouterIDAdd,
	routerIDUpdate:          zapi4RouterIDUpdate,
	hello:                   zapi4Hello,
	nexthopRegister:         zapi4NexthopRegister,
	nexthopUnregister:       zapi4NexthopUnregister,
	nexthopUpdate:           zapi4NexthopUpdate,
	redistributeRouteAdd:    zapi4RedistributeIPv4Add,        
	redistributeRouteDel:    zapi4RedistributeIPv4Del,        
	ipv4NexthopLookupMRIB:   zapi6Frr7Ipv4NexthopLookupMRIB,  
	labelManagerConnect:     zapi4LabelManagerConnect,
	getLabelChunk:           zapi4GetLabelChunk,
	releaseLabelChunk:       zapi4ReleaseLabelChunk,
	BackwardIPv6RouteAdd:    zapi4IPv6RouteAdd,
	BackwardIPv6RouteDelete: zapi4IPv6RouteDelete,
}
const (
	zapi3InterfaceAdd           APIType = 1
	zapi3InterfaceDelete        APIType = 2
	zapi3InterfaceAddressAdd    APIType = 3
	zapi3InterfaceAddressDelete APIType = 4
	zapi3InterfaceUp            APIType = 5
	zapi3InterfaceDown          APIType = 6
	zapi3IPv4RouteAdd           APIType = 7   
	zapi3IPv4RouteDelete        APIType = 8   
	zapi3IPv6RouteAdd           APIType = 9   
	zapi3IPv6RouteDelete        APIType = 10  
	zapi3RedistributeAdd        APIType = 11
	zapi3IPv4NexthopLookup      APIType = 15  
	zapi3IPv6NexthopLookup      APIType = 16  
	zapi3IPv4ImportLookup       APIType = 17  
	zapi3RouterIDAdd            APIType = 20
	zapi3RouterIDUpdate         APIType = 22
	zapi3Hello                  APIType = 23
	zapi3Ipv4NexthopLookupMRIB  APIType = 24
	zapi3NexthopRegister        APIType = 27
	zapi3NexthopUnregister      APIType = 28
	zapi3NexthopUpdate          APIType = 29
)
var apiTypeZapi3Map = map[APIType]APIType{
	interfaceAdd:            zapi3InterfaceAdd,
	interfaceDelete:         zapi3InterfaceDelete,
	interfaceAddressAdd:     zapi3InterfaceAddressAdd,
	interfaceAddressDelete:  zapi3InterfaceAddressDelete,
	interfaceUp:             zapi3InterfaceUp,
	interfaceDown:           zapi3InterfaceDown,
	RouteAdd:                zapi3IPv4RouteAdd,     
	RouteDelete:             zapi3IPv4RouteDelete,  
	redistributeAdd:         zapi3RedistributeAdd,
	routerIDAdd:             zapi3RouterIDAdd,
	routerIDUpdate:          zapi3RouterIDUpdate,
	hello:                   zapi3Hello,
	nexthopRegister:         zapi3NexthopRegister,
	nexthopUnregister:       zapi3NexthopUnregister,
	nexthopUpdate:           zapi3NexthopUpdate,
	BackwardIPv6RouteAdd:    zapi3IPv6RouteAdd,
	BackwardIPv6RouteDelete: zapi3IPv6RouteDelete,
}
func (t APIType) doesNeedConversion(version uint8, softwareName string) bool {
	if (version == 6 && softwareName == "") || t < minDifferentAPIType(version, softwareName) {
		return false
	}
	return true
}
func apiTypeMap(version uint8, softwareName string) map[APIType]APIType {
	if version == 6 && softwareName == "frr7.2" {
		return apiTypeZapi6Frr7dot2Map
	} else if version == 6 && softwareName == "frr7" {
		return apiTypeZapi6Frr7Map
	} else if version == 6 && softwareName == "frr6" {
		return apiTypeZapi6Frr6Map
	} else if version == 5 {
		if softwareName == "frr4" {
			return apiTypeZapi5Frr4Map
		} else if softwareName == "cumulus" {
			return apiTypeZapi5ClMap
		}
		return apiTypeZapi5Frr5Map
	} else if version == 4 {
		return apiTypeZapi4Map
	} else if version < 4 {
		return apiTypeZapi3Map
	}
	return apiTypeZapi6Frr7dot3Map
}