Code Duplication    Length = 41-47 lines in 2 locations

pyof/v0x04/controller2switch/multipart_reply.py 1 location

@@ 318-364 (lines=47) @@
315
    duration_sec = UBInt32()
316
    duration_nsec = UBInt32()
317
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
        """Create a PortStats with the optional parameters below.
325
326
        Args:
327
            port_no (:class:`int`, :class:`~pyof.v0x04.common.port.Port`):
328
                Port number.
329
            rx_packets (int): Number of received packets.
330
            tx_packets (int): Number of transmitted packets.
331
            rx_bytes (int): Number of received bytes.
332
            tx_bytes (int): Number of transmitted bytes.
333
            rx_dropped (int): Number of packets dropped by RX.
334
            tx_dropped (int): Number of packets dropped by TX.
335
            rx_errors (int): Number of receive errors. This is a super-set of
336
                more specific receive errors and should be greater than or
337
                equal to the sum of all rx_*_err values.
338
            tx_errors (int): Number of transmit errors.  This is a super-set of
339
                more specific transmit errors and should be greater than or
340
                equal to the sum of all tx_*_err values (none currently
341
                defined).
342
            rx_frame_err (int): Number of frame alignment errors.
343
            rx_over_err (int): Number of packets with RX overrun.
344
            rx_crc_err (int): Number of CRC errors.
345
            collisions (int): Number of collisions.
346
            duration_sec (int): Time port has been alive in seconds
347
            duration_nsec (int): Time port has been alive in nanoseconds beyond
348
                duration_sec
349
        """
350
        super().__init__()
351
        self.port_no = port_no
352
        self.rx_packets = rx_packets
353
        self.tx_packets = tx_packets
354
        self.rx_bytes = rx_bytes
355
        self.tx_bytes = tx_bytes
356
        self.rx_dropped = rx_dropped
357
        self.tx_dropped = tx_dropped
358
        self.rx_errors = rx_errors
359
        self.tx_errors = tx_errors
360
        self.rx_frame_err = rx_frame_err
361
        self.rx_over_err = rx_over_err
362
        self.rx_crc_err = rx_crc_err
363
        self.collisions = collisions
364
        self.duration_sec = duration_sec
365
        self.duration_nsec = duration_nsec
366
367

pyof/v0x01/controller2switch/common.py 1 location

@@ 289-329 (lines=41) @@
286
    tx_errors = UBInt64()
287
    rx_frame_err = UBInt64()
288
    rx_over_err = UBInt64()
289
    rx_crc_err = UBInt64()
290
    collisions = UBInt64()
291
292
    def __init__(self, port_no=None, rx_packets=None,
293
                 tx_packets=None, rx_bytes=None, tx_bytes=None,
294
                 rx_dropped=None, tx_dropped=None, rx_errors=None,
295
                 tx_errors=None, rx_frame_err=None, rx_over_err=None,
296
                 rx_crc_err=None, collisions=None):
297
        """Create a PortStats with the optional parameters below.
298
299
        Args:
300
            port_no (:class:`int`, :class:`~pyof.v0x01.common.phy_port.Port`):
301
                Port number.
302
            rx_packets (int): Number of received packets.
303
            tx_packets (int): Number of transmitted packets.
304
            rx_bytes (int): Number of received bytes.
305
            tx_bytes (int): Number of transmitted bytes.
306
            rx_dropped (int): Number of packets dropped by RX.
307
            tx_dropped (int): Number of packets dropped by TX.
308
            rx_errors (int): Number of receive errors. This is a super-set of
309
                more specific receive errors and should be greater than or
310
                equal to the sum of all rx_*_err values.
311
            tx_errors (int): Number of transmit errors.  This is a super-set of
312
                more specific transmit errors and should be greater than or
313
                equal to the sum of all tx_*_err values (none currently
314
                defined).
315
            rx_frame_err (int): Number of frame alignment errors.
316
            rx_over_err (int): Number of packets with RX overrun.
317
            rx_crc_err (int): Number of CRC errors.
318
            collisions (int): Number of collisions.
319
        """
320
        super().__init__()
321
        self.port_no = port_no
322
        self.rx_packets = rx_packets
323
        self.tx_packets = tx_packets
324
        self.rx_bytes = rx_bytes
325
        self.tx_bytes = tx_bytes
326
        self.rx_dropped = rx_dropped
327
        self.tx_dropped = tx_dropped
328
        self.rx_errors = rx_errors
329
        self.tx_errors = tx_errors
330
        self.rx_frame_err = rx_frame_err
331
        self.rx_over_err = rx_over_err
332
        self.rx_crc_err = rx_crc_err