*: Apply autopep8

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWASE Yusuke 2017-12-15 10:50:17 +09:00 committed by FUJITA Tomonori
parent 83650576e4
commit 6e3eccb453
47 changed files with 483 additions and 64 deletions

View File

@ -197,7 +197,7 @@ class OfctlService(app_manager.RyuApp):
self.logger.error('unknown error xid %s', msg.xid) self.logger.error('unknown error xid %s', msg.xid)
return return
if ((not isinstance(ev, ofp_event.EventOFPErrorMsg)) and if ((not isinstance(ev, ofp_event.EventOFPErrorMsg)) and
(req.reply_cls is None or not isinstance(ev.msg, req.reply_cls))): (req.reply_cls is None or not isinstance(ev.msg, req.reply_cls))):
self.logger.error('unexpected reply %s for xid %s', ev, msg.xid) self.logger.error('unexpected reply %s for xid %s', ev, msg.xid)
return return
try: try:

View File

@ -30,6 +30,7 @@ class EventRequestBase(EventBase):
""" """
The base class for synchronous request for RyuApp.send_request. The base class for synchronous request for RyuApp.send_request.
""" """
def __init__(self): def __init__(self):
super(EventRequestBase, self).__init__() super(EventRequestBase, self).__init__()
self.dst = None # app.name of provide the event. self.dst = None # app.name of provide the event.
@ -42,6 +43,7 @@ class EventReplyBase(EventBase):
""" """
The base class for synchronous request reply for RyuApp.send_reply. The base class for synchronous request reply for RyuApp.send_reply.
""" """
def __init__(self, dst): def __init__(self, dst):
super(EventReplyBase, self).__init__() super(EventReplyBase, self).__init__()
self.dst = dst self.dst = dst

View File

@ -109,6 +109,7 @@ class EventMacAddress(event.EventBase):
class Networks(dict): class Networks(dict):
"network_id -> set of (dpid, port_no)" "network_id -> set of (dpid, port_no)"
def __init__(self, f): def __init__(self, f):
super(Networks, self).__init__() super(Networks, self).__init__()
self.send_event = f self.send_event = f
@ -200,6 +201,7 @@ class Port(object):
class DPIDs(dict): class DPIDs(dict):
"""dpid -> port_no -> Port(port_no, network_id, mac_address)""" """dpid -> port_no -> Port(port_no, network_id, mac_address)"""
def __init__(self, f, nw_id_unknown): def __init__(self, f, nw_id_unknown):
super(DPIDs, self).__init__() super(DPIDs, self).__init__()
self.send_event = f self.send_event = f
@ -306,6 +308,7 @@ MacPort = collections.namedtuple('MacPort', ('dpid', 'port_no'))
class MacToPort(collections.defaultdict): class MacToPort(collections.defaultdict):
"""mac_address -> set of MacPort(dpid, port_no)""" """mac_address -> set of MacPort(dpid, port_no)"""
def __init__(self): def __init__(self):
super(MacToPort, self).__init__(set) super(MacToPort, self).__init__(set)
@ -324,6 +327,7 @@ class MacToPort(collections.defaultdict):
class MacAddresses(dict): class MacAddresses(dict):
"""network_id -> mac_address -> set of (dpid, port_no)""" """network_id -> mac_address -> set of (dpid, port_no)"""
def add_port(self, network_id, dpid, port_no, mac_address): def add_port(self, network_id, dpid, port_no, mac_address):
mac2port = self.setdefault(network_id, MacToPort()) mac2port = self.setdefault(network_id, MacToPort())
mac2port.add_port(dpid, port_no, mac_address) mac2port.add_port(dpid, port_no, mac_address)

View File

@ -50,6 +50,7 @@ class EventOFPMsgBase(event.EventBase):
The msg object has some more additional members whose values are extracted The msg object has some more additional members whose values are extracted
from the original OpenFlow message. from the original OpenFlow message.
""" """
def __init__(self, msg): def __init__(self, msg):
self.timestamp = time.time() self.timestamp = time.time()
super(EventOFPMsgBase, self).__init__() super(EventOFPMsgBase, self).__init__()
@ -118,6 +119,7 @@ class EventOFPStateChange(event.EventBase):
datapath ryu.controller.controller.Datapath instance of the switch datapath ryu.controller.controller.Datapath instance of the switch
========= ================================================================= ========= =================================================================
""" """
def __init__(self, dp): def __init__(self, dp):
super(EventOFPStateChange, self).__init__() super(EventOFPStateChange, self).__init__()
self.datapath = dp self.datapath = dp
@ -139,6 +141,7 @@ class EventOFPPortStateChange(event.EventBase):
port_no Port number which state was changed port_no Port number which state was changed
========= ================================================================= ========= =================================================================
""" """
def __init__(self, dp, reason, port_no): def __init__(self, dp, reason, port_no):
super(EventOFPPortStateChange, self).__init__() super(EventOFPPortStateChange, self).__init__()
self.datapath = dp self.datapath = dp

View File

@ -98,6 +98,7 @@ class EventTunnelPort(event.EventBase):
add_del True for adding a tunnel. False for removal. add_del True for adding a tunnel. False for removal.
=========== =============================================================== =========== ===============================================================
""" """
def __init__(self, dpid, port_no, remote_dpid, add_del): def __init__(self, dpid, port_no, remote_dpid, add_del):
super(EventTunnelPort, self).__init__() super(EventTunnelPort, self).__init__()
self.dpid = dpid self.dpid = dpid
@ -108,6 +109,7 @@ class EventTunnelPort(event.EventBase):
class TunnelKeys(dict): class TunnelKeys(dict):
"""network id(uuid) <-> tunnel key(32bit unsigned int)""" """network id(uuid) <-> tunnel key(32bit unsigned int)"""
def __init__(self, f): def __init__(self, f):
super(TunnelKeys, self).__init__() super(TunnelKeys, self).__init__()
self.send_event = f self.send_event = f
@ -151,6 +153,7 @@ class TunnelKeys(dict):
class DPIDs(object): class DPIDs(object):
"""dpid -> port_no -> remote_dpid""" """dpid -> port_no -> remote_dpid"""
def __init__(self, f): def __init__(self, f):
super(DPIDs, self).__init__() super(DPIDs, self).__init__()
self.dpids = collections.defaultdict(dict) self.dpids = collections.defaultdict(dict)

View File

@ -72,6 +72,7 @@ class BFDSession(object):
An instance maintains a BFD session. An instance maintains a BFD session.
""" """
def __init__(self, app, my_discr, dpid, ofport, def __init__(self, app, my_discr, dpid, ofport,
src_mac, src_ip, src_port, src_mac, src_ip, src_port,
dst_mac="FF:FF:FF:FF:FF:FF", dst_ip="255.255.255.255", dst_mac="FF:FF:FF:FF:FF:FF", dst_ip="255.255.255.255",
@ -639,6 +640,7 @@ class EventBFDSessionStateChanged(event.EventBase):
""" """
An event class that notifies the state change of a BFD session. An event class that notifies the state change of a BFD session.
""" """
def __init__(self, session, old_state, new_state): def __init__(self, session, old_state, new_state):
super(EventBFDSessionStateChanged, self).__init__() super(EventBFDSessionStateChanged, self).__init__()
self.session = session self.session = session

View File

@ -38,6 +38,7 @@ from ryu.lib.packet import igmp
class EventPacketIn(event.EventBase): class EventPacketIn(event.EventBase):
"""a PacketIn event class using except IGMP.""" """a PacketIn event class using except IGMP."""
def __init__(self, msg): def __init__(self, msg):
"""initialization.""" """initialization."""
super(EventPacketIn, self).__init__() super(EventPacketIn, self).__init__()

View File

@ -33,6 +33,7 @@ from ryu.lib.packet import slow
class EventPacketIn(event.EventBase): class EventPacketIn(event.EventBase):
"""a PacketIn event class using except LACP.""" """a PacketIn event class using except LACP."""
def __init__(self, msg): def __init__(self, msg):
"""initialization.""" """initialization."""
super(EventPacketIn, self).__init__() super(EventPacketIn, self).__init__()
@ -42,6 +43,7 @@ class EventPacketIn(event.EventBase):
class EventSlaveStateChanged(event.EventBase): class EventSlaveStateChanged(event.EventBase):
"""a event class that notifies the changes of the statuses of the """a event class that notifies the changes of the statuses of the
slave i/fs.""" slave i/fs."""
def __init__(self, datapath, port, enabled): def __init__(self, datapath, port, enabled):
"""initialization.""" """initialization."""
super(EventSlaveStateChanged, self).__init__() super(EventSlaveStateChanged, self).__init__()

View File

@ -175,6 +175,7 @@ class OptionDataUnknown(Option):
""" """
Unknown Option Class and Type specific Option Unknown Option Class and Type specific Option
""" """
def __init__(self, buf, option_class=None, type_=None, length=0): def __init__(self, buf, option_class=None, type_=None, length=0):
super(OptionDataUnknown, self).__init__(option_class=option_class, super(OptionDataUnknown, self).__init__(option_class=option_class,
type_=type_, type_=type_,

View File

@ -248,7 +248,7 @@ class dest_unreach(_ICMPv4Payload):
def serialize(self): def serialize(self):
hdr = bytearray(struct.pack(dest_unreach._PACK_STR, hdr = bytearray(struct.pack(dest_unreach._PACK_STR,
self.data_len, self.mtu)) self.data_len, self.mtu))
if self.data is not None: if self.data is not None:
hdr += self.data hdr += self.data

View File

@ -807,8 +807,8 @@ class mldv2_query(mld):
def serialize(self): def serialize(self):
s_qrv = self.s_flg << 3 | self.qrv s_qrv = self.s_flg << 3 | self.qrv
buf = bytearray(struct.pack(self._PACK_STR, self.maxresp, buf = bytearray(struct.pack(self._PACK_STR, self.maxresp,
addrconv.ipv6.text_to_bin(self.address), s_qrv, addrconv.ipv6.text_to_bin(self.address), s_qrv,
self.qqic, self.num)) self.qqic, self.num))
for src in self.srcs: for src in self.srcs:
buf.extend(struct.pack('16s', addrconv.ipv6.text_to_bin(src))) buf.extend(struct.pack('16s', addrconv.ipv6.text_to_bin(src)))
if 0 == self.num: if 0 == self.num:
@ -951,8 +951,8 @@ class mldv2_report_group(stringify.StringifyMixin):
def serialize(self): def serialize(self):
buf = bytearray(struct.pack(self._PACK_STR, self.type_, buf = bytearray(struct.pack(self._PACK_STR, self.type_,
self.aux_len, self.num, self.aux_len, self.num,
addrconv.ipv6.text_to_bin(self.address))) addrconv.ipv6.text_to_bin(self.address)))
for src in self.srcs: for src in self.srcs:
buf.extend(struct.pack('16s', addrconv.ipv6.text_to_bin(src))) buf.extend(struct.pack('16s', addrconv.ipv6.text_to_bin(src)))
if 0 == self.num: if 0 == self.num:

View File

@ -207,8 +207,8 @@ class igmp(packet_base.PacketBase):
def serialize(self, payload, prev): def serialize(self, payload, prev):
hdr = bytearray(struct.pack(self._PACK_STR, self.msgtype, hdr = bytearray(struct.pack(self._PACK_STR, self.msgtype,
trunc(self.maxresp), self.csum, trunc(self.maxresp), self.csum,
addrconv.ipv4.text_to_bin(self.address))) addrconv.ipv4.text_to_bin(self.address)))
if self.csum == 0: if self.csum == 0:
self.csum = packet_utils.checksum(hdr) self.csum = packet_utils.checksum(hdr)
@ -297,9 +297,9 @@ class igmpv3_query(igmp):
def serialize(self, payload, prev): def serialize(self, payload, prev):
s_qrv = self.s_flg << 3 | self.qrv s_qrv = self.s_flg << 3 | self.qrv
buf = bytearray(struct.pack(self._PACK_STR, self.msgtype, buf = bytearray(struct.pack(self._PACK_STR, self.msgtype,
trunc(self.maxresp), self.csum, trunc(self.maxresp), self.csum,
addrconv.ipv4.text_to_bin(self.address), addrconv.ipv4.text_to_bin(self.address),
s_qrv, trunc(self.qqic), self.num)) s_qrv, trunc(self.qqic), self.num))
for src in self.srcs: for src in self.srcs:
buf.extend(struct.pack('4s', addrconv.ipv4.text_to_bin(src))) buf.extend(struct.pack('4s', addrconv.ipv4.text_to_bin(src)))
if 0 == self.num: if 0 == self.num:
@ -372,7 +372,7 @@ class igmpv3_report(igmp):
def serialize(self, payload, prev): def serialize(self, payload, prev):
buf = bytearray(struct.pack(self._PACK_STR, self.msgtype, buf = bytearray(struct.pack(self._PACK_STR, self.msgtype,
self.csum, self.record_num)) self.csum, self.record_num))
for record in self.records: for record in self.records:
buf.extend(record.serialize()) buf.extend(record.serialize())
if 0 == self.record_num: if 0 == self.record_num:
@ -461,8 +461,8 @@ class igmpv3_report_group(stringify.StringifyMixin):
def serialize(self): def serialize(self):
buf = bytearray(struct.pack(self._PACK_STR, self.type_, buf = bytearray(struct.pack(self._PACK_STR, self.type_,
self.aux_len, self.num, self.aux_len, self.num,
addrconv.ipv4.text_to_bin(self.address))) addrconv.ipv4.text_to_bin(self.address)))
for src in self.srcs: for src in self.srcs:
buf.extend(struct.pack('4s', addrconv.ipv4.text_to_bin(src))) buf.extend(struct.pack('4s', addrconv.ipv4.text_to_bin(src)))
if 0 == self.num: if 0 == self.num:

View File

@ -154,6 +154,7 @@ ipv6.register_packet_type(gre.gre, inet.IPPROTO_GRE)
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)
class header(stringify.StringifyMixin): class header(stringify.StringifyMixin):
"""extension header abstract class.""" """extension header abstract class."""
def __init__(self, nxt): def __init__(self, nxt):
self.nxt = nxt self.nxt = nxt
@ -434,7 +435,7 @@ class routing_type3(header):
assert isinstance(adrs, list) assert isinstance(adrs, list)
self.adrs = adrs self.adrs = adrs
self._pad = (8 - ((len(self.adrs) - 1) * (16 - self.cmpi) + self._pad = (8 - ((len(self.adrs) - 1) * (16 - self.cmpi) +
(16 - self.cmpe) % 8)) % 8 (16 - self.cmpe) % 8)) % 8
@classmethod @classmethod
def _get_size(cls, size): def _get_size(cls, size):

View File

@ -208,6 +208,7 @@ class End(LLDPBasicTLV):
buf Binary data to parse. buf Binary data to parse.
============== ===================================== ============== =====================================
""" """
def __init__(self, buf=None, *args, **kwargs): def __init__(self, buf=None, *args, **kwargs):
super(End, self).__init__(buf, *args, **kwargs) super(End, self).__init__(buf, *args, **kwargs)
if buf: if buf:

View File

@ -37,6 +37,7 @@ class MessageEncoder(object):
"""msgpack-rpc encoder/decoder. """msgpack-rpc encoder/decoder.
intended to be transport-agnostic. intended to be transport-agnostic.
""" """
def __init__(self): def __init__(self):
super(MessageEncoder, self).__init__() super(MessageEncoder, self).__init__()
self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True) self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True)
@ -91,6 +92,7 @@ class EndPoint(object):
"""An endpoint """An endpoint
*sock* is a socket-like. it can be either blocking or non-blocking. *sock* is a socket-like. it can be either blocking or non-blocking.
""" """
def __init__(self, sock, encoder=None, disp_table=None): def __init__(self, sock, encoder=None, disp_table=None):
if encoder is None: if encoder is None:
encoder = MessageEncoder() encoder = MessageEncoder()
@ -236,6 +238,7 @@ class EndPoint(object):
class RPCError(Exception): class RPCError(Exception):
"""an error from server """an error from server
""" """
def __init__(self, error): def __init__(self, error):
super(RPCError, self).__init__() super(RPCError, self).__init__()
self._error = error self._error = error
@ -251,6 +254,7 @@ class Client(object):
"""a convenient class for a pure rpc client """a convenient class for a pure rpc client
*sock* is a socket-like. it should be blocking. *sock* is a socket-like. it should be blocking.
""" """
def __init__(self, sock, encoder=None, notification_callback=None): def __init__(self, sock, encoder=None, notification_callback=None):
self._endpoint = EndPoint(sock, encoder) self._endpoint = EndPoint(sock, encoder)
if notification_callback is None: if notification_callback is None:

View File

@ -122,6 +122,7 @@ class FlowWildcards(ofproto_parser.StringifyMixin):
class ClsRule(ofproto_parser.StringifyMixin): class ClsRule(ofproto_parser.StringifyMixin):
"""describe a matching rule for OF 1.0 OFPMatch (and NX). """describe a matching rule for OF 1.0 OFPMatch (and NX).
""" """
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.wc = FlowWildcards() self.wc = FlowWildcards()
self.flow = Flow() self.flow = Flow()
@ -399,6 +400,7 @@ class ClsRule(ofproto_parser.StringifyMixin):
def _set_nxm_headers(nxm_headers): def _set_nxm_headers(nxm_headers):
'''Annotate corresponding NXM header''' '''Annotate corresponding NXM header'''
def _set_nxm_headers_dec(self): def _set_nxm_headers_dec(self):
self.nxm_headers = nxm_headers self.nxm_headers = nxm_headers
return self return self

View File

@ -202,6 +202,7 @@ class OFPMatch(StringifyMixin):
... ...
'192.168.0.1' '192.168.0.1'
""" """
def __init__(self, wildcards=None, in_port=None, dl_src=None, dl_dst=None, def __init__(self, wildcards=None, in_port=None, dl_src=None, dl_dst=None,
dl_vlan=None, dl_vlan_pcp=None, dl_type=None, nw_tos=None, dl_vlan=None, dl_vlan_pcp=None, dl_type=None, nw_tos=None,
nw_proto=None, nw_src=None, nw_dst=None, nw_proto=None, nw_src=None, nw_dst=None,
@ -420,6 +421,7 @@ class OFPActionOutput(OFPAction):
is because there is no good constant in of1.0. is because there is no good constant in of1.0.
The same value as OFPCML_MAX of of1.2 and of1.3 is used. The same value as OFPCML_MAX of of1.2 and of1.3 is used.
""" """
def __init__(self, port, max_len=0xffe5): def __init__(self, port, max_len=0xffe5):
super(OFPActionOutput, self).__init__() super(OFPActionOutput, self).__init__()
self.port = port self.port = port
@ -452,6 +454,7 @@ class OFPActionVlanVid(OFPAction):
vlan_vid VLAN id. vlan_vid VLAN id.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, vlan_vid): def __init__(self, vlan_vid):
super(OFPActionVlanVid, self).__init__() super(OFPActionVlanVid, self).__init__()
self.vlan_vid = vlan_vid self.vlan_vid = vlan_vid
@ -483,6 +486,7 @@ class OFPActionVlanPcp(OFPAction):
vlan_pcp VLAN priority. vlan_pcp VLAN priority.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, vlan_pcp): def __init__(self, vlan_pcp):
super(OFPActionVlanPcp, self).__init__() super(OFPActionVlanPcp, self).__init__()
self.vlan_pcp = vlan_pcp self.vlan_pcp = vlan_pcp
@ -508,6 +512,7 @@ class OFPActionStripVlan(OFPAction):
This action indicates the 802.1q priority to be striped. This action indicates the 802.1q priority to be striped.
""" """
def __init__(self): def __init__(self):
super(OFPActionStripVlan, self).__init__() super(OFPActionStripVlan, self).__init__()
@ -564,6 +569,7 @@ class OFPActionSetDlSrc(OFPActionDlAddr):
dl_addr Ethernet address. dl_addr Ethernet address.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, dl_addr): def __init__(self, dl_addr):
super(OFPActionSetDlSrc, self).__init__(dl_addr) super(OFPActionSetDlSrc, self).__init__(dl_addr)
@ -582,6 +588,7 @@ class OFPActionSetDlDst(OFPActionDlAddr):
dl_addr Ethernet address. dl_addr Ethernet address.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, dl_addr): def __init__(self, dl_addr):
super(OFPActionSetDlDst, self).__init__(dl_addr) super(OFPActionSetDlDst, self).__init__(dl_addr)
@ -629,6 +636,7 @@ class OFPActionSetNwSrc(OFPActionNwAddr):
nw_addr IP address. nw_addr IP address.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, nw_addr): def __init__(self, nw_addr):
super(OFPActionSetNwSrc, self).__init__(nw_addr) super(OFPActionSetNwSrc, self).__init__(nw_addr)
@ -647,6 +655,7 @@ class OFPActionSetNwDst(OFPActionNwAddr):
nw_addr IP address. nw_addr IP address.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, nw_addr): def __init__(self, nw_addr):
super(OFPActionSetNwDst, self).__init__(nw_addr) super(OFPActionSetNwDst, self).__init__(nw_addr)
@ -665,6 +674,7 @@ class OFPActionSetNwTos(OFPAction):
tos IP ToS (DSCP field, 6 bits). tos IP ToS (DSCP field, 6 bits).
================ ====================================================== ================ ======================================================
""" """
def __init__(self, tos): def __init__(self, tos):
super(OFPActionSetNwTos, self).__init__() super(OFPActionSetNwTos, self).__init__()
self.tos = tos self.tos = tos
@ -715,6 +725,7 @@ class OFPActionSetTpSrc(OFPActionTpPort):
tp TCP/UDP port. tp TCP/UDP port.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, tp): def __init__(self, tp):
super(OFPActionSetTpSrc, self).__init__(tp) super(OFPActionSetTpSrc, self).__init__(tp)
@ -733,6 +744,7 @@ class OFPActionSetTpDst(OFPActionTpPort):
tp TCP/UDP port. tp TCP/UDP port.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, tp): def __init__(self, tp):
super(OFPActionSetTpDst, self).__init__(tp) super(OFPActionSetTpDst, self).__init__(tp)
@ -752,6 +764,7 @@ class OFPActionEnqueue(OFPAction):
queue_id Where to enqueue the packets. queue_id Where to enqueue the packets.
================ ====================================================== ================ ======================================================
""" """
def __init__(self, port, queue_id): def __init__(self, port, queue_id):
super(OFPActionEnqueue, self).__init__() super(OFPActionEnqueue, self).__init__()
self.port = port self.port = port
@ -1150,6 +1163,7 @@ class OFPPacketQueue(StringifyMixin):
properties List of ``OFPQueueProp*`` instance. properties List of ``OFPQueueProp*`` instance.
========== ========================================================= ========== =========================================================
""" """
def __init__(self, queue_id, len_): def __init__(self, queue_id, len_):
self.queue_id = queue_id self.queue_id = queue_id
self.len = len_ self.len = len_
@ -1192,6 +1206,7 @@ class OFPHello(MsgBase):
This message is handled by the Ryu framework, so the Ryu application This message is handled by the Ryu framework, so the Ryu application
do not need to process this typically. do not need to process this typically.
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPHello, self).__init__(datapath) super(OFPHello, self).__init__(datapath)
@ -1238,6 +1253,7 @@ class OFPErrorMsg(MsgBase):
'message=%s', 'message=%s',
msg.type, msg.code, utils.hex_array(msg.data)) msg.type, msg.code, utils.hex_array(msg.data))
""" """
def __init__(self, datapath, type_=None, code=None, data=None): def __init__(self, datapath, type_=None, code=None, data=None):
super(OFPErrorMsg, self).__init__(datapath) super(OFPErrorMsg, self).__init__(datapath)
self.type = type_ self.type = type_
@ -1284,6 +1300,7 @@ class OFPEchoRequest(MsgBase):
req = ofp_parser.OFPEchoRequest(datapath, data) req = ofp_parser.OFPEchoRequest(datapath, data)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoRequest, self).__init__(datapath) super(OFPEchoRequest, self).__init__(datapath)
self.data = data self.data = data
@ -1323,6 +1340,7 @@ class OFPEchoReply(MsgBase):
self.logger.debug('OFPEchoReply received: data=%s', self.logger.debug('OFPEchoReply received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoReply, self).__init__(datapath) super(OFPEchoReply, self).__init__(datapath)
self.data = data self.data = data
@ -1686,6 +1704,7 @@ class OFPSwitchFeatures(MsgBase):
msg.datapath_id, msg.n_buffers, msg.n_tables, msg.datapath_id, msg.n_buffers, msg.n_tables,
msg.capabilities, msg.ports) msg.capabilities, msg.ports)
""" """
def __init__(self, datapath, datapath_id=None, n_buffers=None, def __init__(self, datapath, datapath_id=None, n_buffers=None,
n_tables=None, capabilities=None, actions=None, ports=None): n_tables=None, capabilities=None, actions=None, ports=None):
super(OFPSwitchFeatures, self).__init__(datapath) super(OFPSwitchFeatures, self).__init__(datapath)
@ -1760,6 +1779,7 @@ class OFPPortStatus(MsgBase):
self.logger.debug('OFPPortStatus received: reason=%s desc=%s', self.logger.debug('OFPPortStatus received: reason=%s desc=%s',
reason, msg.desc) reason, msg.desc)
""" """
def __init__(self, datapath, reason=None, desc=None): def __init__(self, datapath, reason=None, desc=None):
super(OFPPortStatus, self).__init__(datapath) super(OFPPortStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -1823,6 +1843,7 @@ class OFPPacketIn(MsgBase):
msg.buffer_id, msg.total_len, msg.in_port, msg.buffer_id, msg.total_len, msg.in_port,
reason, utils.hex_array(msg.data)) reason, utils.hex_array(msg.data))
""" """
def __init__(self, datapath, buffer_id=None, total_len=None, in_port=None, def __init__(self, datapath, buffer_id=None, total_len=None, in_port=None,
reason=None, data=None): reason=None, data=None):
super(OFPPacketIn, self).__init__(datapath) super(OFPPacketIn, self).__init__(datapath)
@ -1893,6 +1914,7 @@ class OFPGetConfigReply(MsgBase):
'flags=%s miss_send_len=%d', 'flags=%s miss_send_len=%d',
flags, msg.miss_send_len) flags, msg.miss_send_len)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetConfigReply, self).__init__(datapath) super(OFPGetConfigReply, self).__init__(datapath)
@ -1920,6 +1942,7 @@ class OFPBarrierReply(MsgBase):
def barrier_reply_handler(self, ev): def barrier_reply_handler(self, ev):
self.logger.debug('OFPBarrierReply received') self.logger.debug('OFPBarrierReply received')
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierReply, self).__init__(datapath) super(OFPBarrierReply, self).__init__(datapath)
@ -1980,6 +2003,7 @@ class OFPFlowRemoved(MsgBase):
msg.idle_timeout, msg.packet_count, msg.idle_timeout, msg.packet_count,
msg.byte_count) msg.byte_count)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFlowRemoved, self).__init__(datapath) super(OFPFlowRemoved, self).__init__(datapath)
@ -2029,6 +2053,7 @@ class OFPQueueGetConfigReply(MsgBase):
'port=%s queues=%s', 'port=%s queues=%s',
msg.port, msg.queues) msg.port, msg.queues)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPQueueGetConfigReply, self).__init__(datapath) super(OFPQueueGetConfigReply, self).__init__(datapath)
@ -2150,6 +2175,7 @@ class OFPDescStatsReply(OFPStatsReply):
body.mfr_desc, body.hw_desc, body.sw_desc, body.mfr_desc, body.hw_desc, body.sw_desc,
body.serial_num, body.dp_desc) body.serial_num, body.dp_desc)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPDescStatsReply, self).__init__(datapath) super(OFPDescStatsReply, self).__init__(datapath)
@ -2206,6 +2232,7 @@ class OFPFlowStatsReply(OFPStatsReply):
stat.actions)) stat.actions))
self.logger.debug('FlowStats: %s', flows) self.logger.debug('FlowStats: %s', flows)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFlowStatsReply, self).__init__(datapath) super(OFPFlowStatsReply, self).__init__(datapath)
@ -2241,6 +2268,7 @@ class OFPAggregateStatsReply(OFPStatsReply):
body.packet_count, body.byte_count, body.packet_count, body.byte_count,
body.flow_count) body.flow_count)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPAggregateStatsReply, self).__init__(datapath) super(OFPAggregateStatsReply, self).__init__(datapath)
@ -2286,6 +2314,7 @@ class OFPTableStatsReply(OFPStatsReply):
stat.lookup_count, stat.matched_count)) stat.lookup_count, stat.matched_count))
self.logger.debug('TableStats: %s', tables) self.logger.debug('TableStats: %s', tables)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPTableStatsReply, self).__init__(datapath) super(OFPTableStatsReply, self).__init__(datapath)
@ -2344,6 +2373,7 @@ class OFPPortStatsReply(OFPStatsReply):
stat.rx_crc_err, stat.collisions)) stat.rx_crc_err, stat.collisions))
self.logger.debug('PortStats: %s', ports) self.logger.debug('PortStats: %s', ports)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPPortStatsReply, self).__init__(datapath) super(OFPPortStatsReply, self).__init__(datapath)
@ -2384,6 +2414,7 @@ class OFPQueueStatsReply(OFPStatsReply):
stat.tx_bytes, stat.tx_packets, stat.tx_errors)) stat.tx_bytes, stat.tx_packets, stat.tx_errors))
self.logger.debug('QueueStats: %s', queues) self.logger.debug('QueueStats: %s', queues)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPQueueStatsReply, self).__init__(datapath) super(OFPQueueStatsReply, self).__init__(datapath)
@ -2527,6 +2558,7 @@ class OFPFeaturesRequest(MsgBase):
req = ofp_parser.OFPFeaturesRequest(datapath) req = ofp_parser.OFPFeaturesRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFeaturesRequest, self).__init__(datapath) super(OFPFeaturesRequest, self).__init__(datapath)
@ -2547,6 +2579,7 @@ class OFPGetConfigRequest(MsgBase):
req = ofp_parser.OFPGetConfigRequest(datapath) req = ofp_parser.OFPGetConfigRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetConfigRequest, self).__init__(datapath) super(OFPGetConfigRequest, self).__init__(datapath)
@ -2581,6 +2614,7 @@ class OFPSetConfig(MsgBase):
req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256) req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=None, miss_send_len=None): def __init__(self, datapath, flags=None, miss_send_len=None):
super(OFPSetConfig, self).__init__(datapath) super(OFPSetConfig, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -2625,6 +2659,7 @@ class OFPPacketOut(MsgBase):
in_port, actions) in_port, actions)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, buffer_id=None, in_port=None, actions=None, def __init__(self, datapath, buffer_id=None, in_port=None, actions=None,
data=None): data=None):
super(OFPPacketOut, self).__init__(datapath) super(OFPPacketOut, self).__init__(datapath)
@ -2733,6 +2768,7 @@ class OFPFlowMod(MsgBase):
priority, buffer_id, out_port, flags, actions) priority, buffer_id, out_port, flags, actions)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, match=None, cookie=0, def __init__(self, datapath, match=None, cookie=0,
command=ofproto.OFPFC_ADD, command=ofproto.OFPFC_ADD,
idle_timeout=0, hard_timeout=0, idle_timeout=0, hard_timeout=0,
@ -2890,6 +2926,7 @@ class OFPBarrierRequest(MsgBase):
req = ofp_parser.OFPBarrierRequest(datapath) req = ofp_parser.OFPBarrierRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierRequest, self).__init__(datapath) super(OFPBarrierRequest, self).__init__(datapath)
@ -2917,6 +2954,7 @@ class OFPQueueGetConfigRequest(MsgBase):
ofp.OFPP_NONE) ofp.OFPP_NONE)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, port): def __init__(self, datapath, port):
super(OFPQueueGetConfigRequest, self).__init__(datapath) super(OFPQueueGetConfigRequest, self).__init__(datapath)
self.port = port self.port = port
@ -2967,6 +3005,7 @@ class OFPDescStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPDescStatsRequest(datapath) req = ofp_parser.OFPDescStatsRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags): def __init__(self, datapath, flags):
super(OFPDescStatsRequest, self).__init__(datapath, flags) super(OFPDescStatsRequest, self).__init__(datapath, flags)
@ -3022,6 +3061,7 @@ class OFPFlowStatsRequest(OFPFlowStatsRequestBase):
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, match, table_id, out_port): def __init__(self, datapath, flags, match, table_id, out_port):
super(OFPFlowStatsRequest, self).__init__( super(OFPFlowStatsRequest, self).__init__(
datapath, flags, match, table_id, out_port) datapath, flags, match, table_id, out_port)
@ -3061,6 +3101,7 @@ class OFPAggregateStatsRequest(OFPFlowStatsRequestBase):
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, match, table_id, out_port): def __init__(self, datapath, flags, match, table_id, out_port):
super(OFPAggregateStatsRequest, self).__init__( super(OFPAggregateStatsRequest, self).__init__(
datapath, flags, match, table_id, out_port) datapath, flags, match, table_id, out_port)
@ -3089,6 +3130,7 @@ class OFPTableStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPTableStatsRequest(datapath) req = ofp_parser.OFPTableStatsRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags): def __init__(self, datapath, flags):
super(OFPTableStatsRequest, self).__init__(datapath, flags) super(OFPTableStatsRequest, self).__init__(datapath, flags)
@ -3119,6 +3161,7 @@ class OFPPortStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY) req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, port_no): def __init__(self, datapath, flags, port_no):
super(OFPPortStatsRequest, self).__init__(datapath, flags) super(OFPPortStatsRequest, self).__init__(datapath, flags)
self.port_no = port_no self.port_no = port_no
@ -3155,6 +3198,7 @@ class OFPQueueStatsRequest(OFPStatsRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, port_no, queue_id): def __init__(self, datapath, flags, port_no, queue_id):
super(OFPQueueStatsRequest, self).__init__(datapath, flags) super(OFPQueueStatsRequest, self).__init__(datapath, flags)
self.port_no = port_no self.port_no = port_no
@ -3176,6 +3220,7 @@ class OFPVendorStatsRequest(OFPStatsRequest):
The controller uses this message to query vendor-specific information The controller uses this message to query vendor-specific information
of a switch. of a switch.
""" """
def __init__(self, datapath, flags, vendor, specific_data=None): def __init__(self, datapath, flags, vendor, specific_data=None):
super(OFPVendorStatsRequest, self).__init__(datapath, flags) super(OFPVendorStatsRequest, self).__init__(datapath, flags)
self.vendor = vendor self.vendor = vendor

