These are environment variables expected in `process::initialize`. All these flags should be loaded with the prefix "LIBPROCESS_".
| 174 | // These are environment variables expected in `process::initialize`. |
| 175 | // All these flags should be loaded with the prefix "LIBPROCESS_". |
| 176 | struct Flags : public virtual flags::FlagsBase |
| 177 | { |
| 178 | Flags() |
| 179 | { |
| 180 | add(&Flags::ip, |
| 181 | "ip", |
| 182 | "The IP address for communication to and from libprocess.\n" |
| 183 | "If not specified, libprocess will attempt to reverse-DNS lookup\n" |
| 184 | "the hostname and use that IP instead.", |
| 185 | [](const Option<net::IP>& ip) -> Option<Error> { |
| 186 | if (ip.isSome() && ip->family() != AF_INET) { |
| 187 | return Error( |
| 188 | "Currently we allow only IPv4 address to be specified " |
| 189 | "with the `--ip` flag"); |
| 190 | } |
| 191 | |
| 192 | return None(); |
| 193 | }); |
| 194 | |
| 195 | add(&Flags::ip6, |
| 196 | "ip6", |
| 197 | "The IPv6 address that `libprocess` will use in future to perform " |
| 198 | "communication of IPv6 sockets.\n"); |
| 199 | |
| 200 | add(&Flags::advertise_ip, |
| 201 | "advertise_ip", |
| 202 | "The IP address that will be advertised to the outside world\n" |
| 203 | "for communication to and from libprocess. This is useful,\n" |
| 204 | "for example, for containerized tasks in which communication\n" |
| 205 | "is bound locally to a non-public IP that will be inaccessible\n" |
| 206 | "to the master."); |
| 207 | |
| 208 | add(&Flags::port, |
| 209 | "port", |
| 210 | "The port for communication to and from libprocess.\n" |
| 211 | "If not specified or set to 0, libprocess will bind it to a random\n" |
| 212 | "available port.", |
| 213 | [](const Option<int>& value) -> Option<Error> { |
| 214 | if (value.isSome()) { |
| 215 | if (value.get() < 0 || value.get() > USHRT_MAX) { |
| 216 | return Error( |
| 217 | "LIBPROCESS_PORT=" + stringify(value.get()) + |
| 218 | " is not a valid port"); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | return None(); |
| 223 | }); |
| 224 | |
| 225 | add(&Flags::advertise_port, |
| 226 | "advertise_port", |
| 227 | "The port that will be advertised to the outside world\n" |
| 228 | "for communication to and from libprocess. NOTE: This port\n" |
| 229 | "will not actually be bound (only the local '--port' will be), so\n" |
| 230 | "redirection to the local IP and port must be provided separately.", |
| 231 | [](const Option<int>& value) -> Option<Error> { |
| 232 | if (value.isSome()) { |
| 233 | if (value.get() <= 0 || value.get() > USHRT_MAX) { |
no outgoing calls
no test coverage detected