Skip to content

Modify NetAddress Enum naming #2358

Closed
@yanganto

Description

@yanganto

Hi there,

I have a proposal.

IPv4 socket addresses consist of an IPv4 address and a 16-bit port number, as stated in IETF RFC 793

It may be good to use SocketV4 and SocketV6 here, and also the same naming in Rust std SocketAddr

pub enum NetAddress {
/// An IPv4 address/port on which the peer is listening.
IPv4 {
/// The 4-byte IPv4 address
addr: [u8; 4],
/// The port on which the node is listening
port: u16,
},
/// An IPv6 address/port on which the peer is listening.
IPv6 {
/// The 16-byte IPv6 address
addr: [u8; 16],
/// The port on which the node is listening
port: u16,
},

If this proposal is good, I am happy to do this and also #2183, #2056 at the same time. Some these are implemented in our project.
https://github.com/kuutamolabs/lightning-knd/blob/e5f05755be1c702c56b469964c7d9586bce15e5d/api/src/lib.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions