guid.c revision efaa1272c1b682bc2e105b2f374152a6a1f45825
/* Copyright (c) 2011-2014 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "buffer.h"
#include "sha1.h"
#include "hash.h"
#include "hex-binary.h"
#include "hostpid.h"
#include "guid.h"
#include <unistd.h>
#include <time.h>
const char *guid_generate(void)
{
static unsigned int pid = 0;
/* we'll use the current time in nanoseconds as the initial 64bit
counter. */
i_fatal("clock_gettime() failed: %m");
} else {
}
return t_strdup_printf("%04x%04lx%04x%s",
pid, my_hostname);
}
void guid_128_host_hash_get(const char *host,
unsigned char hash_r[GUID_128_HOST_HASH_SIZE])
{
unsigned char full_hash[SHA1_RESULTLEN];
}
{
#if GUID_128_HOST_HASH_SIZE != 4
#endif
/* we'll use the current time in nanoseconds as the initial 64bit
counter. */
i_fatal("clock_gettime() failed: %m");
} else {
}
}
{
unsigned int i;
for (i = 0; i < GUID_128_SIZE; i++) {
if (guid[i] != 0)
return FALSE;
}
return TRUE;
}
{
}
{
}
{
}
{
}
{
}