package conntrack

import "time"

// EventType represents the type of traffic event
type EventType string

const (
	EventAccept   EventType = "accept"
	EventExternal EventType = "external"
)

// TrafficEvent is the normalized event written to the log
type TrafficEvent struct {
	Timestamp    time.Time `json:"ts"`
	Peer         string    `json:"peer"`
	SrcIP        string    `json:"src_ip"`
	DstIP        string    `json:"dst_ip"`
	DstPort      uint16    `json:"dst_port"`
	Proto        string    `json:"proto"`
	BytesOrig    uint64    `json:"bytes_orig"`
	BytesReply   uint64    `json:"bytes_reply"`
	PacketsOrig  uint64    `json:"packets_orig"`
	PacketsReply uint64    `json:"packets_reply"`
	DurationSec  float64   `json:"duration_sec"`
	Service      string    `json:"service,omitempty"`
	Event        EventType `json:"event"`
	External     bool      `json:"external"`
}