Skip to content

Commit

Permalink
Add Nicira Extension NXT_SET_ASYNC_CONFIG support
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
  • Loading branch information
fujita committed Jun 7, 2012
1 parent 511df56 commit 720c67f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ryu/ofproto/ofproto_v1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@
NXT_SET_PACKET_IN_FORMAT = 16
NXT_PACKET_IN = 17
NXT_FLOW_AGE = 18
NXT_SET_ASYNC_CONFIG = 19
NXT_SET_CONTROLLER_ID = 20

# enum nx_role
Expand Down Expand Up @@ -631,6 +632,11 @@
assert (calcsize(NX_PACKET_IN_PACK_STR) +
NICIRA_HEADER_SIZE == NX_PACKET_IN_SIZE)

NX_ASYNC_CONFIG_PACK_STR = '!IIIIII'
NX_ASYNC_CONFIG_SIZE = 40
assert (calcsize(NX_ASYNC_CONFIG_PACK_STR) +
NICIRA_HEADER_SIZE == NX_ASYNC_CONFIG_SIZE)

NX_CONTROLLER_ID_PACK_STR = '!6xH'
NX_CONTROLLER_ID_SIZE = 24
assert (calcsize(NX_CONTROLLER_ID_PACK_STR) +
Expand Down
18 changes: 18 additions & 0 deletions ryu/ofproto/ofproto_v1_0_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,24 @@ def _serialize_body(self):
self.serialize_header()


class NXTSetAsyncConfig(NiciraHeader):
def __init__(self, datapath, packet_in_mask, port_status_mask,
flow_removed_mask):
super(NXTSetAsyncConfig, self).__init__(
datapath, ofproto_v1_0.NXT_SET_ASYNC_CONFIG)
self.packet_in_mask = packet_in_mask
self.port_status_mask = port_status_mask
self.flow_removed_mask = flow_removed_mask

def _serialize_body(self):
self.serialize_header()
msg_pack_into(ofproto_v1_0.NX_ASYNC_CONFIG_PACK_STR,
self.buf, ofproto_v1_0.NICIRA_HEADER_SIZE,
self.packet_in_mask[0], self.packet_in_mask[1],
self.port_status_mask[0], self.port_status_mask[1],
self.flow_removed_mask[0], self.flow_removed_mask[1])


class NXTSetControllerId(NiciraHeader):
def __init__(self, datapath, controller_id):
super(NXTSetControllerId, self).__init__(
Expand Down

0 comments on commit 720c67f

Please sign in to comment.