Class DefaultOpenFlowPacketContext
- java.lang.Object
-
- org.onosproject.openflow.controller.DefaultOpenFlowPacketContext
-
- All Implemented Interfaces:
OpenFlowPacketContext
public final class DefaultOpenFlowPacketContext extends java.lang.Object implements OpenFlowPacketContext
Default implementation of an OpenFlowPacketContext.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanblock()Blocks further responses (ie.voidbuild(org.onlab.packet.Ethernet ethFrame, org.projectfloodlight.openflow.types.OFPort outPort)Build the packet out in response to this packet in event.voidbuild(org.projectfloodlight.openflow.types.OFPort outPort)Build the packet out in response to this packet in event.java.util.Optional<java.lang.Long>cookie()Provide the cookie in the packet in message.Dpiddpid()Provide the dpid of the switch where the packet in arrived.java.lang.IntegerinPort()Provide the port on which the packet arrived.booleanisBuffered()Indicates that this packet is buffered at the switch.booleanisHandled()Checks whether the packet has been handled.static OpenFlowPacketContextpacketContextFromPacketIn(OpenFlowSwitch s, org.projectfloodlight.openflow.protocol.OFPacketIn pkt)Creates an OpenFlow packet context based on a packet-in.org.onlab.packet.Ethernetparsed()Provided a handle onto the parsed payload.voidsend()Provided build has been called send the packet out the switch it came in on.byte[]unparsed()Provide an unparsed copy of the data.
-
-
-
Method Detail
-
send
public void send()
Description copied from interface:OpenFlowPacketContextProvided build has been called send the packet out the switch it came in on.- Specified by:
sendin interfaceOpenFlowPacketContext
-
build
public void build(org.projectfloodlight.openflow.types.OFPort outPort)
Description copied from interface:OpenFlowPacketContextBuild the packet out in response to this packet in event.- Specified by:
buildin interfaceOpenFlowPacketContext- Parameters:
outPort- the out port to send to packet out of.
-
build
public void build(org.onlab.packet.Ethernet ethFrame, org.projectfloodlight.openflow.types.OFPort outPort)Description copied from interface:OpenFlowPacketContextBuild the packet out in response to this packet in event.- Specified by:
buildin interfaceOpenFlowPacketContext- Parameters:
ethFrame- the actual packet to send out.outPort- the out port to send to packet out of.
-
parsed
public org.onlab.packet.Ethernet parsed()
Description copied from interface:OpenFlowPacketContextProvided a handle onto the parsed payload.- Specified by:
parsedin interfaceOpenFlowPacketContext- Returns:
- the parsed form of the payload.
-
dpid
public Dpid dpid()
Description copied from interface:OpenFlowPacketContextProvide the dpid of the switch where the packet in arrived.- Specified by:
dpidin interfaceOpenFlowPacketContext- Returns:
- the dpid of the switch.
-
packetContextFromPacketIn
public static OpenFlowPacketContext packetContextFromPacketIn(OpenFlowSwitch s, org.projectfloodlight.openflow.protocol.OFPacketIn pkt)
Creates an OpenFlow packet context based on a packet-in.- Parameters:
s- OpenFlow switchpkt- OpenFlow packet-in- Returns:
- the OpenFlow packet context
-
inPort
public java.lang.Integer inPort()
Description copied from interface:OpenFlowPacketContextProvide the port on which the packet arrived.- Specified by:
inPortin interfaceOpenFlowPacketContext- Returns:
- the port
-
unparsed
public byte[] unparsed()
Description copied from interface:OpenFlowPacketContextProvide an unparsed copy of the data.- Specified by:
unparsedin interfaceOpenFlowPacketContext- Returns:
- the unparsed form of the payload.
-
block
public boolean block()
Description copied from interface:OpenFlowPacketContextBlocks further responses (ie. send() calls) on this packet in event.- Specified by:
blockin interfaceOpenFlowPacketContext- Returns:
- true if blocks
-
isHandled
public boolean isHandled()
Description copied from interface:OpenFlowPacketContextChecks whether the packet has been handled.- Specified by:
isHandledin interfaceOpenFlowPacketContext- Returns:
- true if handled, false otherwise.
-
isBuffered
public boolean isBuffered()
Description copied from interface:OpenFlowPacketContextIndicates that this packet is buffered at the switch.- Specified by:
isBufferedin interfaceOpenFlowPacketContext- Returns:
- buffer indication
-
cookie
public java.util.Optional<java.lang.Long> cookie()
Description copied from interface:OpenFlowPacketContextProvide the cookie in the packet in message.- Specified by:
cookiein interfaceOpenFlowPacketContext- Returns:
- optional flow cookie
-
-