Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.counter; |
| 2 | |
| 3 | import java.util.List; |
| 4 | import java.util.Map; |
| 5 | |
| 6 | import org.openflow.protocol.OFMessage; |
| 7 | |
| 8 | import net.floodlightcontroller.core.IOFSwitch; |
| 9 | import net.floodlightcontroller.core.module.IFloodlightService; |
| 10 | import net.floodlightcontroller.counter.CounterStore.NetworkLayer; |
| 11 | import net.floodlightcontroller.packet.Ethernet; |
| 12 | |
| 13 | public interface ICounterStoreService extends IFloodlightService { |
| 14 | |
| 15 | public final static String CONTROLLER_NAME = "controller"; |
| 16 | public final static String TitleDelimitor = "__"; |
| 17 | |
| 18 | /** Broadcast and multicast */ |
| 19 | public final static String BROADCAST = "broadcast"; |
| 20 | public final static String MULTICAST = "multicast"; |
| 21 | public final static String UNICAST = "unicast"; |
| 22 | |
| 23 | /** L2 EtherType subCategories */ |
| 24 | public final static String L3ET_IPV4 = "L3_IPv4"; |
| 25 | |
| 26 | /** |
| 27 | * Update packetIn counters |
| 28 | * |
| 29 | * @param sw |
| 30 | * @param m |
| 31 | * @param eth |
| 32 | */ |
| 33 | public void updatePacketInCounters(IOFSwitch sw, OFMessage m, Ethernet eth); |
| 34 | |
| 35 | /** |
| 36 | * This method can only be used to update packetOut and flowmod counters |
| 37 | * |
| 38 | * @param sw |
| 39 | * @param ofMsg |
| 40 | */ |
| 41 | public void updatePktOutFMCounterStore(IOFSwitch sw, OFMessage ofMsg); |
| 42 | |
| 43 | /** |
| 44 | * Retrieve a list of subCategories by counterName. |
| 45 | * null if nothing. |
| 46 | */ |
| 47 | public List<String> getAllCategories(String counterName, |
| 48 | NetworkLayer layer); |
| 49 | |
| 50 | /** |
| 51 | * Create a new ICounter and set the title. Note that the title must be |
| 52 | * unique, otherwise this will throw an IllegalArgumentException. |
| 53 | * |
| 54 | * @param key |
| 55 | * @param type |
| 56 | * @return |
| 57 | */ |
| 58 | public ICounter createCounter(String key, CounterValue.CounterType type); |
| 59 | |
| 60 | /** |
| 61 | * Retrieves a counter with the given title, or null if none can be found. |
| 62 | */ |
| 63 | public ICounter getCounter(String key); |
| 64 | |
| 65 | /** |
| 66 | * Returns an immutable map of title:counter with all of the counters in the store. |
| 67 | * |
| 68 | * (Note - this method may be slow - primarily for debugging/UI) |
| 69 | */ |
| 70 | public Map<String, ICounter> getAll(); |
| 71 | } |