PcapFileEx.Endpoint (pcap_file_ex v0.1.5)

View Source

Represents a network endpoint (IP + optional port).

ip is stored as a string (IPv4 or IPv6) and port is either an integer or nil.

Summary

Functions

Builds a new endpoint ensuring the IP is a string.

Formats the endpoint as "ip:port" when a port is present, otherwise just the IP.

Types

t()

@type t() :: %PcapFileEx.Endpoint{ip: String.t(), port: non_neg_integer() | nil}

Functions

new(ip, port \\ nil)

@spec new(String.t(), non_neg_integer() | nil) :: t()

Builds a new endpoint ensuring the IP is a string.

to_string(arg1)

@spec to_string(t() | nil) :: String.t() | nil

Formats the endpoint as "ip:port" when a port is present, otherwise just the IP.