20 lines
569 B
Python
20 lines
569 B
Python
import json
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
|
|
class Metadata:
|
|
def __init__(self, name):
|
|
self.device = name
|
|
self.timestamp = datetime.now().timestamp()
|
|
self.capture_id = uuid.uuid4().hex
|
|
self.capture_mode = ... # TODO: eg. promiscuous/monitor/other
|
|
self.host_ip = ...
|
|
self.host_mac = ...
|
|
self.protocol = ...
|
|
|
|
|
|
def create_metadata(filename, unique_id, device_details):
|
|
date_string = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
|
meta_filename = f"meta_{date_string}_{unique_id}.json"
|