summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/ofproto/ofproto_v1_4_parser.py59
1 files changed, 29 insertions, 30 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py
index beebda74..b7e6a527 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -315,7 +315,6 @@ class OFPEchoReply(MsgBase):
Example::
def send_echo_reply(self, datapath, data):
- ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
reply = ofp_parser.OFPEchoReply(datapath, data)
@@ -1704,6 +1703,7 @@ class OFPPacketIn(MsgBase):
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def packet_in_handler(self, ev):
msg = ev.msg
+ dp = msg.datapath
ofp = dp.ofproto
if msg.reason == ofp.TABLE_MISS:
@@ -2039,7 +2039,7 @@ class OFPTableMod(MsgBase):
ofp_parser = datapath.ofproto_parser
req = ofp_parser.OFPTableMod(datapath, 1, 3)
- flags = ofproto.OFPTC_VACANCY_EVENTS
+ flags = ofp.OFPTC_VACANCY_EVENTS
properties = [ofp_parser.OFPTableModPropEviction(flags)]
req = ofp_parser.OFPTableMod(datapath, 1, 3, properties)
datapath.send_msg(req)
@@ -2170,7 +2170,6 @@ class OFPDescStatsRequest(OFPMultipartRequest):
Example::
def send_desc_stats_request(self, datapath):
- ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
req = ofp_parser.OFPDescStatsRequest(datapath, 0)
@@ -2599,7 +2598,7 @@ class OFPPortDescStatsReply(OFPMultipartReply):
================ ======================================================
Attribute Description
================ ======================================================
- body List of ``OFPPortDescStats`` instance
+ body List of ``OFPPort`` instance
================ ======================================================
Example::
@@ -2634,7 +2633,7 @@ class OFPTableDescStatsRequest(OFPMultipartRequest):
Example::
- def send_tablet_desc_stats_request(self, datapath):
+ def send_table_desc_stats_request(self, datapath):
ofp_parser = datapath.ofproto_parser
req = ofp_parser.OFPTableDescStatsRequest(datapath, 0)
@@ -2656,7 +2655,7 @@ class OFPTableDescStatsReply(OFPMultipartReply):
================ ======================================================
Attribute Description
================ ======================================================
- body List of ``OFPTableDescStats`` instance
+ body List of ``OFPTableDesc`` instance
================ ======================================================
Example::
@@ -2667,7 +2666,7 @@ class OFPTableDescStatsReply(OFPMultipartReply):
for p in ev.msg.body:
tables.append('table_id=%d config=0x%08x properties=%s' %
(p.table_id, p.config, repr(p.properties)))
- self.logger.debug('OFPTableDescStatsReply received: %s', ports)
+ self.logger.debug('OFPTableDescStatsReply received: %s', tables)
"""
def __init__(self, datapath, type_=None, **kwargs):
super(OFPTableDescStatsReply, self).__init__(datapath, **kwargs)
@@ -2691,9 +2690,9 @@ class OFPQueueDescStatsRequest(OFPMultipartRequest):
Example::
- def send_tablet_desc_stats_request(self, datapath):
+ def send_queue_desc_stats_request(self, datapath):
+ ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
-
req = ofp_parser.OFPQueueDescStatsRequest(datapath, 0,
ofp.OFPP_ANY,
ofp.OFPQ_ALL)
@@ -2724,7 +2723,7 @@ class OFPQueueDescStatsReply(OFPMultipartReply):
================ ======================================================
Attribute Description
================ ======================================================
- body List of ``OFPQueueDescStats`` instance
+ body List of ``OFPQueueDesc`` instance
================ ======================================================
Example::
@@ -2843,7 +2842,8 @@ class OFPQueueStatsReply(OFPMultipartReply):
for stat in ev.msg.body:
queues.append('port_no=%d queue_id=%d '
'tx_bytes=%d tx_packets=%d tx_errors=%d '
- 'duration_sec=%d duration_nsec=%d' %
+ 'duration_sec=%d duration_nsec=%d'
+ 'properties=%s' %
(stat.port_no, stat.queue_id,
stat.tx_bytes, stat.tx_packets, stat.tx_errors,
stat.duration_sec, stat.duration_nsec,
@@ -3048,7 +3048,7 @@ class OFPGroupDescStatsReply(OFPMultipartReply):
'buckets=%s' %
(stat.length, stat.type, stat.group_id,
stat.bucket))
- self.logger.debug('GroupDescStats: %s', groups)
+ self.logger.debug('GroupDescStats: %s', descs)
"""
def __init__(self, datapath, type_=None, **kwargs):
super(OFPGroupDescStatsReply, self).__init__(datapath, **kwargs)
@@ -3088,7 +3088,6 @@ class OFPGroupFeaturesStatsRequest(OFPMultipartRequest):
Example::
def send_group_features_stats_request(self, datapath):
- ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
req = ofp_parser.OFPGroupFeaturesStatsRequest(datapath, 0)
@@ -3519,7 +3518,7 @@ class OFPMeterFeaturesStatsReply(OFPMultipartReply):
(stat.max_meter, stat.band_types,
stat.capabilities, stat.max_bands,
stat.max_color))
- self.logger.debug('MeterFeaturesStats: %s', configs)
+ self.logger.debug('MeterFeaturesStats: %s', features)
"""
def __init__(self, datapath, type_=None, **kwargs):
super(OFPMeterFeaturesStatsReply, self).__init__(datapath, **kwargs)
@@ -3700,7 +3699,7 @@ class OFPFlowMonitorRequest(OFPFlowMonitorRequestBase):
Example::
- def send_flow_stats_request(self, datapath):
+ def send_flow_monitor_request(self, datapath):
ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
@@ -3763,12 +3762,12 @@ class OFPFlowMonitorReply(OFPMultipartReply):
update_str += 'table_id=%d reason=%d idle_timeout=%d '
'hard_timeout=%d priority=%d cookie=%d '
'match=%d instructions=%s' %
- (stat.table_id, stat.reason,
- stat.idle_timeout, stat.hard_timeout,
- stat.priority, stat.cookie,
- stat.match, stat.instructions)
+ (update.table_id, update.reason,
+ update.idle_timeout, update.hard_timeout,
+ update.priority, update.cookie,
+ update.match, update.instructions)
elif update.event == ofp.OFPFME_ABBREV:
- update_str += 'xid=%d' % (stat.xid)
+ update_str += 'xid=%d' % (update.xid)
flow_updates.append(update_str)
self.logger.debug('FlowUpdates: %s', flow_updates)
"""
@@ -4151,7 +4150,6 @@ class OFPTableStatsRequest(OFPMultipartRequest):
Example::
def send_table_stats_request(self, datapath):
- ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
req = ofp_parser.OFPTableStatsRequest(datapath, 0)
@@ -4186,7 +4184,7 @@ class OFPTableStatsReply(OFPMultipartReply):
' matched_count=%d' %
(stat.table_id, stat.active_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):
super(OFPTableStatsReply, self).__init__(datapath, **kwargs)
@@ -4356,7 +4354,7 @@ class OFPPortStatsReply(OFPMultipartReply):
stat.rx_dropped, stat.tx_dropped,
stat.rx_errors, stat.tx_errors,
repr(stat.properties))
- self.logger.debug('PortStats: %s', ports)
+ self.logger.debug('PortStats: %s', ports)
"""
def __init__(self, datapath, type_=None, **kwargs):
super(OFPPortStatsReply, self).__init__(datapath, **kwargs)
@@ -4607,7 +4605,7 @@ class OFPRequestForward(MsgInMsgBase):
Example::
- def send_bundle_add_message(self, datapath):
+ def send_request_forward_message(self, datapath):
ofp = datapath.ofproto
ofp_parser = datapath.ofproto_parser
@@ -4759,7 +4757,7 @@ class OFPFlowMod(MsgBase):
priority, buffer_id,
ofp.OFPP_ANY, ofp.OFPG_ANY,
ofp.OFPFF_SEND_FLOW_REM,
- imporotance,
+ importance,
match, inst)
datapath.send_msg(req)
"""
@@ -5783,6 +5781,7 @@ class OFPRoleReply(MsgBase):
@set_ev_cls(ofp_event.EventOFPRoleReply, MAIN_DISPATCHER)
def role_reply_handler(self, ev):
msg = ev.msg
+ dp = msg.datapath
ofp = dp.ofproto
if msg.role == ofp.OFPCR_ROLE_NOCHANGE:
@@ -5944,12 +5943,12 @@ class OFPSetAsync(MsgBase):
ofp_parser = datapath.ofproto_parser
properties = [ofp_parser.OFPAsyncConfigPropReasons(
- 8, ofp_parser.OFPACPT_PACKET_IN_SLAVE,
- (ofp_parser.OFPR_APPLY_ACTION |
- ofp_parser.OFPR_INVALID_TTL)),
+ 8, ofp_parser.OFPACPT_PACKET_IN_SLAVE,
+ (ofp_parser.OFPR_APPLY_ACTION |
+ ofp_parser.OFPR_INVALID_TTL)),
ofp_parser.OFPAsyncConfigPropExperimenter(
- ofproto.OFPTFPT_EXPERIMENTER_MASTER,
- 16, 100, 2, bytearray())]
+ ofp.OFPTFPT_EXPERIMENTER_MASTER,
+ 16, 100, 2, bytearray())]
req = ofp_parser.OFPSetAsync(datapath, properties)
datapath.send_msg(req)
"""