bacure.network

get-any-ip

(get-any-ip)
Return the first IPv4 found.

get-broadcast-address

(get-broadcast-address local-ip)
Given a local-ip, return the broadcast address

get-broadcast-address-of-interface

(get-broadcast-address-of-interface interface)

get-interface-from-ip

(get-interface-from-ip ip)
Given an IP address, return the interface.

get-interfaces

(get-interfaces)
Return the list of interfaces on this machine.

interfaces-and-ips

(interfaces-and-ips)
Return a list of interfaces and their IPs.
({:interface "wlan0", :ips ("192.168.0.2")})

ip-network-builder

(ip-network-builder {:keys [broadcast-address local-address local-network-number port reuse-address], :or {reuse-address true, local-network-number 0, local-address IpNetwork/DEFAULT_BIND_IP, port IpNetwork/DEFAULT_PORT}, :as args})
Return an IP network object.

ipv4-from-interface

(ipv4-from-interface interface)
Return a list of available IPs from the interface. Remove any
loopback address.

As BACnet doesn't support IPv6 yet, just keep IPv4.

resolve-dns

(resolve-dns IP-or-url)
Return the IP of a given url, or simply return the IP unchanged

to-bytes

(to-bytes IP-or-url)