Files
airstream/frametypes/base.py

29 lines
801 B
Python
Raw Permalink Normal View History

2025-08-03 20:20:55 -04:00
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