/* * SPDX-License-Identifier: AGPL-3.0-only * Copyright (c) 2022-2023, v2rayA Organization */ package consts import ( internal "github.com/v2rayA/dae/pkg/ebpf_internal" "strconv" "strings" ) const ( AppName = "dae" BpfPinRoot = "/sys/fs/bpf" AddrHdrSize = 20 TaskCommLen = 16 ) type ParamKey uint32 const ( ZeroKey ParamKey = iota BigEndianTproxyPortKey DisableL4TxChecksumKey DisableL4RxChecksumKey ControlPlanePidKey ControlPlaneNatDirectKey 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_Fallback ) type OutboundIndex uint8 const ( OutboundDirect OutboundIndex = 0 OutboundBlock OutboundIndex = 1 OutboundMustDirect OutboundIndex = 0xFC OutboundControlPlaneDirect OutboundIndex = 0xFD OutboundLogicalOr OutboundIndex = 0xFE OutboundLogicalAnd OutboundIndex = 0xFF OutboundLogicalMask OutboundIndex = 0xFE OutboundMax = OutboundLogicalAnd OutboundUserDefinedMax = OutboundMustDirect - 1 ) func (i OutboundIndex) String() string { switch i { case OutboundDirect: return "direct" case OutboundBlock: return "block" case OutboundMustDirect: return "must_direct" case OutboundControlPlaneDirect: return "" case OutboundLogicalOr: return "" case OutboundLogicalAnd: return "" default: return "" } } func (i OutboundIndex) IsReserved() bool { return !strings.HasPrefix(i.String(), "