Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Change QueueStats and QueueStatsRequest to be v0x04 compliance and so…
Browse files Browse the repository at this point in the history
…me PEP008 minor corrections - Issue #158
  • Loading branch information
abaruchi committed Sep 14, 2016
1 parent 91db1e4 commit 63dd1f8
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pyof/v0x04/controller2switch/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ def __init__(self, port_no=None, rx_packets=None,
rx_crc_err (int): Number of CRC errors.
collisions (int): Number of collisions.
duration_sec (int): Time port has been alive in seconds
duration_nsec (int): Time port has been alive in nanoseconds beyond duration_sec
duration_nsec (int): Time port has been alive in nanoseconds beyond
duration_sec
"""
super().__init__()
self.port_no = port_no
Expand Down Expand Up @@ -537,16 +538,17 @@ def __init__(self, port_no=None):
class QueueStats(GenericStruct):
"""Implements the reply body of a port_no."""

port_no = UBInt16()
#: Align to 32-bits.
pad = Pad(2)
port_no = UBInt32()
queue_id = UBInt32()
tx_bytes = UBInt64()
tx_packets = UBInt64()
tx_errors = UBInt64()
duration_sec = UBInt32()
duration_nsec = UBInt32()

def __init__(self, port_no=None, queue_id=None, tx_bytes=None,
tx_packets=None, tx_errors=None):
tx_packets=None, tx_errors=None, duration_sec=None,
duration_nsec=None):
"""The constructor just assings parameters to object attributes.
Args:
Expand All @@ -555,21 +557,24 @@ def __init__(self, port_no=None, queue_id=None, tx_bytes=None,
tx_bytes (int): Number of transmitted bytes.
tx_packets (int): Number of transmitted packets.
tx_errors (int): Number of packets dropped due to overrun.
duration_sec (int): Time queue has been alive in seconds.
duration_nsec (int): Time queue has been alive in nanoseconds
beyond duration_sec.
"""
super().__init__()
self.port_no = port_no
self.queue_id = queue_id
self.tx_bytes = tx_bytes
self.tx_packets = tx_packets
self.tx_errors = tx_errors
self.duration_sec = duration_sec
self.duration_nsec = duration_nsec


class QueueStatsRequest(GenericStruct):
"""Implements the request body of a ``port_no``."""

port_no = UBInt16()
#: Align to 32-bits
pad = Pad(2)
port_no = UBInt32()
queue_id = UBInt32()

def __init__(self, port_no=None, queue_id=None):
Expand Down

0 comments on commit 63dd1f8

Please sign in to comment.