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
3c2538e3
Commit
3c2538e3
authored
12 years ago
by
Andreas Wundsam
Browse files
Options
Downloads
Patches
Plain Diff
openflow/OFError: add convenience constructor + whitespace
parent
928c293a
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/org/openflow/protocol/OFError.java
+21
-15
21 additions, 15 deletions
src/main/java/org/openflow/protocol/OFError.java
with
21 additions
and
15 deletions
src/main/java/org/openflow/protocol/OFError.java
+
21
−
15
View file @
3c2538e3
/**
/**
* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
* University
* University
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* 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
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
* a copy of the License at
...
@@ -29,7 +29,7 @@ import org.openflow.util.U16;
...
@@ -29,7 +29,7 @@ import org.openflow.util.U16;
/**
/**
* Represents an ofp_error_msg
* Represents an ofp_error_msg
*
*
* @author David Erickson (daviderickson@cs.stanford.edu)
* @author David Erickson (daviderickson@cs.stanford.edu)
* @author Rob Sherwood (rob.sherwood@stanford.edu)
* @author Rob Sherwood (rob.sherwood@stanford.edu)
*/
*/
...
@@ -39,22 +39,22 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -39,22 +39,22 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
public
enum
OFErrorType
{
public
enum
OFErrorType
{
// OFPET_VENDOR_ERROR is an extension that was added in Open vSwitch and isn't
// OFPET_VENDOR_ERROR is an extension that was added in Open vSwitch and isn't
// in the OF 1.0 spec, but it was easier to add it here instead of adding
// in the OF 1.0 spec, but it was easier to add it here instead of adding
// generic support for extensible vendor-defined error messages.
// generic support for extensible vendor-defined error messages.
// It uses the random value 0xb0c2 to avoid conflicts with other possible new
// It uses the random value 0xb0c2 to avoid conflicts with other possible new
// error types. Support for vendor-defined extended errors has been standardized
// error types. Support for vendor-defined extended errors has been standardized
// in the OF 1.2 spec, so this workaround is only needed for 1.0.
// in the OF 1.2 spec, so this workaround is only needed for 1.0.
OFPET_HELLO_FAILED
,
OFPET_BAD_REQUEST
,
OFPET_BAD_ACTION
,
OFPET_FLOW_MOD_FAILED
,
OFPET_PORT_MOD_FAILED
,
OFPET_QUEUE_OP_FAILED
,
OFPET_VENDOR_ERROR
((
short
)
0xb0c2
);
OFPET_HELLO_FAILED
,
OFPET_BAD_REQUEST
,
OFPET_BAD_ACTION
,
OFPET_FLOW_MOD_FAILED
,
OFPET_PORT_MOD_FAILED
,
OFPET_QUEUE_OP_FAILED
,
OFPET_VENDOR_ERROR
((
short
)
0xb0c2
);
protected
short
value
;
protected
short
value
;
private
OFErrorType
()
{
private
OFErrorType
()
{
this
.
value
=
(
short
)
this
.
ordinal
();
this
.
value
=
(
short
)
this
.
ordinal
();
}
}
private
OFErrorType
(
short
value
)
{
private
OFErrorType
(
short
value
)
{
this
.
value
=
value
;
this
.
value
=
value
;
}
}
public
short
getValue
()
{
public
short
getValue
()
{
return
value
;
return
value
;
}
}
...
@@ -99,6 +99,12 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -99,6 +99,12 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
this
.
length
=
U16
.
t
(
MINIMUM_LENGTH
);
this
.
length
=
U16
.
t
(
MINIMUM_LENGTH
);
}
}
/** convenience constructor */
public
OFError
(
OFErrorType
errorType
)
{
this
();
setErrorType
(
errorType
);
}
/**
/**
* @return the errorType
* @return the errorType
*/
*/
...
@@ -124,7 +130,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -124,7 +130,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
public
boolean
isVendorError
()
{
public
boolean
isVendorError
()
{
return
errorType
==
OFErrorType
.
OFPET_VENDOR_ERROR
.
getValue
();
return
errorType
==
OFErrorType
.
OFPET_VENDOR_ERROR
.
getValue
();
}
}
/**
/**
* @return the errorCode
* @return the errorCode
*/
*/
...
@@ -167,19 +173,19 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -167,19 +173,19 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
public
int
getVendorErrorType
()
{
public
int
getVendorErrorType
()
{
return
vendorErrorType
;
return
vendorErrorType
;
}
}
public
void
setVendorErrorType
(
int
vendorErrorType
)
{
public
void
setVendorErrorType
(
int
vendorErrorType
)
{
this
.
vendorErrorType
=
vendorErrorType
;
this
.
vendorErrorType
=
vendorErrorType
;
}
}
public
short
getVendorErrorCode
()
{
public
short
getVendorErrorCode
()
{
return
vendorErrorCode
;
return
vendorErrorCode
;
}
}
public
void
setVendorErrorCode
(
short
vendorErrorCode
)
{
public
void
setVendorErrorCode
(
short
vendorErrorCode
)
{
this
.
vendorErrorCode
=
vendorErrorCode
;
this
.
vendorErrorCode
=
vendorErrorCode
;
}
}
public
OFMessage
getOffendingMsg
()
throws
MessageParseException
{
public
OFMessage
getOffendingMsg
()
throws
MessageParseException
{
// should only have one message embedded; if more than one, just
// should only have one message embedded; if more than one, just
// grab first
// grab first
...
@@ -197,7 +203,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -197,7 +203,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
/**
/**
* Write this offending message into the payload of the Error message
* Write this offending message into the payload of the Error message
*
*
* @param offendingMsg
* @param offendingMsg
*/
*/
...
@@ -277,7 +283,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -277,7 +283,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
/*
/*
* (non-Javadoc)
* (non-Javadoc)
*
*
* @see java.lang.Object#hashCode()
* @see java.lang.Object#hashCode()
*/
*/
@Override
@Override
...
@@ -293,7 +299,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
...
@@ -293,7 +299,7 @@ public class OFError extends OFMessage implements OFMessageFactoryAware {
/*
/*
* (non-Javadoc)
* (non-Javadoc)
*
*
* @see java.lang.Object#equals(java.lang.Object)
* @see java.lang.Object#equals(java.lang.Object)
*/
*/
@Override
@Override
...
...
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