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

Commit

Permalink
Changed TableStats to be compliance with v0x04 version - Issue #158
Browse files Browse the repository at this point in the history
  • Loading branch information
abaruchi committed Sep 14, 2016
1 parent 68aefbc commit 4567a30
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions pyof/v0x04/controller2switch/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,30 +634,24 @@ class TableStats(GenericStruct):
table_id = UBInt8()
#: Align to 32-bits.
pad = Pad(3)
name = Char(length=OFP_MAX_TABLE_NAME_LEN)
max_entries = UBInt32()
active_count = UBInt32()
count_lookup = UBInt64()
count_matched = UBInt64()
lookup_count = UBInt64()
matched_count = UBInt64()

def __init__(self, table_id=None, name=None, max_entries=None,
active_count=None, count_lookup=None,
count_matched=None):
active_count=None, lookup_count=None,
matched_count=None):
"""The constructor just assings parameters to object attributes.
Args:
table_id (int): Identifier of table. Lower numbered tables are
consulted first.
name (str): Table name.
max_entries (int): Max number of entries supported.
active_count (int): Number of active entries.
count_lookup (int): Number of packets looked up in table.
count_matched (int): Number of packets that hit table.
lookup_count (int): Number of packets looked up in table.
matched_count (int): Number of packets that hit table.
"""
super().__init__()
self.table_id = table_id
self.name = name
self.max_entries = max_entries
self.active_count = active_count
self.count_lookup = count_lookup
self.count_matched = count_matched
self.lookup_count = lookup_count
self.matched_count = matched_count

0 comments on commit 4567a30

Please sign in to comment.