View File

@ -72,6 +72,7 @@ class OFPHello(MsgBase):
This message is handled by the Ryu framework, so the Ryu application This message is handled by the Ryu framework, so the Ryu application
do not need to process this typically. do not need to process this typically.
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPHello, self).__init__(datapath) super(OFPHello, self).__init__(datapath)
@ -135,6 +136,7 @@ class OFPErrorMsg(MsgBase):
'message=%s', 'message=%s',
msg.type, msg.code, utils.hex_array(msg.data)) msg.type, msg.code, utils.hex_array(msg.data))
""" """
def __init__(self, datapath, type_=None, code=None, data=None, **kwargs): def __init__(self, datapath, type_=None, code=None, data=None, **kwargs):
super(OFPErrorMsg, self).__init__(datapath) super(OFPErrorMsg, self).__init__(datapath)
self.type = type_ self.type = type_
@ -227,6 +229,7 @@ class OFPEchoRequest(MsgBase):
self.logger.debug('OFPEchoRequest received: data=%s', self.logger.debug('OFPEchoRequest received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoRequest, self).__init__(datapath) super(OFPEchoRequest, self).__init__(datapath)
self.data = data self.data = data
@ -272,6 +275,7 @@ class OFPEchoReply(MsgBase):
self.logger.debug('OFPEchoReply received: data=%s', self.logger.debug('OFPEchoReply received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoReply, self).__init__(datapath) super(OFPEchoReply, self).__init__(datapath)
self.data = data self.data = data
@ -302,6 +306,7 @@ class OFPExperimenter(MsgBase):
data Experimenter defined arbitrary additional data data Experimenter defined arbitrary additional data
============= ========================================================= ============= =========================================================
""" """
def __init__(self, datapath, experimenter=None, exp_type=None, data=None): def __init__(self, datapath, experimenter=None, exp_type=None, data=None):
super(OFPExperimenter, self).__init__(datapath) super(OFPExperimenter, self).__init__(datapath)
self.experimenter = experimenter self.experimenter = experimenter
@ -402,6 +407,7 @@ class OFPFeaturesRequest(MsgBase):
req = ofp_parser.OFPFeaturesRequest(datapath) req = ofp_parser.OFPFeaturesRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFeaturesRequest, self).__init__(datapath) super(OFPFeaturesRequest, self).__init__(datapath)
@ -430,6 +436,7 @@ class OFPSwitchFeatures(MsgBase):
msg.datapath_id, msg.n_buffers, msg.n_tables, msg.datapath_id, msg.n_buffers, msg.n_tables,
msg.capabilities, msg.ports) msg.capabilities, msg.ports)
""" """
def __init__(self, datapath, datapath_id=None, n_buffers=None, def __init__(self, datapath, datapath_id=None, n_buffers=None,
n_tables=None, capabilities=None, ports=None): n_tables=None, capabilities=None, ports=None):
super(OFPSwitchFeatures, self).__init__(datapath) super(OFPSwitchFeatures, self).__init__(datapath)
@ -479,6 +486,7 @@ class OFPGetConfigRequest(MsgBase):
req = ofp_parser.OFPGetConfigRequest(datapath) req = ofp_parser.OFPGetConfigRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetConfigRequest, self).__init__(datapath) super(OFPGetConfigRequest, self).__init__(datapath)
@ -530,6 +538,7 @@ class OFPGetConfigReply(MsgBase):
'flags=%s miss_send_len=%d', 'flags=%s miss_send_len=%d',
flags, msg.miss_send_len) flags, msg.miss_send_len)
""" """
def __init__(self, datapath, flags=None, miss_send_len=None): def __init__(self, datapath, flags=None, miss_send_len=None):
super(OFPGetConfigReply, self).__init__(datapath) super(OFPGetConfigReply, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -576,6 +585,7 @@ class OFPSetConfig(MsgBase):
req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256) req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, miss_send_len=0): def __init__(self, datapath, flags=0, miss_send_len=0):
super(OFPSetConfig, self).__init__(datapath) super(OFPSetConfig, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -637,6 +647,7 @@ class OFPPacketIn(MsgBase):
msg.table_id, msg.match, msg.table_id, msg.match,
utils.hex_array(msg.data)) utils.hex_array(msg.data))
""" """
def __init__(self, datapath, buffer_id=None, total_len=None, reason=None, def __init__(self, datapath, buffer_id=None, total_len=None, reason=None,
table_id=None, match=None, data=None): table_id=None, match=None, data=None):
super(OFPPacketIn, self).__init__(datapath) super(OFPPacketIn, self).__init__(datapath)
@ -729,6 +740,7 @@ class OFPFlowRemoved(MsgBase):
msg.idle_timeout, msg.hard_timeout, msg.idle_timeout, msg.hard_timeout,
msg.packet_count, msg.byte_count, msg.match) msg.packet_count, msg.byte_count, msg.match)
""" """
def __init__(self, datapath, cookie=None, priority=None, reason=None, def __init__(self, datapath, cookie=None, priority=None, reason=None,
table_id=None, duration_sec=None, duration_nsec=None, table_id=None, duration_sec=None, duration_nsec=None,
idle_timeout=None, hard_timeout=None, packet_count=None, idle_timeout=None, hard_timeout=None, packet_count=None,
@ -806,6 +818,7 @@ class OFPPortStatus(MsgBase):
self.logger.debug('OFPPortStatus received: reason=%s desc=%s', self.logger.debug('OFPPortStatus received: reason=%s desc=%s',
reason, msg.desc) reason, msg.desc)
""" """
def __init__(self, datapath, reason=None, desc=None): def __init__(self, datapath, reason=None, desc=None):
super(OFPPortStatus, self).__init__(datapath) super(OFPPortStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -852,6 +865,7 @@ class OFPPacketOut(MsgBase):
in_port, actions) in_port, actions)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, buffer_id=None, in_port=None, actions=None, def __init__(self, datapath, buffer_id=None, in_port=None, actions=None,
data=None, actions_len=None): data=None, actions_len=None):
# The in_port field is the ingress port that must be associated # The in_port field is the ingress port that must be associated
@ -967,6 +981,7 @@ class OFPFlowMod(MsgBase):
match, inst) match, inst)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0, def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0,
command=ofproto.OFPFC_ADD, command=ofproto.OFPFC_ADD,
idle_timeout=0, hard_timeout=0, priority=0, idle_timeout=0, hard_timeout=0, priority=0,
@ -1070,6 +1085,7 @@ class OFPInstructionGotoTable(OFPInstruction):
table_id Next table table_id Next table
================ ====================================================== ================ ======================================================
""" """
def __init__(self, table_id, type_=None, len_=None): def __init__(self, table_id, type_=None, len_=None):
super(OFPInstructionGotoTable, self).__init__() super(OFPInstructionGotoTable, self).__init__()
self.type = ofproto.OFPIT_GOTO_TABLE self.type = ofproto.OFPIT_GOTO_TABLE
@ -1102,6 +1118,7 @@ class OFPInstructionWriteMetadata(OFPInstruction):
metadata_mask Metadata write bitmask metadata_mask Metadata write bitmask
================ ====================================================== ================ ======================================================
""" """
def __init__(self, metadata, metadata_mask, type_=None, len_=None): def __init__(self, metadata, metadata_mask, type_=None, len_=None):
super(OFPInstructionWriteMetadata, self).__init__() super(OFPInstructionWriteMetadata, self).__init__()
self.type = ofproto.OFPIT_WRITE_METADATA self.type = ofproto.OFPIT_WRITE_METADATA
@ -1144,6 +1161,7 @@ class OFPInstructionActions(OFPInstruction):
``type`` attribute corresponds to ``type_`` parameter of __init__. ``type`` attribute corresponds to ``type_`` parameter of __init__.
""" """
def __init__(self, type_, actions=None, len_=None): def __init__(self, type_, actions=None, len_=None):
super(OFPInstructionActions, self).__init__() super(OFPInstructionActions, self).__init__()
self.type = type_ self.type = type_
@ -1242,6 +1260,7 @@ class OFPActionOutput(OFPAction):
max_len Max length to send to controller max_len Max length to send to controller
================ ====================================================== ================ ======================================================
""" """
def __init__(self, port, max_len=ofproto.OFPCML_MAX, def __init__(self, port, max_len=ofproto.OFPCML_MAX,
type_=None, len_=None): type_=None, len_=None):
super(OFPActionOutput, self).__init__() super(OFPActionOutput, self).__init__()
@ -1273,6 +1292,7 @@ class OFPActionGroup(OFPAction):
group_id Group identifier group_id Group identifier
================ ====================================================== ================ ======================================================
""" """
def __init__(self, group_id=0, type_=None, len_=None): def __init__(self, group_id=0, type_=None, len_=None):
super(OFPActionGroup, self).__init__() super(OFPActionGroup, self).__init__()
self.group_id = group_id self.group_id = group_id
@ -1303,6 +1323,7 @@ class OFPActionSetQueue(OFPAction):
queue_id Queue ID for the packets queue_id Queue ID for the packets
================ ====================================================== ================ ======================================================
""" """
def __init__(self, queue_id, type_=None, len_=None): def __init__(self, queue_id, type_=None, len_=None):
super(OFPActionSetQueue, self).__init__() super(OFPActionSetQueue, self).__init__()
self.queue_id = queue_id self.queue_id = queue_id
@ -1332,6 +1353,7 @@ class OFPActionSetMplsTtl(OFPAction):
mpls_ttl MPLS TTL mpls_ttl MPLS TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, mpls_ttl, type_=None, len_=None): def __init__(self, mpls_ttl, type_=None, len_=None):
super(OFPActionSetMplsTtl, self).__init__() super(OFPActionSetMplsTtl, self).__init__()
self.mpls_ttl = mpls_ttl self.mpls_ttl = mpls_ttl
@ -1355,6 +1377,7 @@ class OFPActionDecMplsTtl(OFPAction):
This action decrements the MPLS TTL. This action decrements the MPLS TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecMplsTtl, self).__init__() super(OFPActionDecMplsTtl, self).__init__()
@ -1379,6 +1402,7 @@ class OFPActionSetNwTtl(OFPAction):
nw_ttl IP TTL nw_ttl IP TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, nw_ttl, type_=None, len_=None): def __init__(self, nw_ttl, type_=None, len_=None):
super(OFPActionSetNwTtl, self).__init__() super(OFPActionSetNwTtl, self).__init__()
self.nw_ttl = nw_ttl self.nw_ttl = nw_ttl
@ -1402,6 +1426,7 @@ class OFPActionDecNwTtl(OFPAction):
This action decrements the IP TTL. This action decrements the IP TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecNwTtl, self).__init__() super(OFPActionDecNwTtl, self).__init__()
@ -1421,6 +1446,7 @@ class OFPActionCopyTtlOut(OFPAction):
This action copies the TTL from the next-to-outermost header with TTL to This action copies the TTL from the next-to-outermost header with TTL to
the outermost header with TTL. the outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlOut, self).__init__() super(OFPActionCopyTtlOut, self).__init__()
@ -1440,6 +1466,7 @@ class OFPActionCopyTtlIn(OFPAction):
This action copies the TTL from the outermost header with TTL to the This action copies the TTL from the outermost header with TTL to the
next-to-outermost header with TTL. next-to-outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlIn, self).__init__() super(OFPActionCopyTtlIn, self).__init__()
@ -1464,6 +1491,7 @@ class OFPActionPushVlan(OFPAction):
ethertype Ether type. The default is 802.1Q. (0x8100) ethertype Ether type. The default is 802.1Q. (0x8100)
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None):
super(OFPActionPushVlan, self).__init__() super(OFPActionPushVlan, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -1493,6 +1521,7 @@ class OFPActionPushMpls(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None):
super(OFPActionPushMpls, self).__init__() super(OFPActionPushMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -1516,6 +1545,7 @@ class OFPActionPopVlan(OFPAction):
This action pops the outermost VLAN tag from the packet. This action pops the outermost VLAN tag from the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopVlan, self).__init__() super(OFPActionPopVlan, self).__init__()
@ -1534,6 +1564,7 @@ class OFPActionPopMpls(OFPAction):
This action pops the MPLS header from the packet. This action pops the MPLS header from the packet.
""" """
def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None):
super(OFPActionPopMpls, self).__init__() super(OFPActionPopMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -1563,6 +1594,7 @@ class OFPActionSetField(OFPAction):
set_field = OFPActionSetField(eth_src="00:00:00:00:00:00") set_field = OFPActionSetField(eth_src="00:00:00:00:00:00")
""" """
def __init__(self, field=None, **kwargs): def __init__(self, field=None, **kwargs):
# old api # old api
# OFPActionSetField(field) # OFPActionSetField(field)
@ -1683,6 +1715,7 @@ class OFPActionExperimenter(OFPAction):
For the list of the supported Nicira experimenter actions, For the list of the supported Nicira experimenter actions,
please refer to :ref:`ryu.ofproto.nx_actions <nx_actions_structures>`. please refer to :ref:`ryu.ofproto.nx_actions <nx_actions_structures>`.
""" """
def __init__(self, experimenter, type_=None, len_=None): def __init__(self, experimenter, type_=None, len_=None):
super(OFPActionExperimenter, self).__init__() super(OFPActionExperimenter, self).__init__()
self.experimenter = experimenter self.experimenter = experimenter
@ -1789,6 +1822,7 @@ class OFPGroupMod(MsgBase):
ofp.OFPGT_SELECT, group_id, buckets) ofp.OFPGT_SELECT, group_id, buckets)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, command=ofproto.OFPGC_ADD, def __init__(self, datapath, command=ofproto.OFPGC_ADD,
type_=ofproto.OFPGT_ALL, group_id=0, buckets=None): type_=ofproto.OFPGT_ALL, group_id=0, buckets=None):
buckets = buckets if buckets else [] buckets = buckets if buckets else []
@ -1921,6 +1955,7 @@ class OFPTableMod(MsgBase):
ofp.OFPTC_TABLE_MISS_DROP) ofp.OFPTC_TABLE_MISS_DROP)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, table_id, config): def __init__(self, datapath, table_id, config):
super(OFPTableMod, self).__init__(datapath) super(OFPTableMod, self).__init__(datapath)
self.table_id = table_id self.table_id = table_id
@ -2020,6 +2055,7 @@ class OFPDescStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPDescStatsRequest(datapath) req = ofp_parser.OFPDescStatsRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0): def __init__(self, datapath, flags=0):
super(OFPDescStatsRequest, self).__init__(datapath, super(OFPDescStatsRequest, self).__init__(datapath,
ofproto.OFPST_DESC, ofproto.OFPST_DESC,
@ -2120,6 +2156,7 @@ class OFPFlowStatsRequest(OFPStatsRequest):
cookie, cookie_mask, match) cookie, cookie_mask, match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, table_id=ofproto.OFPTT_ALL, def __init__(self, datapath, table_id=ofproto.OFPTT_ALL,
out_port=ofproto.OFPP_ANY, out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPG_ANY, out_group=ofproto.OFPG_ANY,
@ -2202,6 +2239,7 @@ class OFPFlowStats(StringifyMixin):
stat.match, stat.instructions)) stat.match, stat.instructions))
self.logger.debug('FlowStats: %s', flows) self.logger.debug('FlowStats: %s', flows)
""" """
def __init__(self, table_id, duration_sec, duration_nsec, def __init__(self, table_id, duration_sec, duration_nsec,
priority, idle_timeout, hard_timeout, cookie, packet_count, priority, idle_timeout, hard_timeout, cookie, packet_count,
byte_count, match, instructions=None, length=None): byte_count, match, instructions=None, length=None):
@ -2286,6 +2324,7 @@ class OFPAggregateStatsRequest(OFPStatsRequest):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, table_id=ofproto.OFPTT_ALL, def __init__(self, datapath, table_id=ofproto.OFPTT_ALL,
out_port=ofproto.OFPP_ANY, out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPP_ANY, out_group=ofproto.OFPP_ANY,
@ -2384,6 +2423,7 @@ class OFPTableStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPTableStatsRequest(datapath) req = ofp_parser.OFPTableStatsRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0): def __init__(self, datapath, flags=0):
super(OFPTableStatsRequest, self).__init__(datapath, super(OFPTableStatsRequest, self).__init__(datapath,
ofproto.OFPST_TABLE, ofproto.OFPST_TABLE,
@ -2499,6 +2539,7 @@ class OFPPortStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPPortStatsRequest(datapath, ofp.OFPP_ANY) req = ofp_parser.OFPPortStatsRequest(datapath, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, port_no=ofproto.OFPP_ANY, flags=0): def __init__(self, datapath, port_no=ofproto.OFPP_ANY, flags=0):
super(OFPPortStatsRequest, self).__init__(datapath, super(OFPPortStatsRequest, self).__init__(datapath,
ofproto.OFPST_PORT, ofproto.OFPST_PORT,
@ -2608,6 +2649,7 @@ class OFPQueueStatsRequest(OFPStatsRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, port_no=ofproto.OFPP_ANY,
queue_id=ofproto.OFPQ_ALL, flags=0): queue_id=ofproto.OFPQ_ALL, flags=0):
super(OFPQueueStatsRequest, self).__init__(datapath, super(OFPQueueStatsRequest, self).__init__(datapath,
@ -2710,6 +2752,7 @@ class OFPGroupStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPGroupStatsRequest(datapath, ofp.OFPG_ALL) req = ofp_parser.OFPGroupStatsRequest(datapath, ofp.OFPG_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, group_id=ofproto.OFPG_ALL, flags=0): def __init__(self, datapath, group_id=ofproto.OFPG_ALL, flags=0):
super(OFPGroupStatsRequest, self).__init__(datapath, super(OFPGroupStatsRequest, self).__init__(datapath,
ofproto.OFPST_GROUP, ofproto.OFPST_GROUP,
@ -2815,6 +2858,7 @@ class OFPGroupDescStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPGroupDescStatsRequest(datapath) req = ofp_parser.OFPGroupDescStatsRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0): def __init__(self, datapath, flags=0):
super(OFPGroupDescStatsRequest, self).__init__( super(OFPGroupDescStatsRequest, self).__init__(
datapath, datapath,
@ -2858,6 +2902,7 @@ class OFPGroupDescStats(StringifyMixin):
(stat.type, stat.group_id, stat.buckets)) (stat.type, stat.group_id, stat.buckets))
self.logger.debug('GroupDescStats: %s', descs) self.logger.debug('GroupDescStats: %s', descs)
""" """
def __init__(self, type_, group_id, buckets, length=None): def __init__(self, type_, group_id, buckets, length=None):
self.type = type_ self.type = type_
self.group_id = group_id self.group_id = group_id
@ -2905,6 +2950,7 @@ class OFPGroupFeaturesStatsRequest(OFPStatsRequest):
req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath) req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0): def __init__(self, datapath, flags=0):
super(OFPGroupFeaturesStatsRequest, self).__init__( super(OFPGroupFeaturesStatsRequest, self).__init__(
datapath, datapath,
@ -2948,6 +2994,7 @@ class OFPGroupFeaturesStats(StringifyMixin):
body.types, body.capabilities, body.max_groups, body.types, body.capabilities, body.max_groups,
body.actions) body.actions)
""" """
def __init__(self, types, capabilities, max_groups, actions, length=None): def __init__(self, types, capabilities, max_groups, actions, length=None):
self.types = types self.types = types
self.capabilities = capabilities self.capabilities = capabilities
@ -2988,6 +3035,7 @@ class OFPQueueGetConfigRequest(MsgBase):
req = ofp_parser.OFPQueueGetConfigRequest(datapath, ofp.OFPP_ANY) req = ofp_parser.OFPQueueGetConfigRequest(datapath, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, port): def __init__(self, datapath, port):
super(OFPQueueGetConfigRequest, self).__init__(datapath) super(OFPQueueGetConfigRequest, self).__init__(datapath)
self.port = port self.port = port
@ -3112,6 +3160,7 @@ class OFPQueueGetConfigReply(MsgBase):
'port=%s queues=%s', 'port=%s queues=%s',
msg.port, msg.queues) msg.port, msg.queues)
""" """
def __init__(self, datapath, port=None, queues=None): def __init__(self, datapath, port=None, queues=None):
super(OFPQueueGetConfigReply, self).__init__(datapath) super(OFPQueueGetConfigReply, self).__init__(datapath)
self.port = port self.port = port
@ -3155,6 +3204,7 @@ class OFPBarrierRequest(MsgBase):
req = ofp_parser.OFPBarrierRequest(datapath) req = ofp_parser.OFPBarrierRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierRequest, self).__init__(datapath) super(OFPBarrierRequest, self).__init__(datapath)
@ -3173,6 +3223,7 @@ class OFPBarrierReply(MsgBase):
def barrier_reply_handler(self, ev): def barrier_reply_handler(self, ev):
self.logger.debug('OFPBarrierReply received') self.logger.debug('OFPBarrierReply received')
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierReply, self).__init__(datapath) super(OFPBarrierReply, self).__init__(datapath)
@ -3205,6 +3256,7 @@ class OFPRoleRequest(MsgBase):
req = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0) req = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, role, generation_id): def __init__(self, datapath, role, generation_id):
super(OFPRoleRequest, self).__init__(datapath) super(OFPRoleRequest, self).__init__(datapath)
self.role = role self.role = role
@ -3259,6 +3311,7 @@ class OFPRoleReply(MsgBase):
'role=%s generation_id=%d', 'role=%s generation_id=%d',
role, msg.generation_id) role, msg.generation_id)
""" """
def __init__(self, datapath, role=None, generation_id=None): def __init__(self, datapath, role=None, generation_id=None):
super(OFPRoleReply, self).__init__(datapath) super(OFPRoleReply, self).__init__(datapath)
self.role = role self.role = role

