mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-10 23:20:55 +00:00
* feat: base implementation of dcutr for hole-punching * chore: removed circuit-relay imports from __init__ * feat: implemented dcutr protocol * added test suite with mock setup * Fix pre-commit hook issues in DCUtR implementation * usages of CONNECT_TYPE and SYNC_TYPE have been replaced with HolePunch.Type.CONNECT and HolePunch.Type.SYNC * added unit tests for dcutr and nat module and * added multiaddr.get_peer_id() with proper DNS address handling and fixed method signature inconsistencies * added assertions to verify DCUtR hole punch result in integration test --------- Co-authored-by: Manu Sheel Gupta <manusheel.edu@gmail.com>
55 lines
1.7 KiB
Python
55 lines
1.7 KiB
Python
"""
|
|
@generated by mypy-protobuf. Do not edit manually!
|
|
isort:skip_file
|
|
"""
|
|
|
|
import builtins
|
|
import collections.abc
|
|
import google.protobuf.descriptor
|
|
import google.protobuf.internal.containers
|
|
import google.protobuf.message
|
|
import typing
|
|
|
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
|
|
@typing.final
|
|
class HolePunch(google.protobuf.message.Message):
|
|
"""HolePunch message for the DCUtR protocol."""
|
|
|
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
|
|
class Type(builtins.int):
|
|
"""Message types for HolePunch"""
|
|
@builtins.classmethod
|
|
def Name(cls, number: builtins.int) -> builtins.str: ...
|
|
@builtins.classmethod
|
|
def Value(cls, name: builtins.str) -> 'HolePunch.Type': ...
|
|
@builtins.classmethod
|
|
def keys(cls) -> typing.List[builtins.str]: ...
|
|
@builtins.classmethod
|
|
def values(cls) -> typing.List['HolePunch.Type']: ...
|
|
@builtins.classmethod
|
|
def items(cls) -> typing.List[typing.Tuple[builtins.str, 'HolePunch.Type']]: ...
|
|
|
|
CONNECT: HolePunch.Type # 100
|
|
SYNC: HolePunch.Type # 300
|
|
|
|
TYPE_FIELD_NUMBER: builtins.int
|
|
OBSADDRS_FIELD_NUMBER: builtins.int
|
|
type: HolePunch.Type
|
|
|
|
@property
|
|
def ObsAddrs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ...
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
type: HolePunch.Type = ...,
|
|
ObsAddrs: collections.abc.Iterable[builtins.bytes] = ...,
|
|
) -> None: ...
|
|
|
|
def HasField(self, field_name: typing.Literal["type", b"type"]) -> builtins.bool: ...
|
|
def ClearField(self, field_name: typing.Literal["ObsAddrs", b"ObsAddrs", "type", b"type"]) -> None: ...
|
|
|
|
global___HolePunch = HolePunch
|