mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-13 00:28:39 +02:00
Add OF1.4 PushMpls action support
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
12f03a09e5
commit
2cf3a6ee4f
@ -2362,6 +2362,35 @@ class OFPActionCopyTtlIn(OFPAction):
|
||||
return cls()
|
||||
|
||||
|
||||
@OFPAction.register_action_type(ofproto.OFPAT_PUSH_MPLS,
|
||||
ofproto.OFP_ACTION_PUSH_SIZE)
|
||||
class OFPActionPushMpls(OFPAction):
|
||||
"""
|
||||
Push MPLS action
|
||||
|
||||
This action pushes a new MPLS header to the packet.
|
||||
|
||||
================ ======================================================
|
||||
Attribute Description
|
||||
================ ======================================================
|
||||
ethertype Ether type
|
||||
================ ======================================================
|
||||
"""
|
||||
def __init__(self, ethertype, type_=None, len_=None):
|
||||
super(OFPActionPushMpls, self).__init__()
|
||||
self.ethertype = ethertype
|
||||
|
||||
@classmethod
|
||||
def parser(cls, buf, offset):
|
||||
(type_, len_, ethertype) = struct.unpack_from(
|
||||
ofproto.OFP_ACTION_PUSH_PACK_STR, buf, offset)
|
||||
return cls(ethertype)
|
||||
|
||||
def serialize(self, buf, offset):
|
||||
msg_pack_into(ofproto.OFP_ACTION_PUSH_PACK_STR, buf, offset,
|
||||
self.type, self.len, self.ethertype)
|
||||
|
||||
|
||||
@OFPAction.register_action_type(ofproto.OFPAT_POP_MPLS,
|
||||
ofproto.OFP_ACTION_POP_MPLS_SIZE)
|
||||
class OFPActionPopMpls(OFPAction):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user