# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: transport/internet/kcp/config.proto
# plugin: python-betterproto2
# This file has been @generated

__all__ = (
    "Config",
    "ConnectionReuse",
    "DownlinkCapacity",
    "EncryptionSeed",
    "Mtu",
    "ReadBuffer",
    "Tti",
    "UplinkCapacity",
    "WriteBuffer",
)

from dataclasses import dataclass

import betterproto2

from .....message_pool import default_message_pool

betterproto2.check_compiler_version("0.5.1")


@dataclass(eq=False, repr=False)
class Config(betterproto2.Message):
    mtu: "Mtu | None" = betterproto2.field(1, betterproto2.TYPE_MESSAGE, optional=True)

    tti: "Tti | None" = betterproto2.field(2, betterproto2.TYPE_MESSAGE, optional=True)

    uplink_capacity: "UplinkCapacity | None" = betterproto2.field(
        3, betterproto2.TYPE_MESSAGE, optional=True
    )

    downlink_capacity: "DownlinkCapacity | None" = betterproto2.field(
        4, betterproto2.TYPE_MESSAGE, optional=True
    )

    congestion: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL)

    write_buffer: "WriteBuffer | None" = betterproto2.field(
        6, betterproto2.TYPE_MESSAGE, optional=True
    )

    read_buffer: "ReadBuffer | None" = betterproto2.field(
        7, betterproto2.TYPE_MESSAGE, optional=True
    )

    header_config: "___common__serial__.TypedMessage | None" = betterproto2.field(
        8, betterproto2.TYPE_MESSAGE, optional=True
    )

    seed: "EncryptionSeed | None" = betterproto2.field(
        10, betterproto2.TYPE_MESSAGE, optional=True
    )


default_message_pool.register_message("xray.transport.internet.kcp", "Config", Config)


@dataclass(eq=False, repr=False)
class ConnectionReuse(betterproto2.Message):
    enable: "bool" = betterproto2.field(1, betterproto2.TYPE_BOOL)


default_message_pool.register_message(
    "xray.transport.internet.kcp", "ConnectionReuse", ConnectionReuse
)


@dataclass(eq=False, repr=False)
class DownlinkCapacity(betterproto2.Message):
    """
    Downlink capacity, in MB.
    """

    value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)


default_message_pool.register_message(
    "xray.transport.internet.kcp", "DownlinkCapacity", DownlinkCapacity
)


@dataclass(eq=False, repr=False)
class EncryptionSeed(betterproto2.Message):
    """
    Pre-shared secret between client and server. It is used for traffic obfuscation.
    Note that if seed is absent in the config, the traffic will still be obfuscated,
    but by a predefined algorithm.
    """

    seed: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)


default_message_pool.register_message(
    "xray.transport.internet.kcp", "EncryptionSeed", EncryptionSeed
)


@dataclass(eq=False, repr=False)
class Mtu(betterproto2.Message):
    """
    Maximum Transmission Unit, in bytes.
    """

    value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)


default_message_pool.register_message("xray.transport.internet.kcp", "MTU", Mtu)


@dataclass(eq=False, repr=False)
class ReadBuffer(betterproto2.Message):
    size: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)
    """
    Buffer size in bytes.
    """


default_message_pool.register_message(
    "xray.transport.internet.kcp", "ReadBuffer", ReadBuffer
)


@dataclass(eq=False, repr=False)
class Tti(betterproto2.Message):
    """
    Transmission Time Interview, in milli-sec.
    """

    value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)


default_message_pool.register_message("xray.transport.internet.kcp", "TTI", Tti)


@dataclass(eq=False, repr=False)
class UplinkCapacity(betterproto2.Message):
    """
    Uplink capacity, in MB.
    """

    value: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)


default_message_pool.register_message(
    "xray.transport.internet.kcp", "UplinkCapacity", UplinkCapacity
)


@dataclass(eq=False, repr=False)
class WriteBuffer(betterproto2.Message):
    size: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)
    """
    Buffer size in bytes.
    """


default_message_pool.register_message(
    "xray.transport.internet.kcp", "WriteBuffer", WriteBuffer
)


from ....common import serial as ___common__serial__
