MobDev.Network (mob_dev v0.5.6)

Copy Markdown View Source

Network utilities for mob_dev.

Summary

Functions

Returns the first LAN IP from a list of IP tuples, or nil.

Returns the first LAN IPv4 address found on this machine, or nil. Skips loopback. Matches 10.x, 192.168.x, and 172.16-31.x ranges.

Returns true if the IP tuple is a private LAN address (non-loopback).

Functions

first_lan_ip(ips)

@spec first_lan_ip([:inet.ip4_address()]) :: :inet.ip4_address() | nil

Returns the first LAN IP from a list of IP tuples, or nil.

lan_ip()

@spec lan_ip() :: :inet.ip4_address() | nil

Returns the first LAN IPv4 address found on this machine, or nil. Skips loopback. Matches 10.x, 192.168.x, and 172.16-31.x ranges.

lan_ip?(arg1)

@spec lan_ip?(:inet.ip_address()) :: boolean()

Returns true if the IP tuple is a private LAN address (non-loopback).