PcapFileEx.Endpoint (pcap_file_ex v0.1.5)
View SourceRepresents 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
@type t() :: %PcapFileEx.Endpoint{ip: String.t(), port: non_neg_integer() | nil}
Functions
@spec new(String.t(), non_neg_integer() | nil) :: t()
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.