mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 22:06:10 +02:00
of12: new OFPMatch field query api
an example:
if 'ipv6_src' in match:
print match['ipv6_src']
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
150fac2f6a
commit
ed2b5681f0
@ -1641,6 +1641,12 @@ class OFPMatch(StringifyMixin):
|
||||
self._fields2 = dict(ofproto_v1_2.oxm_normalize_user(k, uv) for (k, uv)
|
||||
in kwargs.iteritems())
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self._fields2[key]
|
||||
|
||||
def __contains__(self, key):
|
||||
return key in self._fields2
|
||||
|
||||
def append_field(self, header, value, mask=None):
|
||||
self.fields.append(OFPMatchField.make(header, value, mask))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user