|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.core.util.AppCookie
public class AppCookie
A static utility class to register flow cookiue AppIds and generating flow cookies for a particular App` An "app" is a module or piece of code that can install flows in a switch. E.g., Forwarding and StaticFlowPusher are apps. An App is identified by a 12 bit integer, the id. Furthermore, an App has a name. The id value must be unique but the same name can be registered for multiple numeric ids. TODO: should we enforce unique names This class is thread-safe. The 64 bit OpenFlow cookie field used in the following way
Constructor Summary | |
---|---|
AppCookie()
|
Method Summary | |
---|---|
static int |
extractApp(long cookie)
Extract the application id from a flow cookie. |
static int |
extractUser(long cookie)
|
static java.lang.String |
getAppName(int application)
Retrieves the application name registered for the given application id or null if the application has not been registered |
static boolean |
isDestIpRewriteFlagSet(long cookie)
|
static boolean |
isDestMacRewriteFlagSet(long cookie)
|
static boolean |
isRewriteFlagSet(long cookie)
|
static boolean |
isSrcIpRewriteFlagSet(long cookie)
|
static boolean |
isSrcMacRewriteFlagSet(long cookie)
|
static long |
makeCookie(int application,
int user)
Encapsulate an application ID and a user block of stuff into a cookie |
static void |
registerApp(int application,
java.lang.String appName)
A lame attempt to prevent duplicate application ID. |
static long |
setDestIpRewriteFlag(long cookie)
|
static long |
setDestMacRewriteFlag(long cookie)
|
static long |
setSrcIpRewriteFlag(long cookie)
|
static long |
setSrcMacRewriteFlag(long cookie)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AppCookie()
Method Detail |
---|
public static long makeCookie(int application, int user)
application
- An ID to identify the applicationuser
- Some application specific data
java.lang.IllegalStateException
- if the application has not been registeredpublic static int extractApp(long cookie)
cookie
-
public static int extractUser(long cookie)
public static boolean isRewriteFlagSet(long cookie)
public static boolean isSrcMacRewriteFlagSet(long cookie)
public static boolean isDestMacRewriteFlagSet(long cookie)
public static boolean isSrcIpRewriteFlagSet(long cookie)
public static boolean isDestIpRewriteFlagSet(long cookie)
public static long setSrcMacRewriteFlag(long cookie)
public static long setDestMacRewriteFlag(long cookie)
public static long setSrcIpRewriteFlag(long cookie)
public static long setDestIpRewriteFlag(long cookie)
public static void registerApp(int application, java.lang.String appName) throws AppIDException
application
- appName
-
AppIDInUseException
AppIDException
public static java.lang.String getAppName(int application)
application
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |