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
e25273af
Commit
e25273af
authored
11 years ago
by
Gregor Maier
Browse files
Options
Downloads
Patches
Plain Diff
Small tweaks
parent
8cccb549
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/net/floodlightcontroller/debugevent/IDebugEventService.java
+2
-1
2 additions, 1 deletion
...t/floodlightcontroller/debugevent/IDebugEventService.java
src/main/java/net/floodlightcontroller/packet/IPv4.java
+13
-8
13 additions, 8 deletions
src/main/java/net/floodlightcontroller/packet/IPv4.java
with
15 additions
and
9 deletions
src/main/java/net/floodlightcontroller/debugevent/IDebugEventService.java
+
2
−
1
View file @
e25273af
...
...
@@ -87,7 +87,8 @@ public interface IDebugEventService extends IFloodlightService {
* @param eventType EventType for this event. On-demand events have to
* be explicitly enabled using other methods in this API
* @param eventClass A user defined class that annotates the fields
* with @EventColumn
* with @EventColumn. This class specifies the
* fields/columns of this event.
* @param bufferCapacity Number of events to store for this event in a circular
* buffer. Older events will be discarded once the
* buffer is full.
...
...
This diff is collapsed.
Click to expand it.
src/main/java/net/floodlightcontroller/packet/IPv4.java
+
13
−
8
View file @
e25273af
/**
* Copyright 2011, Big Switch Networks, Inc.
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
*
* 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
...
...
@@ -16,7 +16,7 @@
**/
/**
*
*
*/
package
net.floodlightcontroller.packet
;
...
...
@@ -302,6 +302,7 @@ public class IPv4 extends BasePacket {
* -headerLength : 0
* -totalLength : 0
*/
@Override
public
byte
[]
serialize
()
{
byte
[]
payloadData
=
null
;
if
(
payload
!=
null
)
{
...
...
@@ -359,6 +360,10 @@ public class IPv4 extends BasePacket {
this
.
version
=
bb
.
get
();
this
.
headerLength
=
(
byte
)
(
this
.
version
&
0xf
);
this
.
version
=
(
byte
)
((
this
.
version
>>
4
)
&
0xf
);
if
(
this
.
version
!=
4
)
{
throw
new
RuntimeException
(
"Invalid version for IPv4 packet: "
+
this
.
version
);
}
this
.
diffServ
=
bb
.
get
();
this
.
totalLength
=
bb
.
getShort
();
this
.
identification
=
bb
.
getShort
();
...
...
@@ -422,7 +427,7 @@ public class IPv4 extends BasePacket {
throw
new
IllegalArgumentException
(
"Specified IPv4 address must"
+
"contain 4 sets of numerical digits separated by periods"
);
String
[]
octets
=
ipAddress
.
split
(
"\\."
);
if
(
octets
.
length
!=
4
)
if
(
octets
.
length
!=
4
)
throw
new
IllegalArgumentException
(
"Specified IPv4 address must"
+
"contain 4 sets of numerical digits separated by periods"
);
...
...
@@ -455,7 +460,7 @@ public class IPv4 extends BasePacket {
/**
* Accepts an IPv4 address and returns of string of the form xxx.xxx.xxx.xxx
* ie 192.168.0.1
*
*
* @param ipAddress
* @return
*/
...
...
@@ -475,7 +480,7 @@ public class IPv4 extends BasePacket {
* Accepts a collection of IPv4 addresses as integers and returns a single
* String useful in toString method's containing collections of IP
* addresses.
*
*
* @param ipAddresses collection
* @return
*/
...
...
@@ -500,7 +505,7 @@ public class IPv4 extends BasePacket {
*/
public
static
byte
[]
toIPv4AddressBytes
(
String
ipAddress
)
{
String
[]
octets
=
ipAddress
.
split
(
"\\."
);
if
(
octets
.
length
!=
4
)
if
(
octets
.
length
!=
4
)
throw
new
IllegalArgumentException
(
"Specified IPv4 address must"
+
"contain 4 sets of numerical digits separated by periods"
);
...
...
@@ -510,7 +515,7 @@ public class IPv4 extends BasePacket {
}
return
result
;
}
/**
* Accepts an IPv4 address in the form of an integer and
* returns the corresponding byte array.
...
...
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