Documentation ¶
Index ¶
- func AFToEtherType(family int) uint16
- func AddPortsToVlan(unit int, allBmp *opennsl.PBmp, untagBmp *opennsl.PBmp, vid opennsl.Vlan, ...) error
- func ClearNativeVlan(unit int, vid opennsl.Vlan, pbmp *opennsl.PBmp, strictlyUntagged bool)
- func CreateVlan(unit int, vid opennsl.Vlan) error
- func DelPortsFromVlan(unit int, allBmp *opennsl.PBmp, untagBmp *opennsl.PBmp, vid opennsl.Vlan, ...)
- func DeleteL2Addrs(unit int, vid opennsl.Vlan)
- func DestroyVlan(unit int, vid opennsl.Vlan)
- func DestroyVlanIfEmpty(unit int, vid opennsl.Vlan)
- func DriverExit()
- func DriverInfo(unit int)
- func DriverInit(unit int, cfg *ONSLConfig) error
- func EtherTypeToLen(etherType uint16) int
- func IPToAF(ip net.IP) int
- func IPToEtherType(ip net.IP) uint16
- func LinkmonServe(unit int, linkCh chan<- *LinkInfo, done <-chan struct{})
- func NewL2addrmonKeyFromL2Addr(l2addr *opennsl.L2Addr) string
- func PortBmpGet(unit int) (*opennsl.PBmp, error)
- func PortDefaultConfig(unit int) error
- func PortDefaultVlanConfig(unit int) error
- func PortInfoGet(unit int, port opennsl.Port) (*opennsl.PortInfo, error)
- func PortStatInit(unit int) error
- func RxInit(unit int) error
- func RxServe(unit int, rxCh chan<- *opennsl.Pkt, done <-chan struct{})
- func SetNativeVlan(unit int, vid opennsl.Vlan, pbmp *opennsl.PBmp, strictlyUntagged bool) error
- func SetPortVlanTranslation(unit int, port opennsl.Port, enable int) error
- func SimInit(unit int)
- type APIServer
- func (s *APIServer) FindL3Iface(ctxt context.Context, req *api.FindL3IfaceRequest) (*api.FindL3IfaceReply, error)
- func (s *APIServer) GetFieldEntries(ctxt context.Context, req *api.GetFieldEntriesRequest) (*api.GetFieldEntriesReply, error)
- func (s *APIServer) GetIDMapEntries(ctxt context.Context, req *api.GetIDMapEntriesRequest) (*api.GetIDMapEntriesReply, error)
- func (s *APIServer) GetL2Addrs(ctxt context.Context, req *api.GetL2AddrsRequest) (*api.GetL2AddrsReply, error)
- func (s *APIServer) GetL2Stations(ctxt context.Context, req *api.GetL2StationsRequest) (*api.GetL2StationsReply, error)
- func (s *APIServer) GetL3Egresses(ctxt context.Context, req *api.GetL3EgressesRequest) (*api.GetL3EgressesReply, error)
- func (s *APIServer) GetL3Hosts(ctxt context.Context, req *api.GetL3HostsRequest) (*api.GetL3HostsReply, error)
- func (s *APIServer) GetL3Iface(ctxt context.Context, req *api.GetL3IfaceRequest) (*api.GetL3IfaceReply, error)
- func (s *APIServer) GetL3Ifaces(ctxt context.Context, req *api.GetL3IfacesRequest) (*api.GetL3IfacesReply, error)
- func (s *APIServer) GetL3Routes(ctxt context.Context, req *api.GetL3RoutesRequest) (*api.GetL3RoutesReply, error)
- func (s *APIServer) GetPortInfos(ctxt context.Context, req *api.GetPortInfosRequest) (*api.GetPortInfosReply, error)
- func (s *APIServer) GetTunnelInitiators(ctxt context.Context, req *api.GetTunnelInitiatorsRequest) (*api.GetTunnelInitiatorsReply, error)
- func (s *APIServer) GetTunnelTerminators(ctxt context.Context, req *api.GetTunnelTerminatorsRequest) (*api.GetTunnelTerminatorsReply, error)
- func (s *APIServer) GetVlans(ctxt context.Context, req *api.GetVlansRequest) (*api.GetVlansReply, error)
- func (s *APIServer) Start(addr string) error
- type Args
- type BlockBcastConfig
- type BlockBcastPortConfig
- type BlockBcastRangeConfig
- type BrVlan
- type Config
- type DpConfig
- type FieldEntry
- type FieldEntryDstIP
- type FieldEntryEthDst
- type FieldEntryEthType
- type FieldEntryIPProto
- type FieldGroup
- func NewFieldGroup(unit int, cos uint32, pri int, qs ...opennsl.FieldQualify) *FieldGroup
- func NewFieldGroupDstIPv4(unit int) *FieldGroup
- func NewFieldGroupDstIPv6(unit int) *FieldGroup
- func NewFieldGroupEthDst(unit int) *FieldGroup
- func NewFieldGroupEthType(unit int) *FieldGroup
- func NewFieldGroupIPProto(unit int) *FieldGroup
- type FieldGroups
- type IDMaps
- type L2SWConfig
- type L2StationIDKey
- type L2StationIDMap
- type L2addrmonEntry
- type L2addrmonTable
- type L3EgressIDKey
- type L3EgressIDMap
- type L3IfaceIDKey
- type L3IfaceIDMap
- func (m *L3IfaceIDMap) Get(port uint32, vid uint16) (opennsl.L3IfaceID, bool)
- func (m *L3IfaceIDMap) Register(port uint32, vid uint16, l3ifaceId opennsl.L3IfaceID) bool
- func (m *L3IfaceIDMap) Traverse(f func(L3IfaceIDKey, opennsl.L3IfaceID) bool)
- func (m *L3IfaceIDMap) Unregister(port uint32, vid uint16)
- type L3Vlan
- type LinkInfo
- type LogConfig
- type ONSLConfig
- type PortStats
- type Server
- func (s *Server) DpID() uint64
- func (s *Server) FIBCBridgingFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.BridgingFlow)
- func (s *Server) FIBCFFMultipartPortDescRequest(hdr *fibcnet.Header, mp *fibcapi.FFMultipart_Request, ...)
- func (s *Server) FIBCFFMultipartPortRequest(hdr *fibcnet.Header, mp *fibcapi.FFMultipart_Request, ...)
- func (s *Server) FIBCFFPacketOut(hdr *fibcnet.Header, pktout *fibcapi.FFPacketOut)
- func (s *Server) FIBCFFPortMod(hdr *fibcnet.Header, mod *fibcapi.FFPortMod)
- func (s *Server) FIBCFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod)
- func (s *Server) FIBCGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod)
- func (s *Server) FIBCL2InterfaceGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.L2InterfaceGroup)
- func (s *Server) FIBCL3UnicastGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.L3UnicastGroup)
- func (s *Server) FIBCMPLSFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.MPLSFlow)
- func (s *Server) FIBCMPLSInterfaceGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSInterfaceGroup)
- func (s *Server) FIBCMPLSLabelL2VpnGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
- func (s *Server) FIBCMPLSLabelL3VpnGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
- func (s *Server) FIBCMPLSLabelSwapGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
- func (s *Server) FIBCMPLSLabelTun1GroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
- func (s *Server) FIBCMPLSLabelTun2GroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
- func (s *Server) FIBCPolicyACLFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.PolicyACLFlow)
- func (s *Server) FIBCTerminationMacFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.TerminationMacFlow)
- func (s *Server) FIBCUnicastRoutingFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.UnicastRoutingFlow)
- func (s *Server) FIBCVLANFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.VLANFlow)
- func (s *Server) Fields() *FieldGroups
- func (s *Server) L2AddrInit()
- func (s *Server) L2AddrMonServe(unit int, sweepTime time.Duration, done <-chan struct{})
- func (s *Server) L2AddrMonStart(done <-chan struct{})
- func (s *Server) LinkmonStart(done <-chan struct{}) <-chan *LinkInfo
- func (s *Server) LogConfig() *LogConfig
- func (s *Server) RecvMain()
- func (s *Server) RxStart(done <-chan struct{}) <-chan *opennsl.Pkt
- func (s *Server) Serve(done <-chan struct{})
- func (s *Server) Start(done <-chan struct{}) error
- func (s *Server) Unit() int
- func (s *Server) VlanPorts() *VlanPortTable
- type TrunkIDKey
- type TrunkIDMap
- type VlanPortEntry
- type VlanPortKey
- type VlanPortTable
- func (t *VlanPortTable) ConvVID(port opennsl.Port, vid opennsl.Vlan) opennsl.Vlan
- func (t *VlanPortTable) Has(vid opennsl.Vlan) bool
- func (t *VlanPortTable) Insert(key *VlanPortKey, entry *VlanPortEntry) bool
- func (t *VlanPortTable) SetBaseVID(vid opennsl.Vlan)
- func (t *VlanPortTable) SetDefaultVID(vid opennsl.Vlan)
- func (t *VlanPortTable) SetMaxPort(maxPort opennsl.Port)
- func (t *VlanPortTable) SetMinPort(minPort opennsl.Port)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AFToEtherType ¶
AFToEtherType returns ether-type of family.
func AddPortsToVlan ¶ added in v0.4.0
func ClearNativeVlan ¶ added in v0.4.0
func DelPortsFromVlan ¶ added in v0.4.0
func DeleteL2Addrs ¶ added in v0.4.0
func DestroyVlan ¶ added in v0.4.0
func DestroyVlanIfEmpty ¶ added in v0.4.0
func DriverInfo ¶
func DriverInfo(unit int)
func DriverInit ¶
func DriverInit(unit int, cfg *ONSLConfig) error
DriverInit initialize opennsl driver.
func EtherTypeToLen ¶
func LinkmonServe ¶
LinkmonServe monitor link state and notify.
func NewL2addrmonKeyFromL2Addr ¶ added in v0.4.0
func PortBmpGet ¶
PortBmpGet returns port map instance.
func PortDefaultVlanConfig ¶
PortDefaultVlanConfig registers port to default vlan.
func PortInfoGet ¶
PortInfoGet returns opennsl port info.
func PortStatInit ¶
PortStatInit initialze opennsl port stats function.
func SetNativeVlan ¶ added in v0.4.0
func SetPortVlanTranslation ¶ added in v0.4.0
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
APIServer is api server.
func (*APIServer) FindL3Iface ¶
func (s *APIServer) FindL3Iface(ctxt context.Context, req *api.FindL3IfaceRequest) (*api.FindL3IfaceReply, error)
FindL3Iface process api.FindL3IfaceRequest.
func (*APIServer) GetFieldEntries ¶
func (s *APIServer) GetFieldEntries(ctxt context.Context, req *api.GetFieldEntriesRequest) (*api.GetFieldEntriesReply, error)
GetFieldEntries process api.GetFieldEntriesRequest.
func (*APIServer) GetIDMapEntries ¶
func (s *APIServer) GetIDMapEntries(ctxt context.Context, req *api.GetIDMapEntriesRequest) (*api.GetIDMapEntriesReply, error)
GetIDMapEntries process api.GetIDMapEntriesRequest.
func (*APIServer) GetL2Addrs ¶
func (s *APIServer) GetL2Addrs(ctxt context.Context, req *api.GetL2AddrsRequest) (*api.GetL2AddrsReply, error)
GetL2Addrs process api.GetL2AddrsRequest.
func (*APIServer) GetL2Stations ¶
func (s *APIServer) GetL2Stations(ctxt context.Context, req *api.GetL2StationsRequest) (*api.GetL2StationsReply, error)
GetL2Stations process api.GetL2StationsRequest.
func (*APIServer) GetL3Egresses ¶
func (s *APIServer) GetL3Egresses(ctxt context.Context, req *api.GetL3EgressesRequest) (*api.GetL3EgressesReply, error)
GetL3Egresses process api.GetL3EgressesRequest.
func (*APIServer) GetL3Hosts ¶
func (s *APIServer) GetL3Hosts(ctxt context.Context, req *api.GetL3HostsRequest) (*api.GetL3HostsReply, error)
GetL3Hosts process api.GetL3HostsRequest.
func (*APIServer) GetL3Iface ¶
func (s *APIServer) GetL3Iface(ctxt context.Context, req *api.GetL3IfaceRequest) (*api.GetL3IfaceReply, error)
GetL3Iface process api.GetL3IfaceRequest.
func (*APIServer) GetL3Ifaces ¶
func (s *APIServer) GetL3Ifaces(ctxt context.Context, req *api.GetL3IfacesRequest) (*api.GetL3IfacesReply, error)
GetL3Ifaces process api.GetL3IfacesRequest.
func (*APIServer) GetL3Routes ¶
func (s *APIServer) GetL3Routes(ctxt context.Context, req *api.GetL3RoutesRequest) (*api.GetL3RoutesReply, error)
GetL3Routes process api.GetL3RoutesRequest.
func (*APIServer) GetPortInfos ¶ added in v0.4.0
func (s *APIServer) GetPortInfos(ctxt context.Context, req *api.GetPortInfosRequest) (*api.GetPortInfosReply, error)
func (*APIServer) GetTunnelInitiators ¶
func (s *APIServer) GetTunnelInitiators(ctxt context.Context, req *api.GetTunnelInitiatorsRequest) (*api.GetTunnelInitiatorsReply, error)
GetTunnelInitiators process api.GetTunnelInitiatorsRequest.
func (*APIServer) GetTunnelTerminators ¶
func (s *APIServer) GetTunnelTerminators(ctxt context.Context, req *api.GetTunnelTerminatorsRequest) (*api.GetTunnelTerminatorsReply, error)
GetTunnelTerminators process api.GetTunnelTerminatorsRequest.
func (*APIServer) GetVlans ¶
func (s *APIServer) GetVlans(ctxt context.Context, req *api.GetVlansRequest) (*api.GetVlansReply, error)
GetVlans process api.GetVlansRequest.
type Args ¶
type Args struct { ConfigFile string ConfigType string UseSim bool DpName string APIAddr string Daemon bool PidFile string LogFile string Verbose bool }
Args is gonsl arguments.
type BlockBcastConfig ¶
type BlockBcastConfig struct { Range BlockBcastRangeConfig `mapstructure:"range"` Ports []*BlockBcastPortConfig `mapstructure:"ports"` }
VlanPortConfig is vlan config that port belongs to.
func (*BlockBcastConfig) Block ¶
func (c *BlockBcastConfig) Block() bool
func (*BlockBcastConfig) String ¶
func (c *BlockBcastConfig) String() string
type BlockBcastPortConfig ¶
type BlockBcastPortConfig struct { Port int `mapstructure:"port"` Vid uint16 `mapstructure:"vid"` PVid uint16 `mapstructure:"pvid"` }
BlockBcastPortConfig is port entry of BlockBcastConfig.
func (*BlockBcastPortConfig) String ¶
func (c *BlockBcastPortConfig) String() string
type BlockBcastRangeConfig ¶
type BlockBcastRangeConfig struct { Min int `mapstructure:"min"` Max int `mapstructure:"max"` BaseVID uint16 `mapstructure:"base_vid"` }
BlockBcastRangeConfig is port entry of BlockBcastConfig.
func (*BlockBcastRangeConfig) Block ¶
func (c *BlockBcastRangeConfig) Block() bool
func (*BlockBcastRangeConfig) GetBaseVID ¶
func (c *BlockBcastRangeConfig) GetBaseVID() uint16
func (*BlockBcastRangeConfig) String ¶
func (c *BlockBcastRangeConfig) String() string
type BrVlan ¶ added in v0.4.0
type Config ¶
type Config struct { Dpaths map[string]*DpConfig `mapstructure:"dpaths"` Logging LogConfig `mapstructure:"logging"` }
Config is gonsl config file.
func (*Config) GetDpConfig ¶
GetDpConfig returns dp cofig.
type DpConfig ¶
type DpConfig struct { DpID uint64 `mapstructure:"dpid"` Addr string `mapstructure:"addr"` Port uint16 `mapstructure:"port"` Unit int `mapstructure:"unit"` BlockBcast BlockBcastConfig `mapstructure:"block_bcast"` OpenNSL *ONSLConfig `mapstructure:"opennsl"` L2SW L2SWConfig `mapstructure:"l2sw"` }
DpConfig is part of gonsl config.
func (*DpConfig) GetL2AgingTimer ¶ added in v0.4.0
GetL2AgingTimer returns l2 aging timer (second).
func (*DpConfig) GetL2NotifyLimit ¶ added in v0.4.0
func (*DpConfig) GetL2SweepTime ¶ added in v0.4.0
GetL2SweepTime returns l2 addr table sweep time.
type FieldEntry ¶ added in v0.4.0
type FieldEntry interface {
// contains filtered or unexported methods
}
FieldEntry is interface of field entry.
type FieldEntryDstIP ¶ added in v0.4.0
FieldEntryDstIP is field entry (DstIPv4 or DstIPv6).
func NewFieldEntryDstIP ¶ added in v0.4.0
NewFieldEntryDstIP returns new FieldEntryDstIP(IPv4 or IPv6)
func NewFieldEntryDstIPv4 ¶ added in v0.4.0
func NewFieldEntryDstIPv4(dest *net.IPNet, inPort opennsl.Port) *FieldEntryDstIP
NewFieldEntryDstIPv4 returns new FieldEntryDstIP(IPv4)
func NewFieldEntryDstIPv6 ¶ added in v0.4.0
func NewFieldEntryDstIPv6(dest *net.IPNet, inPort opennsl.Port) *FieldEntryDstIP
NewFieldEntryDstIPv6 returns new FieldEntryDstIP(IPv6)
func (*FieldEntryDstIP) String ¶ added in v0.4.0
func (e *FieldEntryDstIP) String() string
type FieldEntryEthDst ¶ added in v0.4.0
type FieldEntryEthDst struct { Dest net.HardwareAddr Mask net.HardwareAddr InPort opennsl.Port }
FieldEntryEthDst is field entry (EthDst).
func NewFieldEntryEthDst ¶ added in v0.4.0
func NewFieldEntryEthDst(dest, mask net.HardwareAddr, inPort opennsl.Port) *FieldEntryEthDst
NewFieldEntryEthDst returns new FieldEntryEthDst.
func (*FieldEntryEthDst) String ¶ added in v0.4.0
func (e *FieldEntryEthDst) String() string
String returns string.
type FieldEntryEthType ¶ added in v0.4.0
FieldEntryEthType is field entry (EthType).
func NewFieldEntryEthType ¶ added in v0.4.0
func NewFieldEntryEthType(ethType uint16, inPort opennsl.Port) *FieldEntryEthType
NewFieldEntryEthType returns new FieldEntryEthType.
func (*FieldEntryEthType) String ¶ added in v0.4.0
func (e *FieldEntryEthType) String() string
type FieldEntryIPProto ¶ added in v0.4.0
FieldEntryIPProto is field entry (IP proto).
func NewFieldEntryIPProto ¶ added in v0.4.0
func NewFieldEntryIPProto(ipProto uint8, ethType uint16, inPort opennsl.Port) *FieldEntryIPProto
NewFieldEntryIPProto returns new FieldEntryIPProto.
func (*FieldEntryIPProto) String ¶ added in v0.4.0
func (e *FieldEntryIPProto) String() string
type FieldGroup ¶
type FieldGroup struct {
// contains filtered or unexported fields
}
FieldGroup has cos, field_group and entries.
func NewFieldGroup ¶
func NewFieldGroup(unit int, cos uint32, pri int, qs ...opennsl.FieldQualify) *FieldGroup
NewFieldGroup returns new instance.
func NewFieldGroupDstIPv4 ¶
func NewFieldGroupDstIPv4(unit int) *FieldGroup
NewFieldGroupDstIPv4 returns new FieldGroup for FieldEntryDstIP(v4)
func NewFieldGroupDstIPv6 ¶
func NewFieldGroupDstIPv6(unit int) *FieldGroup
NewFieldGroupDstIPv6 returns new FieldGroup for FieldEntryDstIP(v6)
func NewFieldGroupEthDst ¶
func NewFieldGroupEthDst(unit int) *FieldGroup
NewFieldGroupEthDst created new FieldGroup for FieldEntryEthDst.
func NewFieldGroupEthType ¶
func NewFieldGroupEthType(unit int) *FieldGroup
NewFieldGroupEthType create new FieldGroup for FieldEntryEthType.
func NewFieldGroupIPProto ¶
func NewFieldGroupIPProto(unit int) *FieldGroup
NewFieldGroupIPProto created new FieldGroup for FieldEntryIPProto.
func (*FieldGroup) AddEntry ¶ added in v0.4.0
func (f *FieldGroup) AddEntry(e FieldEntry) error
AddEntry installs field entry.
func (*FieldGroup) DeleteEntry ¶ added in v0.4.0
func (f *FieldGroup) DeleteEntry(e FieldEntry)
DeleteEntry uninstall field entry.
func (*FieldGroup) GetEntries ¶
func (f *FieldGroup) GetEntries() ([]opennsl.FieldEntry, error)
GetEntries get all field entry from H.W.
func (*FieldGroup) GetEntry ¶ added in v0.4.0
func (f *FieldGroup) GetEntry(e FieldEntry, entry opennsl.FieldEntry) error
GetEntry get field entry form H.W.
type FieldGroups ¶
type FieldGroups struct { EthDst *FieldGroup EthType *FieldGroup DstIPv4 *FieldGroup DstIPv6 *FieldGroup IPProto *FieldGroup }
FieldGroups has opennsl field_groups.
func NewFieldGroups ¶
func NewFieldGroups(unit int) *FieldGroups
NewFieldGroups returns new instance.
type IDMaps ¶
type IDMaps struct { L2Stations *L2StationIDMap L3Ifaces *L3IfaceIDMap L3Egress *L3EgressIDMap Trunks *TrunkIDMap }
IDMaps has sub-maps.
type L2SWConfig ¶ added in v0.4.0
type L2SWConfig struct { NotifyLimit uint32 `mapstructure:"notify_limit"` SweepSec uint32 `mapstructure:"sweep_sec"` AgingSec uint32 `mapstructure:"aging_sec"` }
L2SWConfig is l2sw configurations.
func (*L2SWConfig) String ¶ added in v0.4.0
func (c *L2SWConfig) String() string
type L2StationIDKey ¶ added in v0.4.0
type L2StationIDKey uint32
L2StationIDKey is key of L2StationIDMap
func NewL2StationIDKey ¶ added in v0.4.0
func NewL2StationIDKey(id uint32) L2StationIDKey
NewL2StationIDKey returns new L2StationIDKey
func (L2StationIDKey) String ¶ added in v0.4.0
func (k L2StationIDKey) String() string
String returns string.
type L2StationIDMap ¶ added in v0.4.0
L2StationIDMap has id and l2station id.
func NewL2StationIDMap ¶ added in v0.4.0
func NewL2StationIDMap() *L2StationIDMap
NewL2StationIDMap returns new L2StationIDMap
func (*L2StationIDMap) Get ¶ added in v0.4.0
func (m *L2StationIDMap) Get(id uint32) (opennsl.L2StationID, bool)
Get returns L2StationID by id.
func (*L2StationIDMap) Register ¶ added in v0.4.0
func (m *L2StationIDMap) Register(id uint32, l2stationId opennsl.L2StationID) bool
Register registers id and l3egrId.
func (*L2StationIDMap) Traverse ¶ added in v0.4.0
func (m *L2StationIDMap) Traverse(f func(L2StationIDKey, opennsl.L2StationID) bool)
Traverse enumerates all entries.
func (*L2StationIDMap) Unregister ¶ added in v0.4.0
func (m *L2StationIDMap) Unregister(id uint32)
Unregister removes id.
type L2addrmonEntry ¶ added in v0.4.0
type L2addrmonEntry struct { L2Addr *opennsl.L2Addr Oper opennsl.L2CallbackOper }
func NewL2addrmonEntry ¶ added in v0.4.0
func NewL2addrmonEntry(src *opennsl.L2Addr, oper opennsl.L2CallbackOper) *L2addrmonEntry
func (*L2addrmonEntry) Key ¶ added in v0.4.0
func (e *L2addrmonEntry) Key() string
func (*L2addrmonEntry) SetAdd ¶ added in v0.4.0
func (e *L2addrmonEntry) SetAdd() bool
func (*L2addrmonEntry) SetDel ¶ added in v0.4.0
func (e *L2addrmonEntry) SetDel() bool
func (*L2addrmonEntry) String ¶ added in v0.4.0
func (e *L2addrmonEntry) String() string
type L2addrmonTable ¶ added in v0.4.0
type L2addrmonTable struct {
// contains filtered or unexported fields
}
func NewL2addrmonTable ¶ added in v0.4.0
func NewL2addrmonTable(maxEntry uint32) *L2addrmonTable
func (*L2addrmonTable) Add ¶ added in v0.4.0
func (t *L2addrmonTable) Add(newEntry *L2addrmonEntry)
func (*L2addrmonTable) Del ¶ added in v0.4.0
func (t *L2addrmonTable) Del(delEntry *L2addrmonEntry)
func (*L2addrmonTable) Put ¶ added in v0.4.0
func (t *L2addrmonTable) Put(e *L2addrmonEntry)
func (*L2addrmonTable) Reset ¶ added in v0.4.0
func (t *L2addrmonTable) Reset(force bool) []*L2addrmonEntry
type L3EgressIDKey ¶ added in v0.4.0
type L3EgressIDKey uint32
L3EgressIDKey is key of L3EgressIDMap
func NewL3EgressIDKey ¶ added in v0.4.0
func NewL3EgressIDKey(neighId uint32) L3EgressIDKey
NewL3EgressIDKey returns new L3EgressIDKey
func (L3EgressIDKey) String ¶ added in v0.4.0
func (k L3EgressIDKey) String() string
String returns string.
type L3EgressIDMap ¶ added in v0.4.0
L3EgressIDMap has id(key) and l3-egress-id(value).
func NewL3EgressIDMap ¶ added in v0.4.0
func NewL3EgressIDMap() *L3EgressIDMap
NewL3EgressIDMap returns new L3EgressIDMap
func (*L3EgressIDMap) Get ¶ added in v0.4.0
func (m *L3EgressIDMap) Get(id uint32) (opennsl.L3EgressID, bool)
Get returns L3EgressID by id.
func (*L3EgressIDMap) Register ¶ added in v0.4.0
func (m *L3EgressIDMap) Register(id uint32, l3egrId opennsl.L3EgressID) bool
Register registers id and l3egrId.
func (*L3EgressIDMap) Traverse ¶ added in v0.4.0
func (m *L3EgressIDMap) Traverse(f func(L3EgressIDKey, opennsl.L3EgressID) bool)
Traverse enumerates all entries.
func (*L3EgressIDMap) Unregister ¶ added in v0.4.0
func (m *L3EgressIDMap) Unregister(id uint32)
Unregister removes id.
type L3IfaceIDKey ¶ added in v0.4.0
L3IfaceIDKey is key of L3IfaceIDMap.
func NewL3IfaceIDKey ¶ added in v0.4.0
func NewL3IfaceIDKey(port uint32, vid uint16) L3IfaceIDKey
NewL3IfaceIDKey returns new L3IfaceIDKey
func (*L3IfaceIDKey) String ¶ added in v0.4.0
func (k *L3IfaceIDKey) String() string
String returns string.
type L3IfaceIDMap ¶ added in v0.4.0
L3IfaceIDMap has id/vid(key) and l3-interface-id(value).
func NewL3IfaceIDMap ¶ added in v0.4.0
func NewL3IfaceIDMap() *L3IfaceIDMap
NewL3IfaceIDMap returns new NewL3IfaceIDMap
func (*L3IfaceIDMap) Traverse ¶ added in v0.4.0
func (m *L3IfaceIDMap) Traverse(f func(L3IfaceIDKey, opennsl.L3IfaceID) bool)
Traverse enumerates all entries.
func (*L3IfaceIDMap) Unregister ¶ added in v0.4.0
func (m *L3IfaceIDMap) Unregister(port uint32, vid uint16)
Unregister removes id.
type LinkInfo ¶
LinkInfo is opennsl port_info and port_no.
func NewLinkInfo ¶
NewLinkInfo create new instance of LinkInfo.
type LogConfig ¶
type LogConfig struct { RxDetail bool `mapstructure:"rx_detail"` RxDump bool `mapstructure:"rx_dump"` }
LogConfig is logging config.
type ONSLConfig ¶
type ONSLConfig struct { Config string `mapstructure:"cfg_fname"` ConfigPost string `mapstructure:"cfg_post_fname"` Flags uint `mapstructure:"flags"` RmConfig string `mapstructure:"rmcfg_fname"` WbConfig string `mapstructure:"wb_fname"` }
ONSLConfig is opennsl config file.
type PortStats ¶
PortStats is list of opennsl.StatVal.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is main service of gonsld.
func (*Server) FIBCBridgingFlowMod ¶
func (s *Server) FIBCBridgingFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.BridgingFlow)
FIBCBridgingFlowMod process FlowMod (Bridging)
func (*Server) FIBCFFMultipartPortDescRequest ¶
func (s *Server) FIBCFFMultipartPortDescRequest(hdr *fibcnet.Header, mp *fibcapi.FFMultipart_Request, pd *fibcapi.FFMultipart_PortDescRequest)
FIBCFFMultipartPortDescRequest process multipart-request(port desc) from fibcd.
func (*Server) FIBCFFMultipartPortRequest ¶
func (s *Server) FIBCFFMultipartPortRequest(hdr *fibcnet.Header, mp *fibcapi.FFMultipart_Request, req *fibcapi.FFMultipart_PortRequest)
FIBCFFMultipartPortRequest process multipart-request(port stats) from fibcd.
func (*Server) FIBCFFPacketOut ¶
func (s *Server) FIBCFFPacketOut(hdr *fibcnet.Header, pktout *fibcapi.FFPacketOut)
FIBCFFPacketOut process FFPacketOUT message from fibcd.
func (*Server) FIBCFFPortMod ¶
func (*Server) FIBCFlowMod ¶
FIBCFlowMod process any FlowMod.
func (*Server) FIBCGroupMod ¶
func (s *Server) FIBCGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod)
FIBCGroupMod process any GroupMod.
func (*Server) FIBCL2InterfaceGroupMod ¶
func (s *Server) FIBCL2InterfaceGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.L2InterfaceGroup)
FIBCL2InterfaceGroupMod process GroupMod(L2 Interface)
func (*Server) FIBCL3UnicastGroupMod ¶
func (s *Server) FIBCL3UnicastGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.L3UnicastGroup)
FIBCL3UnicastGroupMod process GroupMod(L3 Unicst)
func (*Server) FIBCMPLSFlowMod ¶
FIBCMPLSFlowMod process FlowMod (MPLS)
func (*Server) FIBCMPLSInterfaceGroupMod ¶
func (s *Server) FIBCMPLSInterfaceGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSInterfaceGroup)
FIBCMPLSInterfaceGroupMod process GroupMod(MPLS Interface)
func (*Server) FIBCMPLSLabelL2VpnGroupMod ¶
func (s *Server) FIBCMPLSLabelL2VpnGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
FIBCMPLSLabelL2VpnGroupMod process GroupMod(MPLS Label(L2 VPN))
func (*Server) FIBCMPLSLabelL3VpnGroupMod ¶
func (s *Server) FIBCMPLSLabelL3VpnGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
FIBCMPLSLabelL3VpnGroupMod process GroupMod(MPLS Label(L3 VPN))
func (*Server) FIBCMPLSLabelSwapGroupMod ¶
func (s *Server) FIBCMPLSLabelSwapGroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
FIBCMPLSLabelSwapGroupMod process GroupMod(MPLS Label(Swap))
func (*Server) FIBCMPLSLabelTun1GroupMod ¶
func (s *Server) FIBCMPLSLabelTun1GroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
FIBCMPLSLabelTun1GroupMod process GroupMod(MPLS Label(Tunnel1))
func (*Server) FIBCMPLSLabelTun2GroupMod ¶
func (s *Server) FIBCMPLSLabelTun2GroupMod(hdr *fibcnet.Header, mod *fibcapi.GroupMod, group *fibcapi.MPLSLabelGroup)
FIBCMPLSLabelTun2GroupMod process GroupMod(MPLS Label(Tunnel2))
func (*Server) FIBCPolicyACLFlowMod ¶
func (s *Server) FIBCPolicyACLFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.PolicyACLFlow)
FIBCPolicyACLFlowMod process FlowMod(ACL Policy)
func (*Server) FIBCTerminationMacFlowMod ¶
func (s *Server) FIBCTerminationMacFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.TerminationMacFlow)
FIBCTerminationMacFlowMod process FlowMod(Termination MAC)
func (*Server) FIBCUnicastRoutingFlowMod ¶
func (s *Server) FIBCUnicastRoutingFlowMod(hdr *fibcnet.Header, mod *fibcapi.FlowMod, flow *fibcapi.UnicastRoutingFlow)
FIBCUnicastRoutingFlowMod process FlowMod(Unicast Routing)
func (*Server) FIBCVLANFlowMod ¶
FIBCVLANFlowMod process FlowMod(VLAN)
func (*Server) Fields ¶
func (s *Server) Fields() *FieldGroups
func (*Server) L2AddrInit ¶ added in v0.4.0
func (s *Server) L2AddrInit()
func (*Server) L2AddrMonServe ¶ added in v0.4.0
func (*Server) L2AddrMonStart ¶ added in v0.4.0
func (s *Server) L2AddrMonStart(done <-chan struct{})
func (*Server) LinkmonStart ¶
LinkmonStart starts link monitor.
func (*Server) RecvMain ¶
func (s *Server) RecvMain()
RecvMain reveives and dispatch messages from fibcd.
func (*Server) VlanPorts ¶
func (s *Server) VlanPorts() *VlanPortTable
type TrunkIDKey ¶ added in v0.4.0
TrunkIDKey is key of TrunkIDMap
func NewTrunkIDKey ¶ added in v0.4.0
func NewTrunkIDKey(lagId uint32, vid uint16) TrunkIDKey
NewTrunkIDKey returns new TrunkIDKey
func (*TrunkIDKey) String ¶ added in v0.4.0
func (k *TrunkIDKey) String() string
String returns string
type TrunkIDMap ¶ added in v0.4.0
TrunkIDMap has lag-id/vid(key) and trunk-id(value)
func NewTrunkIDMap ¶ added in v0.4.0
func NewTrunkIDMap() *TrunkIDMap
NewTrunkIDMap returns new TrunkIDMap
func (*TrunkIDMap) Traverse ¶ added in v0.4.0
func (m *TrunkIDMap) Traverse(f func(TrunkIDKey, opennsl.Trunk) bool)
Traverse enumerates all entries.
func (*TrunkIDMap) Unregister ¶ added in v0.4.0
func (m *TrunkIDMap) Unregister(lagid uint32, vid uint16)
Unregister removes id.
type VlanPortEntry ¶
func NewVlanPortEntry ¶
func NewVlanPortEntry(vid opennsl.Vlan) *VlanPortEntry
func NewVlanPortEntryDefault ¶
func NewVlanPortEntryDefault() *VlanPortEntry
type VlanPortKey ¶
func NewVlanPortKey ¶
func NewVlanPortKey(port opennsl.Port, vid opennsl.Vlan) *VlanPortKey
func (*VlanPortKey) String ¶
func (k *VlanPortKey) String() string
type VlanPortTable ¶
type VlanPortTable struct {
// contains filtered or unexported fields
}
func NewVlanPortTable ¶
func NewVlanPortTable() *VlanPortTable
func NewVlanPortTableFromConfig ¶
func NewVlanPortTableFromConfig(config *BlockBcastConfig) *VlanPortTable
func (*VlanPortTable) Insert ¶
func (t *VlanPortTable) Insert(key *VlanPortKey, entry *VlanPortEntry) bool
func (*VlanPortTable) SetBaseVID ¶
func (t *VlanPortTable) SetBaseVID(vid opennsl.Vlan)
func (*VlanPortTable) SetDefaultVID ¶
func (t *VlanPortTable) SetDefaultVID(vid opennsl.Vlan)
func (*VlanPortTable) SetMaxPort ¶
func (t *VlanPortTable) SetMaxPort(maxPort opennsl.Port)
func (*VlanPortTable) SetMinPort ¶
func (t *VlanPortTable) SetMinPort(minPort opennsl.Port)