/* * SPDX-License-Identifier: AGPL-3.0-only * Copyright (c) 2022-2024, daeuniverse Organization */ package consts import ( "strconv" "strings" internal "github.com/daeuniverse/dae/pkg/ebpf_internal" ) const ( BpfPinRoot = "/sys/fs/bpf" TaskCommLen = 16 ) type ParamKey uint32 const ( ZeroKey ParamKey = iota BigEndianTproxyPortKey DisableL4TxChecksumKey DisableL4RxChecksumKey ControlPlanePidKey ControlPlaneNatDirectKey ControlPlaneDnsRoutingKey OneKey ParamKey = 1 ) type DisableL4ChecksumPolicy uint32 const ( DisableL4ChecksumPolicy_EnableL4Checksum DisableL4ChecksumPolicy = iota DisableL4ChecksumPolicy_Restore DisableL4ChecksumPolicy_SetZero ) type MatchType uint8 const ( MatchType_DomainSet MatchType = iota MatchType_IpSet MatchType_SourceIpSet MatchType_Port MatchType_SourcePort MatchType_L4Proto MatchType_IpVersion MatchType_Mac MatchType_ProcessName MatchType_Dscp MatchType_Fallback MatchType_MustRules MatchType_Upstream MatchType_QType ) type OutboundIndex uint8 const ( OutboundDirect OutboundIndex = iota OutboundBlock OutboundUserDefinedMin OutboundMustRules OutboundIndex = 0xFC OutboundControlPlaneRouting OutboundIndex = 0xFD OutboundLogicalOr OutboundIndex = 0xFE OutboundLogicalAnd OutboundIndex = 0xFF OutboundLogicalMask OutboundIndex = 0xFE OutboundUserDefinedMax = OutboundMustRules - 1 ) func (i OutboundIndex) String() string { switch i { case OutboundMustRules: return "must_rules" case OutboundDirect: return "direct" case OutboundBlock: return "block" case OutboundControlPlaneRouting: return "" case OutboundLogicalOr: return "" case OutboundLogicalAnd: return "" default: return "" } } func (i OutboundIndex) IsReserved() bool { return !strings.HasPrefix(i.String(), "