Versions in this module Expand all Collapse all v0 v0.4.0 Jun 26, 2019 Changes in this version + 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 NewL2addrmonKeyFromL2Addr(l2addr *opennsl.L2Addr) string + func SetNativeVlan(unit int, vid opennsl.Vlan, pbmp *opennsl.PBmp, strictlyUntagged bool) error + func SetPortVlanTranslation(unit int, port opennsl.Port, enable int) error type APIServer + func (s *APIServer) GetPortInfos(ctxt context.Context, req *api.GetPortInfosRequest) (*api.GetPortInfosReply, error) + type BrVlan struct + Pbmp *opennsl.PBmp + StrictlyUntagged bool + UntagBmp *opennsl.PBmp + Vid opennsl.Vlan + func NewBrVlan(unit int, vid opennsl.Vlan) *BrVlan + func (b *BrVlan) Create(unit int) error + func (b *BrVlan) Delete(unit int) + func (b *BrVlan) String() string type DpConfig + L2SW L2SWConfig + func (c *DpConfig) GetL2AgingTimer() int + func (c *DpConfig) GetL2NotifyLimit() uint32 + func (c *DpConfig) GetL2SweepTime() time.Duration + type FieldEntry interface + type FieldEntryDstIP struct + Dest *net.IPNet + EthType opennsl.Ethertype + InPort opennsl.Port + func NewFieldEntryDstIP(dest *net.IPNet, inPort opennsl.Port, ethType uint16) *FieldEntryDstIP + func NewFieldEntryDstIPv4(dest *net.IPNet, inPort opennsl.Port) *FieldEntryDstIP + func NewFieldEntryDstIPv6(dest *net.IPNet, inPort opennsl.Port) *FieldEntryDstIP + func (e *FieldEntryDstIP) String() string + type FieldEntryEthDst struct + Dest net.HardwareAddr + InPort opennsl.Port + Mask net.HardwareAddr + func NewFieldEntryEthDst(dest, mask net.HardwareAddr, inPort opennsl.Port) *FieldEntryEthDst + func (e *FieldEntryEthDst) String() string + type FieldEntryEthType struct + EthType uint16 + InPort opennsl.Port + func NewFieldEntryEthType(ethType uint16, inPort opennsl.Port) *FieldEntryEthType + func (e *FieldEntryEthType) String() string + type FieldEntryIPProto struct + EthType uint16 + IPProto uint8 + InPort opennsl.Port + func NewFieldEntryIPProto(ipProto uint8, ethType uint16, inPort opennsl.Port) *FieldEntryIPProto + func (e *FieldEntryIPProto) String() string type FieldGroup + func (f *FieldGroup) AddEntry(e FieldEntry) error + func (f *FieldGroup) DeleteEntry(e FieldEntry) + func (f *FieldGroup) GetEntry(e FieldEntry, entry opennsl.FieldEntry) error type IDMaps + Trunks *TrunkIDMap + type L2SWConfig struct + AgingSec uint32 + NotifyLimit uint32 + SweepSec uint32 + func (c *L2SWConfig) String() string + type L2StationIDKey uint32 + func NewL2StationIDKey(id uint32) L2StationIDKey + func (k L2StationIDKey) String() string + type L2StationIDMap struct + func NewL2StationIDMap() *L2StationIDMap + func (m *L2StationIDMap) Get(id uint32) (opennsl.L2StationID, bool) + func (m *L2StationIDMap) Register(id uint32, l2stationId opennsl.L2StationID) bool + func (m *L2StationIDMap) Traverse(f func(L2StationIDKey, opennsl.L2StationID) bool) + func (m *L2StationIDMap) Unregister(id uint32) + type L2addrmonEntry struct + L2Addr *opennsl.L2Addr + Oper opennsl.L2CallbackOper + func NewL2addrmonEntry(src *opennsl.L2Addr, oper opennsl.L2CallbackOper) *L2addrmonEntry + func (e *L2addrmonEntry) Key() string + func (e *L2addrmonEntry) SetAdd() bool + func (e *L2addrmonEntry) SetDel() bool + func (e *L2addrmonEntry) String() string + type L2addrmonTable struct + func NewL2addrmonTable(maxEntry uint32) *L2addrmonTable + func (t *L2addrmonTable) Add(newEntry *L2addrmonEntry) + func (t *L2addrmonTable) Del(delEntry *L2addrmonEntry) + func (t *L2addrmonTable) Put(e *L2addrmonEntry) + func (t *L2addrmonTable) Reset(force bool) []*L2addrmonEntry + type L3EgressIDKey uint32 + func NewL3EgressIDKey(neighId uint32) L3EgressIDKey + func (k L3EgressIDKey) String() string + type L3EgressIDMap struct + func NewL3EgressIDMap() *L3EgressIDMap + func (m *L3EgressIDMap) Get(id uint32) (opennsl.L3EgressID, bool) + func (m *L3EgressIDMap) Register(id uint32, l3egrId opennsl.L3EgressID) bool + func (m *L3EgressIDMap) Traverse(f func(L3EgressIDKey, opennsl.L3EgressID) bool) + func (m *L3EgressIDMap) Unregister(id uint32) + type L3IfaceIDKey struct + Port uint32 + Vid uint16 + func NewL3IfaceIDKey(port uint32, vid uint16) L3IfaceIDKey + func (k *L3IfaceIDKey) String() string + type L3IfaceIDMap struct + func NewL3IfaceIDMap() *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 struct + Pbmp *opennsl.PBmp + Vid opennsl.Vlan + Vlan opennsl.Vlan + func NewL3Vlan(unit int, vid opennsl.Vlan) *L3Vlan + func (b *L3Vlan) Create(unit int) error + func (b *L3Vlan) Delete(unit int) error + func (b *L3Vlan) String() string type Server + func (s *Server) L2AddrInit() + func (s *Server) L2AddrMonServe(unit int, sweepTime time.Duration, done <-chan struct{}) + func (s *Server) L2AddrMonStart(done <-chan struct{}) + type TrunkIDKey struct + LagId uint32 + Vid uint16 + func NewTrunkIDKey(lagId uint32, vid uint16) TrunkIDKey + func (k *TrunkIDKey) String() string + type TrunkIDMap struct + func NewTrunkIDMap() *TrunkIDMap + func (m *TrunkIDMap) Get(lagid uint32, vid uint16) (opennsl.Trunk, bool) + func (m *TrunkIDMap) Register(lagid uint32, vid uint16, trunkId opennsl.Trunk) bool + func (m *TrunkIDMap) Traverse(f func(TrunkIDKey, opennsl.Trunk) bool) + func (m *TrunkIDMap) Unregister(lagid uint32, vid uint16) type VlanPortTable + func (t *VlanPortTable) Has(vid opennsl.Vlan) bool v0.3.1 Mar 22, 2019 Changes in this version + func AFToEtherType(family int) uint16 + 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 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 SimInit(unit int) + type APIServer struct + func NewAPIServer(server *Server) *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) 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 struct + APIAddr string + ConfigFile string + ConfigType string + Daemon bool + DpName string + LogFile string + PidFile string + UseSim bool + Verbose bool + func NewArgs() *Args + func (a *Args) Parse() + type BlockBcastConfig struct + Ports []*BlockBcastPortConfig + Range BlockBcastRangeConfig + func (c *BlockBcastConfig) Block() bool + func (c *BlockBcastConfig) String() string + type BlockBcastPortConfig struct + PVid uint16 + Port int + Vid uint16 + func (c *BlockBcastPortConfig) String() string + type BlockBcastRangeConfig struct + BaseVID uint16 + Max int + Min int + func (c *BlockBcastRangeConfig) Block() bool + func (c *BlockBcastRangeConfig) GetBaseVID() uint16 + func (c *BlockBcastRangeConfig) String() string + type Config struct + Dpaths map[string]*DpConfig + Logging LogConfig + func NewConfig() *Config + func (c *Config) GetDpConfig(name string) (*DpConfig, error) + func (c *Config) ReadFile(args *Args) (*viper.Viper, error) + type DpConfig struct + Addr string + BlockBcast BlockBcastConfig + DpID uint64 + OpenNSL *ONSLConfig + Port uint16 + Unit int + func (c *DpConfig) GetAddr() string + func (c *DpConfig) GetHost() string + func (c *DpConfig) GetPort() uint16 + func (c *DpConfig) String() string + type FieldGroup struct + func NewFieldGroup(unit int, cos uint32, pri int, qs ...opennsl.FieldQualify) *FieldGroup + func (f *FieldGroup) GetEntries() ([]opennsl.FieldEntry, error) + func (f *FieldGroup) InstallEntry(key string, entry opennsl.FieldEntry) error + func (f *FieldGroup) UninstallEntry(key string) + type FieldGroupDstIP struct + func NewFieldGroupDstIPv4(unit int) *FieldGroupDstIP + func NewFieldGroupDstIPv6(unit int) *FieldGroupDstIP + func (f *FieldGroupDstIP) AddEntry(ipDst *net.IPNet) error + func (f *FieldGroupDstIP) DeleteEntry(ipDst *net.IPNet) + func (f *FieldGroupDstIP) GetEntry(entry opennsl.FieldEntry) (opennsl.Ethertype, *net.IPNet, error) + func (f *FieldGroupDstIP) Key(ipDst *net.IPNet) string + type FieldGroupEthDst struct + func NewFieldGroupEthDst(unit int) *FieldGroupEthDst + func (f *FieldGroupEthDst) AddEntry(dest, mask net.HardwareAddr) error + func (f *FieldGroupEthDst) DeleteEntry(dest, mask net.HardwareAddr) + func (f *FieldGroupEthDst) GetEntry(entry opennsl.FieldEntry) (net.HardwareAddr, net.HardwareAddr, error) + func (f *FieldGroupEthDst) Key(dest, mask net.HardwareAddr) string + type FieldGroupEthType struct + func NewFieldGroupEthType(unit int) *FieldGroupEthType + func (f *FieldGroupEthType) AddEntry(etherType uint16) error + func (f *FieldGroupEthType) DeleteEntry(etherType uint16) + func (f *FieldGroupEthType) GetEntry(entry opennsl.FieldEntry) (opennsl.Ethertype, error) + func (f *FieldGroupEthType) Key(etherType uint16) string + type FieldGroupIPProto struct + func NewFieldGroupIPProto(unit int) *FieldGroupIPProto + func (f *FieldGroupIPProto) AddEntry(etherType uint16, proto uint8) error + func (f *FieldGroupIPProto) DeleteEntry(etherType uint16, proto uint8) + func (f *FieldGroupIPProto) GetEntry(entry opennsl.FieldEntry) (opennsl.Ethertype, uint8, error) + func (f *FieldGroupIPProto) Key(etherType uint16, proto uint8) string + type FieldGroups struct + DstIPv4 *FieldGroupDstIP + DstIPv6 *FieldGroupDstIP + EthDst *FieldGroupEthDst + EthType *FieldGroupEthType + IPProto *FieldGroupIPProto + func NewFieldGroups(unit int) *FieldGroups + type IDMaps struct + L2Stations *opennsl.L2StationIDMap + L3Egress *opennsl.L3EgressIDMap + L3Ifaces *opennsl.L3IfaceIDMap + func NewIDMaps() *IDMaps + type LinkInfo struct + Port opennsl.Port + func NewLinkInfo(port opennsl.Port, info *opennsl.PortInfo) *LinkInfo + func (l *LinkInfo) PortNo() uint32 + func (l *LinkInfo) PortState() uint32 + type LogConfig struct + RxDetail bool + RxDump bool + func (c *LogConfig) String() string + type ONSLConfig struct + Config string + ConfigPost string + Flags uint + RmConfig string + WbConfig string + type PortStats []opennsl.StatVal + func NewPortStats(names []string) PortStats + func (p PortStats) Get(unit int, port opennsl.Port) (map[string]uint64, error) + func (p PortStats) GetAll(unit int, ports []opennsl.Port) ([]map[string]uint64, error) + type Server struct + func NewServer(dpCfg *DpConfig, logCfg *LogConfig) *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) 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 VlanPortEntry struct + Vid opennsl.Vlan + func NewVlanPortEntry(vid opennsl.Vlan) *VlanPortEntry + func NewVlanPortEntryDefault() *VlanPortEntry + type VlanPortKey struct + Port opennsl.Port + Vid opennsl.Vlan + func NewVlanPortKey(port opennsl.Port, vid opennsl.Vlan) *VlanPortKey + func (k *VlanPortKey) String() string + type VlanPortTable struct + func NewVlanPortTable() *VlanPortTable + func NewVlanPortTableFromConfig(config *BlockBcastConfig) *VlanPortTable + func (t *VlanPortTable) ConvVID(port opennsl.Port, vid opennsl.Vlan) opennsl.Vlan + 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)