View File

@ -112,6 +112,7 @@ class OFPHello(MsgBase):
elements list of ``OFPHelloElemVersionBitmap`` instance elements list of ``OFPHelloElemVersionBitmap`` instance
========== ========================================================= ========== =========================================================
""" """
def __init__(self, datapath, elements=None): def __init__(self, datapath, elements=None):
elements = elements if elements else [] elements = elements if elements else []
super(OFPHello, self).__init__(datapath) super(OFPHello, self).__init__(datapath)
@ -150,6 +151,7 @@ class OFPHelloElemVersionBitmap(StringifyMixin):
versions list of versions of OpenFlow protocol a device supports versions list of versions of OpenFlow protocol a device supports
========== ========================================================= ========== =========================================================
""" """
def __init__(self, versions, type_=None, length=None): def __init__(self, versions, type_=None, length=None):
super(OFPHelloElemVersionBitmap, self).__init__() super(OFPHelloElemVersionBitmap, self).__init__()
self.type = ofproto.OFPHET_VERSIONBITMAP self.type = ofproto.OFPHET_VERSIONBITMAP
@ -244,6 +246,7 @@ class OFPErrorMsg(MsgBase):
'message=%s', 'message=%s',
msg.type, msg.code, utils.hex_array(msg.data)) msg.type, msg.code, utils.hex_array(msg.data))
""" """
def __init__(self, datapath, type_=None, code=None, data=None, **kwargs): def __init__(self, datapath, type_=None, code=None, data=None, **kwargs):
super(OFPErrorMsg, self).__init__(datapath) super(OFPErrorMsg, self).__init__(datapath)
self.type = type_ self.type = type_
@ -336,6 +339,7 @@ class OFPEchoRequest(MsgBase):
self.logger.debug('OFPEchoRequest received: data=%s', self.logger.debug('OFPEchoRequest received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoRequest, self).__init__(datapath) super(OFPEchoRequest, self).__init__(datapath)
self.data = data self.data = data
@ -381,6 +385,7 @@ class OFPEchoReply(MsgBase):
self.logger.debug('OFPEchoReply received: data=%s', self.logger.debug('OFPEchoReply received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoReply, self).__init__(datapath) super(OFPEchoReply, self).__init__(datapath)
self.data = data self.data = data
@ -465,6 +470,7 @@ class OFPFeaturesRequest(MsgBase):
req = ofp_parser.OFPFeaturesRequest(datapath) req = ofp_parser.OFPFeaturesRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFeaturesRequest, self).__init__(datapath) super(OFPFeaturesRequest, self).__init__(datapath)
@ -494,6 +500,7 @@ class OFPSwitchFeatures(MsgBase):
msg.datapath_id, msg.n_buffers, msg.n_tables, msg.datapath_id, msg.n_buffers, msg.n_tables,
msg.auxiliary_id, msg.capabilities) msg.auxiliary_id, msg.capabilities)
""" """
def __init__(self, datapath, datapath_id=None, n_buffers=None, def __init__(self, datapath, datapath_id=None, n_buffers=None,
n_tables=None, auxiliary_id=None, capabilities=None): n_tables=None, auxiliary_id=None, capabilities=None):
super(OFPSwitchFeatures, self).__init__(datapath) super(OFPSwitchFeatures, self).__init__(datapath)
@ -534,6 +541,7 @@ class OFPGetConfigRequest(MsgBase):
req = ofp_parser.OFPGetConfigRequest(datapath) req = ofp_parser.OFPGetConfigRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetConfigRequest, self).__init__(datapath) super(OFPGetConfigRequest, self).__init__(datapath)
@ -579,6 +587,7 @@ class OFPGetConfigReply(MsgBase):
'flags=%s miss_send_len=%d', 'flags=%s miss_send_len=%d',
','.join(flags), msg.miss_send_len) ','.join(flags), msg.miss_send_len)
""" """
def __init__(self, datapath, flags=None, miss_send_len=None): def __init__(self, datapath, flags=None, miss_send_len=None):
super(OFPGetConfigReply, self).__init__(datapath) super(OFPGetConfigReply, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -623,6 +632,7 @@ class OFPSetConfig(MsgBase):
req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256) req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, miss_send_len=0): def __init__(self, datapath, flags=0, miss_send_len=0):
super(OFPSetConfig, self).__init__(datapath) super(OFPSetConfig, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -2295,6 +2305,7 @@ class OFPPacketIn(MsgBase):
msg.table_id, msg.cookie, msg.match, msg.table_id, msg.cookie, msg.match,
utils.hex_array(msg.data)) utils.hex_array(msg.data))
""" """
def __init__(self, datapath, buffer_id=None, total_len=None, reason=None, def __init__(self, datapath, buffer_id=None, total_len=None, reason=None,
table_id=None, cookie=None, match=None, data=None): table_id=None, cookie=None, match=None, data=None):
super(OFPPacketIn, self).__init__(datapath) super(OFPPacketIn, self).__init__(datapath)
@ -2388,6 +2399,7 @@ class OFPFlowRemoved(MsgBase):
msg.idle_timeout, msg.hard_timeout, msg.idle_timeout, msg.hard_timeout,
msg.packet_count, msg.byte_count, msg.match) msg.packet_count, msg.byte_count, msg.match)
""" """
def __init__(self, datapath, cookie=None, priority=None, reason=None, def __init__(self, datapath, cookie=None, priority=None, reason=None,
table_id=None, duration_sec=None, duration_nsec=None, table_id=None, duration_sec=None, duration_nsec=None,
idle_timeout=None, hard_timeout=None, packet_count=None, idle_timeout=None, hard_timeout=None, packet_count=None,
@ -2522,6 +2534,7 @@ class OFPPortStatus(MsgBase):
self.logger.debug('OFPPortStatus received: reason=%s desc=%s', self.logger.debug('OFPPortStatus received: reason=%s desc=%s',
reason, msg.desc) reason, msg.desc)
""" """
def __init__(self, datapath, reason=None, desc=None): def __init__(self, datapath, reason=None, desc=None):
super(OFPPortStatus, self).__init__(datapath) super(OFPPortStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -2568,6 +2581,7 @@ class OFPPacketOut(MsgBase):
in_port, actions) in_port, actions)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, buffer_id=None, in_port=None, actions=None, def __init__(self, datapath, buffer_id=None, in_port=None, actions=None,
data=None, actions_len=None): data=None, actions_len=None):
assert in_port is not None assert in_port is not None
@ -2683,6 +2697,7 @@ class OFPFlowMod(MsgBase):
match, inst) match, inst)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0, def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0,
command=ofproto.OFPFC_ADD, command=ofproto.OFPFC_ADD,
idle_timeout=0, hard_timeout=0, idle_timeout=0, hard_timeout=0,
@ -2804,6 +2819,7 @@ class OFPInstructionGotoTable(OFPInstruction):
table_id Next table table_id Next table
================ ====================================================== ================ ======================================================
""" """
def __init__(self, table_id, type_=None, len_=None): def __init__(self, table_id, type_=None, len_=None):
super(OFPInstructionGotoTable, self).__init__() super(OFPInstructionGotoTable, self).__init__()
self.type = ofproto.OFPIT_GOTO_TABLE self.type = ofproto.OFPIT_GOTO_TABLE
@ -2836,6 +2852,7 @@ class OFPInstructionWriteMetadata(OFPInstruction):
metadata_mask Metadata write bitmask metadata_mask Metadata write bitmask
================ ====================================================== ================ ======================================================
""" """
def __init__(self, metadata, metadata_mask, type_=None, len_=None): def __init__(self, metadata, metadata_mask, type_=None, len_=None):
super(OFPInstructionWriteMetadata, self).__init__() super(OFPInstructionWriteMetadata, self).__init__()
self.type = ofproto.OFPIT_WRITE_METADATA self.type = ofproto.OFPIT_WRITE_METADATA
@ -2878,6 +2895,7 @@ class OFPInstructionActions(OFPInstruction):
``type`` attribute corresponds to ``type_`` parameter of __init__. ``type`` attribute corresponds to ``type_`` parameter of __init__.
""" """
def __init__(self, type_, actions=None, len_=None): def __init__(self, type_, actions=None, len_=None):
super(OFPInstructionActions, self).__init__() super(OFPInstructionActions, self).__init__()
self.type = type_ self.type = type_
@ -3011,6 +3029,7 @@ class OFPActionOutput(OFPAction):
max_len Max length to send to controller max_len Max length to send to controller
================ ====================================================== ================ ======================================================
""" """
def __init__(self, port, max_len=ofproto.OFPCML_MAX, def __init__(self, port, max_len=ofproto.OFPCML_MAX,
type_=None, len_=None): type_=None, len_=None):
super(OFPActionOutput, self).__init__() super(OFPActionOutput, self).__init__()
@ -3042,6 +3061,7 @@ class OFPActionGroup(OFPAction):
group_id Group identifier group_id Group identifier
================ ====================================================== ================ ======================================================
""" """
def __init__(self, group_id=0, type_=None, len_=None): def __init__(self, group_id=0, type_=None, len_=None):
super(OFPActionGroup, self).__init__() super(OFPActionGroup, self).__init__()
self.group_id = group_id self.group_id = group_id
@ -3072,6 +3092,7 @@ class OFPActionSetQueue(OFPAction):
queue_id Queue ID for the packets queue_id Queue ID for the packets
================ ====================================================== ================ ======================================================
""" """
def __init__(self, queue_id, type_=None, len_=None): def __init__(self, queue_id, type_=None, len_=None):
super(OFPActionSetQueue, self).__init__() super(OFPActionSetQueue, self).__init__()
self.queue_id = queue_id self.queue_id = queue_id
@ -3101,6 +3122,7 @@ class OFPActionSetMplsTtl(OFPAction):
mpls_ttl MPLS TTL mpls_ttl MPLS TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, mpls_ttl, type_=None, len_=None): def __init__(self, mpls_ttl, type_=None, len_=None):
super(OFPActionSetMplsTtl, self).__init__() super(OFPActionSetMplsTtl, self).__init__()
self.mpls_ttl = mpls_ttl self.mpls_ttl = mpls_ttl
@ -3124,6 +3146,7 @@ class OFPActionDecMplsTtl(OFPAction):
This action decrements the MPLS TTL. This action decrements the MPLS TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecMplsTtl, self).__init__() super(OFPActionDecMplsTtl, self).__init__()
@ -3148,6 +3171,7 @@ class OFPActionSetNwTtl(OFPAction):
nw_ttl IP TTL nw_ttl IP TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, nw_ttl, type_=None, len_=None): def __init__(self, nw_ttl, type_=None, len_=None):
super(OFPActionSetNwTtl, self).__init__() super(OFPActionSetNwTtl, self).__init__()
self.nw_ttl = nw_ttl self.nw_ttl = nw_ttl
@ -3171,6 +3195,7 @@ class OFPActionDecNwTtl(OFPAction):
This action decrements the IP TTL. This action decrements the IP TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecNwTtl, self).__init__() super(OFPActionDecNwTtl, self).__init__()
@ -3190,6 +3215,7 @@ class OFPActionCopyTtlOut(OFPAction):
This action copies the TTL from the next-to-outermost header with TTL to This action copies the TTL from the next-to-outermost header with TTL to
the outermost header with TTL. the outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlOut, self).__init__() super(OFPActionCopyTtlOut, self).__init__()
@ -3209,6 +3235,7 @@ class OFPActionCopyTtlIn(OFPAction):
This action copies the TTL from the outermost header with TTL to the This action copies the TTL from the outermost header with TTL to the
next-to-outermost header with TTL. next-to-outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlIn, self).__init__() super(OFPActionCopyTtlIn, self).__init__()
@ -3233,6 +3260,7 @@ class OFPActionPushVlan(OFPAction):
ethertype Ether type. The default is 802.1Q. (0x8100) ethertype Ether type. The default is 802.1Q. (0x8100)
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None):
super(OFPActionPushVlan, self).__init__() super(OFPActionPushVlan, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -3262,6 +3290,7 @@ class OFPActionPushMpls(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None):
super(OFPActionPushMpls, self).__init__() super(OFPActionPushMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -3285,6 +3314,7 @@ class OFPActionPopVlan(OFPAction):
This action pops the outermost VLAN tag from the packet. This action pops the outermost VLAN tag from the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopVlan, self).__init__() super(OFPActionPopVlan, self).__init__()
@ -3303,6 +3333,7 @@ class OFPActionPopMpls(OFPAction):
This action pops the MPLS header from the packet. This action pops the MPLS header from the packet.
""" """
def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None):
super(OFPActionPopMpls, self).__init__() super(OFPActionPopMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -3332,6 +3363,7 @@ class OFPActionSetField(OFPAction):
set_field = OFPActionSetField(eth_src="00:00:00:00:00:00") set_field = OFPActionSetField(eth_src="00:00:00:00:00:00")
""" """
def __init__(self, field=None, **kwargs): def __init__(self, field=None, **kwargs):
# old api # old api
# OFPActionSetField(field) # OFPActionSetField(field)
@ -3447,6 +3479,7 @@ class OFPActionPushPbb(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype, type_=None, len_=None): def __init__(self, ethertype, type_=None, len_=None):
super(OFPActionPushPbb, self).__init__() super(OFPActionPushPbb, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -3471,6 +3504,7 @@ class OFPActionPopPbb(OFPAction):
This action pops the outermost PBB service instance header from This action pops the outermost PBB service instance header from
the packet. the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopPbb, self).__init__() super(OFPActionPopPbb, self).__init__()
@ -3634,6 +3668,7 @@ class OFPGroupMod(MsgBase):
ofp.OFPGT_SELECT, group_id, buckets) ofp.OFPGT_SELECT, group_id, buckets)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, command=ofproto.OFPGC_ADD, def __init__(self, datapath, command=ofproto.OFPGC_ADD,
type_=ofproto.OFPGT_ALL, group_id=0, buckets=None): type_=ofproto.OFPGT_ALL, group_id=0, buckets=None):
buckets = buckets if buckets else [] buckets = buckets if buckets else []
@ -3766,6 +3801,7 @@ class OFPMeterMod(MsgBase):
| OFPMeterBandExperimenter | OFPMeterBandExperimenter
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, command=ofproto.OFPMC_ADD, def __init__(self, datapath, command=ofproto.OFPMC_ADD,
flags=ofproto.OFPMF_KBPS, meter_id=1, bands=None): flags=ofproto.OFPMF_KBPS, meter_id=1, bands=None):
bands = bands if bands else [] bands = bands if bands else []
@ -3809,6 +3845,7 @@ class OFPTableMod(MsgBase):
req = ofp_parser.OFPTableMod(datapath, 1, 3) req = ofp_parser.OFPTableMod(datapath, 1, 3)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, table_id, config): def __init__(self, datapath, table_id, config):
super(OFPTableMod, self).__init__(datapath) super(OFPTableMod, self).__init__(datapath)
self.table_id = table_id self.table_id = table_id
@ -3958,6 +3995,7 @@ class OFPDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPDescStatsRequest(datapath, 0) req = ofp_parser.OFPDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPDescStatsRequest, self).__init__(datapath, flags) super(OFPDescStatsRequest, self).__init__(datapath, flags)
@ -3989,6 +4027,7 @@ class OFPDescStatsReply(OFPMultipartReply):
body.mfr_desc, body.hw_desc, body.sw_desc, body.mfr_desc, body.hw_desc, body.sw_desc,
body.serial_num, body.dp_desc) body.serial_num, body.dp_desc)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPDescStatsReply, self).__init__(datapath, **kwargs) super(OFPDescStatsReply, self).__init__(datapath, **kwargs)
@ -4102,6 +4141,7 @@ class OFPFlowStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL, def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL,
out_port=ofproto.OFPP_ANY, out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPG_ANY, out_group=ofproto.OFPG_ANY,
@ -4149,6 +4189,7 @@ class OFPFlowStatsReply(OFPMultipartReply):
stat.match, stat.instructions)) stat.match, stat.instructions))
self.logger.debug('FlowStats: %s', flows) self.logger.debug('FlowStats: %s', flows)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPFlowStatsReply, self).__init__(datapath, **kwargs) super(OFPFlowStatsReply, self).__init__(datapath, **kwargs)
@ -4202,6 +4243,7 @@ class OFPAggregateStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, table_id, out_port, out_group, def __init__(self, datapath, flags, table_id, out_port, out_group,
cookie, cookie_mask, match, type_=None): cookie, cookie_mask, match, type_=None):
super(OFPAggregateStatsRequest, self).__init__(datapath, super(OFPAggregateStatsRequest, self).__init__(datapath,
@ -4241,6 +4283,7 @@ class OFPAggregateStatsReply(OFPMultipartReply):
body.packet_count, body.byte_count, body.packet_count, body.byte_count,
body.flow_count) body.flow_count)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPAggregateStatsReply, self).__init__(datapath, **kwargs) super(OFPAggregateStatsReply, self).__init__(datapath, **kwargs)
@ -4279,6 +4322,7 @@ class OFPTableStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPTableStatsRequest(datapath, 0) req = ofp_parser.OFPTableStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPTableStatsRequest, self).__init__(datapath, flags) super(OFPTableStatsRequest, self).__init__(datapath, flags)
@ -4310,6 +4354,7 @@ class OFPTableStatsReply(OFPMultipartReply):
stat.lookup_count, stat.matched_count)) stat.lookup_count, stat.matched_count))
self.logger.debug('TableStats: %s', tables) self.logger.debug('TableStats: %s', tables)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableStatsReply, self).__init__(datapath, **kwargs) super(OFPTableStatsReply, self).__init__(datapath, **kwargs)
@ -4353,6 +4398,7 @@ class OFPPortStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY) req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY,
type_=None): type_=None):
super(OFPPortStatsRequest, self).__init__(datapath, flags) super(OFPPortStatsRequest, self).__init__(datapath, flags)
@ -4403,6 +4449,7 @@ class OFPPortStatsReply(OFPMultipartReply):
stat.duration_sec, stat.duration_nsec)) stat.duration_sec, stat.duration_nsec))
self.logger.debug('PortStats: %s', ports) self.logger.debug('PortStats: %s', ports)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortStatsReply, self).__init__(datapath, **kwargs) super(OFPPortStatsReply, self).__init__(datapath, **kwargs)
@ -4445,6 +4492,7 @@ class OFPQueueStatsRequest(OFPMultipartRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY,
queue_id=ofproto.OFPQ_ALL, type_=None): queue_id=ofproto.OFPQ_ALL, type_=None):
super(OFPQueueStatsRequest, self).__init__(datapath, flags) super(OFPQueueStatsRequest, self).__init__(datapath, flags)
@ -4488,6 +4536,7 @@ class OFPQueueStatsReply(OFPMultipartReply):
stat.duration_sec, stat.duration_nsec)) stat.duration_sec, stat.duration_nsec))
self.logger.debug('QueueStats: %s', queues) self.logger.debug('QueueStats: %s', queues)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPQueueStatsReply, self).__init__(datapath, **kwargs) super(OFPQueueStatsReply, self).__init__(datapath, **kwargs)
@ -4561,6 +4610,7 @@ class OFPGroupStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupStatsRequest(datapath, 0, ofp.OFPG_ALL) req = ofp_parser.OFPGroupStatsRequest(datapath, 0, ofp.OFPG_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL, def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL,
type_=None): type_=None):
super(OFPGroupStatsRequest, self).__init__(datapath, flags) super(OFPGroupStatsRequest, self).__init__(datapath, flags)
@ -4603,6 +4653,7 @@ class OFPGroupStatsReply(OFPMultipartReply):
stat.duration_nsec)) stat.duration_nsec))
self.logger.debug('GroupStats: %s', groups) self.logger.debug('GroupStats: %s', groups)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupStatsReply, self).__init__(datapath, **kwargs)
@ -4656,6 +4707,7 @@ class OFPGroupDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupDescStatsRequest(datapath, 0) req = ofp_parser.OFPGroupDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPGroupDescStatsRequest, self).__init__(datapath, flags) super(OFPGroupDescStatsRequest, self).__init__(datapath, flags)
@ -4687,13 +4739,14 @@ class OFPGroupDescStatsReply(OFPMultipartReply):
stat.bucket)) stat.bucket))
self.logger.debug('GroupDescStats: %s', descs) self.logger.debug('GroupDescStats: %s', descs)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs)
class OFPGroupFeaturesStats(ofproto_parser.namedtuple('OFPGroupFeaturesStats', class OFPGroupFeaturesStats(ofproto_parser.namedtuple('OFPGroupFeaturesStats',
('types', 'capabilities', 'max_groups', ('types', 'capabilities', 'max_groups',
'actions'))): 'actions'))):
@classmethod @classmethod
def parser(cls, buf, offset): def parser(cls, buf, offset):
group_features = struct.unpack_from( group_features = struct.unpack_from(
@ -4730,6 +4783,7 @@ class OFPGroupFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPGroupFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPGroupFeaturesStatsRequest, self).__init__(datapath, flags)
@ -4761,6 +4815,7 @@ class OFPGroupFeaturesStatsReply(OFPMultipartReply):
body.types, body.capabilities, body.types, body.capabilities,
body.max_groups, body.actions) body.max_groups, body.actions)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -4839,6 +4894,7 @@ class OFPMeterStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPMeterStatsRequest(datapath, 0, ofp.OFPM_ALL) req = ofp_parser.OFPMeterStatsRequest(datapath, 0, ofp.OFPM_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL, def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL,
type_=None): type_=None):
super(OFPMeterStatsRequest, self).__init__(datapath, flags) super(OFPMeterStatsRequest, self).__init__(datapath, flags)
@ -4882,6 +4938,7 @@ class OFPMeterStatsReply(OFPMultipartReply):
stat.band_stats)) stat.band_stats))
self.logger.debug('MeterStats: %s', meters) self.logger.debug('MeterStats: %s', meters)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterStatsReply, self).__init__(datapath, **kwargs)
@ -5044,6 +5101,7 @@ class OFPMeterConfigStatsRequest(OFPMultipartRequest):
ofp.OFPM_ALL) ofp.OFPM_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL, def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL,
type_=None): type_=None):
super(OFPMeterConfigStatsRequest, self).__init__(datapath, flags) super(OFPMeterConfigStatsRequest, self).__init__(datapath, flags)
@ -5084,13 +5142,14 @@ class OFPMeterConfigStatsReply(OFPMultipartReply):
stat.bands)) stat.bands))
self.logger.debug('MeterConfigStats: %s', configs) self.logger.debug('MeterConfigStats: %s', configs)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterConfigStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterConfigStatsReply, self).__init__(datapath, **kwargs)
class OFPMeterFeaturesStats(ofproto_parser.namedtuple('OFPMeterFeaturesStats', class OFPMeterFeaturesStats(ofproto_parser.namedtuple('OFPMeterFeaturesStats',
('max_meter', 'band_types', 'capabilities', ('max_meter', 'band_types', 'capabilities',
'max_bands', 'max_color'))): 'max_bands', 'max_color'))):
@classmethod @classmethod
def parser(cls, buf, offset): def parser(cls, buf, offset):
meter_features = struct.unpack_from( meter_features = struct.unpack_from(
@ -5123,6 +5182,7 @@ class OFPMeterFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPMeterFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPMeterFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPMeterFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPMeterFeaturesStatsRequest, self).__init__(datapath, flags)
@ -5157,6 +5217,7 @@ class OFPMeterFeaturesStatsReply(OFPMultipartReply):
stat.max_color)) stat.max_color))
self.logger.debug('MeterFeaturesStats: %s', features) self.logger.debug('MeterFeaturesStats: %s', features)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -5508,6 +5569,7 @@ class OFPTableFeaturesStatsRequest(OFPMultipartRequest):
The default is []. The default is [].
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags=0, def __init__(self, datapath, flags=0,
body=None, body=None,
type_=None): type_=None):
@ -5538,6 +5600,7 @@ class OFPTableFeaturesStatsReply(OFPMultipartReply):
body List of ``OFPTableFeaturesStats`` instance body List of ``OFPTableFeaturesStats`` instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPTableFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -5564,6 +5627,7 @@ class OFPPortDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortDescStatsRequest(datapath, 0) req = ofp_parser.OFPPortDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPPortDescStatsRequest, self).__init__(datapath, flags) super(OFPPortDescStatsRequest, self).__init__(datapath, flags)
@ -5600,6 +5664,7 @@ class OFPPortDescStatsReply(OFPMultipartReply):
p.max_speed)) p.max_speed))
self.logger.debug('OFPPortDescStatsReply received: %s', ports) self.logger.debug('OFPPortDescStatsReply received: %s', ports)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs) super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs)
@ -5663,6 +5728,7 @@ class OFPExperimenterStatsRequest(OFPExperimenterStatsRequestBase):
data Experimenter defined additional data data Experimenter defined additional data
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags, def __init__(self, datapath, flags,
experimenter, exp_type, data, experimenter, exp_type, data,
type_=None): type_=None):
@ -5727,6 +5793,7 @@ class ONFFlowMonitorStatsRequest(OFPExperimenterStatsRequestBase):
body List of ONFFlowMonitorRequest instances body List of ONFFlowMonitorRequest instances
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags, body=None, def __init__(self, datapath, flags, body=None,
type_=None, experimenter=None, exp_type=None): type_=None, experimenter=None, exp_type=None):
body = body if body else [] body = body if body else []
@ -5759,6 +5826,7 @@ class OFPExperimenterStatsReply(OFPMultipartReply):
body An ``OFPExperimenterMultipart`` instance body An ``OFPExperimenterMultipart`` instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPExperimenterStatsReply, self).__init__(datapath, **kwargs) super(OFPExperimenterStatsReply, self).__init__(datapath, **kwargs)
@ -5779,6 +5847,7 @@ class OFPBarrierRequest(MsgBase):
req = ofp_parser.OFPBarrierRequest(datapath) req = ofp_parser.OFPBarrierRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierRequest, self).__init__(datapath) super(OFPBarrierRequest, self).__init__(datapath)
@ -5797,6 +5866,7 @@ class OFPBarrierReply(MsgBase):
def barrier_reply_handler(self, ev): def barrier_reply_handler(self, ev):
self.logger.debug('OFPBarrierReply received') self.logger.debug('OFPBarrierReply received')
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierReply, self).__init__(datapath) super(OFPBarrierReply, self).__init__(datapath)
@ -5821,6 +5891,7 @@ class OFPQueueGetConfigRequest(MsgBase):
req = ofp_parser.OFPQueueGetConfigRequest(datapath, ofp.OFPP_ANY) req = ofp_parser.OFPQueueGetConfigRequest(datapath, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, port): def __init__(self, datapath, port):
super(OFPQueueGetConfigRequest, self).__init__(datapath) super(OFPQueueGetConfigRequest, self).__init__(datapath)
self.port = port self.port = port
@ -5977,6 +6048,7 @@ class OFPQueueGetConfigReply(MsgBase):
'port=%s queues=%s', 'port=%s queues=%s',
msg.port, msg.queues) msg.port, msg.queues)
""" """
def __init__(self, datapath, queues=None, port=None): def __init__(self, datapath, queues=None, port=None):
super(OFPQueueGetConfigReply, self).__init__(datapath) super(OFPQueueGetConfigReply, self).__init__(datapath)
self.queues = queues self.queues = queues
@ -6029,6 +6101,7 @@ class OFPRoleRequest(MsgBase):
req = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0) req = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, role=None, generation_id=None): def __init__(self, datapath, role=None, generation_id=None):
super(OFPRoleRequest, self).__init__(datapath) super(OFPRoleRequest, self).__init__(datapath)
self.role = role self.role = role
@ -6085,6 +6158,7 @@ class OFPRoleReply(MsgBase):
'role=%s generation_id=%d', 'role=%s generation_id=%d',
role, msg.generation_id) role, msg.generation_id)
""" """
def __init__(self, datapath, role=None, generation_id=None): def __init__(self, datapath, role=None, generation_id=None):
super(OFPRoleReply, self).__init__(datapath) super(OFPRoleReply, self).__init__(datapath)
self.role = role self.role = role
@ -6116,6 +6190,7 @@ class OFPGetAsyncRequest(MsgBase):
req = ofp_parser.OFPGetAsyncRequest(datapath) req = ofp_parser.OFPGetAsyncRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetAsyncRequest, self).__init__(datapath) super(OFPGetAsyncRequest, self).__init__(datapath)
@ -6172,6 +6247,7 @@ class OFPGetAsyncReply(MsgBase):
msg.flow_removed_mask[0], msg.flow_removed_mask[0],
msg.flow_removed_mask[1]) msg.flow_removed_mask[1])
""" """
def __init__(self, datapath, packet_in_mask=None, port_status_mask=None, def __init__(self, datapath, packet_in_mask=None, port_status_mask=None,
flow_removed_mask=None): flow_removed_mask=None):
super(OFPGetAsyncReply, self).__init__(datapath) super(OFPGetAsyncReply, self).__init__(datapath)
@ -6248,6 +6324,7 @@ class OFPSetAsync(MsgBase):
[flow_removed_mask, 0]) [flow_removed_mask, 0])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, def __init__(self, datapath,
packet_in_mask, port_status_mask, flow_removed_mask): packet_in_mask, port_status_mask, flow_removed_mask):
super(OFPSetAsync, self).__init__(datapath) super(OFPSetAsync, self).__init__(datapath)
@ -6303,6 +6380,7 @@ class ONFBundleCtrlMsg(OFPExperimenter):
ofp.ONF_BF_ATOMIC, []) ofp.ONF_BF_ATOMIC, [])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, bundle_id=None, type_=None, flags=None, def __init__(self, datapath, bundle_id=None, type_=None, flags=None,
properties=None): properties=None):
super(ONFBundleCtrlMsg, self).__init__( super(ONFBundleCtrlMsg, self).__init__(
@ -6370,6 +6448,7 @@ class ONFBundleAddMsg(OFPExperimenter):
msg, []) msg, [])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, bundle_id, flags, message, properties): def __init__(self, datapath, bundle_id, flags, message, properties):
super(ONFBundleAddMsg, self).__init__( super(ONFBundleAddMsg, self).__init__(
datapath, ofproto_common.ONF_EXPERIMENTER_ID, datapath, ofproto_common.ONF_EXPERIMENTER_ID,

View File

@ -76,6 +76,7 @@ class OFPHello(MsgBase):
elements list of ``OFPHelloElemVersionBitmap`` instance elements list of ``OFPHelloElemVersionBitmap`` instance
========== ========================================================= ========== =========================================================
""" """
def __init__(self, datapath, elements=None): def __init__(self, datapath, elements=None):
elements = elements if elements else [] elements = elements if elements else []
super(OFPHello, self).__init__(datapath) super(OFPHello, self).__init__(datapath)
@ -114,6 +115,7 @@ class OFPHelloElemVersionBitmap(StringifyMixin):
versions list of versions of OpenFlow protocol a device supports versions list of versions of OpenFlow protocol a device supports
========== ========================================================= ========== =========================================================
""" """
def __init__(self, versions, type_=None, length=None): def __init__(self, versions, type_=None, length=None):
super(OFPHelloElemVersionBitmap, self).__init__() super(OFPHelloElemVersionBitmap, self).__init__()
self.type = ofproto.OFPHET_VERSIONBITMAP self.type = ofproto.OFPHET_VERSIONBITMAP
@ -177,6 +179,7 @@ class OFPEchoRequest(MsgBase):
self.logger.debug('OFPEchoRequest received: data=%s', self.logger.debug('OFPEchoRequest received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoRequest, self).__init__(datapath) super(OFPEchoRequest, self).__init__(datapath)
self.data = data self.data = data
@ -254,6 +257,7 @@ class OFPErrorMsg(MsgBase):
'message=%s', 'message=%s',
msg.type, msg.code, utils.hex_array(msg.data)) msg.type, msg.code, utils.hex_array(msg.data))
""" """
def __init__(self, datapath, type_=None, code=None, data=None, **kwargs): def __init__(self, datapath, type_=None, code=None, data=None, **kwargs):
super(OFPErrorMsg, self).__init__(datapath) super(OFPErrorMsg, self).__init__(datapath)
self.type = type_ self.type = type_
@ -346,6 +350,7 @@ class OFPEchoReply(MsgBase):
self.logger.debug('OFPEchoReply received: data=%s', self.logger.debug('OFPEchoReply received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoReply, self).__init__(datapath) super(OFPEchoReply, self).__init__(datapath)
self.data = data self.data = data
@ -381,6 +386,7 @@ class OFPFeaturesRequest(MsgBase):
req = ofp_parser.OFPFeaturesRequest(datapath) req = ofp_parser.OFPFeaturesRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFeaturesRequest, self).__init__(datapath) super(OFPFeaturesRequest, self).__init__(datapath)
@ -399,6 +405,7 @@ class OFPExperimenter(MsgBase):
data Experimenter defined arbitrary additional data data Experimenter defined arbitrary additional data
============= ========================================================= ============= =========================================================
""" """
def __init__(self, datapath, experimenter=None, exp_type=None, data=None): def __init__(self, datapath, experimenter=None, exp_type=None, data=None):
super(OFPExperimenter, self).__init__(datapath) super(OFPExperimenter, self).__init__(datapath)
self.experimenter = experimenter self.experimenter = experimenter
@ -450,6 +457,7 @@ class OFPSwitchFeatures(MsgBase):
msg.datapath_id, msg.n_buffers, msg.n_tables, msg.datapath_id, msg.n_buffers, msg.n_tables,
msg.auxiliary_id, msg.capabilities) msg.auxiliary_id, msg.capabilities)
""" """
def __init__(self, datapath, datapath_id=None, n_buffers=None, def __init__(self, datapath, datapath_id=None, n_buffers=None,
n_tables=None, auxiliary_id=None, capabilities=None): n_tables=None, auxiliary_id=None, capabilities=None):
super(OFPSwitchFeatures, self).__init__(datapath) super(OFPSwitchFeatures, self).__init__(datapath)
@ -490,6 +498,7 @@ class OFPGetConfigRequest(MsgBase):
req = ofp_parser.OFPGetConfigRequest(datapath) req = ofp_parser.OFPGetConfigRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetConfigRequest, self).__init__(datapath) super(OFPGetConfigRequest, self).__init__(datapath)
@ -534,6 +543,7 @@ class OFPGetConfigReply(MsgBase):
'flags=%s miss_send_len=%d', 'flags=%s miss_send_len=%d',
','.join(flags), msg.miss_send_len) ','.join(flags), msg.miss_send_len)
""" """
def __init__(self, datapath, flags=None, miss_send_len=None): def __init__(self, datapath, flags=None, miss_send_len=None):
super(OFPGetConfigReply, self).__init__(datapath) super(OFPGetConfigReply, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -578,6 +588,7 @@ class OFPSetConfig(MsgBase):
req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256) req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, miss_send_len=0): def __init__(self, datapath, flags=0, miss_send_len=0):
super(OFPSetConfig, self).__init__(datapath) super(OFPSetConfig, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -1201,6 +1212,7 @@ class OFPPacketIn(MsgBase):
msg.table_id, msg.cookie, msg.match, msg.table_id, msg.cookie, msg.match,
utils.hex_array(msg.data)) utils.hex_array(msg.data))
""" """
def __init__(self, datapath, buffer_id=None, total_len=None, reason=None, def __init__(self, datapath, buffer_id=None, total_len=None, reason=None,
table_id=None, cookie=None, match=None, data=None): table_id=None, cookie=None, match=None, data=None):
super(OFPPacketIn, self).__init__(datapath) super(OFPPacketIn, self).__init__(datapath)
@ -1296,6 +1308,7 @@ class OFPFlowRemoved(MsgBase):
msg.idle_timeout, msg.hard_timeout, msg.idle_timeout, msg.hard_timeout,
msg.packet_count, msg.byte_count, msg.match) msg.packet_count, msg.byte_count, msg.match)
""" """
def __init__(self, datapath, cookie=None, priority=None, reason=None, def __init__(self, datapath, cookie=None, priority=None, reason=None,
table_id=None, duration_sec=None, duration_nsec=None, table_id=None, duration_sec=None, duration_nsec=None,
idle_timeout=None, hard_timeout=None, packet_count=None, idle_timeout=None, hard_timeout=None, packet_count=None,
@ -1497,6 +1510,7 @@ class OFPMeterMod(MsgBase):
| OFPMeterBandExperimenter | OFPMeterBandExperimenter
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, command=ofproto.OFPMC_ADD, def __init__(self, datapath, command=ofproto.OFPMC_ADD,
flags=ofproto.OFPMF_KBPS, meter_id=1, bands=None): flags=ofproto.OFPMF_KBPS, meter_id=1, bands=None):
bands = bands if bands else [] bands = bands if bands else []
@ -1564,6 +1578,7 @@ class OFPTableMod(MsgBase):
req = ofp_parser.OFPTableMod(datapath, 1, 3, properties) req = ofp_parser.OFPTableMod(datapath, 1, 3, properties)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, table_id, config, properties): def __init__(self, datapath, table_id, config, properties):
super(OFPTableMod, self).__init__(datapath) super(OFPTableMod, self).__init__(datapath)
self.table_id = table_id self.table_id = table_id
@ -1695,6 +1710,7 @@ class OFPDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPDescStatsRequest(datapath, 0) req = ofp_parser.OFPDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPDescStatsRequest, self).__init__(datapath, flags) super(OFPDescStatsRequest, self).__init__(datapath, flags)
@ -1726,6 +1742,7 @@ class OFPDescStatsReply(OFPMultipartReply):
body.mfr_desc, body.hw_desc, body.sw_desc, body.mfr_desc, body.hw_desc, body.sw_desc,
body.serial_num, body.dp_desc) body.serial_num, body.dp_desc)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPDescStatsReply, self).__init__(datapath, **kwargs) super(OFPDescStatsReply, self).__init__(datapath, **kwargs)
@ -2056,6 +2073,7 @@ class OFPTableFeaturesStatsRequest(OFPMultipartRequest):
The default is []. The default is [].
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags=0, body=None, type_=None): def __init__(self, datapath, flags=0, body=None, type_=None):
body = body if body else [] body = body if body else []
super(OFPTableFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPTableFeaturesStatsRequest, self).__init__(datapath, flags)
@ -2084,6 +2102,7 @@ class OFPTableFeaturesStatsReply(OFPMultipartReply):
body List of ``OFPTableFeaturesStats`` instance body List of ``OFPTableFeaturesStats`` instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPTableFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -2110,6 +2129,7 @@ class OFPPortDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortDescStatsRequest(datapath, 0) req = ofp_parser.OFPPortDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPPortDescStatsRequest, self).__init__(datapath, flags) super(OFPPortDescStatsRequest, self).__init__(datapath, flags)
@ -2141,6 +2161,7 @@ class OFPPortDescStatsReply(OFPMultipartReply):
p.name, p.config, p.state, repr(p.properties))) p.name, p.config, p.state, repr(p.properties)))
self.logger.debug('OFPPortDescStatsReply received: %s', ports) self.logger.debug('OFPPortDescStatsReply received: %s', ports)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs) super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs)
@ -2167,6 +2188,7 @@ class OFPTableDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPTableDescStatsRequest(datapath, 0) req = ofp_parser.OFPTableDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPTableDescStatsRequest, self).__init__(datapath, flags) super(OFPTableDescStatsRequest, self).__init__(datapath, flags)
@ -2196,6 +2218,7 @@ class OFPTableDescStatsReply(OFPMultipartReply):
(p.table_id, p.config, repr(p.properties))) (p.table_id, p.config, repr(p.properties)))
self.logger.debug('OFPTableDescStatsReply received: %s', tables) self.logger.debug('OFPTableDescStatsReply received: %s', tables)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableDescStatsReply, self).__init__(datapath, **kwargs) super(OFPTableDescStatsReply, self).__init__(datapath, **kwargs)
@ -2226,6 +2249,7 @@ class OFPQueueDescStatsRequest(OFPMultipartRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY,
queue_id=ofproto.OFPQ_ALL, type_=None): queue_id=ofproto.OFPQ_ALL, type_=None):
super(OFPQueueDescStatsRequest, self).__init__(datapath, flags) super(OFPQueueDescStatsRequest, self).__init__(datapath, flags)
@ -2264,6 +2288,7 @@ class OFPQueueDescStatsReply(OFPMultipartReply):
(q.port_no, q.queue_id, repr(q.properties))) (q.port_no, q.queue_id, repr(q.properties)))
self.logger.debug('OFPQueueDescStatsReply received: %s', queues) self.logger.debug('OFPQueueDescStatsReply received: %s', queues)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPQueueDescStatsReply, self).__init__(datapath, **kwargs) super(OFPQueueDescStatsReply, self).__init__(datapath, **kwargs)
@ -2333,6 +2358,7 @@ class OFPQueueStatsRequest(OFPMultipartRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY,
queue_id=ofproto.OFPQ_ALL, type_=None): queue_id=ofproto.OFPQ_ALL, type_=None):
super(OFPQueueStatsRequest, self).__init__(datapath, flags) super(OFPQueueStatsRequest, self).__init__(datapath, flags)
@ -2378,6 +2404,7 @@ class OFPQueueStatsReply(OFPMultipartReply):
repr(stat.properties))) repr(stat.properties)))
self.logger.debug('QueueStats: %s', queues) self.logger.debug('QueueStats: %s', queues)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPQueueStatsReply, self).__init__(datapath, **kwargs) super(OFPQueueStatsReply, self).__init__(datapath, **kwargs)
@ -2451,6 +2478,7 @@ class OFPGroupStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupStatsRequest(datapath, 0, ofp.OFPG_ALL) req = ofp_parser.OFPGroupStatsRequest(datapath, 0, ofp.OFPG_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL, def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL,
type_=None): type_=None):
super(OFPGroupStatsRequest, self).__init__(datapath, flags) super(OFPGroupStatsRequest, self).__init__(datapath, flags)
@ -2493,6 +2521,7 @@ class OFPGroupStatsReply(OFPMultipartReply):
stat.duration_nsec)) stat.duration_nsec))
self.logger.debug('GroupStats: %s', groups) self.logger.debug('GroupStats: %s', groups)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupStatsReply, self).__init__(datapath, **kwargs)
@ -2547,6 +2576,7 @@ class OFPGroupDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupDescStatsRequest(datapath, 0) req = ofp_parser.OFPGroupDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPGroupDescStatsRequest, self).__init__(datapath, flags) super(OFPGroupDescStatsRequest, self).__init__(datapath, flags)
@ -2578,13 +2608,14 @@ class OFPGroupDescStatsReply(OFPMultipartReply):
stat.bucket)) stat.bucket))
self.logger.debug('GroupDescStats: %s', descs) self.logger.debug('GroupDescStats: %s', descs)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs)
class OFPGroupFeaturesStats(ofproto_parser.namedtuple('OFPGroupFeaturesStats', class OFPGroupFeaturesStats(ofproto_parser.namedtuple('OFPGroupFeaturesStats',
('types', 'capabilities', 'max_groups', ('types', 'capabilities', 'max_groups',
'actions'))): 'actions'))):
@classmethod @classmethod
def parser(cls, buf, offset): def parser(cls, buf, offset):
group_features = struct.unpack_from( group_features = struct.unpack_from(
@ -2621,6 +2652,7 @@ class OFPGroupFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPGroupFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPGroupFeaturesStatsRequest, self).__init__(datapath, flags)
@ -2652,6 +2684,7 @@ class OFPGroupFeaturesStatsReply(OFPMultipartReply):
body.types, body.capabilities, body.types, body.capabilities,
body.max_groups, body.actions) body.max_groups, body.actions)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -2730,6 +2763,7 @@ class OFPMeterStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPMeterStatsRequest(datapath, 0, ofp.OFPM_ALL) req = ofp_parser.OFPMeterStatsRequest(datapath, 0, ofp.OFPM_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL, def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL,
type_=None): type_=None):
super(OFPMeterStatsRequest, self).__init__(datapath, flags) super(OFPMeterStatsRequest, self).__init__(datapath, flags)
@ -2773,6 +2807,7 @@ class OFPMeterStatsReply(OFPMultipartReply):
stat.band_stats)) stat.band_stats))
self.logger.debug('MeterStats: %s', meters) self.logger.debug('MeterStats: %s', meters)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterStatsReply, self).__init__(datapath, **kwargs)
@ -2935,6 +2970,7 @@ class OFPMeterConfigStatsRequest(OFPMultipartRequest):
ofp.OFPM_ALL) ofp.OFPM_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL, def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL,
type_=None): type_=None):
super(OFPMeterConfigStatsRequest, self).__init__(datapath, flags) super(OFPMeterConfigStatsRequest, self).__init__(datapath, flags)
@ -2975,13 +3011,14 @@ class OFPMeterConfigStatsReply(OFPMultipartReply):
stat.bands)) stat.bands))
self.logger.debug('MeterConfigStats: %s', configs) self.logger.debug('MeterConfigStats: %s', configs)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterConfigStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterConfigStatsReply, self).__init__(datapath, **kwargs)
class OFPMeterFeaturesStats(ofproto_parser.namedtuple('OFPMeterFeaturesStats', class OFPMeterFeaturesStats(ofproto_parser.namedtuple('OFPMeterFeaturesStats',
('max_meter', 'band_types', 'capabilities', ('max_meter', 'band_types', 'capabilities',
'max_bands', 'max_color'))): 'max_bands', 'max_color'))):
@classmethod @classmethod
def parser(cls, buf, offset): def parser(cls, buf, offset):
meter_features = struct.unpack_from( meter_features = struct.unpack_from(
@ -3014,6 +3051,7 @@ class OFPMeterFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPMeterFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPMeterFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPMeterFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPMeterFeaturesStatsRequest, self).__init__(datapath, flags)
@ -3048,6 +3086,7 @@ class OFPMeterFeaturesStatsReply(OFPMultipartReply):
stat.max_color)) stat.max_color))
self.logger.debug('MeterFeaturesStats: %s', features) self.logger.debug('MeterFeaturesStats: %s', features)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -3241,6 +3280,7 @@ class OFPFlowMonitorRequest(OFPFlowMonitorRequestBase):
ofp.OFPFMC_ADD, match) ofp.OFPFMC_ADD, match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, monitor_id=0, def __init__(self, datapath, flags=0, monitor_id=0,
out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY, out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY,
monitor_flags=0, table_id=ofproto.OFPTT_ALL, monitor_flags=0, table_id=ofproto.OFPTT_ALL,
@ -3300,6 +3340,7 @@ class OFPFlowMonitorReply(OFPMultipartReply):
flow_updates.append(update_str) flow_updates.append(update_str)
self.logger.debug('FlowUpdates: %s', flow_updates) self.logger.debug('FlowUpdates: %s', flow_updates)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPFlowMonitorReply, self).__init__(datapath, **kwargs) super(OFPFlowMonitorReply, self).__init__(datapath, **kwargs)
@ -3363,6 +3404,7 @@ class OFPExperimenterStatsRequest(OFPExperimenterStatsRequestBase):
data Experimenter defined additional data data Experimenter defined additional data
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags, def __init__(self, datapath, flags,
experimenter, exp_type, data, experimenter, exp_type, data,
type_=None): type_=None):
@ -3391,6 +3433,7 @@ class OFPExperimenterStatsReply(OFPMultipartReply):
body An ``OFPExperimenterMultipart`` instance body An ``OFPExperimenterMultipart`` instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPExperimenterStatsReply, self).__init__(datapath, **kwargs) super(OFPExperimenterStatsReply, self).__init__(datapath, **kwargs)
@ -3506,6 +3549,7 @@ class OFPFlowStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL, def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL,
out_port=ofproto.OFPP_ANY, out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPG_ANY, out_group=ofproto.OFPG_ANY,
@ -3554,6 +3598,7 @@ class OFPFlowStatsReply(OFPMultipartReply):
stat.match, stat.instructions)) stat.match, stat.instructions))
self.logger.debug('FlowStats: %s', flows) self.logger.debug('FlowStats: %s', flows)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPFlowStatsReply, self).__init__(datapath, **kwargs) super(OFPFlowStatsReply, self).__init__(datapath, **kwargs)
@ -3607,6 +3652,7 @@ class OFPAggregateStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, table_id, out_port, out_group, def __init__(self, datapath, flags, table_id, out_port, out_group,
cookie, cookie_mask, match, type_=None): cookie, cookie_mask, match, type_=None):
super(OFPAggregateStatsRequest, self).__init__(datapath, super(OFPAggregateStatsRequest, self).__init__(datapath,
@ -3646,6 +3692,7 @@ class OFPAggregateStatsReply(OFPMultipartReply):
body.packet_count, body.byte_count, body.packet_count, body.byte_count,
body.flow_count) body.flow_count)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPAggregateStatsReply, self).__init__(datapath, **kwargs) super(OFPAggregateStatsReply, self).__init__(datapath, **kwargs)
@ -3684,6 +3731,7 @@ class OFPTableStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPTableStatsRequest(datapath, 0) req = ofp_parser.OFPTableStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, type_=None): def __init__(self, datapath, flags, type_=None):
super(OFPTableStatsRequest, self).__init__(datapath, flags) super(OFPTableStatsRequest, self).__init__(datapath, flags)
@ -3715,6 +3763,7 @@ class OFPTableStatsReply(OFPMultipartReply):
stat.lookup_count, stat.matched_count)) stat.lookup_count, stat.matched_count))
self.logger.debug('TableStats: %s', tables) self.logger.debug('TableStats: %s', tables)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableStatsReply, self).__init__(datapath, **kwargs) super(OFPTableStatsReply, self).__init__(datapath, **kwargs)
@ -3844,6 +3893,7 @@ class OFPPortStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY) req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, port_no, type_=None): def __init__(self, datapath, flags, port_no, type_=None):
super(OFPPortStatsRequest, self).__init__(datapath, flags) super(OFPPortStatsRequest, self).__init__(datapath, flags)
self.port_no = port_no self.port_no = port_no
@ -3885,6 +3935,7 @@ class OFPPortStatsReply(OFPMultipartReply):
repr(stat.properties)) repr(stat.properties))
self.logger.debug('PortStats: %s', ports) self.logger.debug('PortStats: %s', ports)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortStatsReply, self).__init__(datapath, **kwargs) super(OFPPortStatsReply, self).__init__(datapath, **kwargs)
@ -3905,6 +3956,7 @@ class OFPBarrierRequest(MsgBase):
req = ofp_parser.OFPBarrierRequest(datapath) req = ofp_parser.OFPBarrierRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierRequest, self).__init__(datapath) super(OFPBarrierRequest, self).__init__(datapath)
@ -3923,6 +3975,7 @@ class OFPBarrierReply(MsgBase):
def barrier_reply_handler(self, ev): def barrier_reply_handler(self, ev):
self.logger.debug('OFPBarrierReply received') self.logger.debug('OFPBarrierReply received')
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierReply, self).__init__(datapath) super(OFPBarrierReply, self).__init__(datapath)
@ -3966,6 +4019,7 @@ class OFPPortStatus(MsgBase):
self.logger.debug('OFPPortStatus received: reason=%s desc=%s', self.logger.debug('OFPPortStatus received: reason=%s desc=%s',
reason, msg.desc) reason, msg.desc)
""" """
def __init__(self, datapath, reason=None, desc=None): def __init__(self, datapath, reason=None, desc=None):
super(OFPPortStatus, self).__init__(datapath) super(OFPPortStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -4037,6 +4091,7 @@ class OFPRoleStatus(MsgBase):
'generation_id=%d properties=%s', role, reason, 'generation_id=%d properties=%s', role, reason,
msg.generation_id, repr(msg.properties)) msg.generation_id, repr(msg.properties))
""" """
def __init__(self, datapath, role=None, reason=None, def __init__(self, datapath, role=None, reason=None,
generation_id=None, properties=None): generation_id=None, properties=None):
super(OFPRoleStatus, self).__init__(datapath) super(OFPRoleStatus, self).__init__(datapath)
@ -4100,6 +4155,7 @@ class OFPTableStatus(MsgBase):
reason, msg.table.table_id, msg.table.config, reason, msg.table.table_id, msg.table.config,
repr(msg.table.properties)) repr(msg.table.properties))
""" """
def __init__(self, datapath, reason=None, table=None): def __init__(self, datapath, reason=None, table=None):
super(OFPTableStatus, self).__init__(datapath) super(OFPTableStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -4157,6 +4213,7 @@ class OFPRequestForward(MsgInMsgBase):
self.logger.debug( self.logger.debug(
'OFPRequestForward received: request=Unknown') 'OFPRequestForward received: request=Unknown')
""" """
def __init__(self, datapath, request=None): def __init__(self, datapath, request=None):
super(OFPRequestForward, self).__init__(datapath) super(OFPRequestForward, self).__init__(datapath)
self.request = request self.request = request
@ -4206,6 +4263,7 @@ class OFPPacketOut(MsgBase):
in_port, actions) in_port, actions)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, buffer_id=None, in_port=None, actions=None, def __init__(self, datapath, buffer_id=None, in_port=None, actions=None,
data=None, actions_len=None): data=None, actions_len=None):
assert in_port is not None assert in_port is not None
@ -4324,6 +4382,7 @@ class OFPFlowMod(MsgBase):
match, inst) match, inst)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0, def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0,
command=ofproto.OFPFC_ADD, command=ofproto.OFPFC_ADD,
idle_timeout=0, hard_timeout=0, idle_timeout=0, hard_timeout=0,
@ -4429,6 +4488,7 @@ class OFPInstructionGotoTable(OFPInstruction):
table_id Next table table_id Next table
================ ====================================================== ================ ======================================================
""" """
def __init__(self, table_id, type_=None, len_=None): def __init__(self, table_id, type_=None, len_=None):
super(OFPInstructionGotoTable, self).__init__() super(OFPInstructionGotoTable, self).__init__()
self.type = ofproto.OFPIT_GOTO_TABLE self.type = ofproto.OFPIT_GOTO_TABLE
@ -4461,6 +4521,7 @@ class OFPInstructionWriteMetadata(OFPInstruction):
metadata_mask Metadata write bitmask metadata_mask Metadata write bitmask
================ ====================================================== ================ ======================================================
""" """
def __init__(self, metadata, metadata_mask, type_=None, len_=None): def __init__(self, metadata, metadata_mask, type_=None, len_=None):
super(OFPInstructionWriteMetadata, self).__init__() super(OFPInstructionWriteMetadata, self).__init__()
self.type = ofproto.OFPIT_WRITE_METADATA self.type = ofproto.OFPIT_WRITE_METADATA
@ -4503,6 +4564,7 @@ class OFPInstructionActions(OFPInstruction):
``type`` attribute corresponds to ``type_`` parameter of __init__. ``type`` attribute corresponds to ``type_`` parameter of __init__.
""" """
def __init__(self, type_, actions=None, len_=None): def __init__(self, type_, actions=None, len_=None):
super(OFPInstructionActions, self).__init__() super(OFPInstructionActions, self).__init__()
self.type = type_ self.type = type_
@ -4558,6 +4620,7 @@ class OFPInstructionMeter(OFPInstruction):
meter_id Meter instance meter_id Meter instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, meter_id=1, type_=None, len_=None): def __init__(self, meter_id=1, type_=None, len_=None):
super(OFPInstructionMeter, self).__init__() super(OFPInstructionMeter, self).__init__()
self.type = ofproto.OFPIT_METER self.type = ofproto.OFPIT_METER
@ -4627,6 +4690,7 @@ class OFPActionOutput(OFPAction):
max_len Max length to send to controller max_len Max length to send to controller
================ ====================================================== ================ ======================================================
""" """
def __init__(self, port, max_len=ofproto.OFPCML_MAX, def __init__(self, port, max_len=ofproto.OFPCML_MAX,
type_=None, len_=None): type_=None, len_=None):
super(OFPActionOutput, self).__init__() super(OFPActionOutput, self).__init__()
@ -4658,6 +4722,7 @@ class OFPActionGroup(OFPAction):
group_id Group identifier group_id Group identifier
================ ====================================================== ================ ======================================================
""" """
def __init__(self, group_id=0, type_=None, len_=None): def __init__(self, group_id=0, type_=None, len_=None):
super(OFPActionGroup, self).__init__() super(OFPActionGroup, self).__init__()
self.group_id = group_id self.group_id = group_id
@ -4688,6 +4753,7 @@ class OFPActionSetQueue(OFPAction):
queue_id Queue ID for the packets queue_id Queue ID for the packets
================ ====================================================== ================ ======================================================
""" """
def __init__(self, queue_id, type_=None, len_=None): def __init__(self, queue_id, type_=None, len_=None):
super(OFPActionSetQueue, self).__init__() super(OFPActionSetQueue, self).__init__()
self.queue_id = queue_id self.queue_id = queue_id
@ -4717,6 +4783,7 @@ class OFPActionSetMplsTtl(OFPAction):
mpls_ttl MPLS TTL mpls_ttl MPLS TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, mpls_ttl, type_=None, len_=None): def __init__(self, mpls_ttl, type_=None, len_=None):
super(OFPActionSetMplsTtl, self).__init__() super(OFPActionSetMplsTtl, self).__init__()
self.mpls_ttl = mpls_ttl self.mpls_ttl = mpls_ttl
@ -4740,6 +4807,7 @@ class OFPActionDecMplsTtl(OFPAction):
This action decrements the MPLS TTL. This action decrements the MPLS TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecMplsTtl, self).__init__() super(OFPActionDecMplsTtl, self).__init__()
@ -4764,6 +4832,7 @@ class OFPActionSetNwTtl(OFPAction):
nw_ttl IP TTL nw_ttl IP TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, nw_ttl, type_=None, len_=None): def __init__(self, nw_ttl, type_=None, len_=None):
super(OFPActionSetNwTtl, self).__init__() super(OFPActionSetNwTtl, self).__init__()
self.nw_ttl = nw_ttl self.nw_ttl = nw_ttl
@ -4787,6 +4856,7 @@ class OFPActionDecNwTtl(OFPAction):
This action decrements the IP TTL. This action decrements the IP TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecNwTtl, self).__init__() super(OFPActionDecNwTtl, self).__init__()
@ -4806,6 +4876,7 @@ class OFPActionCopyTtlOut(OFPAction):
This action copies the TTL from the next-to-outermost header with TTL to This action copies the TTL from the next-to-outermost header with TTL to
the outermost header with TTL. the outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlOut, self).__init__() super(OFPActionCopyTtlOut, self).__init__()
@ -4825,6 +4896,7 @@ class OFPActionCopyTtlIn(OFPAction):
This action copies the TTL from the outermost header with TTL to the This action copies the TTL from the outermost header with TTL to the
next-to-outermost header with TTL. next-to-outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlIn, self).__init__() super(OFPActionCopyTtlIn, self).__init__()
@ -4849,6 +4921,7 @@ class OFPActionPushVlan(OFPAction):
ethertype Ether type. The default is 802.1Q. (0x8100) ethertype Ether type. The default is 802.1Q. (0x8100)
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None):
super(OFPActionPushVlan, self).__init__() super(OFPActionPushVlan, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -4878,6 +4951,7 @@ class OFPActionPushMpls(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None):
super(OFPActionPushMpls, self).__init__() super(OFPActionPushMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -4901,6 +4975,7 @@ class OFPActionPopVlan(OFPAction):
This action pops the outermost VLAN tag from the packet. This action pops the outermost VLAN tag from the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopVlan, self).__init__() super(OFPActionPopVlan, self).__init__()
@ -4919,6 +4994,7 @@ class OFPActionPopMpls(OFPAction):
This action pops the MPLS header from the packet. This action pops the MPLS header from the packet.
""" """
def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None):
super(OFPActionPopMpls, self).__init__() super(OFPActionPopMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -4948,6 +5024,7 @@ class OFPActionSetField(OFPAction):
set_field = OFPActionSetField(eth_src="00:00:00:00:00:00") set_field = OFPActionSetField(eth_src="00:00:00:00:00:00")
""" """
def __init__(self, field=None, **kwargs): def __init__(self, field=None, **kwargs):
super(OFPActionSetField, self).__init__() super(OFPActionSetField, self).__init__()
assert len(kwargs) == 1 assert len(kwargs) == 1
@ -5008,6 +5085,7 @@ class OFPActionPushPbb(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype, type_=None, len_=None): def __init__(self, ethertype, type_=None, len_=None):
super(OFPActionPushPbb, self).__init__() super(OFPActionPushPbb, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -5032,6 +5110,7 @@ class OFPActionPopPbb(OFPAction):
This action pops the outermost PBB service instance header from This action pops the outermost PBB service instance header from
the packet. the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopPbb, self).__init__() super(OFPActionPopPbb, self).__init__()
@ -5062,6 +5141,7 @@ class OFPActionExperimenter(OFPAction):
For the list of the supported Nicira experimenter actions, For the list of the supported Nicira experimenter actions,
please refer to :ref:`ryu.ofproto.nx_actions <nx_actions_structures>`. please refer to :ref:`ryu.ofproto.nx_actions <nx_actions_structures>`.
""" """
def __init__(self, experimenter): def __init__(self, experimenter):
super(OFPActionExperimenter, self).__init__() super(OFPActionExperimenter, self).__init__()
self.type = ofproto.OFPAT_EXPERIMENTER self.type = ofproto.OFPAT_EXPERIMENTER
@ -5155,6 +5235,7 @@ class OFPGroupMod(MsgBase):
ofp.OFPGT_SELECT, group_id, buckets) ofp.OFPGT_SELECT, group_id, buckets)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, command=ofproto.OFPGC_ADD, def __init__(self, datapath, command=ofproto.OFPGC_ADD,
type_=ofproto.OFPGT_ALL, group_id=0, buckets=None): type_=ofproto.OFPGT_ALL, group_id=0, buckets=None):
buckets = buckets if buckets else [] buckets = buckets if buckets else []
@ -5379,6 +5460,7 @@ class OFPRoleRequest(MsgBase):
req = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0) req = ofp_parser.OFPRoleRequest(datapath, ofp.OFPCR_ROLE_EQUAL, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, role=None, generation_id=None): def __init__(self, datapath, role=None, generation_id=None):
super(OFPRoleRequest, self).__init__(datapath) super(OFPRoleRequest, self).__init__(datapath)
self.role = role self.role = role
@ -5435,6 +5517,7 @@ class OFPRoleReply(MsgBase):
'role=%s generation_id=%d', 'role=%s generation_id=%d',
role, msg.generation_id) role, msg.generation_id)
""" """
def __init__(self, datapath, role=None, generation_id=None): def __init__(self, datapath, role=None, generation_id=None):
super(OFPRoleReply, self).__init__(datapath) super(OFPRoleReply, self).__init__(datapath)
self.role = role self.role = role
@ -5511,6 +5594,7 @@ class OFPGetAsyncRequest(MsgBase):
req = ofp_parser.OFPGetAsyncRequest(datapath) req = ofp_parser.OFPGetAsyncRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetAsyncRequest, self).__init__(datapath) super(OFPGetAsyncRequest, self).__init__(datapath)
@ -5539,6 +5623,7 @@ class OFPGetAsyncReply(MsgBase):
self.logger.debug('OFPGetAsyncReply received: ' self.logger.debug('OFPGetAsyncReply received: '
'properties=%s', repr(msg.properties)) 'properties=%s', repr(msg.properties))
""" """
def __init__(self, datapath, properties=None): def __init__(self, datapath, properties=None):
super(OFPGetAsyncReply, self).__init__(datapath) super(OFPGetAsyncReply, self).__init__(datapath)
self.properties = properties self.properties = properties
@ -5586,6 +5671,7 @@ class OFPSetAsync(MsgBase):
req = ofp_parser.OFPSetAsync(datapath, properties) req = ofp_parser.OFPSetAsync(datapath, properties)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, properties=None): def __init__(self, datapath, properties=None):
super(OFPSetAsync, self).__init__(datapath) super(OFPSetAsync, self).__init__(datapath)
self.properties = properties self.properties = properties
@ -5638,6 +5724,7 @@ class OFPBundleCtrlMsg(MsgBase):
ofp.OFPBF_ATOMIC, []) ofp.OFPBF_ATOMIC, [])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, bundle_id=None, type_=None, flags=None, def __init__(self, datapath, bundle_id=None, type_=None, flags=None,
properties=None): properties=None):
super(OFPBundleCtrlMsg, self).__init__(datapath) super(OFPBundleCtrlMsg, self).__init__(datapath)
@ -5707,6 +5794,7 @@ class OFPBundleAddMsg(MsgInMsgBase):
msg, []) msg, [])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, bundle_id, flags, message, properties): def __init__(self, datapath, bundle_id, flags, message, properties):
super(OFPBundleAddMsg, self).__init__(datapath) super(OFPBundleAddMsg, self).__init__(datapath)
self.bundle_id = bundle_id self.bundle_id = bundle_id

