Skip to content

Commit

Permalink
Add Nicira Extension NXT_SET_PACKET_IN_FORMAT 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 9b631b7 commit 5ad1639
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ryu/ofproto/ofproto_v1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@
NXT_FLOW_MOD = 13
NXT_FLOW_REMOVED = 14
NXT_FLOW_MOD_TABLE_ID = 15
NXT_SET_PACKET_IN_FORMAT = 16
NXT_SET_CONTROLLER_ID = 20

# enum nx_role
Expand All @@ -584,6 +585,10 @@
NXFF_OPENFLOW10 = 0
NXFF_NXM = 2

# enum nx_packet_in_format
NXPIF_OPENFLOW10 = 0
NXPIF_NXM = 1

NICIRA_HEADER_PACK_STR = '!II'
NICIRA_HEADER_SIZE = 16
assert (calcsize(NICIRA_HEADER_PACK_STR) +
Expand Down Expand Up @@ -614,6 +619,11 @@
assert (calcsize(NX_FLOW_MOD_TABLE_ID_PACK_STR) +
NICIRA_HEADER_SIZE == NX_FLOW_MOD_TABLE_ID_SIZE)

NX_SET_PACKET_IN_FORMAT_PACK_STR = '!I'
NX_SET_PACKET_IN_FORMAT_SIZE = 20
assert (calcsize(NX_SET_PACKET_IN_FORMAT_PACK_STR) +
NICIRA_HEADER_SIZE == NX_SET_PACKET_IN_FORMAT_SIZE)

NX_CONTROLLER_ID_PACK_STR = '!6xH'
NX_CONTROLLER_ID_SIZE = 24
assert (calcsize(NX_CONTROLLER_ID_PACK_STR) +
Expand Down
13 changes: 13 additions & 0 deletions ryu/ofproto/ofproto_v1_0_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,19 @@ def parser(cls, datapath, buf, offset):
byte_count, match)


class NXTSetPacketInFormat(NiciraHeader):
def __init__(self, datapath, packet_in_format):
super(NXTSetPacketInFormat, self).__init__(
datapath, ofproto_v1_0.NXT_SET_PACKET_IN_FORMAT)
self.format = packet_in_format

def _serialize_body(self):
self.serialize_header()
msg_pack_into(ofproto_v1_0.NX_SET_PACKET_IN_FORMAT_PACK_STR,
self.buf, ofproto_v1_0.NICIRA_HEADER_SIZE,
self.format)


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

0 comments on commit 5ad1639

Please sign in to comment.