public class Wildcards extends Object
You can construct a Wildcard object from either its integer representation
Wildcard.of(0x3820e0);
Or start with either an empty or full wildcard, and select/unselect foo.
Wildcard w = Wildcards.NONE
.set(Flag.DL_SRC, Flag. DL_DST, Flag.DL_VLAN_PCP)
.setNwDstMask(8)
.setNwSrcMask(8);
Remember: Wildcards objects are immutable. set... operations have NO EFFECT on the current wildcard object. You HAVE to use the returned changed object.
Modifier and Type | Class and Description |
---|---|
static class |
Wildcards.Flag
enum type for the binary flags that can be set in the wildcards field of
an OFMatch.
|
Modifier and Type | Field and Description |
---|---|
static Wildcards |
EXACT |
static Wildcards |
FULL |
static Wildcards |
INPORT_L2_MATCH |
static int |
INT_INPORT_L2_MATCH |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getInt()
return the OpenFlow 'wire' integer representation of these wildcards
|
int |
getNwDstMask()
return the nw dst mask in normal CIDR style, e.g., 8 means x.x.x.x/8
means 8 bits wildcarded
|
int |
getNwSrcMask()
return the nw src mask in normal CIDR style, e.g., 8 means x.x.x.x/8
means 8 bits wildcarded
|
EnumSet<Wildcards.Flag> |
getWildcardedFlags()
return all wildcard flags that are fully wildcarded as an EnumSet.
|
int |
hashCode() |
Wildcards |
inverted()
return a Wildcard object that is inverted to this wildcard object.
|
boolean |
isExact()
is this a wildcard of an exact match
|
boolean |
isFull()
is this a wildcard set that has all flags set + and full (/0) nw_src and
nw_dst wildcarding ?
|
boolean |
isWildcarded(Wildcards.Flag flag) |
Wildcards |
matchOn(Wildcards.Flag... setFlags)
return a Wildcards object that matches on exactly the given flags
|
Wildcards |
matchOn(Wildcards.Flag flag)
return a Wildcards object that matches on exactly the given flag
|
Wildcards |
matchOn(Wildcards.Flag flag,
Wildcards.Flag flag2)
return a Wildcards object that matches on exactly the given flags
|
static Wildcards |
of(int paramFlags)
return a wildcard object matching the given int flags.
|
static Wildcards |
of(Wildcards.Flag... setFlags)
convience method return a wildcard for an arbitrary number of set flags
|
static Wildcards |
of(Wildcards.Flag setFlag)
convience method return a wildcard for exactly one set flag
|
static Wildcards |
of(Wildcards.Flag setFlag,
Wildcards.Flag setFlag2)
convience method return a wildcard for exactly two set flags
|
static Wildcards |
ofMatches(Wildcards.Flag... setFlags)
convience method return a wildcard for an ofmatch that amtch on an
arbitrary number of set flags
|
static Wildcards |
ofMatches(Wildcards.Flag setFlag)
convience method return a wildcards for ofmatches that match on one flag
|
static Wildcards |
ofMatches(Wildcards.Flag setFlag,
Wildcards.Flag setFlag2)
convience method return a wildcard for for an ofmatch that match on two
flags
|
static int |
sanitizeInt(int flags)
return the OpenFlow 'wire' integer representation of these wildcards.
|
String |
toJava()
a Java expression that constructs 'this' wildcards set
|
String |
toString() |
Wildcards |
wildcard(Wildcards.Flag... setFlags)
return a Wildcards object that has the given flags wildcarded
|
Wildcards |
wildcard(Wildcards.Flag flag)
return a Wildcards object that has the given flags set
|
Wildcards |
wildcard(Wildcards.Flag flag,
Wildcards.Flag flag2)
return a Wildcards object that has the given flags set
|
Wildcards |
withNwDstMask(int dstCidrMask)
return a Wildcard object that has the given nwDstCidrMask set.
|
Wildcards |
withNwSrcMask(int srcCidrMask)
return a Wildcard object that has the given nwSrcCidrMask set.
|
public static final Wildcards FULL
public static final Wildcards EXACT
public static final int INT_INPORT_L2_MATCH
public static final Wildcards INPORT_L2_MATCH
public static Wildcards of(int paramFlags)
flags
- public static Wildcards of(Wildcards.Flag setFlag)
public static Wildcards of(Wildcards.Flag setFlag, Wildcards.Flag setFlag2)
public static Wildcards of(Wildcards.Flag... setFlags)
public static Wildcards ofMatches(Wildcards.Flag setFlag)
public static Wildcards ofMatches(Wildcards.Flag setFlag, Wildcards.Flag setFlag2)
public static Wildcards ofMatches(Wildcards.Flag... setFlags)
public Wildcards wildcard(Wildcards.Flag flag)
NOTE: NOT a mutator function. 'this' wildcard object stays unmodified.
public Wildcards wildcard(Wildcards.Flag flag, Wildcards.Flag flag2)
NOTE: NOT a mutator function. 'this' wildcard object stays unmodified.
public Wildcards wildcard(Wildcards.Flag... setFlags)
NOTE: NOT a mutator function. 'this' wildcard object stays unmodified.
public Wildcards matchOn(Wildcards.Flag flag)
NOTE: NOT a mutator function. 'this' wildcard object stays unmodified.
public Wildcards matchOn(Wildcards.Flag flag, Wildcards.Flag flag2)
NOTE: NOT a mutator function. 'this' wildcard object stays unmodified.
public Wildcards matchOn(Wildcards.Flag... setFlags)
NOTE: NOT a mutator function. 'this' wildcard object stays unmodified.
public int getNwSrcMask()
public int getNwDstMask()
public Wildcards withNwSrcMask(int srcCidrMask)
srcCidrMask
- source mask to set in normal CIDR notation, i.e., 8
means x.x.x.x/8public Wildcards withNwDstMask(int dstCidrMask)
dstCidrMask
- dest mask to set in normal CIDR notation, i.e., 8 means
x.x.x.x/8public Wildcards inverted()
public boolean isWildcarded(Wildcards.Flag flag)
public EnumSet<Wildcards.Flag> getWildcardedFlags()
public int getInt()
public static int sanitizeInt(int flags)
public boolean isFull()
public boolean isExact()
public String toJava()
Copyright © 2015. All rights reserved.