# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: xcapi/xray/app/proxyman/config.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
from xcapi.xray.common.net.port_pb import PortList
from xcapi.xray.common.net.address_pb import IPOrDomain
from xcapi.xray.transport.internet.config_pb import StreamConfig, ProxyConfig
from xcapi.xray.common.serial.typed_message_pb import TypedMessage
from xcapi.model import ClassMeta
from typing import Optional, List
from dataclasses import dataclass
from enum import Enum


@dataclass
class InboundConfig(ClassMeta):
    pass


@dataclass
class AllocationStrategy(ClassMeta):
    class Type(Enum):
        Always: int = 0
        """Always allocate all connection handlers."""
        Random: int = 1
        """Randomly allocate specific range of handlers."""
        External: int = 2
        """External. Not supported yet."""

    type: Optional[Type] = None

    @dataclass
    class AllocationStrategyConcurrency(ClassMeta):
        value: Optional[int] = None

    concurrency: Optional[AllocationStrategyConcurrency] = None
    """Number of handlers (ports) running in parallel.Default value is 3 if unset."""

    @dataclass
    class AllocationStrategyRefresh(ClassMeta):
        value: Optional[int] = None

    refresh: Optional[AllocationStrategyRefresh] = None
    """Number of minutes before a handler is regenerated.Default value is 5 if unset."""


@dataclass
class SniffingConfig(ClassMeta):
    enabled: Optional[bool] = None
    """Whether or not to enable content sniffing on an inbound connection."""
    destination_override: Optional[List[str]] = None
    """
    Override target destination if sniff'ed protocol is in the given list.
    Supported values are "http", "tls", "fakedns".
    """
    domains_excluded: Optional[List[str]] = None
    metadata_only: Optional[bool] = None
    """
    Whether should only try to sniff metadata without waiting for client input.
    Can be used to support SMTP like protocol where server send the first message.
    """
    route_only: Optional[bool] = None


@dataclass
class ReceiverConfig(ClassMeta):
    port_list: Optional[PortList] = None
    """PortList specifies the ports which the Receiver should listen on."""
    listen: Optional[IPOrDomain] = None
    """Listen specifies the IP address that the Receiver should listen on."""
    allocation_strategy: Optional[AllocationStrategy] = None
    stream_settings: Optional[StreamConfig] = None
    receive_original_destination: Optional[bool] = None
    sniffing_settings: Optional[SniffingConfig] = None


@dataclass
class InboundHandlerConfig(ClassMeta):
    tag: Optional[str] = None
    receiver_settings: Optional[TypedMessage] = None
    proxy_settings: Optional[TypedMessage] = None


@dataclass
class OutboundConfig(ClassMeta):
    pass


@dataclass
class MultiplexingConfig(ClassMeta):
    enabled: Optional[bool] = None
    """Whether or not Mux is enabled."""
    concurrency: Optional[int] = None
    """Max number of concurrent connections that one Mux connection can handle."""
    xudpConcurrency: Optional[int] = None
    """Transport XUDP in another Mux."""
    xudpProxyUDP443: Optional[str] = None
    """"reject" (default), "allow" or "skip"."""


@dataclass
class SenderConfig(ClassMeta):
    via: Optional[IPOrDomain] = None
    """Send traffic through the given IP. Only IP is allowed."""
    stream_settings: Optional[StreamConfig] = None
    proxy_settings: Optional[ProxyConfig] = None
    multiplex_settings: Optional[MultiplexingConfig] = None
    via_cidr: Optional[str] = None


_sym_db = _symbol_database.Default()

DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
    b'\n$xcapi/xray/app/proxyman/config.proto\x12\x11xray.app.proxyman\x1a#xcapi/xray/common/net/address.proto\x1a xcapi/xray/common/net/port.proto\x1a*xcapi/xray/transport/internet/config.proto\x1a,xcapi/xray/common/serial/typed_message.proto\"\x0f\n\rInboundConfig\"\x84\x03\n\x12\x41llocationStrategy\x12\x38\n\x04type\x18\x01 \x01(\x0e\x32*.xray.app.proxyman.AllocationStrategy.Type\x12X\n\x0b\x63oncurrency\x18\x02 \x01(\x0b\x32\x43.xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency\x12P\n\x07refresh\x18\x03 \x01(\x0b\x32?.xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh\x1a.\n\x1d\x41llocationStrategyConcurrency\x12\r\n\x05value\x18\x01 \x01(\r\x1a*\n\x19\x41llocationStrategyRefresh\x12\r\n\x05value\x18\x01 \x01(\r\",\n\x04Type\x12\n\n\x06\x41lways\x10\x00\x12\n\n\x06Random\x10\x01\x12\x0c\n\x08\x45xternal\x10\x02\"\x84\x01\n\x0eSniffingConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x1c\n\x14\x64\x65stination_override\x18\x02 \x03(\t\x12\x18\n\x10\x64omains_excluded\x18\x03 \x03(\t\x12\x15\n\rmetadata_only\x18\x04 \x01(\x08\x12\x12\n\nroute_only\x18\x05 \x01(\x08\"\xd9\x02\n\x0eReceiverConfig\x12,\n\tport_list\x18\x01 \x01(\x0b\x32\x19.xray.common.net.PortList\x12+\n\x06listen\x18\x02 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x42\n\x13\x61llocation_strategy\x18\x03 \x01(\x0b\x32%.xray.app.proxyman.AllocationStrategy\x12>\n\x0fstream_settings\x18\x04 \x01(\x0b\x32%.xray.transport.internet.StreamConfig\x12$\n\x1creceive_original_destination\x18\x05 \x01(\x08\x12<\n\x11sniffing_settings\x18\x07 \x01(\x0b\x32!.xray.app.proxyman.SniffingConfigJ\x04\x08\x06\x10\x07\"\x9a\x01\n\x14InboundHandlerConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12;\n\x11receiver_settings\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x38\n\x0eproxy_settings\x18\x03 \x01(\x0b\x32 .xray.common.serial.TypedMessage\"\x10\n\x0eOutboundConfig\"\x8b\x02\n\x0cSenderConfig\x12(\n\x03via\x18\x01 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12>\n\x0fstream_settings\x18\x02 \x01(\x0b\x32%.xray.transport.internet.StreamConfig\x12<\n\x0eproxy_settings\x18\x03 \x01(\x0b\x32$.xray.transport.internet.ProxyConfig\x12\x41\n\x12multiplex_settings\x18\x04 \x01(\x0b\x32%.xray.app.proxyman.MultiplexingConfig\x12\x10\n\x08via_cidr\x18\x05 \x01(\t\"l\n\x12MultiplexingConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x13\n\x0b\x63oncurrency\x18\x02 \x01(\x05\x12\x17\n\x0fxudpConcurrency\x18\x03 \x01(\x05\x12\x17\n\x0fxudpProxyUDP443\x18\x04 \x01(\tb\x06proto3')

_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xcapi.xray.app.proxyman.config_pb', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
    DESCRIPTOR._loaded_options = None
    _globals['_INBOUNDCONFIG']._serialized_start = 220
    _globals['_INBOUNDCONFIG']._serialized_end = 235
    _globals['_ALLOCATIONSTRATEGY']._serialized_start = 238
    _globals['_ALLOCATIONSTRATEGY']._serialized_end = 626
    _globals['_ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYCONCURRENCY']._serialized_start = 490
    _globals['_ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYCONCURRENCY']._serialized_end = 536
    _globals['_ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYREFRESH']._serialized_start = 538
    _globals['_ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYREFRESH']._serialized_end = 580
    _globals['_ALLOCATIONSTRATEGY_TYPE']._serialized_start = 582
    _globals['_ALLOCATIONSTRATEGY_TYPE']._serialized_end = 626
    _globals['_SNIFFINGCONFIG']._serialized_start = 629
    _globals['_SNIFFINGCONFIG']._serialized_end = 761
    _globals['_RECEIVERCONFIG']._serialized_start = 764
    _globals['_RECEIVERCONFIG']._serialized_end = 1109
    _globals['_INBOUNDHANDLERCONFIG']._serialized_start = 1112
    _globals['_INBOUNDHANDLERCONFIG']._serialized_end = 1266
    _globals['_OUTBOUNDCONFIG']._serialized_start = 1268
    _globals['_OUTBOUNDCONFIG']._serialized_end = 1284
    _globals['_SENDERCONFIG']._serialized_start = 1287
    _globals['_SENDERCONFIG']._serialized_end = 1554
    _globals['_MULTIPLEXINGCONFIG']._serialized_start = 1556
    _globals['_MULTIPLEXINGCONFIG']._serialized_end = 1664
