foxygit / GZDoom Log in
commits tags

/src/net/webjoin/wj_lanip.h · 620 B

raw
// wj_lanip.h -- enumerate this machine's local (private-range) IPv4
// addresses, so we can embed a reachable http://<ip>:<port>/ URL in the
// join QR code. Neither GZDoom/LZDoom nor civetweb do this today.
#pragma once

#include <string>
#include <vector>

// Returns all private-range IPv4 addresses (RFC1918: 10.0.0.0/8,
// 172.16.0.0/12, 192.168.0.0/16) found on non-loopback, up, running
// interfaces, as dotted-quad strings. Empty if none found (e.g. no
// network connection) -- callers should fall back to telling the user
// to enter an address manually.
std::vector<std::string> WJ_GetLocalIPv4Addresses();