2 Unix SMB/CIFS implementation.
3 Samba utility functions
4 Copyright (C) Andrew Bartlett 2011
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __LIB_UTIL_SERVER_ID_H__
21 #define __LIB_UTIL_SERVER_ID_H__
27 struct server_id_buf
{ char buf
[48]; }; /* probably a bit too large ... */
29 bool server_id_same_process(const struct server_id
*p1
,
30 const struct server_id
*p2
);
31 bool server_id_equal(const struct server_id
*p1
, const struct server_id
*p2
);
32 char *server_id_str_buf(struct server_id id
, struct server_id_buf
*dst
);
33 size_t server_id_str_buf_unique(struct server_id id
, char *buf
, size_t buflen
);
35 struct server_id
server_id_from_string(uint32_t local_vnn
,
36 const char *pid_string
);
39 * Set the serverid to the special value that represents a disconnected
40 * client for (e.g.) durable handles.
42 void server_id_set_disconnected(struct server_id
*id
);
45 * check whether a serverid is the special placeholder for
46 * a disconnected client
48 bool server_id_is_disconnected(const struct server_id
*id
);
50 #define SERVER_ID_BUF_LENGTH 24
51 void server_id_put(uint8_t buf
[SERVER_ID_BUF_LENGTH
],
52 const struct server_id id
);
53 void server_id_get(struct server_id
*id
,
54 const uint8_t buf
[SERVER_ID_BUF_LENGTH
]);