View File

@ -77,6 +77,7 @@ class OFPHello(MsgBase):
elements list of ``OFPHelloElemVersionBitmap`` instance elements list of ``OFPHelloElemVersionBitmap`` instance
========== ========================================================= ========== =========================================================
""" """
def __init__(self, datapath, elements=None): def __init__(self, datapath, elements=None):
elements = elements if elements else [] elements = elements if elements else []
super(OFPHello, self).__init__(datapath) super(OFPHello, self).__init__(datapath)
@ -115,6 +116,7 @@ class OFPHelloElemVersionBitmap(StringifyMixin):
versions list of versions of OpenFlow protocol a device supports versions list of versions of OpenFlow protocol a device supports
========== ========================================================= ========== =========================================================
""" """
def __init__(self, versions, type_=None, length=None): def __init__(self, versions, type_=None, length=None):
super(OFPHelloElemVersionBitmap, self).__init__() super(OFPHelloElemVersionBitmap, self).__init__()
self.type = ofproto.OFPHET_VERSIONBITMAP self.type = ofproto.OFPHET_VERSIONBITMAP
@ -177,6 +179,7 @@ class OFPEchoRequest(MsgBase):
self.logger.debug('OFPEchoRequest received: data=%s', self.logger.debug('OFPEchoRequest received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoRequest, self).__init__(datapath) super(OFPEchoRequest, self).__init__(datapath)
self.data = data self.data = data
@ -254,6 +257,7 @@ class OFPErrorMsg(MsgBase):
'message=%s', 'message=%s',
msg.type, msg.code, utils.hex_array(msg.data)) msg.type, msg.code, utils.hex_array(msg.data))
""" """
def __init__(self, datapath, type_=None, code=None, data=None, **kwargs): def __init__(self, datapath, type_=None, code=None, data=None, **kwargs):
super(OFPErrorMsg, self).__init__(datapath) super(OFPErrorMsg, self).__init__(datapath)
self.type = type_ self.type = type_
@ -346,6 +350,7 @@ class OFPEchoReply(MsgBase):
self.logger.debug('OFPEchoReply received: data=%s', self.logger.debug('OFPEchoReply received: data=%s',
utils.hex_array(ev.msg.data)) utils.hex_array(ev.msg.data))
""" """
def __init__(self, datapath, data=None): def __init__(self, datapath, data=None):
super(OFPEchoReply, self).__init__(datapath) super(OFPEchoReply, self).__init__(datapath)
self.data = data self.data = data
@ -381,6 +386,7 @@ class OFPFeaturesRequest(MsgBase):
req = ofp_parser.OFPFeaturesRequest(datapath) req = ofp_parser.OFPFeaturesRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPFeaturesRequest, self).__init__(datapath) super(OFPFeaturesRequest, self).__init__(datapath)
@ -399,6 +405,7 @@ class OFPExperimenter(MsgBase):
data Experimenter defined arbitrary additional data data Experimenter defined arbitrary additional data
============= ========================================================= ============= =========================================================
""" """
def __init__(self, datapath, experimenter=None, exp_type=None, data=None): def __init__(self, datapath, experimenter=None, exp_type=None, data=None):
super(OFPExperimenter, self).__init__(datapath) super(OFPExperimenter, self).__init__(datapath)
self.experimenter = experimenter self.experimenter = experimenter
@ -450,6 +457,7 @@ class OFPSwitchFeatures(MsgBase):
msg.datapath_id, msg.n_buffers, msg.n_tables, msg.datapath_id, msg.n_buffers, msg.n_tables,
msg.auxiliary_id, msg.capabilities) msg.auxiliary_id, msg.capabilities)
""" """
def __init__(self, datapath, datapath_id=None, n_buffers=None, def __init__(self, datapath, datapath_id=None, n_buffers=None,
n_tables=None, auxiliary_id=None, capabilities=None): n_tables=None, auxiliary_id=None, capabilities=None):
super(OFPSwitchFeatures, self).__init__(datapath) super(OFPSwitchFeatures, self).__init__(datapath)
@ -490,6 +498,7 @@ class OFPGetConfigRequest(MsgBase):
req = ofp_parser.OFPGetConfigRequest(datapath) req = ofp_parser.OFPGetConfigRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetConfigRequest, self).__init__(datapath) super(OFPGetConfigRequest, self).__init__(datapath)
@ -534,6 +543,7 @@ class OFPGetConfigReply(MsgBase):
'flags=%s miss_send_len=%d', 'flags=%s miss_send_len=%d',
','.join(flags), msg.miss_send_len) ','.join(flags), msg.miss_send_len)
""" """
def __init__(self, datapath, flags=None, miss_send_len=None): def __init__(self, datapath, flags=None, miss_send_len=None):
super(OFPGetConfigReply, self).__init__(datapath) super(OFPGetConfigReply, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -578,6 +588,7 @@ class OFPSetConfig(MsgBase):
req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256) req = ofp_parser.OFPSetConfig(datapath, ofp.OFPC_FRAG_NORMAL, 256)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, miss_send_len=0): def __init__(self, datapath, flags=0, miss_send_len=0):
super(OFPSetConfig, self).__init__(datapath) super(OFPSetConfig, self).__init__(datapath)
self.flags = flags self.flags = flags
@ -1440,6 +1451,7 @@ class OFPPacketIn(MsgBase):
msg.table_id, msg.cookie, msg.match, msg.table_id, msg.cookie, msg.match,
utils.hex_array(msg.data)) utils.hex_array(msg.data))
""" """
def __init__(self, datapath, buffer_id=None, total_len=None, reason=None, def __init__(self, datapath, buffer_id=None, total_len=None, reason=None,
table_id=None, cookie=None, match=None, data=None): table_id=None, cookie=None, match=None, data=None):
super(OFPPacketIn, self).__init__(datapath) super(OFPPacketIn, self).__init__(datapath)
@ -1534,6 +1546,7 @@ class OFPFlowRemoved(MsgBase):
msg.idle_timeout, msg.hard_timeout, msg.cookie, msg.idle_timeout, msg.hard_timeout, msg.cookie,
msg.match, msg.stats) msg.match, msg.stats)
""" """
def __init__(self, datapath, table_id=None, reason=None, priority=None, def __init__(self, datapath, table_id=None, reason=None, priority=None,
idle_timeout=None, hard_timeout=None, cookie=None, idle_timeout=None, hard_timeout=None, cookie=None,
match=None, stats=None): match=None, stats=None):
@ -1733,6 +1746,7 @@ class OFPMeterMod(MsgBase):
| OFPMeterBandExperimenter | OFPMeterBandExperimenter
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, command=ofproto.OFPMC_ADD, def __init__(self, datapath, command=ofproto.OFPMC_ADD,
flags=ofproto.OFPMF_KBPS, meter_id=1, bands=None): flags=ofproto.OFPMF_KBPS, meter_id=1, bands=None):
bands = bands if bands else [] bands = bands if bands else []
@ -1800,6 +1814,7 @@ class OFPTableMod(MsgBase):
req = ofp_parser.OFPTableMod(datapath, 1, 3, properties) req = ofp_parser.OFPTableMod(datapath, 1, 3, properties)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, table_id, config, properties): def __init__(self, datapath, table_id, config, properties):
super(OFPTableMod, self).__init__(datapath) super(OFPTableMod, self).__init__(datapath)
self.table_id = table_id self.table_id = table_id
@ -1934,6 +1949,7 @@ class OFPDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPDescStatsRequest(datapath, 0) req = ofp_parser.OFPDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPDescStatsRequest, self).__init__(datapath, flags) super(OFPDescStatsRequest, self).__init__(datapath, flags)
@ -1965,6 +1981,7 @@ class OFPDescStatsReply(OFPMultipartReply):
body.mfr_desc, body.hw_desc, body.sw_desc, body.mfr_desc, body.hw_desc, body.sw_desc,
body.serial_num, body.dp_desc) body.serial_num, body.dp_desc)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPDescStatsReply, self).__init__(datapath, **kwargs) super(OFPDescStatsReply, self).__init__(datapath, **kwargs)
@ -2382,6 +2399,7 @@ class OFPTableFeaturesStatsRequest(OFPMultipartRequest):
The default is []. The default is [].
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags=0, body=None, type_=None): def __init__(self, datapath, flags=0, body=None, type_=None):
body = body if body else [] body = body if body else []
super(OFPTableFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPTableFeaturesStatsRequest, self).__init__(datapath, flags)
@ -2410,6 +2428,7 @@ class OFPTableFeaturesStatsReply(OFPMultipartReply):
body List of ``OFPTableFeaturesStats`` instance body List of ``OFPTableFeaturesStats`` instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPTableFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -2438,6 +2457,7 @@ class OFPPortDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortDescStatsRequest(datapath, 0, ofp.OFPP_ANY) req = ofp_parser.OFPPortDescStatsRequest(datapath, 0, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, type_=None): def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, type_=None):
super(OFPPortDescStatsRequest, self).__init__(datapath, flags) super(OFPPortDescStatsRequest, self).__init__(datapath, flags)
self.port_no = port_no self.port_no = port_no
@ -2476,6 +2496,7 @@ class OFPPortDescStatsReply(OFPMultipartReply):
p.name, p.config, p.state, repr(p.properties))) p.name, p.config, p.state, repr(p.properties)))
self.logger.debug('OFPPortDescStatsReply received: %s', ports) self.logger.debug('OFPPortDescStatsReply received: %s', ports)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs) super(OFPPortDescStatsReply, self).__init__(datapath, **kwargs)
@ -2502,6 +2523,7 @@ class OFPTableDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPTableDescStatsRequest(datapath, 0) req = ofp_parser.OFPTableDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPTableDescStatsRequest, self).__init__(datapath, flags) super(OFPTableDescStatsRequest, self).__init__(datapath, flags)
@ -2531,6 +2553,7 @@ class OFPTableDescStatsReply(OFPMultipartReply):
(p.table_id, p.config, repr(p.properties))) (p.table_id, p.config, repr(p.properties)))
self.logger.debug('OFPTableDescStatsReply received: %s', tables) self.logger.debug('OFPTableDescStatsReply received: %s', tables)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableDescStatsReply, self).__init__(datapath, **kwargs) super(OFPTableDescStatsReply, self).__init__(datapath, **kwargs)
@ -2562,6 +2585,7 @@ class OFPQueueDescStatsRequest(OFPMultipartRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY,
queue_id=ofproto.OFPQ_ALL, type_=None): queue_id=ofproto.OFPQ_ALL, type_=None):
super(OFPQueueDescStatsRequest, self).__init__(datapath, flags) super(OFPQueueDescStatsRequest, self).__init__(datapath, flags)
@ -2600,6 +2624,7 @@ class OFPQueueDescStatsReply(OFPMultipartReply):
(q.port_no, q.queue_id, repr(q.properties))) (q.port_no, q.queue_id, repr(q.properties)))
self.logger.debug('OFPQueueDescStatsReply received: %s', queues) self.logger.debug('OFPQueueDescStatsReply received: %s', queues)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPQueueDescStatsReply, self).__init__(datapath, **kwargs) super(OFPQueueDescStatsReply, self).__init__(datapath, **kwargs)
@ -2669,6 +2694,7 @@ class OFPQueueStatsRequest(OFPMultipartRequest):
ofp.OFPQ_ALL) ofp.OFPQ_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY, def __init__(self, datapath, flags=0, port_no=ofproto.OFPP_ANY,
queue_id=ofproto.OFPQ_ALL, type_=None): queue_id=ofproto.OFPQ_ALL, type_=None):
super(OFPQueueStatsRequest, self).__init__(datapath, flags) super(OFPQueueStatsRequest, self).__init__(datapath, flags)
@ -2714,6 +2740,7 @@ class OFPQueueStatsReply(OFPMultipartReply):
repr(stat.properties))) repr(stat.properties)))
self.logger.debug('QueueStats: %s', queues) self.logger.debug('QueueStats: %s', queues)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPQueueStatsReply, self).__init__(datapath, **kwargs) super(OFPQueueStatsReply, self).__init__(datapath, **kwargs)
@ -2787,6 +2814,7 @@ class OFPGroupStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupStatsRequest(datapath, 0, ofp.OFPG_ALL) req = ofp_parser.OFPGroupStatsRequest(datapath, 0, ofp.OFPG_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL, def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL,
type_=None): type_=None):
super(OFPGroupStatsRequest, self).__init__(datapath, flags) super(OFPGroupStatsRequest, self).__init__(datapath, flags)
@ -2829,6 +2857,7 @@ class OFPGroupStatsReply(OFPMultipartReply):
stat.duration_nsec)) stat.duration_nsec))
self.logger.debug('GroupStats: %s', groups) self.logger.debug('GroupStats: %s', groups)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupStatsReply, self).__init__(datapath, **kwargs)
@ -2894,6 +2923,7 @@ class OFPGroupDescStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupDescStatsRequest(datapath, 0, ofp.OFPG_ALL) req = ofp_parser.OFPGroupDescStatsRequest(datapath, 0, ofp.OFPG_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL, def __init__(self, datapath, flags=0, group_id=ofproto.OFPG_ALL,
type_=None): type_=None):
super(OFPGroupDescStatsRequest, self).__init__(datapath, flags) super(OFPGroupDescStatsRequest, self).__init__(datapath, flags)
@ -2933,13 +2963,14 @@ class OFPGroupDescStatsReply(OFPMultipartReply):
stat.bucket, repr(stat.properties))) stat.bucket, repr(stat.properties)))
self.logger.debug('GroupDescStats: %s', descs) self.logger.debug('GroupDescStats: %s', descs)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs)
class OFPGroupFeaturesStats(ofproto_parser.namedtuple('OFPGroupFeaturesStats', class OFPGroupFeaturesStats(ofproto_parser.namedtuple('OFPGroupFeaturesStats',
('types', 'capabilities', 'max_groups', ('types', 'capabilities', 'max_groups',
'actions'))): 'actions'))):
@classmethod @classmethod
def parser(cls, buf, offset): def parser(cls, buf, offset):
group_features = struct.unpack_from( group_features = struct.unpack_from(
@ -2976,6 +3007,7 @@ class OFPGroupFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPGroupFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPGroupFeaturesStatsRequest, self).__init__(datapath, flags)
@ -3007,6 +3039,7 @@ class OFPGroupFeaturesStatsReply(OFPMultipartReply):
body.types, body.capabilities, body.types, body.capabilities,
body.max_groups, body.actions) body.max_groups, body.actions)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPGroupFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -3085,6 +3118,7 @@ class OFPMeterStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPMeterStatsRequest(datapath, 0, ofp.OFPM_ALL) req = ofp_parser.OFPMeterStatsRequest(datapath, 0, ofp.OFPM_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL, def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL,
type_=None): type_=None):
super(OFPMeterStatsRequest, self).__init__(datapath, flags) super(OFPMeterStatsRequest, self).__init__(datapath, flags)
@ -3128,6 +3162,7 @@ class OFPMeterStatsReply(OFPMultipartReply):
stat.band_stats)) stat.band_stats))
self.logger.debug('MeterStats: %s', meters) self.logger.debug('MeterStats: %s', meters)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterStatsReply, self).__init__(datapath, **kwargs)
@ -3290,6 +3325,7 @@ class OFPMeterDescStatsRequest(OFPMultipartRequest):
ofp.OFPM_ALL) ofp.OFPM_ALL)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL, def __init__(self, datapath, flags=0, meter_id=ofproto.OFPM_ALL,
type_=None): type_=None):
super(OFPMeterDescStatsRequest, self).__init__(datapath, flags) super(OFPMeterDescStatsRequest, self).__init__(datapath, flags)
@ -3330,13 +3366,14 @@ class OFPMeterDescStatsReply(OFPMultipartReply):
stat.bands)) stat.bands))
self.logger.debug('MeterDescStats: %s', configs) self.logger.debug('MeterDescStats: %s', configs)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterDescStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterDescStatsReply, self).__init__(datapath, **kwargs)
class OFPMeterFeaturesStats(ofproto_parser.namedtuple('OFPMeterFeaturesStats', class OFPMeterFeaturesStats(ofproto_parser.namedtuple('OFPMeterFeaturesStats',
('max_meter', 'band_types', 'capabilities', ('max_meter', 'band_types', 'capabilities',
'max_bands', 'max_color', 'features'))): 'max_bands', 'max_color', 'features'))):
@classmethod @classmethod
def parser(cls, buf, offset): def parser(cls, buf, offset):
meter_features = struct.unpack_from( meter_features = struct.unpack_from(
@ -3369,6 +3406,7 @@ class OFPMeterFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPMeterFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPMeterFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPMeterFeaturesStatsRequest, self).__init__(datapath, flags) super(OFPMeterFeaturesStatsRequest, self).__init__(datapath, flags)
@ -3403,6 +3441,7 @@ class OFPMeterFeaturesStatsReply(OFPMultipartReply):
stat.max_color)) stat.max_color))
self.logger.debug('MeterFeaturesStats: %s', features) self.logger.debug('MeterFeaturesStats: %s', features)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -3596,6 +3635,7 @@ class OFPFlowMonitorRequest(OFPFlowMonitorRequestBase):
ofp.OFPFMC_ADD, match) ofp.OFPFMC_ADD, match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, monitor_id=0, def __init__(self, datapath, flags=0, monitor_id=0,
out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY, out_port=ofproto.OFPP_ANY, out_group=ofproto.OFPG_ANY,
monitor_flags=0, table_id=ofproto.OFPTT_ALL, monitor_flags=0, table_id=ofproto.OFPTT_ALL,
@ -3655,6 +3695,7 @@ class OFPFlowMonitorReply(OFPMultipartReply):
flow_updates.append(update_str) flow_updates.append(update_str)
self.logger.debug('FlowUpdates: %s', flow_updates) self.logger.debug('FlowUpdates: %s', flow_updates)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPFlowMonitorReply, self).__init__(datapath, **kwargs) super(OFPFlowMonitorReply, self).__init__(datapath, **kwargs)
@ -3762,6 +3803,7 @@ class OFPBundleFeaturesStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPBundleFeaturesStatsRequest(datapath, 0) req = ofp_parser.OFPBundleFeaturesStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, feature_request_flags=0, def __init__(self, datapath, flags=0, feature_request_flags=0,
properties=None, type_=None): properties=None, type_=None):
properties = properties if properties else [] properties = properties if properties else []
@ -3805,6 +3847,7 @@ class OFPBundleFeaturesStatsReply(OFPMultipartReply):
'properties=%s', 'properties=%s',
body.capabilities, repr(body.properties)) body.capabilities, repr(body.properties))
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPBundleFeaturesStatsReply, self).__init__(datapath, **kwargs) super(OFPBundleFeaturesStatsReply, self).__init__(datapath, **kwargs)
@ -3868,6 +3911,7 @@ class OFPExperimenterStatsRequest(OFPExperimenterStatsRequestBase):
data Experimenter defined additional data data Experimenter defined additional data
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, flags, def __init__(self, datapath, flags,
experimenter, exp_type, data, experimenter, exp_type, data,
type_=None): type_=None):
@ -3896,6 +3940,7 @@ class OFPExperimenterStatsReply(OFPMultipartReply):
body An ``OFPExperimenterMultipart`` instance body An ``OFPExperimenterMultipart`` instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPExperimenterStatsReply, self).__init__(datapath, **kwargs) super(OFPExperimenterStatsReply, self).__init__(datapath, **kwargs)
@ -4042,6 +4087,7 @@ class OFPFlowDescStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL, def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL,
out_port=ofproto.OFPP_ANY, out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPG_ANY, out_group=ofproto.OFPG_ANY,
@ -4086,6 +4132,7 @@ class OFPFlowDescStatsReply(OFPMultipartReply):
stat.stats, stat.instructions)) stat.stats, stat.instructions))
self.logger.debug('FlowDesc: %s', flows) self.logger.debug('FlowDesc: %s', flows)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPFlowDescStatsReply, self).__init__(datapath, **kwargs) super(OFPFlowDescStatsReply, self).__init__(datapath, **kwargs)
@ -4127,6 +4174,7 @@ class OFPFlowStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL, def __init__(self, datapath, flags=0, table_id=ofproto.OFPTT_ALL,
out_port=ofproto.OFPP_ANY, out_port=ofproto.OFPP_ANY,
out_group=ofproto.OFPG_ANY, out_group=ofproto.OFPG_ANY,
@ -4166,6 +4214,7 @@ class OFPFlowStatsReply(OFPMultipartReply):
stat.match, stat.stats)) stat.match, stat.stats))
self.logger.debug('FlowStats: %s', flows) self.logger.debug('FlowStats: %s', flows)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPFlowStatsReply, self).__init__(datapath, **kwargs) super(OFPFlowStatsReply, self).__init__(datapath, **kwargs)
@ -4224,6 +4273,7 @@ class OFPAggregateStatsRequest(OFPFlowStatsRequestBase):
match) match)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, table_id, out_port, out_group, def __init__(self, datapath, flags, table_id, out_port, out_group,
cookie, cookie_mask, match, type_=None): cookie, cookie_mask, match, type_=None):
super(OFPAggregateStatsRequest, self).__init__(datapath, super(OFPAggregateStatsRequest, self).__init__(datapath,
@ -4260,6 +4310,7 @@ class OFPAggregateStatsReply(OFPMultipartReply):
self.logger.debug('AggregateStats: stats=%s', body.stats) self.logger.debug('AggregateStats: stats=%s', body.stats)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPAggregateStatsReply, self).__init__(datapath, **kwargs) super(OFPAggregateStatsReply, self).__init__(datapath, **kwargs)
@ -4298,6 +4349,7 @@ class OFPTableStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPTableStatsRequest(datapath, 0) req = ofp_parser.OFPTableStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, type_=None): def __init__(self, datapath, flags, type_=None):
super(OFPTableStatsRequest, self).__init__(datapath, flags) super(OFPTableStatsRequest, self).__init__(datapath, flags)
@ -4329,6 +4381,7 @@ class OFPTableStatsReply(OFPMultipartReply):
stat.lookup_count, stat.matched_count)) stat.lookup_count, stat.matched_count))
self.logger.debug('TableStats: %s', tables) self.logger.debug('TableStats: %s', tables)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableStatsReply, self).__init__(datapath, **kwargs) super(OFPTableStatsReply, self).__init__(datapath, **kwargs)
@ -4458,6 +4511,7 @@ class OFPPortStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY) req = ofp_parser.OFPPortStatsRequest(datapath, 0, ofp.OFPP_ANY)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags, port_no, type_=None): def __init__(self, datapath, flags, port_no, type_=None):
super(OFPPortStatsRequest, self).__init__(datapath, flags) super(OFPPortStatsRequest, self).__init__(datapath, flags)
self.port_no = port_no self.port_no = port_no
@ -4499,6 +4553,7 @@ class OFPPortStatsReply(OFPMultipartReply):
repr(stat.properties)) repr(stat.properties))
self.logger.debug('PortStats: %s', ports) self.logger.debug('PortStats: %s', ports)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortStatsReply, self).__init__(datapath, **kwargs) super(OFPPortStatsReply, self).__init__(datapath, **kwargs)
@ -4519,6 +4574,7 @@ class OFPBarrierRequest(MsgBase):
req = ofp_parser.OFPBarrierRequest(datapath) req = ofp_parser.OFPBarrierRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierRequest, self).__init__(datapath) super(OFPBarrierRequest, self).__init__(datapath)
@ -4537,6 +4593,7 @@ class OFPBarrierReply(MsgBase):
def barrier_reply_handler(self, ev): def barrier_reply_handler(self, ev):
self.logger.debug('OFPBarrierReply received') self.logger.debug('OFPBarrierReply received')
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPBarrierReply, self).__init__(datapath) super(OFPBarrierReply, self).__init__(datapath)
@ -4580,6 +4637,7 @@ class OFPPortStatus(MsgBase):
self.logger.debug('OFPPortStatus received: reason=%s desc=%s', self.logger.debug('OFPPortStatus received: reason=%s desc=%s',
reason, msg.desc) reason, msg.desc)
""" """
def __init__(self, datapath, reason=None, desc=None): def __init__(self, datapath, reason=None, desc=None):
super(OFPPortStatus, self).__init__(datapath) super(OFPPortStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -4651,6 +4709,7 @@ class OFPRoleStatus(MsgBase):
'generation_id=%d properties=%s', role, reason, 'generation_id=%d properties=%s', role, reason,
msg.generation_id, repr(msg.properties)) msg.generation_id, repr(msg.properties))
""" """
def __init__(self, datapath, role=None, reason=None, def __init__(self, datapath, role=None, reason=None,
generation_id=None, properties=None): generation_id=None, properties=None):
super(OFPRoleStatus, self).__init__(datapath) super(OFPRoleStatus, self).__init__(datapath)
@ -4714,6 +4773,7 @@ class OFPTableStatus(MsgBase):
reason, msg.table.table_id, msg.table.config, reason, msg.table.table_id, msg.table.config,
repr(msg.table.properties)) repr(msg.table.properties))
""" """
def __init__(self, datapath, reason=None, table=None): def __init__(self, datapath, reason=None, table=None):
super(OFPTableStatus, self).__init__(datapath) super(OFPTableStatus, self).__init__(datapath)
self.reason = reason self.reason = reason
@ -4773,6 +4833,7 @@ class OFPRequestForward(MsgInMsgBase):
self.logger.debug( self.logger.debug(
'OFPRequestForward received: request=Unknown') 'OFPRequestForward received: request=Unknown')
""" """
def __init__(self, datapath, request=None): def __init__(self, datapath, request=None):
super(OFPRequestForward, self).__init__(datapath) super(OFPRequestForward, self).__init__(datapath)
self.request = request self.request = request
@ -4907,6 +4968,7 @@ class OFPControllerStatusStatsRequest(OFPMultipartRequest):
req = ofp_parser.OFPPortDescStatsRequest(datapath, 0) req = ofp_parser.OFPPortDescStatsRequest(datapath, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, flags=0, type_=None): def __init__(self, datapath, flags=0, type_=None):
super(OFPControllerStatusStatsRequest, super(OFPControllerStatusStatsRequest,
self).__init__(datapath, flags) self).__init__(datapath, flags)
@ -4942,6 +5004,7 @@ class OFPControllerStatusStatsReply(OFPMultipartReply):
self.logger.debug('OFPControllerStatusStatsReply received: %s', self.logger.debug('OFPControllerStatusStatsReply received: %s',
status) status)
""" """
def __init__(self, datapath, type_=None, **kwargs): def __init__(self, datapath, type_=None, **kwargs):
super(OFPControllerStatusStatsReply, self).__init__(datapath, super(OFPControllerStatusStatsReply, self).__init__(datapath,
**kwargs) **kwargs)
@ -5012,6 +5075,7 @@ class OFPControllerStatus(MsgBase):
status.short_id, role, reason, channel_status, status.short_id, role, reason, channel_status,
repr(status.properties)) repr(status.properties))
""" """
def __init__(self, datapath, status=None): def __init__(self, datapath, status=None):
super(OFPControllerStatus, self).__init__(datapath) super(OFPControllerStatus, self).__init__(datapath)
self.status = status self.status = status
@ -5059,6 +5123,7 @@ class OFPPacketOut(MsgBase):
match, actions) match, actions)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, buffer_id=None, match=None, actions=None, def __init__(self, datapath, buffer_id=None, match=None, actions=None,
data=None, actions_len=None): data=None, actions_len=None):
super(OFPPacketOut, self).__init__(datapath) super(OFPPacketOut, self).__init__(datapath)
@ -5185,6 +5250,7 @@ class OFPFlowMod(MsgBase):
match, inst) match, inst)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0, def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0,
command=ofproto.OFPFC_ADD, command=ofproto.OFPFC_ADD,
idle_timeout=0, hard_timeout=0, idle_timeout=0, hard_timeout=0,
@ -5290,6 +5356,7 @@ class OFPInstructionGotoTable(OFPInstruction):
table_id Next table table_id Next table
================ ====================================================== ================ ======================================================
""" """
def __init__(self, table_id, type_=None, len_=None): def __init__(self, table_id, type_=None, len_=None):
super(OFPInstructionGotoTable, self).__init__() super(OFPInstructionGotoTable, self).__init__()
self.type = ofproto.OFPIT_GOTO_TABLE self.type = ofproto.OFPIT_GOTO_TABLE
@ -5322,6 +5389,7 @@ class OFPInstructionWriteMetadata(OFPInstruction):
metadata_mask Metadata write bitmask metadata_mask Metadata write bitmask
================ ====================================================== ================ ======================================================
""" """
def __init__(self, metadata, metadata_mask, type_=None, len_=None): def __init__(self, metadata, metadata_mask, type_=None, len_=None):
super(OFPInstructionWriteMetadata, self).__init__() super(OFPInstructionWriteMetadata, self).__init__()
self.type = ofproto.OFPIT_WRITE_METADATA self.type = ofproto.OFPIT_WRITE_METADATA
@ -5364,6 +5432,7 @@ class OFPInstructionActions(OFPInstruction):
``type`` attribute corresponds to ``type_`` parameter of __init__. ``type`` attribute corresponds to ``type_`` parameter of __init__.
""" """
def __init__(self, type_, actions=None, len_=None): def __init__(self, type_, actions=None, len_=None):
super(OFPInstructionActions, self).__init__() super(OFPInstructionActions, self).__init__()
self.type = type_ self.type = type_
@ -5423,6 +5492,7 @@ class OFPInstructionStatTrigger(OFPInstruction):
thresholds Instance of ``OFPStats`` thresholds Instance of ``OFPStats``
================ ====================================================== ================ ======================================================
""" """
def __init__(self, flags, thresholds, type_=None, len_=None): def __init__(self, flags, thresholds, type_=None, len_=None):
super(OFPInstructionStatTrigger, self).__init__() super(OFPInstructionStatTrigger, self).__init__()
self.type = ofproto.OFPIT_STAT_TRIGGER self.type = ofproto.OFPIT_STAT_TRIGGER
@ -5502,6 +5572,7 @@ class OFPActionOutput(OFPAction):
max_len Max length to send to controller max_len Max length to send to controller
================ ====================================================== ================ ======================================================
""" """
def __init__(self, port, max_len=ofproto.OFPCML_MAX, def __init__(self, port, max_len=ofproto.OFPCML_MAX,
type_=None, len_=None): type_=None, len_=None):
super(OFPActionOutput, self).__init__() super(OFPActionOutput, self).__init__()
@ -5533,6 +5604,7 @@ class OFPActionGroup(OFPAction):
group_id Group identifier group_id Group identifier
================ ====================================================== ================ ======================================================
""" """
def __init__(self, group_id=0, type_=None, len_=None): def __init__(self, group_id=0, type_=None, len_=None):
super(OFPActionGroup, self).__init__() super(OFPActionGroup, self).__init__()
self.group_id = group_id self.group_id = group_id
@ -5563,6 +5635,7 @@ class OFPActionSetQueue(OFPAction):
queue_id Queue ID for the packets queue_id Queue ID for the packets
================ ====================================================== ================ ======================================================
""" """
def __init__(self, queue_id, type_=None, len_=None): def __init__(self, queue_id, type_=None, len_=None):
super(OFPActionSetQueue, self).__init__() super(OFPActionSetQueue, self).__init__()
self.queue_id = queue_id self.queue_id = queue_id
@ -5592,6 +5665,7 @@ class OFPActionSetMplsTtl(OFPAction):
mpls_ttl MPLS TTL mpls_ttl MPLS TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, mpls_ttl, type_=None, len_=None): def __init__(self, mpls_ttl, type_=None, len_=None):
super(OFPActionSetMplsTtl, self).__init__() super(OFPActionSetMplsTtl, self).__init__()
self.mpls_ttl = mpls_ttl self.mpls_ttl = mpls_ttl
@ -5615,6 +5689,7 @@ class OFPActionDecMplsTtl(OFPAction):
This action decrements the MPLS TTL. This action decrements the MPLS TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecMplsTtl, self).__init__() super(OFPActionDecMplsTtl, self).__init__()
@ -5639,6 +5714,7 @@ class OFPActionSetNwTtl(OFPAction):
nw_ttl IP TTL nw_ttl IP TTL
================ ====================================================== ================ ======================================================
""" """
def __init__(self, nw_ttl, type_=None, len_=None): def __init__(self, nw_ttl, type_=None, len_=None):
super(OFPActionSetNwTtl, self).__init__() super(OFPActionSetNwTtl, self).__init__()
self.nw_ttl = nw_ttl self.nw_ttl = nw_ttl
@ -5662,6 +5738,7 @@ class OFPActionDecNwTtl(OFPAction):
This action decrements the IP TTL. This action decrements the IP TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionDecNwTtl, self).__init__() super(OFPActionDecNwTtl, self).__init__()
@ -5681,6 +5758,7 @@ class OFPActionCopyTtlOut(OFPAction):
This action copies the TTL from the next-to-outermost header with TTL to This action copies the TTL from the next-to-outermost header with TTL to
the outermost header with TTL. the outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlOut, self).__init__() super(OFPActionCopyTtlOut, self).__init__()
@ -5700,6 +5778,7 @@ class OFPActionCopyTtlIn(OFPAction):
This action copies the TTL from the outermost header with TTL to the This action copies the TTL from the outermost header with TTL to the
next-to-outermost header with TTL. next-to-outermost header with TTL.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionCopyTtlIn, self).__init__() super(OFPActionCopyTtlIn, self).__init__()
@ -5724,6 +5803,7 @@ class OFPActionPushVlan(OFPAction):
ethertype Ether type. The default is 802.1Q. (0x8100) ethertype Ether type. The default is 802.1Q. (0x8100)
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_8021Q, type_=None, len_=None):
super(OFPActionPushVlan, self).__init__() super(OFPActionPushVlan, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -5753,6 +5833,7 @@ class OFPActionPushMpls(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_MPLS, type_=None, len_=None):
super(OFPActionPushMpls, self).__init__() super(OFPActionPushMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -5776,6 +5857,7 @@ class OFPActionPopVlan(OFPAction):
This action pops the outermost VLAN tag from the packet. This action pops the outermost VLAN tag from the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopVlan, self).__init__() super(OFPActionPopVlan, self).__init__()
@ -5794,6 +5876,7 @@ class OFPActionPopMpls(OFPAction):
This action pops the MPLS header from the packet. This action pops the MPLS header from the packet.
""" """
def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None): def __init__(self, ethertype=ether.ETH_TYPE_IP, type_=None, len_=None):
super(OFPActionPopMpls, self).__init__() super(OFPActionPopMpls, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -5826,6 +5909,7 @@ class OFPActionSetField(OFPAction):
set_field = OFPActionSetField(ipv4_src=("192.168.100.0", set_field = OFPActionSetField(ipv4_src=("192.168.100.0",
"255.255.255.0")) "255.255.255.0"))
""" """
def __init__(self, field=None, **kwargs): def __init__(self, field=None, **kwargs):
super(OFPActionSetField, self).__init__() super(OFPActionSetField, self).__init__()
assert len(kwargs) == 1 assert len(kwargs) == 1
@ -5885,6 +5969,7 @@ class OFPActionPushPbb(OFPAction):
ethertype Ether type ethertype Ether type
================ ====================================================== ================ ======================================================
""" """
def __init__(self, ethertype, type_=None, len_=None): def __init__(self, ethertype, type_=None, len_=None):
super(OFPActionPushPbb, self).__init__() super(OFPActionPushPbb, self).__init__()
self.ethertype = ethertype self.ethertype = ethertype
@ -5909,6 +5994,7 @@ class OFPActionPopPbb(OFPAction):
This action pops the outermost PBB service instance header from This action pops the outermost PBB service instance header from
the packet. the packet.
""" """
def __init__(self, type_=None, len_=None): def __init__(self, type_=None, len_=None):
super(OFPActionPopPbb, self).__init__() super(OFPActionPopPbb, self).__init__()
@ -5941,6 +6027,7 @@ class OFPActionCopyField(OFPAction):
The default is []. The default is [].
================ ====================================================== ================ ======================================================
""" """
def __init__(self, n_bits=0, src_offset=0, dst_offset=0, oxm_ids=None, def __init__(self, n_bits=0, src_offset=0, dst_offset=0, oxm_ids=None,
type_=None, len_=None): type_=None, len_=None):
oxm_ids = oxm_ids if oxm_ids else [] oxm_ids = oxm_ids if oxm_ids else []
@ -5999,6 +6086,7 @@ class OFPActionMeter(OFPAction):
meter_id Meter instance meter_id Meter instance
================ ====================================================== ================ ======================================================
""" """
def __init__(self, meter_id, def __init__(self, meter_id,
type_=None, len_=None): type_=None, len_=None):
super(OFPActionMeter, self).__init__() super(OFPActionMeter, self).__init__()
@ -6145,6 +6233,7 @@ class OFPGroupMod(MsgBase):
command_bucket_id, buckets) command_bucket_id, buckets)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, command=ofproto.OFPGC_ADD, def __init__(self, datapath, command=ofproto.OFPGC_ADD,
type_=ofproto.OFPGT_ALL, group_id=0, type_=ofproto.OFPGT_ALL, group_id=0,
command_bucket_id=ofproto.OFPG_BUCKET_ALL, command_bucket_id=ofproto.OFPG_BUCKET_ALL,
@ -6464,6 +6553,7 @@ class OFPRoleRequest(MsgBase):
ofp.OFPCID_UNDEFINED, 0) ofp.OFPCID_UNDEFINED, 0)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, role=None, short_id=None, def __init__(self, datapath, role=None, short_id=None,
generation_id=None): generation_id=None):
super(OFPRoleRequest, self).__init__(datapath) super(OFPRoleRequest, self).__init__(datapath)
@ -6526,6 +6616,7 @@ class OFPRoleReply(MsgBase):
'role=%s short_id=%d, generation_id=%d', 'role=%s short_id=%d, generation_id=%d',
role, msg.short_id, msg.generation_id) role, msg.short_id, msg.generation_id)
""" """
def __init__(self, datapath, role=None, short_id=None, def __init__(self, datapath, role=None, short_id=None,
generation_id=None): generation_id=None):
super(OFPRoleReply, self).__init__(datapath) super(OFPRoleReply, self).__init__(datapath)
@ -6604,6 +6695,7 @@ class OFPGetAsyncRequest(MsgBase):
req = ofp_parser.OFPGetAsyncRequest(datapath) req = ofp_parser.OFPGetAsyncRequest(datapath)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath): def __init__(self, datapath):
super(OFPGetAsyncRequest, self).__init__(datapath) super(OFPGetAsyncRequest, self).__init__(datapath)
@ -6632,6 +6724,7 @@ class OFPGetAsyncReply(MsgBase):
self.logger.debug('OFPGetAsyncReply received: ' self.logger.debug('OFPGetAsyncReply received: '
'properties=%s', repr(msg.properties)) 'properties=%s', repr(msg.properties))
""" """
def __init__(self, datapath, properties=None): def __init__(self, datapath, properties=None):
super(OFPGetAsyncReply, self).__init__(datapath) super(OFPGetAsyncReply, self).__init__(datapath)
self.properties = properties self.properties = properties
@ -6679,6 +6772,7 @@ class OFPSetAsync(MsgBase):
req = ofp_parser.OFPSetAsync(datapath, properties) req = ofp_parser.OFPSetAsync(datapath, properties)
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, properties=None): def __init__(self, datapath, properties=None):
super(OFPSetAsync, self).__init__(datapath) super(OFPSetAsync, self).__init__(datapath)
self.properties = properties self.properties = properties
@ -6731,6 +6825,7 @@ class OFPBundleCtrlMsg(MsgBase):
ofp.OFPBF_ATOMIC, []) ofp.OFPBF_ATOMIC, [])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, bundle_id=None, type_=None, flags=None, def __init__(self, datapath, bundle_id=None, type_=None, flags=None,
properties=None): properties=None):
super(OFPBundleCtrlMsg, self).__init__(datapath) super(OFPBundleCtrlMsg, self).__init__(datapath)
@ -6800,6 +6895,7 @@ class OFPBundleAddMsg(MsgInMsgBase):
msg, []) msg, [])
datapath.send_msg(req) datapath.send_msg(req)
""" """
def __init__(self, datapath, bundle_id, flags, message, properties): def __init__(self, datapath, bundle_id, flags, message, properties):
super(OFPBundleAddMsg, self).__init__(datapath) super(OFPBundleAddMsg, self).__init__(datapath)
self.bundle_id = bundle_id self.bundle_id = bundle_id

