]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/hostname-util.h
Merge pull request #653 from dvdhrm/bus-gold
[thirdparty/systemd.git] / src / basic / hostname-util.h
CommitLineData
958b66ea
LP
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2010-2015 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22#include <stdbool.h>
23
24#include "macro.h"
25
26bool hostname_is_set(void);
27
28char* gethostname_malloc(void);
8e1ad1ea 29int gethostname_strict(char **ret);
958b66ea 30
b59abc4d 31bool hostname_is_valid(const char *s, bool allow_trailing_dot) _pure_;
ae691c1d 32char* hostname_cleanup(char *s);
958b66ea 33
25300b5a
LP
34#define machine_name_is_valid(s) hostname_is_valid(s, false)
35
958b66ea 36bool is_localhost(const char *hostname);
46a5e0e7 37bool is_gateway_hostname(const char *hostname);
958b66ea
LP
38
39int sethostname_idempotent(const char *s);
139e5336
MP
40
41int read_hostname_config(const char *path, char **hostname);