first working
This commit is contained in:
29
frametypes/base.py
Normal file
29
frametypes/base.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict, List, Any
|
||||
from scapy.all import Packet
|
||||
|
||||
|
||||
class FrameTypeInterface(ABC):
|
||||
def __init__(self):
|
||||
self.name: str = ""
|
||||
self.frames_list = []
|
||||
self.bytes = 0
|
||||
|
||||
def get_name(self):
|
||||
"""Return the interface's name"""
|
||||
return self.name
|
||||
|
||||
@abstractmethod
|
||||
def add(self, timestamp: float, size: int, packet: Packet):
|
||||
"""Add a packet to the statistics."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_summary_dict(self) -> Dict[str, Any]:
|
||||
"""Return a dictionary of statistics for the tabular report."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_column_definitions(self) -> List[tuple]:
|
||||
"""Return column definitions as [(column_name, format_spec), ...]"""
|
||||
pass
|
||||
Reference in New Issue
Block a user