mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-09 11:51:02 -05:00
156 lines
6.5 KiB
Go
156 lines
6.5 KiB
Go
package domainsocket
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// Flag Array
|
|
type DomainSocketSecurityMode int32
|
|
|
|
const (
|
|
DomainSocketSecurityMode_Danger DomainSocketSecurityMode = 0
|
|
// Verfify is Dialer have a pid or ppid match pid file
|
|
DomainSocketSecurityMode_VerifyPid DomainSocketSecurityMode = 1
|
|
// Do not tolerance ppid match
|
|
DomainSocketSecurityMode_DisqualifyPPIDMatch DomainSocketSecurityMode = 2
|
|
// Enforce Uid Verify On euid
|
|
DomainSocketSecurityMode_VerifyEUID DomainSocketSecurityMode = 4
|
|
// Enforce Uid Verify On ruid
|
|
DomainSocketSecurityMode_VerifyRUID DomainSocketSecurityMode = 8
|
|
// Does not allow same user exception
|
|
DomainSocketSecurityMode_DisqualifySameUser DomainSocketSecurityMode = 16
|
|
// Does not allow root user exception
|
|
DomainSocketSecurityMode_DisqualifyRootUser DomainSocketSecurityMode = 32
|
|
)
|
|
|
|
var DomainSocketSecurityMode_name = map[int32]string{
|
|
0: "Danger",
|
|
1: "VerifyPid",
|
|
2: "DisqualifyPPIDMatch",
|
|
4: "VerifyEUID",
|
|
8: "VerifyRUID",
|
|
16: "DisqualifySameUser",
|
|
32: "DisqualifyRootUser",
|
|
}
|
|
var DomainSocketSecurityMode_value = map[string]int32{
|
|
"Danger": 0,
|
|
"VerifyPid": 1,
|
|
"DisqualifyPPIDMatch": 2,
|
|
"VerifyEUID": 4,
|
|
"VerifyRUID": 8,
|
|
"DisqualifySameUser": 16,
|
|
"DisqualifyRootUser": 32,
|
|
}
|
|
|
|
func (x DomainSocketSecurityMode) String() string {
|
|
return proto.EnumName(DomainSocketSecurityMode_name, int32(x))
|
|
}
|
|
func (DomainSocketSecurityMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
type DomainSocketSecurity struct {
|
|
// Flag Array Type, User can set an integer to define various configure
|
|
Mode DomainSocketSecurityMode `protobuf:"varint,1,opt,name=Mode,enum=v2ray.core.internet.domainsocket.DomainSocketSecurityMode" json:"Mode,omitempty"`
|
|
// Set pid files to be allowed
|
|
AllowedPid []string `protobuf:"bytes,2,rep,name=AllowedPid" json:"AllowedPid,omitempty"`
|
|
// Set uids to be allowed, either euid or ruid should match one of following
|
|
// uids AllowedUid, or user that v2ray is running or root.
|
|
AllowedUid []uint64 `protobuf:"varint,3,rep,packed,name=AllowedUid" json:"AllowedUid,omitempty"`
|
|
}
|
|
|
|
func (m *DomainSocketSecurity) Reset() { *m = DomainSocketSecurity{} }
|
|
func (m *DomainSocketSecurity) String() string { return proto.CompactTextString(m) }
|
|
func (*DomainSocketSecurity) ProtoMessage() {}
|
|
func (*DomainSocketSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
func (m *DomainSocketSecurity) GetMode() DomainSocketSecurityMode {
|
|
if m != nil {
|
|
return m.Mode
|
|
}
|
|
return DomainSocketSecurityMode_Danger
|
|
}
|
|
|
|
func (m *DomainSocketSecurity) GetAllowedPid() []string {
|
|
if m != nil {
|
|
return m.AllowedPid
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *DomainSocketSecurity) GetAllowedUid() []uint64 {
|
|
if m != nil {
|
|
return m.AllowedUid
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DomainSocketSettings struct {
|
|
// Path we should listen/dial
|
|
Path string `protobuf:"bytes,1,opt,name=Path" json:"Path,omitempty"`
|
|
Security *DomainSocketSecurity `protobuf:"bytes,2,opt,name=Security" json:"Security,omitempty"`
|
|
}
|
|
|
|
func (m *DomainSocketSettings) Reset() { *m = DomainSocketSettings{} }
|
|
func (m *DomainSocketSettings) String() string { return proto.CompactTextString(m) }
|
|
func (*DomainSocketSettings) ProtoMessage() {}
|
|
func (*DomainSocketSettings) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *DomainSocketSettings) GetPath() string {
|
|
if m != nil {
|
|
return m.Path
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *DomainSocketSettings) GetSecurity() *DomainSocketSecurity {
|
|
if m != nil {
|
|
return m.Security
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*DomainSocketSecurity)(nil), "v2ray.core.internet.domainsocket.DomainSocketSecurity")
|
|
proto.RegisterType((*DomainSocketSettings)(nil), "v2ray.core.internet.domainsocket.DomainSocketSettings")
|
|
proto.RegisterEnum("v2ray.core.internet.domainsocket.DomainSocketSecurityMode", DomainSocketSecurityMode_name, DomainSocketSecurityMode_value)
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("v2ray.com/core/transport/internet/domainsocket/config.proto", fileDescriptor0)
|
|
}
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 323 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0x4b, 0xf3, 0x40,
|
|
0x10, 0x86, 0xbf, 0xb4, 0xa1, 0xb4, 0xf3, 0x69, 0x09, 0xab, 0x68, 0x4e, 0x12, 0x7a, 0x0a, 0x1e,
|
|
0x12, 0xa8, 0xe0, 0x41, 0x4f, 0x4a, 0x3c, 0xf4, 0x50, 0x09, 0x5b, 0xea, 0xc1, 0xdb, 0x9a, 0xdd,
|
|
0xb6, 0x8b, 0xed, 0x4e, 0xdd, 0x4c, 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