@@ 291-337 (lines=47) @@ | ||
288 | self.packet_count = packet_count |
|
289 | self.byte_count = byte_count |
|
290 | ||
291 | ||
292 | class PortStats(GenericStruct): |
|
293 | """Body of reply to OFPST_PORT request. |
|
294 | ||
295 | If a counter is unsupported, set the field to all ones. |
|
296 | """ |
|
297 | ||
298 | port_no = UBInt32() |
|
299 | #: Align to 64-bits. |
|
300 | pad = Pad(4) |
|
301 | rx_packets = UBInt64() |
|
302 | tx_packets = UBInt64() |
|
303 | rx_bytes = UBInt64() |
|
304 | tx_bytes = UBInt64() |
|
305 | rx_dropped = UBInt64() |
|
306 | tx_dropped = UBInt64() |
|
307 | rx_errors = UBInt64() |
|
308 | tx_errors = UBInt64() |
|
309 | rx_frame_err = UBInt64() |
|
310 | rx_over_err = UBInt64() |
|
311 | rx_crc_err = UBInt64() |
|
312 | collisions = UBInt64() |
|
313 | duration_sec = UBInt32() |
|
314 | duration_nsec = UBInt32() |
|
315 | ||
316 | # Can't avoid "too many local variables" (R0914) in this struct. |
|
317 | # pylint: disable=R0914 |
|
318 | def __init__(self, port_no=None, rx_packets=None, |
|
319 | tx_packets=None, rx_bytes=None, tx_bytes=None, |
|
320 | rx_dropped=None, tx_dropped=None, rx_errors=None, |
|
321 | tx_errors=None, rx_frame_err=None, rx_over_err=None, |
|
322 | rx_crc_err=None, collisions=None, duration_sec=None, |
|
323 | duration_nsec=None): |
|
324 | """The constructor assigns parameters to object attributes. |
|
325 | ||
326 | Args: |
|
327 | port_no (:class:`int`, :class:`.Port`): Port number. |
|
328 | rx_packets (int): Number of received packets. |
|
329 | tx_packets (int): Number of transmitted packets. |
|
330 | rx_bytes (int): Number of received bytes. |
|
331 | tx_bytes (int): Number of transmitted bytes. |
|
332 | rx_dropped (int): Number of packets dropped by RX. |
|
333 | tx_dropped (int): Number of packets dropped by TX. |
|
334 | rx_errors (int): Number of receive errors. This is a super-set of |
|
335 | more specific receive errors and should be greater than or |
|
336 | equal to the sum of all rx_*_err values. |
|
337 | tx_errors (int): Number of transmit errors. This is a super-set of |
|
338 | more specific transmit errors and should be greater than or |
|
339 | equal to the sum of all tx_*_err values (none currently |
|
340 | defined). |
@@ 289-329 (lines=41) @@ | ||
286 | rx_crc_err = UBInt64() |
|
287 | collisions = UBInt64() |
|
288 | ||
289 | def __init__(self, port_no=None, rx_packets=None, |
|
290 | tx_packets=None, rx_bytes=None, tx_bytes=None, |
|
291 | rx_dropped=None, tx_dropped=None, rx_errors=None, |
|
292 | tx_errors=None, rx_frame_err=None, rx_over_err=None, |
|
293 | rx_crc_err=None, collisions=None): |
|
294 | """The constructor assigns parameters to object attributes. |
|
295 | ||
296 | Args: |
|
297 | port_no (:class:`int`, :class:`.Port`): Port number. |
|
298 | rx_packets (int): Number of received packets. |
|
299 | tx_packets (int): Number of transmitted packets. |
|
300 | rx_bytes (int): Number of received bytes. |
|
301 | tx_bytes (int): Number of transmitted bytes. |
|
302 | rx_dropped (int): Number of packets dropped by RX. |
|
303 | tx_dropped (int): Number of packets dropped by TX. |
|
304 | rx_errors (int): Number of receive errors. This is a super-set of |
|
305 | more specific receive errors and should be greater than or |
|
306 | equal to the sum of all rx_*_err values. |
|
307 | tx_errors (int): Number of transmit errors. This is a super-set of |
|
308 | more specific transmit errors and should be greater than or |
|
309 | equal to the sum of all tx_*_err values (none currently |
|
310 | defined). |
|
311 | rx_frame_err (int): Number of frame alignment errors. |
|
312 | rx_over_err (int): Number of packets with RX overrun. |
|
313 | rx_crc_err (int): Number of CRC errors. |
|
314 | collisions (int): Number of collisions. |
|
315 | """ |
|
316 | super().__init__() |
|
317 | self.port_no = port_no |
|
318 | self.rx_packets = rx_packets |
|
319 | self.tx_packets = tx_packets |
|
320 | self.rx_bytes = rx_bytes |
|
321 | self.tx_bytes = tx_bytes |
|
322 | self.rx_dropped = rx_dropped |
|
323 | self.tx_dropped = tx_dropped |
|
324 | self.rx_errors = rx_errors |
|
325 | self.tx_errors = tx_errors |
|
326 | self.rx_frame_err = rx_frame_err |
|
327 | self.rx_over_err = rx_over_err |
|
328 | self.rx_crc_err = rx_crc_err |
|
329 | self.collisions = collisions |
|
330 | ||
331 | ||
332 | class PortStatsRequest(GenericStruct): |