Showing
9 changed files
with
12 additions
and
269 deletions
| ... | @@ -74,6 +74,10 @@ public class ReactiveForwarding { | ... | @@ -74,6 +74,10 @@ public class ReactiveForwarding { |
| 74 | 74 | ||
| 75 | @Override | 75 | @Override |
| 76 | public void process(PacketContext context) { | 76 | public void process(PacketContext context) { |
| 77 | + /* | ||
| 78 | + * stop processing if the packet has been handled, | ||
| 79 | + * we can't do any more to it | ||
| 80 | + */ | ||
| 77 | if (context.isHandled()) { | 81 | if (context.isHandled()) { |
| 78 | return; | 82 | return; |
| 79 | } | 83 | } | ... | ... |
| ... | @@ -20,7 +20,7 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext | ... | @@ -20,7 +20,7 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext |
| 20 | private final Logger log = getLogger(getClass()); | 20 | private final Logger log = getLogger(getClass()); |
| 21 | 21 | ||
| 22 | private final AtomicBoolean free = new AtomicBoolean(true); | 22 | private final AtomicBoolean free = new AtomicBoolean(true); |
| 23 | - private boolean isBuilt = false; | 23 | + private final AtomicBoolean isBuilt = new AtomicBoolean(false); |
| 24 | private final OpenFlowSwitch sw; | 24 | private final OpenFlowSwitch sw; |
| 25 | private final OFPacketIn pktin; | 25 | private final OFPacketIn pktin; |
| 26 | private OFPacketOut pktout = null; | 26 | private OFPacketOut pktout = null; |
| ... | @@ -32,14 +32,14 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext | ... | @@ -32,14 +32,14 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext |
| 32 | 32 | ||
| 33 | @Override | 33 | @Override |
| 34 | public void send() { | 34 | public void send() { |
| 35 | - if (block() && isBuilt) { | 35 | + if (block() && isBuilt.get()) { |
| 36 | sw.sendMsg(pktout); | 36 | sw.sendMsg(pktout); |
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | @Override | 40 | @Override |
| 41 | - public synchronized void build(OFPort outPort) { | 41 | + public void build(OFPort outPort) { |
| 42 | - if (isBuilt) { | 42 | + if (isBuilt.getAndSet(true)) { |
| 43 | return; | 43 | return; |
| 44 | } | 44 | } |
| 45 | OFPacketOut.Builder builder = sw.factory().buildPacketOut(); | 45 | OFPacketOut.Builder builder = sw.factory().buildPacketOut(); |
| ... | @@ -49,12 +49,11 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext | ... | @@ -49,12 +49,11 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext |
| 49 | .setBufferId(pktin.getBufferId()) | 49 | .setBufferId(pktin.getBufferId()) |
| 50 | .setActions(Collections.singletonList(act)) | 50 | .setActions(Collections.singletonList(act)) |
| 51 | .build(); | 51 | .build(); |
| 52 | - isBuilt = true; | ||
| 53 | } | 52 | } |
| 54 | 53 | ||
| 55 | @Override | 54 | @Override |
| 56 | - public synchronized void build(Ethernet ethFrame, OFPort outPort) { | 55 | + public void build(Ethernet ethFrame, OFPort outPort) { |
| 57 | - if (isBuilt) { | 56 | + if (isBuilt.getAndSet(true)) { |
| 58 | return; | 57 | return; |
| 59 | } | 58 | } |
| 60 | OFPacketOut.Builder builder = sw.factory().buildPacketOut(); | 59 | OFPacketOut.Builder builder = sw.factory().buildPacketOut(); |
| ... | @@ -65,7 +64,6 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext | ... | @@ -65,7 +64,6 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext |
| 65 | .setActions(Collections.singletonList(act)) | 64 | .setActions(Collections.singletonList(act)) |
| 66 | .setData(ethFrame.serialize()) | 65 | .setData(ethFrame.serialize()) |
| 67 | .build(); | 66 | .build(); |
| 68 | - isBuilt = true; | ||
| 69 | } | 67 | } |
| 70 | 68 | ||
| 71 | @Override | 69 | @Override | ... | ... |
| ... | @@ -32,8 +32,6 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; | ... | @@ -32,8 +32,6 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; |
| 32 | import org.onlab.onos.of.controller.Dpid; | 32 | import org.onlab.onos.of.controller.Dpid; |
| 33 | import org.onlab.onos.of.controller.driver.OpenFlowAgent; | 33 | import org.onlab.onos.of.controller.driver.OpenFlowAgent; |
| 34 | import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver; | 34 | import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver; |
| 35 | -import org.onlab.onos.of.controller.impl.annotations.LogMessageDoc; | ||
| 36 | -import org.onlab.onos.of.controller.impl.annotations.LogMessageDocs; | ||
| 37 | import org.onlab.onos.of.drivers.impl.DriverManager; | 35 | import org.onlab.onos.of.drivers.impl.DriverManager; |
| 38 | import org.projectfloodlight.openflow.protocol.OFDescStatsReply; | 36 | import org.projectfloodlight.openflow.protocol.OFDescStatsReply; |
| 39 | import org.projectfloodlight.openflow.protocol.OFFactories; | 37 | import org.projectfloodlight.openflow.protocol.OFFactories; |
| ... | @@ -119,19 +117,6 @@ public class Controller { | ... | @@ -119,19 +117,6 @@ public class Controller { |
| 119 | /** | 117 | /** |
| 120 | * Tell controller that we're ready to accept switches loop. | 118 | * Tell controller that we're ready to accept switches loop. |
| 121 | */ | 119 | */ |
| 122 | - @LogMessageDocs({ | ||
| 123 | - @LogMessageDoc(message = "Listening for switch connections on {address}", | ||
| 124 | - explanation = "The controller is ready and listening for new" + | ||
| 125 | - " switch connections"), | ||
| 126 | - @LogMessageDoc(message = "Storage exception in controller " + | ||
| 127 | - "updates loop; terminating process", | ||
| 128 | - explanation = ERROR_DATABASE, | ||
| 129 | - recommendation = LogMessageDoc.CHECK_CONTROLLER), | ||
| 130 | - @LogMessageDoc(level = "ERROR", | ||
| 131 | - message = "Exception in controller updates loop", | ||
| 132 | - explanation = "Failed to dispatch controller event", | ||
| 133 | - recommendation = LogMessageDoc.GENERIC_ACTION) | ||
| 134 | - }) | ||
| 135 | public void run() { | 120 | public void run() { |
| 136 | 121 | ||
| 137 | try { | 122 | try { | ... | ... |
| ... | @@ -17,11 +17,8 @@ import org.jboss.netty.channel.MessageEvent; | ... | @@ -17,11 +17,8 @@ import org.jboss.netty.channel.MessageEvent; |
| 17 | import org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler; | 17 | import org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler; |
| 18 | import org.jboss.netty.handler.timeout.IdleStateEvent; | 18 | import org.jboss.netty.handler.timeout.IdleStateEvent; |
| 19 | import org.jboss.netty.handler.timeout.ReadTimeoutException; | 19 | import org.jboss.netty.handler.timeout.ReadTimeoutException; |
| 20 | -import org.onlab.onos.of.controller.RoleState; | ||
| 21 | import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver; | 20 | import org.onlab.onos.of.controller.driver.OpenFlowSwitchDriver; |
| 22 | import org.onlab.onos.of.controller.driver.SwitchStateException; | 21 | import org.onlab.onos.of.controller.driver.SwitchStateException; |
| 23 | -import org.onlab.onos.of.controller.impl.annotations.LogMessageDoc; | ||
| 24 | -import org.onlab.onos.of.controller.impl.annotations.LogMessageDocs; | ||
| 25 | import org.projectfloodlight.openflow.exceptions.OFParseError; | 22 | import org.projectfloodlight.openflow.exceptions.OFParseError; |
| 26 | import org.projectfloodlight.openflow.protocol.OFAsyncGetReply; | 23 | import org.projectfloodlight.openflow.protocol.OFAsyncGetReply; |
| 27 | import org.projectfloodlight.openflow.protocol.OFBadRequestCode; | 24 | import org.projectfloodlight.openflow.protocol.OFBadRequestCode; |
| ... | @@ -75,9 +72,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -75,9 +72,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 75 | // needs to check if the handshake is complete | 72 | // needs to check if the handshake is complete |
| 76 | private volatile ChannelState state; | 73 | private volatile ChannelState state; |
| 77 | 74 | ||
| 78 | - // Used to coordinate between the controller and the cleanup thread(?) | ||
| 79 | - // for access to the global registry on a per switch basis. | ||
| 80 | - volatile Boolean controlRequested; | ||
| 81 | // When a switch with a duplicate dpid is found (i.e we already have a | 75 | // When a switch with a duplicate dpid is found (i.e we already have a |
| 82 | // connected switch with the same dpid), the new switch is immediately | 76 | // connected switch with the same dpid), the new switch is immediately |
| 83 | // disconnected. At that point netty callsback channelDisconnected() which | 77 | // disconnected. At that point netty callsback channelDisconnected() which |
| ... | @@ -113,7 +107,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -113,7 +107,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 113 | this.pendingPortStatusMsg = new CopyOnWriteArrayList<OFPortStatus>(); | 107 | this.pendingPortStatusMsg = new CopyOnWriteArrayList<OFPortStatus>(); |
| 114 | factory13 = controller.getOFMessageFactory13(); | 108 | factory13 = controller.getOFMessageFactory13(); |
| 115 | factory10 = controller.getOFMessageFactory10(); | 109 | factory10 = controller.getOFMessageFactory10(); |
| 116 | - controlRequested = Boolean.FALSE; | ||
| 117 | duplicateDpidFound = Boolean.FALSE; | 110 | duplicateDpidFound = Boolean.FALSE; |
| 118 | } | 111 | } |
| 119 | 112 | ||
| ... | @@ -316,16 +309,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -316,16 +309,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 316 | */ | 309 | */ |
| 317 | WAIT_CONFIG_REPLY(false) { | 310 | WAIT_CONFIG_REPLY(false) { |
| 318 | @Override | 311 | @Override |
| 319 | - @LogMessageDocs({ | ||
| 320 | - @LogMessageDoc(level = "WARN", | ||
| 321 | - message = "Config Reply from {switch} has " | ||
| 322 | - + "miss length set to {length}", | ||
| 323 | - explanation = "The controller requires that the switch " | ||
| 324 | - + "use a miss length of 0xffff for correct " | ||
| 325 | - + "function", | ||
| 326 | - recommendation = "Use a different switch to ensure " | ||
| 327 | - + "correct function") | ||
| 328 | - }) | ||
| 329 | void processOFGetConfigReply(OFChannelHandler h, OFGetConfigReply m) | 312 | void processOFGetConfigReply(OFChannelHandler h, OFGetConfigReply m) |
| 330 | throws IOException { | 313 | throws IOException { |
| 331 | if (m.getMissSendLen() == 0xffff) { | 314 | if (m.getMissSendLen() == 0xffff) { |
| ... | @@ -395,11 +378,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -395,11 +378,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 395 | * All following states will have a h.sw instance! | 378 | * All following states will have a h.sw instance! |
| 396 | */ | 379 | */ |
| 397 | WAIT_DESCRIPTION_STAT_REPLY(false) { | 380 | WAIT_DESCRIPTION_STAT_REPLY(false) { |
| 398 | - @LogMessageDoc(message = "Switch {switch info} bound to class " | ||
| 399 | - + "{switch driver}, description {switch description}", | ||
| 400 | - explanation = "The specified switch has been bound to " | ||
| 401 | - + "a switch driver based on the switch description" | ||
| 402 | - + "received from the switch") | ||
| 403 | @Override | 381 | @Override |
| 404 | void processOFStatisticsReply(OFChannelHandler h, OFStatsReply m) | 382 | void processOFStatisticsReply(OFChannelHandler h, OFStatsReply m) |
| 405 | throws SwitchStateException { | 383 | throws SwitchStateException { |
| ... | @@ -528,15 +506,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -528,15 +506,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 528 | * SLAVE. | 506 | * SLAVE. |
| 529 | */ | 507 | */ |
| 530 | ACTIVE(true) { | 508 | ACTIVE(true) { |
| 531 | - @LogMessageDoc(level = "WARN", | ||
| 532 | - message = "Received permission error from switch {} while" | ||
| 533 | - + "being master. Reasserting master role.", | ||
| 534 | - explanation = "The switch has denied an operation likely " | ||
| 535 | - + "indicating inconsistent controller roles", | ||
| 536 | - recommendation = "This situation can occurs transiently during role" | ||
| 537 | - + " changes. If, however, the condition persists or happens" | ||
| 538 | - + " frequently this indicates a role inconsistency. " | ||
| 539 | - + LogMessageDoc.CHECK_CONTROLLER) | ||
| 540 | @Override | 509 | @Override |
| 541 | void processOFError(OFChannelHandler h, OFErrorMsg m) | 510 | void processOFError(OFChannelHandler h, OFErrorMsg m) |
| 542 | throws IOException, SwitchStateException { | 511 | throws IOException, SwitchStateException { |
| ... | @@ -685,15 +654,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -685,15 +654,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 685 | * @param h The switch that sent the error | 654 | * @param h The switch that sent the error |
| 686 | * @param error The error message | 655 | * @param error The error message |
| 687 | */ | 656 | */ |
| 688 | - @LogMessageDoc(level = "ERROR", | ||
| 689 | - message = "Error {error type} {error code} from {switch} " | ||
| 690 | - + "in state {state}", | ||
| 691 | - explanation = "The switch responded with an unexpected error" | ||
| 692 | - + "to an OpenFlow message from the controller", | ||
| 693 | - recommendation = "This could indicate improper network operation. " | ||
| 694 | - + "If the problem persists restarting the switch and " | ||
| 695 | - + "controller may help." | ||
| 696 | - ) | ||
| 697 | protected void logError(OFChannelHandler h, OFErrorMsg error) { | 657 | protected void logError(OFChannelHandler h, OFErrorMsg error) { |
| 698 | log.error("{} from switch {} in state {}", | 658 | log.error("{} from switch {} in state {}", |
| 699 | new Object[] { | 659 | new Object[] { |
| ... | @@ -1003,9 +963,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -1003,9 +963,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 1003 | //************************* | 963 | //************************* |
| 1004 | 964 | ||
| 1005 | @Override | 965 | @Override |
| 1006 | - @LogMessageDoc(message = "New switch connection from {ip address}", | ||
| 1007 | - explanation = "A new switch has connected from the " | ||
| 1008 | - + "specified IP address") | ||
| 1009 | public void channelConnected(ChannelHandlerContext ctx, | 966 | public void channelConnected(ChannelHandlerContext ctx, |
| 1010 | ChannelStateEvent e) throws Exception { | 967 | ChannelStateEvent e) throws Exception { |
| 1011 | channel = e.getChannel(); | 968 | channel = e.getChannel(); |
| ... | @@ -1016,8 +973,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -1016,8 +973,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 1016 | } | 973 | } |
| 1017 | 974 | ||
| 1018 | @Override | 975 | @Override |
| 1019 | - @LogMessageDoc(message = "Disconnected switch {switch information}", | ||
| 1020 | - explanation = "The specified switch has disconnected.") | ||
| 1021 | public void channelDisconnected(ChannelHandlerContext ctx, | 976 | public void channelDisconnected(ChannelHandlerContext ctx, |
| 1022 | ChannelStateEvent e) throws Exception { | 977 | ChannelStateEvent e) throws Exception { |
| 1023 | log.info("Switch disconnected callback for sw:{}. Cleaning up ...", | 978 | log.info("Switch disconnected callback for sw:{}. Cleaning up ...", |
| ... | @@ -1044,47 +999,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -1044,47 +999,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 1044 | } | 999 | } |
| 1045 | 1000 | ||
| 1046 | @Override | 1001 | @Override |
| 1047 | - @LogMessageDocs({ | ||
| 1048 | - @LogMessageDoc(level = "ERROR", | ||
| 1049 | - message = "Disconnecting switch {switch} due to read timeout", | ||
| 1050 | - explanation = "The connected switch has failed to send any " | ||
| 1051 | - + "messages or respond to echo requests", | ||
| 1052 | - recommendation = LogMessageDoc.CHECK_SWITCH), | ||
| 1053 | - @LogMessageDoc(level = "ERROR", | ||
| 1054 | - message = "Disconnecting switch {switch}: failed to " | ||
| 1055 | - + "complete handshake", | ||
| 1056 | - explanation = "The switch did not respond correctly " | ||
| 1057 | - + "to handshake messages", | ||
| 1058 | - recommendation = LogMessageDoc.CHECK_SWITCH), | ||
| 1059 | - @LogMessageDoc(level = "ERROR", | ||
| 1060 | - message = "Disconnecting switch {switch} due to IO Error: {}", | ||
| 1061 | - explanation = "There was an error communicating with the switch", | ||
| 1062 | - recommendation = LogMessageDoc.CHECK_SWITCH), | ||
| 1063 | - @LogMessageDoc(level = "ERROR", | ||
| 1064 | - message = "Disconnecting switch {switch} due to switch " | ||
| 1065 | - + "state error: {error}", | ||
| 1066 | - explanation = "The switch sent an unexpected message", | ||
| 1067 | - recommendation = LogMessageDoc.CHECK_SWITCH), | ||
| 1068 | - @LogMessageDoc(level = "ERROR", | ||
| 1069 | - message = "Disconnecting switch {switch} due to " | ||
| 1070 | - + "message parse failure", | ||
| 1071 | - explanation = "Could not parse a message from the switch", | ||
| 1072 | - recommendation = LogMessageDoc.CHECK_SWITCH), | ||
| 1073 | - @LogMessageDoc(level = "ERROR", | ||
| 1074 | - message = "Terminating controller due to storage exception", | ||
| 1075 | - explanation = Controller.ERROR_DATABASE, | ||
| 1076 | - recommendation = LogMessageDoc.CHECK_CONTROLLER), | ||
| 1077 | - @LogMessageDoc(level = "ERROR", | ||
| 1078 | - message = "Could not process message: queue full", | ||
| 1079 | - explanation = "OpenFlow messages are arriving faster than " | ||
| 1080 | - + "the controller can process them.", | ||
| 1081 | - recommendation = LogMessageDoc.CHECK_CONTROLLER), | ||
| 1082 | - @LogMessageDoc(level = "ERROR", | ||
| 1083 | - message = "Error while processing message " | ||
| 1084 | - + "from switch {switch} {cause}", | ||
| 1085 | - explanation = "An error occurred processing the switch message", | ||
| 1086 | - recommendation = LogMessageDoc.GENERIC_ACTION) | ||
| 1087 | - }) | ||
| 1088 | public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) | 1002 | public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) |
| 1089 | throws Exception { | 1003 | throws Exception { |
| 1090 | if (e.getCause() instanceof ReadTimeoutException) { | 1004 | if (e.getCause() instanceof ReadTimeoutException) { |
| ... | @@ -1248,10 +1162,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { | ... | @@ -1248,10 +1162,6 @@ class OFChannelHandler extends IdleStateAwareChannelHandler { |
| 1248 | channel.write(Collections.singletonList(m)); | 1162 | channel.write(Collections.singletonList(m)); |
| 1249 | } | 1163 | } |
| 1250 | 1164 | ||
| 1251 | - private void setSwitchRole(RoleState role) { | ||
| 1252 | - sw.setRole(role); | ||
| 1253 | - } | ||
| 1254 | - | ||
| 1255 | /** | 1165 | /** |
| 1256 | * Send the configuration requests to tell the switch we want full | 1166 | * Send the configuration requests to tell the switch we want full |
| 1257 | * packets. | 1167 | * packets. | ... | ... |
of/ctl/src/main/java/org/onlab/onos/of/controller/impl/annotations/LogMessageCategory.java
deleted
100644 → 0
| 1 | -/** | ||
| 2 | - * Copyright 2012, Big Switch Networks, Inc. | ||
| 3 | - * Originally created by David Erickson, Stanford University | ||
| 4 | - * | ||
| 5 | - * Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| 6 | - * not use this file except in compliance with the License. You may obtain | ||
| 7 | - * a copy of the License at | ||
| 8 | - * | ||
| 9 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | - * | ||
| 11 | - * Unless required by applicable law or agreed to in writing, software | ||
| 12 | - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| 13 | - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| 14 | - * License for the specific language governing permissions and limitations | ||
| 15 | - * under the License. | ||
| 16 | - **/ | ||
| 17 | - | ||
| 18 | -package org.onlab.onos.of.controller.impl.annotations; | ||
| 19 | - | ||
| 20 | -import java.lang.annotation.ElementType; | ||
| 21 | -import java.lang.annotation.Target; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * Annotation used to set the category for log messages for a class. | ||
| 25 | - * | ||
| 26 | - */ | ||
| 27 | -@Target({ ElementType.TYPE, ElementType.METHOD }) | ||
| 28 | -public @interface LogMessageCategory { | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * The category for the log messages for this class. | ||
| 32 | - * | ||
| 33 | - * @return category | ||
| 34 | - */ | ||
| 35 | - String value() default "Core"; | ||
| 36 | -} |
of/ctl/src/main/java/org/onlab/onos/of/controller/impl/annotations/LogMessageDoc.java
deleted
100644 → 0
| 1 | -/** | ||
| 2 | - * Copyright 2012, Big Switch Networks, Inc. | ||
| 3 | - * Originally created by David Erickson, Stanford University | ||
| 4 | - * | ||
| 5 | - * Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| 6 | - * not use this file except in compliance with the License. You may obtain | ||
| 7 | - * a copy of the License at | ||
| 8 | - * | ||
| 9 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | - * | ||
| 11 | - * Unless required by applicable law or agreed to in writing, software | ||
| 12 | - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| 13 | - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| 14 | - * License for the specific language governing permissions and limitations | ||
| 15 | - * under the License. | ||
| 16 | - **/ | ||
| 17 | - | ||
| 18 | -package org.onlab.onos.of.controller.impl.annotations; | ||
| 19 | - | ||
| 20 | -import java.lang.annotation.ElementType; | ||
| 21 | -import java.lang.annotation.Target; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * Annotation used to document log messages. This can be used to generate | ||
| 25 | - * documentation on syslog output. | ||
| 26 | - * | ||
| 27 | - */ | ||
| 28 | -@Target({ ElementType.TYPE, ElementType.METHOD }) | ||
| 29 | -public @interface LogMessageDoc { | ||
| 30 | - public static final String NO_ACTION = "No action is required."; | ||
| 31 | - public static final String UNKNOWN_ERROR = "An unknown error occured"; | ||
| 32 | - public static final String GENERIC_ACTION = | ||
| 33 | - "Examine the returned error or exception and take " + | ||
| 34 | - "appropriate action."; | ||
| 35 | - public static final String CHECK_SWITCH = | ||
| 36 | - "Check the health of the indicated switch. " + | ||
| 37 | - "Test and troubleshoot IP connectivity."; | ||
| 38 | - public static final String CHECK_CONTROLLER = | ||
| 39 | - "Verify controller system health, CPU usage, and memory. " + | ||
| 40 | - "Rebooting the controller node may help if the controller " + | ||
| 41 | - "node is in a distressed state."; | ||
| 42 | - public static final String REPORT_CONTROLLER_BUG = | ||
| 43 | - "This is likely a defect in the controller. Please report this " + | ||
| 44 | - "issue. Restarting the controller or switch may help to " + | ||
| 45 | - "alleviate."; | ||
| 46 | - public static final String REPORT_SWITCH_BUG = | ||
| 47 | - "This is likely a defect in the switch. Please report this " + | ||
| 48 | - "issue. Restarting the controller or switch may help to " + | ||
| 49 | - "alleviate."; | ||
| 50 | - | ||
| 51 | - /** | ||
| 52 | - * The log level for the log message. | ||
| 53 | - * | ||
| 54 | - * @return the log level as a tring | ||
| 55 | - */ | ||
| 56 | - String level() default "INFO"; | ||
| 57 | - | ||
| 58 | - /** | ||
| 59 | - * The message that will be printed. | ||
| 60 | - * | ||
| 61 | - * @return the message | ||
| 62 | - */ | ||
| 63 | - String message() default UNKNOWN_ERROR; | ||
| 64 | - | ||
| 65 | - /** | ||
| 66 | - * An explanation of the meaning of the log message. | ||
| 67 | - * | ||
| 68 | - * @return the explanation | ||
| 69 | - */ | ||
| 70 | - String explanation() default UNKNOWN_ERROR; | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | - * The recommendated action associated with the log message. | ||
| 74 | - * | ||
| 75 | - * @return the recommendation | ||
| 76 | - */ | ||
| 77 | - String recommendation() default NO_ACTION; | ||
| 78 | -} |
of/ctl/src/main/java/org/onlab/onos/of/controller/impl/annotations/LogMessageDocs.java
deleted
100644 → 0
| 1 | -/** | ||
| 2 | - * Copyright 2012, Big Switch Networks, Inc. | ||
| 3 | - * Originally created by David Erickson, Stanford University | ||
| 4 | - * | ||
| 5 | - * Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| 6 | - * not use this file except in compliance with the License. You may obtain | ||
| 7 | - * a copy of the License at | ||
| 8 | - * | ||
| 9 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 10 | - * | ||
| 11 | - * Unless required by applicable law or agreed to in writing, software | ||
| 12 | - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| 13 | - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| 14 | - * License for the specific language governing permissions and limitations | ||
| 15 | - * under the License. | ||
| 16 | - **/ | ||
| 17 | - | ||
| 18 | -package org.onlab.onos.of.controller.impl.annotations; | ||
| 19 | - | ||
| 20 | -import java.lang.annotation.ElementType; | ||
| 21 | -import java.lang.annotation.Target; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * Annotation used to document log messages. This can be used to generate | ||
| 25 | - * documentation on syslog output. This version allows multiple log messages | ||
| 26 | - * to be documentated on an interface. | ||
| 27 | - * | ||
| 28 | - */ | ||
| 29 | -@Target({ ElementType.TYPE, ElementType.METHOD }) | ||
| 30 | -public @interface LogMessageDocs { | ||
| 31 | - /** | ||
| 32 | - * A list of {@link LogMessageDoc} elements. | ||
| 33 | - * | ||
| 34 | - * @return the list of log message doc | ||
| 35 | - */ | ||
| 36 | - LogMessageDoc[] value(); | ||
| 37 | -} |
providers/of/packet/src/main/java/org/onlab/onos/provider/of/packet/impl/OpenFlowPacketProvider.java
| ... | @@ -87,7 +87,8 @@ public class OpenFlowPacketProvider extends AbstractProvider implements PacketPr | ... | @@ -87,7 +87,8 @@ public class OpenFlowPacketProvider extends AbstractProvider implements PacketPr |
| 87 | pktCtx.parsed(), ByteBuffer.wrap(pktCtx.unparsed())); | 87 | pktCtx.parsed(), ByteBuffer.wrap(pktCtx.unparsed())); |
| 88 | 88 | ||
| 89 | OpenFlowCorePacketContext corePktCtx = | 89 | OpenFlowCorePacketContext corePktCtx = |
| 90 | - new OpenFlowCorePacketContext(0, inPkt, null, pktCtx.isHandled(), pktCtx); | 90 | + new OpenFlowCorePacketContext(System.currentTimeMillis(), |
| 91 | + inPkt, null, pktCtx.isHandled(), pktCtx); | ||
| 91 | providerService.processPacket(corePktCtx); | 92 | providerService.processPacket(corePktCtx); |
| 92 | } | 93 | } |
| 93 | 94 | ... | ... |
-
Please register or login to post a comment