# Path: telethon/_network/transports/transport.py
# class Transport(abc.ABC):
#     # Should return a newly-created instance of itself
#     @abc.abstractmethod
#     def recreate_fresh(self):
#         pass
# 
#     @abc.abstractmethod
#     def pack(self, input: bytes) -> bytes:
#         pass
# 
#     # Should raise EOFError if it does not have enough bytes
#     @abc.abstractmethod
#     def unpack(self, input: bytes) -> (int, bytes):
#         pass


from .transport import Transport
from zlib import crc32
import struct


class Full(Transport):
    def __init__(self):
        self._send_counter = 0
        self._recv_counter = 0

    def recreate_fresh(self):
        return type(self)()

    def pack(self, input: bytes) -> bytes:
        # https://core.telegram.org/mtproto#tcp-transport
        length = len(input) + 12

# Path: telethon/_network/transports/transport.py
# class Transport(abc.ABC):
#     # Should return a newly-created instance of itself
#     @abc.abstractmethod
#     def recreate_fresh(self):
#         pass
# 
#     @abc.abstractmethod
#     def pack(self, input: bytes) -> bytes:
#         pass
# 
#     # Should raise EOFError if it does not have enough bytes
#     @abc.abstractmethod
#     def unpack(self, input: bytes) -> (int, bytes):
#         pass


# Path: telethon/_network/transports/full.py
from .transport import Transport
from zlib import crc32
import struct



class Full(Transport):
    def __init__(self):
        self._send_counter = 0
        self._recv_counter = 0

    def recreate_fresh(self):
        return type(self)()

    def pack(self, input: bytes) -> bytes:
        # https://core.telegram.org/mtproto#tcp-transport
        length = len(input) + 12

        data = struct.pack('<ii', length, self._send_counter) + input