go-udap

interfaces

List network interfaces usable for discovery

go-udap interfaces [--format text|json|csv | --json]

What it does

Lists every local network interface that's usable for UDAP discovery. Filter applied: Up + Broadcast + !Loopback + has IPv4 address. The output gives you the NAME values you can pass to --bind-interface.

Output

The default text format is a fixed-column table:

NAME            INDEX  ADDRESS            BROADCAST
en0             14     192.168.1.118      192.168.1.255
en7             31     192.168.1.226      192.168.1.255

The BROADCAST column is the subnet's directed-broadcast address. It's informational only — UDAP discovery sends to limited broadcast 255.255.255.255 regardless (see How UDAP discovery works for the why).

With --json (or -o json), an array with one object per interface. address and broadcast are null when absent:

[{"name":"en0","index":14,"address":"192.168.1.118","broadcast":"192.168.1.255"}]

With -o csv, a header row and one row per interface. A null value is an empty cell:

name,index,address,broadcast
en0,14,192.168.1.118,192.168.1.255

When no interface qualifies, stderr says no usable interfaces found and stdout is empty for text, [] for json, and the header row alone for csv.

The JSON keys and CSV columns are a stable contract: none will be removed or renamed without a major version. New ones may be added. See Output formats.

Flags

FlagDefaultDescription
--format FORMAT, -otextOutput format: text, json or csv
--jsonoffShorthand for --format json

Exit codes

  • 0 — success (even if zero interfaces qualify)
  • 1 — OS enumeration error
  • 2 — unknown or invalid flag (including a format name other than text, json or csv), --json with --format, or a stray argument

On this page