Documentation ¶
Overview ¶
* Copyright 2020-2024 Open Networking Foundation (ONF) and the ONF Contributors * * Licensed 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.
* Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors * * Licensed 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.
Index ¶
- Variables
- func ArpOp(arpOp uint32) *ofp.OfpOxmOfbField
- func ArpSha(arpSha []byte) *ofp.OfpOxmOfbField
- func ArpSpa(arpSpa uint32) *ofp.OfpOxmOfbField
- func ArpTha(arpTha []byte) *ofp.OfpOxmOfbField
- func ArpTpa(arpTpa uint32) *ofp.OfpOxmOfbField
- func ConvertToMulticastMacBytes(ip uint32) []byte
- func ConvertToMulticastMacInt(ip uint32) uint64
- func EthDst(ethDst uint64) *ofp.OfpOxmOfbField
- func EthSrc(ethSrc uint64) *ofp.OfpOxmOfbField
- func EthType(ethType uint32) *ofp.OfpOxmOfbField
- func Experimenter(experimenter uint32, data []byte) *ofp.OfpAction
- func FindFlowById(flows []*ofp.OfpFlowStats, flow *ofp.OfpFlowStats) int
- func FindFlows(flows []*ofp.OfpFlowStats, flow *ofp.OfpFlowStats) int
- func FindGroup(groups []*ofp.OfpGroupEntry, groupId uint32) int
- func FindOverlappingFlows(flows []*ofp.OfpFlowStats, mod *ofp.OfpFlowMod) []*ofp.OfpFlowStats
- func FlowHasOutGroup(flow *ofp.OfpFlowStats, groupID uint32) bool
- func FlowHasOutPort(flow *ofp.OfpFlowStats, outPort uint32) bool
- func FlowMatch(f1 *ofp.OfpFlowStats, f2 *ofp.OfpFlowStats) bool
- func FlowMatchesMod(flow *ofp.OfpFlowStats, mod *ofp.OfpFlowMod) bool
- func FlowStatsEntryFromFlowModMessage(mod *ofp.OfpFlowMod) (*ofp.OfpFlowStats, error)
- func FlowsDeleteByGroupId(flows []*ofp.OfpFlowStats, groupId uint32) (bool, []*ofp.OfpFlowStats)
- func GetActions(flow *ofp.OfpFlowStats, exclude ...ofp.OfpActionType) []*ofp.OfpAction
- func GetChildPortFromTunnelId(flow *ofp.OfpFlowStats) uint32
- func GetEgressPortNumberFromWriteMetadata(ctx context.Context, flow *ofp.OfpFlowStats) uint32
- func GetGotoTableId(flow *ofp.OfpFlowStats) uint32
- func GetGroup(flow *ofp.OfpFlowStats) uint32
- func GetInPort(flow *ofp.OfpFlowStats) uint32
- func GetInnerTagFromMetaData(ctx context.Context, flow *ofp.OfpFlowStats) uint16
- func GetInnerTagFromWriteMetaData(ctx context.Context, metadata uint64) uint16
- func GetMetaData(ctx context.Context, flow *ofp.OfpFlowStats) uint32
- func GetMetaData64Bit(ctx context.Context, flow *ofp.OfpFlowStats) uint64
- func GetMetadataFlowModArgs(kw OfpFlowModArgs) uint64
- func GetMetadataFromWriteMetadataAction(ctx context.Context, flow *ofp.OfpFlowStats) uint64
- func GetMeterId(flow *ofp.OfpFlowStats) uint32
- func GetMeterIdFlowModArgs(kw OfpFlowModArgs) uint32
- func GetMeterIdFromFlow(flow *ofp.OfpFlowStats) uint32
- func GetMeterIdFromWriteMetadata(ctx context.Context, flow *ofp.OfpFlowStats) uint32
- func GetNextTableId(kw OfpFlowModArgs) *uint32
- func GetOfbFields(flow *ofp.OfpFlowStats, exclude ...ofp.OxmOfbFieldTypes) []*ofp.OfpOxmOfbField
- func GetOutPort(flow *ofp.OfpFlowStats) uint32
- func GetPacketOutPort(packet *ofp.OfpPacketOut) uint32
- func GetSetActionField(ctx context.Context, flow *ofp.OfpFlowStats, ofbType ofp.OxmOfbFieldTypes) (uint32, bool)
- func GetTechProfileIDFromWriteMetaData(ctx context.Context, metadata uint64) uint16
- func GetTunnelId(flow *ofp.OfpFlowStats) uint64
- func GetVlanVid(flow *ofp.OfpFlowStats) *uint32
- func Group(groupId uint32) *ofp.OfpAction
- func GroupEntryFromGroupMod(mod *ofp.OfpGroupMod) *ofp.OfpGroupEntry
- func HasGroup(flow *ofp.OfpFlowStats) bool
- func HasNextTable(flow *ofp.OfpFlowStats) bool
- func HashFlowStats(flow *ofp.OfpFlowStats) (uint64, error)
- func Icmpv4Code(icmpv4Code uint32) *ofp.OfpOxmOfbField
- func Icmpv4Type(icmpv4Type uint32) *ofp.OfpOxmOfbField
- func Icmpv6Code(icmpv6Code uint32) *ofp.OfpOxmOfbField
- func Icmpv6Type(icmpv6Type uint32) *ofp.OfpOxmOfbField
- func InPhyPort(inPhyPort uint32) *ofp.OfpOxmOfbField
- func InPort(inPort uint32) *ofp.OfpOxmOfbField
- func IpDscp(ipDscp uint32) *ofp.OfpOxmOfbField
- func IpEcn(ipEcn uint32) *ofp.OfpOxmOfbField
- func IpProto(ipProto uint32) *ofp.OfpOxmOfbField
- func Ipv4Dst(ipv4Dst uint32) *ofp.OfpOxmOfbField
- func Ipv4Src(ipv4Src uint32) *ofp.OfpOxmOfbField
- func Ipv6Dst(ipv6Dst []byte) *ofp.OfpOxmOfbField
- func Ipv6Exthdr(ipv6Exthdr uint32) *ofp.OfpOxmOfbField
- func Ipv6Flabel(ipv6Flabel uint32) *ofp.OfpOxmOfbField
- func Ipv6NdTarget(ipv6NdTarget []byte) *ofp.OfpOxmOfbField
- func Ipv6NdTll(ipv6NdTll []byte) *ofp.OfpOxmOfbField
- func Ipv6Src(ipv6Src []byte) *ofp.OfpOxmOfbField
- func IsMulticastIp(ip uint32) bool
- func Metadata_ofp(tableMetadata uint64) *ofp.OfpOxmOfbField
- func MeterEntryFromMeterMod(ctx context.Context, meterMod *ofp.OfpMeterMod) *ofp.OfpMeterEntry
- func MkFlowStat(fa *FlowArgs) (*ofp.OfpFlowStats, error)
- func MkGroupStat(ga *GroupArgs) *ofp.OfpGroupEntry
- func MkInstructionsFromActions(actions []*ofp.OfpAction) []*ofp.OfpInstruction
- func MkMulticastGroupMod(groupId uint32, buckets []*ofp.OfpBucket, command *ofp.OfpGroupModCommand) *ofp.OfpGroupMod
- func MkOxmFields(matchFields []ofp.OfpOxmField) []*ofp.OfpOxmField
- func MkPacketIn(port uint32, packet []byte) *ofp.OfpPacketIn
- func MkSimpleFlowMod(matchFields []*ofp.OfpOxmField, actions []*ofp.OfpAction, ...) *ofp.OfpFlowMod
- func MplsBos(mplsBos uint32) *ofp.OfpOxmOfbField
- func MplsLabel(mplsLabel uint32) *ofp.OfpOxmOfbField
- func MplsTc(mplsTc uint32) *ofp.OfpOxmOfbField
- func MplsTtl(ttl uint32) *ofp.OfpAction
- func NwTtl(nwTtl uint32) *ofp.OfpAction
- func OfbIpv6NdSll(ofbIpv6NdSll []byte) *ofp.OfpOxmOfbField
- func Output(port uint32, maxLen ...ofp.OfpControllerMaxLen) *ofp.OfpAction
- func PbbIsid(pbbIsid uint32) *ofp.OfpOxmOfbField
- func PopMpls(ethType uint32) *ofp.OfpAction
- func PopVlan() *ofp.OfpAction
- func PushVlan(ethType uint32) *ofp.OfpAction
- func SctpDst(sctpDst uint32) *ofp.OfpOxmOfbField
- func SctpSrc(sctpSrc uint32) *ofp.OfpOxmOfbField
- func SetField(field *ofp.OfpOxmOfbField) *ofp.OfpAction
- func SetMeterIdToFlow(flow *ofp.OfpFlowStats, meterId uint32)
- func TcpDst(tcpDst uint32) *ofp.OfpOxmOfbField
- func TcpSrc(tcpSrc uint32) *ofp.OfpOxmOfbField
- func ToOfpOxmField(from []*ofp.OfpOxmOfbField) []*ofp.OfpOxmField
- func TunnelId(tunnelId uint64) *ofp.OfpOxmOfbField
- func UdpDst(udpDst uint32) *ofp.OfpOxmOfbField
- func UdpSrc(udpSrc uint32) *ofp.OfpOxmOfbField
- func UpdateOutputPortByActionType(flow *ofp.OfpFlowStats, actionType uint32, toPort uint32) *ofp.OfpFlowStats
- func VlanPcp(vlanPcp uint32) *ofp.OfpOxmOfbField
- func VlanVid(vlanVid uint32) *ofp.OfpOxmOfbField
- type DeviceRules
- func (dr *DeviceRules) AddFlow(deviceId string, flow *ofp.OfpFlowStats)
- func (dr *DeviceRules) AddFlowsAndGroup(deviceId string, fg *FlowsAndGroups)
- func (dr *DeviceRules) ClearFlows(deviceId string)
- func (dr *DeviceRules) Copy() *DeviceRules
- func (dr *DeviceRules) CreateEntryIfNotExist(deviceId string)
- func (dr *DeviceRules) FilterRules(deviceIds map[string]string) *DeviceRules
- func (dr *DeviceRules) GetRules() map[string]*FlowsAndGroups
- func (dr *DeviceRules) Keys() []string
- func (dr *DeviceRules) RemoveRule(deviceId string)
- func (dr *DeviceRules) String() string
- type FlowArgs
- type FlowsAndGroups
- func (fg *FlowsAndGroups) AddFlow(flow *ofp.OfpFlowStats)
- func (fg *FlowsAndGroups) AddFrom(from *FlowsAndGroups)
- func (fg *FlowsAndGroups) AddGroup(group *ofp.OfpGroupEntry)
- func (fg *FlowsAndGroups) Copy() *FlowsAndGroups
- func (fg *FlowsAndGroups) GetFlow(index int) *ofp.OfpFlowStats
- func (fg *FlowsAndGroups) ListFlows() []*ofp.OfpFlowStats
- func (fg *FlowsAndGroups) ListGroups() []*ofp.OfpGroupEntry
- func (fg *FlowsAndGroups) String() string
- type GroupArgs
- type OfpFlowModArgs
Constants ¶
This section is empty.
Variables ¶
var ( // Instructions shortcut APPLY_ACTIONS = ofp.OfpInstructionType_OFPIT_APPLY_ACTIONS WRITE_METADATA = ofp.OfpInstructionType_OFPIT_WRITE_METADATA METER_ACTION = ofp.OfpInstructionType_OFPIT_METER //OFPAT_* shortcuts OUTPUT = ofp.OfpActionType_OFPAT_OUTPUT COPY_TTL_OUT = ofp.OfpActionType_OFPAT_COPY_TTL_OUT COPY_TTL_IN = ofp.OfpActionType_OFPAT_COPY_TTL_IN SET_MPLS_TTL = ofp.OfpActionType_OFPAT_SET_MPLS_TTL DEC_MPLS_TTL = ofp.OfpActionType_OFPAT_DEC_MPLS_TTL PUSH_VLAN = ofp.OfpActionType_OFPAT_PUSH_VLAN POP_VLAN = ofp.OfpActionType_OFPAT_POP_VLAN PUSH_MPLS = ofp.OfpActionType_OFPAT_PUSH_MPLS POP_MPLS = ofp.OfpActionType_OFPAT_POP_MPLS SET_QUEUE = ofp.OfpActionType_OFPAT_SET_QUEUE GROUP = ofp.OfpActionType_OFPAT_GROUP SET_NW_TTL = ofp.OfpActionType_OFPAT_SET_NW_TTL NW_TTL = ofp.OfpActionType_OFPAT_DEC_NW_TTL SET_FIELD = ofp.OfpActionType_OFPAT_SET_FIELD PUSH_PBB = ofp.OfpActionType_OFPAT_PUSH_PBB POP_PBB = ofp.OfpActionType_OFPAT_POP_PBB EXPERIMENTER = ofp.OfpActionType_OFPAT_EXPERIMENTER //OFPXMT_OFB_* shortcuts (incomplete) IN_PORT = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IN_PORT IN_PHY_PORT = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IN_PHY_PORT METADATA = ofp.OxmOfbFieldTypes_OFPXMT_OFB_METADATA ETH_DST = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ETH_DST ETH_SRC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ETH_SRC ETH_TYPE = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ETH_TYPE VLAN_VID = ofp.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_VID VLAN_PCP = ofp.OxmOfbFieldTypes_OFPXMT_OFB_VLAN_PCP IP_DSCP = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IP_DSCP IP_ECN = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IP_ECN IP_PROTO = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IP_PROTO IPV4_SRC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_SRC IPV4_DST = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV4_DST TCP_SRC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_TCP_SRC TCP_DST = ofp.OxmOfbFieldTypes_OFPXMT_OFB_TCP_DST UDP_SRC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_UDP_SRC UDP_DST = ofp.OxmOfbFieldTypes_OFPXMT_OFB_UDP_DST SCTP_SRC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_SCTP_SRC SCTP_DST = ofp.OxmOfbFieldTypes_OFPXMT_OFB_SCTP_DST ICMPV4_TYPE = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ICMPV4_TYPE ICMPV4_CODE = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ICMPV4_CODE ARP_OP = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ARP_OP ARP_SPA = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ARP_SPA ARP_TPA = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ARP_TPA ARP_SHA = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ARP_SHA ARP_THA = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ARP_THA IPV6_SRC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_SRC IPV6_DST = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_DST IPV6_FLABEL = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_FLABEL ICMPV6_TYPE = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ICMPV6_TYPE ICMPV6_CODE = ofp.OxmOfbFieldTypes_OFPXMT_OFB_ICMPV6_CODE IPV6_ND_TARGET = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_ND_TARGET OFB_IPV6_ND_SLL = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_ND_SLL IPV6_ND_TLL = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_ND_TLL MPLS_LABEL = ofp.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_LABEL MPLS_TC = ofp.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_TC MPLS_BOS = ofp.OxmOfbFieldTypes_OFPXMT_OFB_MPLS_BOS PBB_ISID = ofp.OxmOfbFieldTypes_OFPXMT_OFB_PBB_ISID TUNNEL_ID = ofp.OxmOfbFieldTypes_OFPXMT_OFB_TUNNEL_ID IPV6_EXTHDR = ofp.OxmOfbFieldTypes_OFPXMT_OFB_IPV6_EXTHDR )
Functions ¶
func ArpOp ¶
func ArpOp(arpOp uint32) *ofp.OfpOxmOfbField
func ArpSha ¶
func ArpSha(arpSha []byte) *ofp.OfpOxmOfbField
func ArpSpa ¶
func ArpSpa(arpSpa uint32) *ofp.OfpOxmOfbField
func ArpTha ¶
func ArpTha(arpTha []byte) *ofp.OfpOxmOfbField
func ArpTpa ¶
func ArpTpa(arpTpa uint32) *ofp.OfpOxmOfbField
func ConvertToMulticastMacBytes ¶
ConvertToMulticastMacBytes returns equivalent mac address of the given multicast ip address
func ConvertToMulticastMacInt ¶
ConvertToMulticastMacInt returns equivalent mac address of the given multicast ip address
func EthType ¶
func EthType(ethType uint32) *ofp.OfpOxmOfbField
func FindFlowById ¶
func FindFlowById(flows []*ofp.OfpFlowStats, flow *ofp.OfpFlowStats) int
FindFlowById returns the index of the flow in the flows array if present. Otherwise, it returns -1
func FindFlows ¶
func FindFlows(flows []*ofp.OfpFlowStats, flow *ofp.OfpFlowStats) int
FindFlows returns the index in flows where flow if present. Otherwise, it returns -1
func FindGroup ¶
func FindGroup(groups []*ofp.OfpGroupEntry, groupId uint32) int
FindGroup returns index of group if found, else returns -1
func FindOverlappingFlows ¶
func FindOverlappingFlows(flows []*ofp.OfpFlowStats, mod *ofp.OfpFlowMod) []*ofp.OfpFlowStats
FindOverlappingFlows return a list of overlapping flow(s) where mod is the flow request
func FlowHasOutGroup ¶
func FlowHasOutGroup(flow *ofp.OfpFlowStats, groupID uint32) bool
FlowHasOutGroup return True if flow has a output command with the given out_group
func FlowHasOutPort ¶
func FlowHasOutPort(flow *ofp.OfpFlowStats, outPort uint32) bool
FlowHasOutPort returns True if flow has a output command with the given out_port
func FlowMatch ¶
func FlowMatch(f1 *ofp.OfpFlowStats, f2 *ofp.OfpFlowStats) bool
FlowMatch returns true if two flows matches on the following flow attributes: TableId, Priority, Flags, Cookie, Match
func FlowMatchesMod ¶
func FlowMatchesMod(flow *ofp.OfpFlowStats, mod *ofp.OfpFlowMod) bool
FlowMatchesMod returns True if given flow is "covered" by the wildcard flow_mod, taking into consideration of both exact matches as well as masks-based match fields if any. Otherwise return False
func FlowStatsEntryFromFlowModMessage ¶
func FlowStatsEntryFromFlowModMessage(mod *ofp.OfpFlowMod) (*ofp.OfpFlowStats, error)
flowStatsEntryFromFlowModMessage maps an ofp_flow_mod message to an ofp_flow_stats message
func FlowsDeleteByGroupId ¶
func FlowsDeleteByGroupId(flows []*ofp.OfpFlowStats, groupId uint32) (bool, []*ofp.OfpFlowStats)
func GetActions ¶
func GetActions(flow *ofp.OfpFlowStats, exclude ...ofp.OfpActionType) []*ofp.OfpAction
func GetChildPortFromTunnelId ¶
func GetChildPortFromTunnelId(flow *ofp.OfpFlowStats) uint32
Extract the child device port from a flow that contains the parent device peer port. Typically the UNI port of an ONU child device. Per TST agreement this will be the lower 32 bits of tunnel id reserving upper 32 bits for later use
func GetEgressPortNumberFromWriteMetadata ¶
func GetEgressPortNumberFromWriteMetadata(ctx context.Context, flow *ofp.OfpFlowStats) uint32
func GetGotoTableId ¶
func GetGotoTableId(flow *ofp.OfpFlowStats) uint32
func GetGroup ¶
func GetGroup(flow *ofp.OfpFlowStats) uint32
func GetInPort ¶
func GetInPort(flow *ofp.OfpFlowStats) uint32
func GetInnerTagFromMetaData ¶
func GetInnerTagFromMetaData(ctx context.Context, flow *ofp.OfpFlowStats) uint16
func GetMetaData ¶
func GetMetaData(ctx context.Context, flow *ofp.OfpFlowStats) uint32
GetMetaData - legacy get method (only want lower 32 bits)
func GetMetaData64Bit ¶
func GetMetaData64Bit(ctx context.Context, flow *ofp.OfpFlowStats) uint64
func GetMetadataFlowModArgs ¶
func GetMetadataFlowModArgs(kw OfpFlowModArgs) uint64
Function returns the metadata if the "write_metadata" is present in the map, otherwise return nil
func GetMetadataFromWriteMetadataAction ¶
func GetMetadataFromWriteMetadataAction(ctx context.Context, flow *ofp.OfpFlowStats) uint64
function returns write metadata value from write_metadata action field
func GetMeterId ¶
func GetMeterId(flow *ofp.OfpFlowStats) uint32
func GetMeterIdFlowModArgs ¶
func GetMeterIdFlowModArgs(kw OfpFlowModArgs) uint32
GetMeterIdFlowModArgs returns the meterId if the "meter_id" is present in the map, otherwise return 0
func GetMeterIdFromFlow ¶
func GetMeterIdFromFlow(flow *ofp.OfpFlowStats) uint32
func GetMeterIdFromWriteMetadata ¶
func GetMeterIdFromWriteMetadata(ctx context.Context, flow *ofp.OfpFlowStats) uint32
func GetNextTableId ¶
func GetNextTableId(kw OfpFlowModArgs) *uint32
GetNextTableId returns the next table ID if the "table_id" is present in the map, otherwise return nil
func GetOfbFields ¶
func GetOfbFields(flow *ofp.OfpFlowStats, exclude ...ofp.OxmOfbFieldTypes) []*ofp.OfpOxmOfbField
func GetOutPort ¶
func GetOutPort(flow *ofp.OfpFlowStats) uint32
func GetPacketOutPort ¶
func GetPacketOutPort(packet *ofp.OfpPacketOut) uint32
func GetSetActionField ¶
func GetSetActionField(ctx context.Context, flow *ofp.OfpFlowStats, ofbType ofp.OxmOfbFieldTypes) (uint32, bool)
func GetTunnelId ¶
func GetTunnelId(flow *ofp.OfpFlowStats) uint64
func GetVlanVid ¶
func GetVlanVid(flow *ofp.OfpFlowStats) *uint32
func GroupEntryFromGroupMod ¶
func GroupEntryFromGroupMod(mod *ofp.OfpGroupMod) *ofp.OfpGroupEntry
func HasGroup ¶
func HasGroup(flow *ofp.OfpFlowStats) bool
func HasNextTable ¶
func HasNextTable(flow *ofp.OfpFlowStats) bool
func HashFlowStats ¶
func HashFlowStats(flow *ofp.OfpFlowStats) (uint64, error)
HashFlowStats returns a unique 64-bit integer hash of 'table_id', 'priority', and 'match' The OF spec states that: A flow table entry is identified by its match fields and priority: the match fields and priority taken together identify a unique flow entry in the flow table.
func Icmpv4Code ¶
func Icmpv4Code(icmpv4Code uint32) *ofp.OfpOxmOfbField
func Icmpv4Type ¶
func Icmpv4Type(icmpv4Type uint32) *ofp.OfpOxmOfbField
func Icmpv6Code ¶
func Icmpv6Code(icmpv6Code uint32) *ofp.OfpOxmOfbField
func Icmpv6Type ¶
func Icmpv6Type(icmpv6Type uint32) *ofp.OfpOxmOfbField
func InPhyPort ¶
func InPhyPort(inPhyPort uint32) *ofp.OfpOxmOfbField
func InPort ¶
func InPort(inPort uint32) *ofp.OfpOxmOfbField
func IpDscp ¶
func IpDscp(ipDscp uint32) *ofp.OfpOxmOfbField
func IpEcn ¶
func IpEcn(ipEcn uint32) *ofp.OfpOxmOfbField
func IpProto ¶
func IpProto(ipProto uint32) *ofp.OfpOxmOfbField
func Ipv4Dst ¶
func Ipv4Dst(ipv4Dst uint32) *ofp.OfpOxmOfbField
func Ipv4Src ¶
func Ipv4Src(ipv4Src uint32) *ofp.OfpOxmOfbField
func Ipv6Dst ¶
func Ipv6Dst(ipv6Dst []byte) *ofp.OfpOxmOfbField
func Ipv6Exthdr ¶
func Ipv6Exthdr(ipv6Exthdr uint32) *ofp.OfpOxmOfbField
func Ipv6Flabel ¶
func Ipv6Flabel(ipv6Flabel uint32) *ofp.OfpOxmOfbField
func Ipv6NdTarget ¶
func Ipv6NdTarget(ipv6NdTarget []byte) *ofp.OfpOxmOfbField
func Ipv6NdTll ¶
func Ipv6NdTll(ipv6NdTll []byte) *ofp.OfpOxmOfbField
func Ipv6Src ¶
func Ipv6Src(ipv6Src []byte) *ofp.OfpOxmOfbField
func IsMulticastIp ¶
IsMulticastIp returns true if the ip starts with the byte sequence of 1110; false otherwise.
func Metadata_ofp ¶
func Metadata_ofp(tableMetadata uint64) *ofp.OfpOxmOfbField
func MeterEntryFromMeterMod ¶
func MeterEntryFromMeterMod(ctx context.Context, meterMod *ofp.OfpMeterMod) *ofp.OfpMeterEntry
flowStatsEntryFromFlowModMessage maps an ofp_flow_mod message to an ofp_flow_stats message
func MkFlowStat ¶
func MkFlowStat(fa *FlowArgs) (*ofp.OfpFlowStats, error)
MkFlowStat is a helper method to build flows
func MkGroupStat ¶
func MkGroupStat(ga *GroupArgs) *ofp.OfpGroupEntry
func MkInstructionsFromActions ¶
func MkInstructionsFromActions(actions []*ofp.OfpAction) []*ofp.OfpInstruction
func MkMulticastGroupMod ¶
func MkMulticastGroupMod(groupId uint32, buckets []*ofp.OfpBucket, command *ofp.OfpGroupModCommand) *ofp.OfpGroupMod
func MkOxmFields ¶
func MkOxmFields(matchFields []ofp.OfpOxmField) []*ofp.OfpOxmField
func MkPacketIn ¶
func MkPacketIn(port uint32, packet []byte) *ofp.OfpPacketIn
func MkSimpleFlowMod ¶
func MkSimpleFlowMod(matchFields []*ofp.OfpOxmField, actions []*ofp.OfpAction, command *ofp.OfpFlowModCommand, kw OfpFlowModArgs) *ofp.OfpFlowMod
Convenience function to generare ofp_flow_mod message with OXM BASIC match composed from the match_fields, and single APPLY_ACTIONS instruction with a list if ofp_action objects.
func MplsBos ¶
func MplsBos(mplsBos uint32) *ofp.OfpOxmOfbField
func MplsLabel ¶
func MplsLabel(mplsLabel uint32) *ofp.OfpOxmOfbField
func MplsTc ¶
func MplsTc(mplsTc uint32) *ofp.OfpOxmOfbField
func OfbIpv6NdSll ¶
func OfbIpv6NdSll(ofbIpv6NdSll []byte) *ofp.OfpOxmOfbField
func PbbIsid ¶
func PbbIsid(pbbIsid uint32) *ofp.OfpOxmOfbField
func SctpDst ¶
func SctpDst(sctpDst uint32) *ofp.OfpOxmOfbField
func SctpSrc ¶
func SctpSrc(sctpSrc uint32) *ofp.OfpOxmOfbField
func SetMeterIdToFlow ¶
func SetMeterIdToFlow(flow *ofp.OfpFlowStats, meterId uint32)
func TcpDst ¶
func TcpDst(tcpDst uint32) *ofp.OfpOxmOfbField
func TcpSrc ¶
func TcpSrc(tcpSrc uint32) *ofp.OfpOxmOfbField
func ToOfpOxmField ¶
func ToOfpOxmField(from []*ofp.OfpOxmOfbField) []*ofp.OfpOxmField
func TunnelId ¶
func TunnelId(tunnelId uint64) *ofp.OfpOxmOfbField
func UdpDst ¶
func UdpDst(udpDst uint32) *ofp.OfpOxmOfbField
func UdpSrc ¶
func UdpSrc(udpSrc uint32) *ofp.OfpOxmOfbField
func UpdateOutputPortByActionType ¶
func UpdateOutputPortByActionType(flow *ofp.OfpFlowStats, actionType uint32, toPort uint32) *ofp.OfpFlowStats
func VlanPcp ¶
func VlanPcp(vlanPcp uint32) *ofp.OfpOxmOfbField
func VlanVid ¶
func VlanVid(vlanVid uint32) *ofp.OfpOxmOfbField
Types ¶
type DeviceRules ¶
type DeviceRules struct { Rules map[string]*FlowsAndGroups // contains filtered or unexported fields }
func NewDeviceRules ¶
func NewDeviceRules() *DeviceRules
func (*DeviceRules) AddFlow ¶
func (dr *DeviceRules) AddFlow(deviceId string, flow *ofp.OfpFlowStats)
func (*DeviceRules) AddFlowsAndGroup ¶
func (dr *DeviceRules) AddFlowsAndGroup(deviceId string, fg *FlowsAndGroups)
func (*DeviceRules) ClearFlows ¶
func (dr *DeviceRules) ClearFlows(deviceId string)
func (*DeviceRules) Copy ¶
func (dr *DeviceRules) Copy() *DeviceRules
func (*DeviceRules) CreateEntryIfNotExist ¶
func (dr *DeviceRules) CreateEntryIfNotExist(deviceId string)
CreateEntryIfNotExist creates a new deviceId in the Map if it does not exist and assigns an empty FlowsAndGroups to it. Otherwise, it does nothing.
func (*DeviceRules) FilterRules ¶
func (dr *DeviceRules) FilterRules(deviceIds map[string]string) *DeviceRules
func (*DeviceRules) GetRules ¶
func (dr *DeviceRules) GetRules() map[string]*FlowsAndGroups
func (*DeviceRules) Keys ¶
func (dr *DeviceRules) Keys() []string
func (*DeviceRules) RemoveRule ¶
func (dr *DeviceRules) RemoveRule(deviceId string)
func (*DeviceRules) String ¶
func (dr *DeviceRules) String() string
type FlowArgs ¶
type FlowArgs struct { MatchFields []*ofp.OfpOxmOfbField Actions []*ofp.OfpAction Command *ofp.OfpFlowModCommand Priority uint32 KV OfpFlowModArgs }
type FlowsAndGroups ¶
type FlowsAndGroups struct { Flows *ordered_map.OrderedMap Groups *ordered_map.OrderedMap }
func NewFlowsAndGroups ¶
func NewFlowsAndGroups() *FlowsAndGroups
func (*FlowsAndGroups) AddFlow ¶
func (fg *FlowsAndGroups) AddFlow(flow *ofp.OfpFlowStats)
func (*FlowsAndGroups) AddFrom ¶
func (fg *FlowsAndGroups) AddFrom(from *FlowsAndGroups)
AddFrom add flows and groups from the argument into this structure only if they do not already exist
func (*FlowsAndGroups) AddGroup ¶
func (fg *FlowsAndGroups) AddGroup(group *ofp.OfpGroupEntry)
func (*FlowsAndGroups) Copy ¶
func (fg *FlowsAndGroups) Copy() *FlowsAndGroups
func (*FlowsAndGroups) GetFlow ¶
func (fg *FlowsAndGroups) GetFlow(index int) *ofp.OfpFlowStats
func (*FlowsAndGroups) ListFlows ¶
func (fg *FlowsAndGroups) ListFlows() []*ofp.OfpFlowStats
func (*FlowsAndGroups) ListGroups ¶
func (fg *FlowsAndGroups) ListGroups() []*ofp.OfpGroupEntry
func (*FlowsAndGroups) String ¶
func (fg *FlowsAndGroups) String() string
type GroupArgs ¶
type GroupArgs struct { GroupId uint32 Buckets []*ofp.OfpBucket Command *ofp.OfpGroupModCommand }