View File

@ -100,6 +100,7 @@ class RegisterWithArgChecks(object):
Does some argument checking and validation of required arguments. Does some argument checking and validation of required arguments.
""" """
def __init__(self, name, req_args=None, opt_args=None): def __init__(self, name, req_args=None, opt_args=None):
self._name = name self._name = name
if not req_args: if not req_args:

View File

@ -25,6 +25,7 @@ from ryu.services.protocols.bgp.net_ctrl import NOTIFICATION_LOG
class RpcLogHandler(logging.Handler): class RpcLogHandler(logging.Handler):
"""Outputs log records to `NET_CONTROLLER`.""" """Outputs log records to `NET_CONTROLLER`."""
def emit(self, record): def emit(self, record):
msg = self.format(record) msg = self.format(record)
NET_CONTROLLER.send_rpc_notification( NET_CONTROLLER.send_rpc_notification(

View File

@ -68,10 +68,10 @@ class BMPClient(Activity):
self._connect_tcp(self.server_address, self._connect_tcp(self.server_address,
self._handle_bmp_session) self._handle_bmp_session)
except socket.error: except socket.error:
self._connect_retry_event.set() self._connect_retry_event.set()
LOG.info('Will try to reconnect to %s after %s secs: %s', LOG.info('Will try to reconnect to %s after %s secs: %s',
self.server_address, self._connect_retry_time, self.server_address, self._connect_retry_time,
self._connect_retry_event.is_set()) self._connect_retry_event.is_set())
self.pause(self._connect_retry_time) self.pause(self._connect_retry_time)

View File

@ -45,6 +45,7 @@ class VRFFlowSpecTable(VrfTable):
Keeps destination imported to given VRF Flow Specification Keeps destination imported to given VRF Flow Specification
in represents. in represents.
""" """
def insert_vrffs_path(self, nlri, communities, is_withdraw=False): def insert_vrffs_path(self, nlri, communities, is_withdraw=False):
assert nlri assert nlri
assert isinstance(communities, list) assert isinstance(communities, list)

View File

@ -27,6 +27,7 @@ LOG = logging.getLogger('bgpspeaker.model')
class Counter(object): class Counter(object):
"""Simple counter for keeping count of several keys.""" """Simple counter for keeping count of several keys."""
def __init__(self): def __init__(self):
self._counters = {} self._counters = {}

View File

@ -99,6 +99,7 @@ class MissingRequiredConf(RuntimeConfigError):
"""Exception raised when trying to configure with missing required """Exception raised when trying to configure with missing required
settings. settings.
""" """
def __init__(self, **kwargs): def __init__(self, **kwargs):
conf_name = kwargs.get('conf_name') conf_name = kwargs.get('conf_name')
if conf_name: if conf_name:
@ -113,6 +114,7 @@ class MissingRequiredConf(RuntimeConfigError):
class ConfigTypeError(RuntimeConfigError): class ConfigTypeError(RuntimeConfigError):
"""Exception raised when configuration value type miss-match happens. """Exception raised when configuration value type miss-match happens.
""" """
def __init__(self, **kwargs): def __init__(self, **kwargs):
conf_name = kwargs.get(CONF_NAME) conf_name = kwargs.get(CONF_NAME)
conf_value = kwargs.get(CONF_VALUE) conf_value = kwargs.get(CONF_VALUE)
@ -133,6 +135,7 @@ class ConfigValueError(RuntimeConfigError):
"""Exception raised when configuration value is of correct type but """Exception raised when configuration value is of correct type but
incorrect value. incorrect value.
""" """
def __init__(self, **kwargs): def __init__(self, **kwargs):
conf_name = kwargs.get(CONF_NAME) conf_name = kwargs.get(CONF_NAME)
conf_value = kwargs.get(CONF_VALUE) conf_value = kwargs.get(CONF_VALUE)

View File

@ -819,6 +819,7 @@ class NeighborsConf(BaseConf):
class NeighborConfListener(ConfWithIdListener, ConfWithStatsListener): class NeighborConfListener(ConfWithIdListener, ConfWithStatsListener):
"""Base listener for change events to a specific neighbors' configurations. """Base listener for change events to a specific neighbors' configurations.
""" """
def __init__(self, neigh_conf): def __init__(self, neigh_conf):
super(NeighborConfListener, self).__init__(neigh_conf) super(NeighborConfListener, self).__init__(neigh_conf)
neigh_conf.add_listener(NeighborConf.UPDATE_ENABLED_EVT, neigh_conf.add_listener(NeighborConf.UPDATE_ENABLED_EVT,

View File

@ -39,6 +39,7 @@ class EventletIOFactory(object):
class LoopingCall(object): class LoopingCall(object):
"""Call a function repeatedly. """Call a function repeatedly.
""" """
def __init__(self, funct, *args, **kwargs): def __init__(self, funct, *args, **kwargs):
self._funct = funct self._funct = funct
self._args = args self._args = args

View File

@ -92,6 +92,7 @@ class EventModifyRequest(ryu_event.EventRequestBase):
port_uuid = reply.insert_uuids[new_port_uuid] port_uuid = reply.insert_uuids[new_port_uuid]
""" """
def __init__(self, system_id, func): def __init__(self, system_id, func):
super(EventModifyRequest, self).__init__() super(EventModifyRequest, self).__init__()
self.dst = 'OVSDB' self.dst = 'OVSDB'

View File

@ -42,6 +42,7 @@ class VRRPInterfaceBase(object):
NOTE: multiple virtual router can be configured on single port NOTE: multiple virtual router can be configured on single port
See RFC 5798 4.2 Sample Configuration 2 See RFC 5798 4.2 Sample Configuration 2
""" """
def __init__(self, mac_address, primary_ip_address, vlan_id=None): def __init__(self, mac_address, primary_ip_address, vlan_id=None):
super(VRRPInterfaceBase, self).__init__() super(VRRPInterfaceBase, self).__init__()
self.mac_address = mac_address self.mac_address = mac_address
@ -115,6 +116,7 @@ class VRRPConfig(object):
""" """
advertmisement_interval is in seconds as float. (Not in centiseconds) advertmisement_interval is in seconds as float. (Not in centiseconds)
""" """
def __init__(self, version=vrrp.VRRP_VERSION_V3, vrid=None, def __init__(self, version=vrrp.VRRP_VERSION_V3, vrid=None,
admin_state=True, admin_state=True,
priority=vrrp.VRRP_PRIORITY_BACKUP_DEFAULT, ip_addresses=None, priority=vrrp.VRRP_PRIORITY_BACKUP_DEFAULT, ip_addresses=None,
@ -165,6 +167,7 @@ class EventVRRPConfigRequest(event.EventRequestBase):
""" """
Request from management layer to VRRP manager to initialize VRRP Router. Request from management layer to VRRP manager to initialize VRRP Router.
""" """
def __init__(self, interface, config): def __init__(self, interface, config):
super(EventVRRPConfigRequest, self).__init__() super(EventVRRPConfigRequest, self).__init__()
self.dst = VRRP_MANAGER_NAME self.dst = VRRP_MANAGER_NAME
@ -185,6 +188,7 @@ class EventVRRPShutdownRequest(event.EventRequestBase):
""" """
Request from management layer to VRRP to shutdown VRRP Router. Request from management layer to VRRP to shutdown VRRP Router.
""" """
def __init__(self, instance_name): def __init__(self, instance_name):
super(EventVRRPShutdownRequest, self).__init__() super(EventVRRPShutdownRequest, self).__init__()
self.instance_name = instance_name self.instance_name = instance_name
@ -194,6 +198,7 @@ class EventVRRPStateChanged(event.EventBase):
""" """
Event that this VRRP Router changed its state. Event that this VRRP Router changed its state.
""" """
def __init__(self, instance_name, monitor_name, interface, config, def __init__(self, instance_name, monitor_name, interface, config,
old_state, new_state): old_state, new_state):
super(EventVRRPStateChanged, self).__init__() super(EventVRRPStateChanged, self).__init__()
@ -220,6 +225,7 @@ class EventVRRPListRequest(event.EventRequestBase):
Event that requests list of configured VRRP router Event that requests list of configured VRRP router
instance_name=None means all instances. instance_name=None means all instances.
""" """
def __init__(self, instance_name=None): def __init__(self, instance_name=None):
super(EventVRRPListRequest, self).__init__() super(EventVRRPListRequest, self).__init__()
self.instance_name = instance_name self.instance_name = instance_name
@ -236,6 +242,7 @@ class EventVRRPConfigChangeRequest(event.EventRequestBase):
Event that requests to change configuration of a given VRRP router. Event that requests to change configuration of a given VRRP router.
None means no-change. None means no-change.
""" """
def __init__(self, instance_name, priority=None, def __init__(self, instance_name, priority=None,
advertisement_interval=None, preempt_mode=None, advertisement_interval=None, preempt_mode=None,
preempt_delay=None, accept_mode=None): preempt_delay=None, accept_mode=None):
@ -255,6 +262,7 @@ class EventVRRPReceived(event.EventBase):
Event that port manager received valid VRRP packet. Event that port manager received valid VRRP packet.
Usually handed by VRRP Router. Usually handed by VRRP Router.
""" """
def __init__(self, interface, packet): def __init__(self, interface, packet):
super(EventVRRPReceived, self).__init__() super(EventVRRPReceived, self).__init__()
self.interface = interface self.interface = interface
@ -265,6 +273,7 @@ class EventVRRPTransmitRequest(event.EventRequestBase):
""" """
Request from VRRP router to port manager to transmit VRRP packet. Request from VRRP router to port manager to transmit VRRP packet.
""" """
def __init__(self, data): def __init__(self, data):
super(EventVRRPTransmitRequest, self).__init__() super(EventVRRPTransmitRequest, self).__init__()
self.data = data self.data = data

View File

@ -53,6 +53,7 @@ class VRRPInterfaceMonitorNetworkDevice(monitor.VRRPInterfaceMonitor):
This module uses raw socket so that privilege(CAP_NET_ADMIN capability) This module uses raw socket so that privilege(CAP_NET_ADMIN capability)
is required. is required.
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(VRRPInterfaceMonitorNetworkDevice, self).__init__(*args, super(VRRPInterfaceMonitorNetworkDevice, self).__init__(*args,
**kwargs) **kwargs)

View File

@ -34,6 +34,7 @@ RYU_MGR = './bin/ryu-manager'
class OVS12KernelSwitch(OVSKernelSwitch): class OVS12KernelSwitch(OVSKernelSwitch):
"""Set protocols parameter for OVS version 1.10""" """Set protocols parameter for OVS version 1.10"""
def start(self, controllers): def start(self, controllers):
super(OVS12KernelSwitch, self).start(controllers) super(OVS12KernelSwitch, self).start(controllers)
self.cmd('ovs-vsctl set Bridge', self, self.cmd('ovs-vsctl set Bridge', self,

View File

@ -91,8 +91,8 @@ class RunTest(tester.TestFlowBase):
s_val = s_val.value s_val = s_val.value
if name and s_val != value: if name and s_val != value:
return "Value error. send:%s=%s val:%s" \ return "Value error. send:%s=%s val:%s" \
% (name, value, s_val) % (name, value, s_val)
return True return True

View File

@ -94,9 +94,9 @@ class VRRPCommon(app_manager.RyuApp):
if i.state == vrrp_event.VRRP_STATE_MASTER: if i.state == vrrp_event.VRRP_STATE_MASTER:
print("bad master:") print("bad master:")
print('%s %s' % (d[vr[0].instance_name].state, print('%s %s' % (d[vr[0].instance_name].state,
d[vr[0].instance_name].config.priority)) d[vr[0].instance_name].config.priority))
print('%s %s' % (d[vr[1].instance_name].state, print('%s %s' % (d[vr[1].instance_name].state,
d[vr[1].instance_name].config.priority)) d[vr[1].instance_name].config.priority))
bad += 1 bad += 1
# assert i.state != vrrp_event.VRRP_STATE_MASTER # assert i.state != vrrp_event.VRRP_STATE_MASTER
if bad > 0: if bad > 0:

View File

@ -100,35 +100,35 @@ MESSAGES = [
'versions': [4], 'versions': [4],
'cmd': 'add-flow', 'cmd': 'add-flow',
'args': (['table=3', 'args': (['table=3',
'importance=39032'] + 'importance=39032'] +
STD_MATCH + STD_MATCH +
['actions=resubmit(1234,99)'])}, ['actions=resubmit(1234,99)'])},
{'name': 'action_ct', {'name': 'action_ct',
'versions': [4], 'versions': [4],
'cmd': 'add-flow', 'cmd': 'add-flow',
'args': (['table=3,', 'args': (['table=3,',
'importance=39032'] + 'importance=39032'] +
['dl_type=0x0800,ct_state=-trk'] + ['dl_type=0x0800,ct_state=-trk'] +
['actions=ct(table=4,zone=NXM_NX_REG0[4..31])'])}, ['actions=ct(table=4,zone=NXM_NX_REG0[4..31])'])},
{'name': 'action_ct_exec', {'name': 'action_ct_exec',
'versions': [4], 'versions': [4],
'cmd': 'add-flow', 'cmd': 'add-flow',
'args': (['table=3,', 'args': (['table=3,',
'importance=39032'] + 'importance=39032'] +
['dl_type=0x0800,ct_state=+trk+est'] + ['dl_type=0x0800,ct_state=+trk+est'] +
['actions=ct(commit,exec(set_field:0x654321->ct_mark))'])}, ['actions=ct(commit,exec(set_field:0x654321->ct_mark))'])},
{'name': 'action_ct_nat', {'name': 'action_ct_nat',
'versions': [4], 'versions': [4],
'cmd': 'add-flow', 'cmd': 'add-flow',
'args': (['table=3,', 'args': (['table=3,',
'importance=39032'] + 'importance=39032'] +
['dl_type=0x0800'] + ['dl_type=0x0800'] +
['actions=ct(commit,nat(src=10.1.12.0-10.1.13.255:1-1023)'])}, ['actions=ct(commit,nat(src=10.1.12.0-10.1.13.255:1-1023)'])},
{'name': 'action_ct_nat_v6', {'name': 'action_ct_nat_v6',
'versions': [4], 'versions': [4],
'cmd': 'add-flow', 'cmd': 'add-flow',
'args': (['table=3,', 'args': (['table=3,',
'importance=39032'] + 'importance=39032'] +
['dl_type=0x86dd'] + ['dl_type=0x86dd'] +
['actions=ct(commit,nat(dst=2001:1::1-2001:1::ffff)'])}, ['actions=ct(commit,nat(dst=2001:1::1-2001:1::ffff)'])},
{'name': 'action_note', {'name': 'action_note',

View File

@ -1034,7 +1034,7 @@ class OfTester(app_manager.RyuApp):
self.logger.debug("margin:[%s]", margin) self.logger.debug("margin:[%s]", margin)
if math.fabs(measured_value - expected_value) > margin: if math.fabs(measured_value - expected_value) > margin:
msgs.append('{0} {1:.2f}{2}'.format(fields, msgs.append('{0} {1:.2f}{2}'.format(fields,
measured_value / elapsed_sec / conv, unit)) measured_value / elapsed_sec / conv, unit))
if msgs: if msgs:
raise TestFailure(self.state, detail=', '.join(msgs)) raise TestFailure(self.state, detail=', '.join(msgs))
@ -1289,6 +1289,7 @@ class OpenFlowSw(object):
class TestPatterns(dict): class TestPatterns(dict):
""" List of Test class objects. """ """ List of Test class objects. """
def __init__(self, test_dir, logger): def __init__(self, test_dir, logger):
super(TestPatterns, self).__init__() super(TestPatterns, self).__init__()
self.logger = logger self.logger = logger
@ -1316,6 +1317,7 @@ class TestPatterns(dict):
class TestFile(stringify.StringifyMixin): class TestFile(stringify.StringifyMixin):
"""Test File object include Test objects.""" """Test File object include Test objects."""
def __init__(self, path, logger): def __init__(self, path, logger):
super(TestFile, self).__init__() super(TestFile, self).__init__()
self.logger = logger self.logger = logger

View File

@ -79,6 +79,7 @@ class _Win32Colorizer(object):
""" """
See _AnsiColorizer docstring. See _AnsiColorizer docstring.
""" """
def __init__(self, stream): def __init__(self, stream):
from win32console import GetStdHandle, STD_OUT_HANDLE from win32console import GetStdHandle, STD_OUT_HANDLE
from win32console import FOREGROUND_RED, FOREGROUND_BLUE from win32console import FOREGROUND_RED, FOREGROUND_BLUE
@ -127,6 +128,7 @@ class _NullColorizer(object):
""" """
See _AnsiColorizer docstring. See _AnsiColorizer docstring.
""" """
def __init__(self, stream): def __init__(self, stream):
self.stream = stream self.stream = stream

View File

@ -58,7 +58,7 @@ class Test_Parser_Compat(unittest.TestCase):
old_eth_src = addrconv.mac.text_to_bin(eth_src) old_eth_src = addrconv.mac.text_to_bin(eth_src)
old_ipv4_src = unpack('!I', addrconv.ipv4.text_to_bin(ipv4_src))[0] old_ipv4_src = unpack('!I', addrconv.ipv4.text_to_bin(ipv4_src))[0]
old_ipv6_src = list(unpack('!8H', old_ipv6_src = list(unpack('!8H',
addrconv.ipv6.text_to_bin(ipv6_src))) addrconv.ipv6.text_to_bin(ipv6_src)))
def check(o): def check(o):
check_old(o) check_old(o)

View File

@ -6392,6 +6392,7 @@ class TestOFPQueueGetConfigReply(unittest.TestCase):
class TestOFPBarrierRequest(unittest.TestCase): class TestOFPBarrierRequest(unittest.TestCase):
""" Test case for ofproto_v1_2_parser.OFPBarrierRequest """ Test case for ofproto_v1_2_parser.OFPBarrierRequest
""" """
def test_serialize(self): def test_serialize(self):
c = OFPBarrierRequest(_Datapath) c = OFPBarrierRequest(_Datapath)
c.serialize() c.serialize()

View File

@ -307,8 +307,8 @@ class Test_cfm(unittest.TestCase):
def test_to_string(self): def test_to_string(self):
cfm_values = {'op': self.message} cfm_values = {'op': self.message}
_cfm_str = ','.join(['%s=%s' % (k, cfm_values[k]) _cfm_str = ','.join(['%s=%s' % (k, cfm_values[k])
for k, v in inspect.getmembers(self.ins) for k, v in inspect.getmembers(self.ins)
if k in cfm_values]) if k in cfm_values])
cfm_str = '%s(%s)' % (cfm.cfm.__name__, _cfm_str) cfm_str = '%s(%s)' % (cfm.cfm.__name__, _cfm_str)
eq_(str(self.ins), cfm_str) eq_(str(self.ins), cfm_str)
eq_(repr(self.ins), cfm_str) eq_(repr(self.ins), cfm_str)

View File

@ -1048,8 +1048,8 @@ class Test_icmpv6_membership_query(unittest.TestCase):
mld_values = {'maxresp': self.maxresp, mld_values = {'maxresp': self.maxresp,
'address': self.address} 'address': self.address}
_mld_str = ','.join(['%s=%s' % (k, repr(mld_values[k])) _mld_str = ','.join(['%s=%s' % (k, repr(mld_values[k]))
for k, v in inspect.getmembers(ml) for k, v in inspect.getmembers(ml)
if k in mld_values]) if k in mld_values])
mld_str = '%s(%s)' % (icmpv6.mld.__name__, _mld_str) mld_str = '%s(%s)' % (icmpv6.mld.__name__, _mld_str)
icmp_values = {'type_': repr(self.type_), icmp_values = {'type_': repr(self.type_),
@ -1309,8 +1309,8 @@ class Test_mldv2_query(unittest.TestCase):
'num': self.num, 'num': self.num,
'srcs': self.srcs} 'srcs': self.srcs}
_mld_str = ','.join(['%s=%s' % (k, repr(mld_values[k])) _mld_str = ','.join(['%s=%s' % (k, repr(mld_values[k]))
for k, v in inspect.getmembers(self.mld) for k, v in inspect.getmembers(self.mld)
if k in mld_values]) if k in mld_values])
mld_str = '%s(%s)' % (icmpv6.mldv2_query.__name__, _mld_str) mld_str = '%s(%s)' % (icmpv6.mldv2_query.__name__, _mld_str)
icmp_values = {'type_': repr(self.type_), icmp_values = {'type_': repr(self.type_),
@ -1578,8 +1578,8 @@ class Test_mldv2_report(unittest.TestCase):
mld_values = {'record_num': self.record_num, mld_values = {'record_num': self.record_num,
'records': self.records} 'records': self.records}
_mld_str = ','.join(['%s=%s' % (k, repr(mld_values[k])) _mld_str = ','.join(['%s=%s' % (k, repr(mld_values[k]))
for k, v in inspect.getmembers(self.mld) for k, v in inspect.getmembers(self.mld)
if k in mld_values]) if k in mld_values])
mld_str = '%s(%s)' % (icmpv6.mldv2_report.__name__, _mld_str) mld_str = '%s(%s)' % (icmpv6.mldv2_report.__name__, _mld_str)
icmp_values = {'type_': repr(self.type_), icmp_values = {'type_': repr(self.type_),

View File

@ -43,6 +43,7 @@ LOG = logging.getLogger(__name__)
class Test_igmp(unittest.TestCase): class Test_igmp(unittest.TestCase):
""" Test case for Internet Group Management Protocol """ Test case for Internet Group Management Protocol
""" """
def setUp(self): def setUp(self):
self.msgtype = IGMP_TYPE_QUERY self.msgtype = IGMP_TYPE_QUERY
self.maxresp = 100 self.maxresp = 100
@ -170,6 +171,7 @@ class Test_igmp(unittest.TestCase):
class Test_igmpv3_query(unittest.TestCase): class Test_igmpv3_query(unittest.TestCase):
""" Test case for Internet Group Management Protocol v3 """ Test case for Internet Group Management Protocol v3
Membership Query Message""" Membership Query Message"""
def setUp(self): def setUp(self):
self.msgtype = IGMP_TYPE_QUERY self.msgtype = IGMP_TYPE_QUERY
self.maxresp = 100 self.maxresp = 100
@ -440,6 +442,7 @@ class Test_igmpv3_query(unittest.TestCase):
class Test_igmpv3_report(unittest.TestCase): class Test_igmpv3_report(unittest.TestCase):
""" Test case for Internet Group Management Protocol v3 """ Test case for Internet Group Management Protocol v3
Membership Report Message""" Membership Report Message"""
def setUp(self): def setUp(self):
self.msgtype = IGMP_TYPE_REPORT_V3 self.msgtype = IGMP_TYPE_REPORT_V3
self.csum = 0 self.csum = 0
@ -705,6 +708,7 @@ class Test_igmpv3_report(unittest.TestCase):
class Test_igmpv3_report_group(unittest.TestCase): class Test_igmpv3_report_group(unittest.TestCase):
"""Test case for Group Records of """Test case for Group Records of
Internet Group Management Protocol v3 Membership Report Message""" Internet Group Management Protocol v3 Membership Report Message"""
def setUp(self): def setUp(self):
self.type_ = MODE_IS_INCLUDE self.type_ = MODE_IS_INCLUDE
self.aux_len = 0 self.aux_len = 0

View File

@ -760,7 +760,7 @@ class Test_routing(unittest.TestCase):
"2001:db8:dead::3"] "2001:db8:dead::3"]
# calculate pad # calculate pad
self.pad = (8 - ((len(self.adrs) - 1) * (16 - self.cmpi) + self.pad = (8 - ((len(self.adrs) - 1) * (16 - self.cmpi) +
(16 - self.cmpe) % 8)) % 8 (16 - self.cmpe) % 8)) % 8
# create buf # create buf
self.form = '!BBBBBB2x16s16s16s' self.form = '!BBBBBB2x16s16s16s'
self.buf = struct.pack(self.form, self.nxt, self.size, self.buf = struct.pack(self.form, self.nxt, self.size,
@ -818,7 +818,7 @@ class Test_routing_type3(unittest.TestCase):
"2001:db8:dead::3"] "2001:db8:dead::3"]
# calculate pad # calculate pad
self.pad = (8 - ((len(self.adrs) - 1) * (16 - self.cmpi) + self.pad = (8 - ((len(self.adrs) - 1) * (16 - self.cmpi) +
(16 - self.cmpe) % 8)) % 8 (16 - self.cmpe) % 8)) % 8
self.routing = ipv6.routing_type3( self.routing = ipv6.routing_type3(
self.nxt, self.size, self.type_, self.seg, self.cmpi, self.nxt, self.size, self.type_, self.seg, self.cmpi,

View File

@ -23,6 +23,7 @@ from ryu.lib.packet import ospf
class Test_ospf(unittest.TestCase): class Test_ospf(unittest.TestCase):
""" Test case for ryu.lib.packet.ospf """ Test case for ryu.lib.packet.ospf
""" """
def setUp(self): def setUp(self):
pass pass

View File

@ -254,8 +254,8 @@ class TestPacket(unittest.TestCase):
'vid': 3, 'vid': 3,
'ethertype': ether.ETH_TYPE_ARP} 'ethertype': ether.ETH_TYPE_ARP}
_vlan_str = ','.join(['%s=%s' % (k, repr(vlan_values[k])) _vlan_str = ','.join(['%s=%s' % (k, repr(vlan_values[k]))
for k, v in inspect.getmembers(p_vlan) for k, v in inspect.getmembers(p_vlan)
if k in vlan_values]) if k in vlan_values])
vlan_str = '%s(%s)' % (vlan.vlan.__name__, _vlan_str) vlan_str = '%s(%s)' % (vlan.vlan.__name__, _vlan_str)
arp_values = {'hwtype': 1, arp_values = {'hwtype': 1,
@ -709,7 +709,7 @@ class TestPacket(unittest.TestCase):
'payload_id': 0, 'payload_id': 0,
'payload_data': self.payload} 'payload_data': self.payload}
_data_str = ','.join(['%s=%s' % (k, repr(data_values[k])) _data_str = ','.join(['%s=%s' % (k, repr(data_values[k]))
for k in sorted(data_values.keys())]) for k in sorted(data_values.keys())])
data_str = '[%s(%s)]' % (sctp.chunk_data.__name__, _data_str) data_str = '[%s(%s)]' % (sctp.chunk_data.__name__, _data_str)
sctp_values = {'src_port': 1, sctp_values = {'src_port': 1,
@ -718,8 +718,8 @@ class TestPacket(unittest.TestCase):
'csum': repr(p_sctp.csum), 'csum': repr(p_sctp.csum),
'chunks': data_str} 'chunks': data_str}
_sctp_str = ','.join(['%s=%s' % (k, sctp_values[k]) _sctp_str = ','.join(['%s=%s' % (k, sctp_values[k])
for k, _ in inspect.getmembers(p_sctp) for k, _ in inspect.getmembers(p_sctp)
if k in sctp_values]) if k in sctp_values])
sctp_str = '%s(%s)' % (sctp.sctp.__name__, _sctp_str) sctp_str = '%s(%s)' % (sctp.sctp.__name__, _sctp_str)
pkt_str = '%s, %s, %s' % (eth_str, ipv4_str, sctp_str) pkt_str = '%s, %s, %s' % (eth_str, ipv4_str, sctp_str)
@ -1245,7 +1245,7 @@ class TestPacket(unittest.TestCase):
'payload_id': 0, 'payload_id': 0,
'payload_data': self.payload} 'payload_data': self.payload}
_data_str = ','.join(['%s=%s' % (k, repr(data_values[k])) _data_str = ','.join(['%s=%s' % (k, repr(data_values[k]))
for k in sorted(data_values.keys())]) for k in sorted(data_values.keys())])
data_str = '[%s(%s)]' % (sctp.chunk_data.__name__, _data_str) data_str = '[%s(%s)]' % (sctp.chunk_data.__name__, _data_str)
sctp_values = {'src_port': 1, sctp_values = {'src_port': 1,
@ -1254,8 +1254,8 @@ class TestPacket(unittest.TestCase):
'csum': repr(p_sctp.csum), 'csum': repr(p_sctp.csum),
'chunks': data_str} 'chunks': data_str}
_sctp_str = ','.join(['%s=%s' % (k, sctp_values[k]) _sctp_str = ','.join(['%s=%s' % (k, sctp_values[k])
for k, _ in inspect.getmembers(p_sctp) for k, _ in inspect.getmembers(p_sctp)
if k in sctp_values]) if k in sctp_values])
sctp_str = '%s(%s)' % (sctp.sctp.__name__, _sctp_str) sctp_str = '%s(%s)' % (sctp.sctp.__name__, _sctp_str)
pkt_str = '%s, %s, %s' % (eth_str, ipv6_str, sctp_str) pkt_str = '%s, %s, %s' % (eth_str, ipv6_str, sctp_str)
@ -1496,8 +1496,8 @@ class TestPacket(unittest.TestCase):
'pf_bit': 0, 'pf_bit': 0,
'modifier_function2': 0} 'modifier_function2': 0}
_ctrl_str = ','.join(['%s=%s' % (k, repr(ctrl_values[k])) _ctrl_str = ','.join(['%s=%s' % (k, repr(ctrl_values[k]))
for k, v in inspect.getmembers(p_llc.control) for k, v in inspect.getmembers(p_llc.control)
if k in ctrl_values]) if k in ctrl_values])
ctrl_str = '%s(%s)' % (llc.ControlFormatU.__name__, _ctrl_str) ctrl_str = '%s(%s)' % (llc.ControlFormatU.__name__, _ctrl_str)
llc_values = {'dsap_addr': repr(llc.SAP_BPDU), llc_values = {'dsap_addr': repr(llc.SAP_BPDU),
@ -1524,8 +1524,8 @@ class TestPacket(unittest.TestCase):
'hello_time': float(2), 'hello_time': float(2),
'forward_delay': float(15)} 'forward_delay': float(15)}
_bpdu_str = ','.join(['%s=%s' % (k, repr(bpdu_values[k])) _bpdu_str = ','.join(['%s=%s' % (k, repr(bpdu_values[k]))
for k, v in inspect.getmembers(p_bpdu) for k, v in inspect.getmembers(p_bpdu)
if k in bpdu_values]) if k in bpdu_values])
bpdu_str = '%s(%s)' % (bpdu.ConfigurationBPDUs.__name__, _bpdu_str) bpdu_str = '%s(%s)' % (bpdu.ConfigurationBPDUs.__name__, _bpdu_str)
pkt_str = '%s, %s, %s' % (eth_str, llc_str, bpdu_str) pkt_str = '%s, %s, %s' % (eth_str, llc_str, bpdu_str)

View File

@ -36,6 +36,7 @@ LOG = logging.getLogger(__name__)
class Test_slow(unittest.TestCase): class Test_slow(unittest.TestCase):
""" Test case for Slow Protocol """ Test case for Slow Protocol
""" """
def setUp(self): def setUp(self):
self.subtype = SLOW_SUBTYPE_LACP self.subtype = SLOW_SUBTYPE_LACP
self.version = lacp.LACP_VERSION_NUMBER self.version = lacp.LACP_VERSION_NUMBER