Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
0d41da88
Commit
0d41da88
authored
12 years ago
by
Gregor Maier
Browse files
Options
Downloads
Patches
Plain Diff
packetOutMultiPort: add version with byte[] and IPacket as input
parent
552bf85d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
+34
-8
34 additions, 8 deletions
...java/net/floodlightcontroller/routing/ForwardingBase.java
with
34 additions
and
8 deletions
src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
+
34
−
8
View file @
0d41da88
...
...
@@ -20,9 +20,9 @@ package net.floodlightcontroller.routing;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Set
;
import
net.floodlightcontroller.core.FloodlightContext
;
import
net.floodlightcontroller.core.IFloodlightProviderService
;
...
...
@@ -35,6 +35,7 @@ import net.floodlightcontroller.devicemanager.IDeviceListener;
import
net.floodlightcontroller.devicemanager.IDeviceService
;
import
net.floodlightcontroller.devicemanager.SwitchPort
;
import
net.floodlightcontroller.packet.Ethernet
;
import
net.floodlightcontroller.packet.IPacket
;
import
net.floodlightcontroller.routing.IRoutingService
;
import
net.floodlightcontroller.routing.IRoutingDecision
;
import
net.floodlightcontroller.routing.Route
;
...
...
@@ -341,20 +342,20 @@ public abstract class ForwardingBase implements
}
}
/**
* Write packetout message to sw with output actions to one or more
* output ports with inPort/outPorts passed in.
* Note that the packet in could be from a different switch.
* @param pi
* @param packetData
* @param sw
* @param inPort
* @param ports
* @param cntx
*/
public
void
P
acketOutMultiPort
(
OFPacketIn
pi
,
public
void
p
acketOutMultiPort
(
byte
[]
packetData
,
IOFSwitch
sw
,
short
inPort
,
Hash
Set
<
Integer
>
outPorts
,
Set
<
Integer
>
outPorts
,
FloodlightContext
cntx
)
{
//setting actions
List
<
OFAction
>
actions
=
new
ArrayList
<
OFAction
>();
...
...
@@ -381,7 +382,6 @@ public abstract class ForwardingBase implements
// data (note buffer_id is always BUFFER_ID_NONE) and length
short
poLength
=
(
short
)(
po
.
getActionsLength
()
+
OFPacketOut
.
MINIMUM_LENGTH
);
byte
[]
packetData
=
pi
.
getPacketData
();
poLength
+=
packetData
.
length
;
po
.
setPacketData
(
packetData
);
po
.
setLength
(
poLength
);
...
...
@@ -390,8 +390,8 @@ public abstract class ForwardingBase implements
counterStore
.
updatePktOutFMCounterStore
(
sw
,
po
);
if
(
log
.
isTraceEnabled
())
{
log
.
trace
(
"write broadcast packet on switch-id={} "
+
"interaces={}
packet-in={}
packet-out={}"
,
new
Object
[]
{
sw
.
getId
(),
outPorts
,
pi
,
po
});
"inter
f
aces={} packet-out={}"
,
new
Object
[]
{
sw
.
getId
(),
outPorts
,
po
});
}
sw
.
write
(
po
,
cntx
);
...
...
@@ -399,6 +399,32 @@ public abstract class ForwardingBase implements
log
.
error
(
"Failure writing packet out"
,
e
);
}
}
/**
* @see packetOutMultiPort
* Accepts a PacketIn instead of raw packet data. Note that the inPort
* and switch can be different than the packet in switch/port
*/
public
void
packetOutMultiPort
(
OFPacketIn
pi
,
IOFSwitch
sw
,
short
inPort
,
Set
<
Integer
>
outPorts
,
FloodlightContext
cntx
)
{
packetOutMultiPort
(
pi
.
getPacketData
(),
sw
,
inPort
,
outPorts
,
cntx
);
}
/**
* @see packetOutMultiPort
* Accepts an IPacket instead of raw packet data. Note that the inPort
* and switch can be different than the packet in switch/port
*/
public
void
packetOutMultiPort
(
IPacket
packet
,
IOFSwitch
sw
,
short
inPort
,
Set
<
Integer
>
outPorts
,
FloodlightContext
cntx
)
{
packetOutMultiPort
(
packet
.
serialize
(),
sw
,
inPort
,
outPorts
,
cntx
);
}
protected
boolean
isInBroadcastCache
(
IOFSwitch
sw
,
OFPacketIn
pi
,
FloodlightContext
cntx
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment