lib/util_uuid.c

ソースコードを見る。

関数

void smb_uuid_pack (const struct GUID uu, UUID_FLAT *ptr)
void smb_uuid_unpack (const UUID_FLAT in, struct GUID *uu)
GUID smb_uuid_unpack_static (const UUID_FLAT in)
void smb_uuid_generate_random (struct GUID *uu)
char * smb_uuid_to_string (const struct GUID uu)
const char * smb_uuid_string_static (const struct GUID uu)
BOOL smb_string_to_uuid (const char *in, struct GUID *uu)


関数

void smb_uuid_pack ( const struct GUID  uu,
UUID_FLAT ptr 
)

util_uuid.c30 行で定義されています。

参照先 GUID::clock_sequuid_flat::infoGUID::nodeGUID::time_hi_and_versionGUID::time_lowGUID::time_mid.

参照元 process_logon_packet().

00031 {
00032         SIVAL(ptr->info, 0, uu.time_low);
00033         SSVAL(ptr->info, 4, uu.time_mid);
00034         SSVAL(ptr->info, 6, uu.time_hi_and_version);
00035         memcpy(ptr->info+8, uu.clock_seq, 2);
00036         memcpy(ptr->info+10, uu.node, 6);
00037 }

void smb_uuid_unpack ( const UUID_FLAT  in,
struct GUID uu 
)

util_uuid.c39 行で定義されています。

参照先 GUID::clock_sequuid_flat::infoGUID::nodeGUID::time_hi_and_versionGUID::time_lowGUID::time_mid.

参照元 ads_pull_guid()smb_uuid_generate_random()smb_uuid_unpack_static().

00040 {
00041         uu->time_low = IVAL(in.info, 0);
00042         uu->time_mid = SVAL(in.info, 4);
00043         uu->time_hi_and_version = SVAL(in.info, 6);
00044         memcpy(uu->clock_seq, in.info+8, 2);
00045         memcpy(uu->node, in.info+10, 6);
00046 }

struct GUID smb_uuid_unpack_static ( const UUID_FLAT  in  ) 

util_uuid.c48 行で定義されています。

参照先 smb_uuid_unpack().

参照元 dump_guid()net_ads_cldap_netlogon().

00049 {
00050         static struct GUID uu;
00051 
00052         smb_uuid_unpack(in, &uu);
00053         return uu;
00054 }

void smb_uuid_generate_random ( struct GUID uu  ) 

util_uuid.c56 行で定義されています。

参照先 GUID::clock_seqgenerate_random_buffer()uuid_flat::infosmb_uuid_unpack()GUID::time_hi_and_version.

参照元 secrets_fetch_domain_guid().

00057 {
00058         UUID_FLAT tmp;
00059 
00060         generate_random_buffer(tmp.info, sizeof(tmp.info));
00061         smb_uuid_unpack(tmp, uu);
00062 
00063         uu->clock_seq[0] = (uu->clock_seq[0] & 0x3F) | 0x80;
00064         uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
00065 }

char* smb_uuid_to_string ( const struct GUID  uu  ) 

util_uuid.c67 行で定義されています。

参照先 asprintf()GUID::clock_seqGUID::nodeGUID::time_hi_and_versionGUID::time_lowGUID::time_mid.

00068 {
00069         char *out;
00070 
00071         asprintf(&out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
00072                  uu.time_low, uu.time_mid, uu.time_hi_and_version,
00073                  uu.clock_seq[0], uu.clock_seq[1],
00074                  uu.node[0], uu.node[1], uu.node[2], 
00075                  uu.node[3], uu.node[4], uu.node[5]);
00076 
00077         return out;
00078 }

const char* smb_uuid_string_static ( const struct GUID  uu  ) 

util_uuid.c80 行で定義されています。

参照先 GUID::clock_seqGUID::nodeGUID::time_hi_and_versionGUID::time_lowGUID::time_mid.

参照元 construct_printer_info_7()display_query_info_12()dump_guid()net_ads_cldap_netlogon()store_printer_guid()unpack_values().

00081 {
00082         static char out[37];
00083 
00084         slprintf(out, sizeof(out), 
00085                  "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
00086                  uu.time_low, uu.time_mid, uu.time_hi_and_version,
00087                  uu.clock_seq[0], uu.clock_seq[1],
00088                  uu.node[0], uu.node[1], uu.node[2], 
00089                  uu.node[3], uu.node[4], uu.node[5]);
00090         return out;
00091 }

BOOL smb_string_to_uuid ( const char *  in,
struct GUID uu 
)

util_uuid.c93 行で定義されています。

参照先 GUID::clock_seqGUID::nodeGUID::time_hi_and_versionGUID::time_lowGUID::time_mid.

参照元 is_printer_published().

00094 {
00095         BOOL ret = False;
00096         const char *ptr = in;
00097         char *end = (char *)in;
00098         int i;
00099         unsigned v1, v2;
00100 
00101         if (!in || !uu) goto out;
00102 
00103         uu->time_low = strtoul(ptr, &end, 16);
00104         if ((end - ptr) != 8 || *end != '-') goto out;
00105         ptr = (end + 1);
00106 
00107         uu->time_mid = strtoul(ptr, &end, 16);
00108         if ((end - ptr) != 4 || *end != '-') goto out;
00109         ptr = (end + 1);
00110 
00111         uu->time_hi_and_version = strtoul(ptr, &end, 16);
00112         if ((end - ptr) != 4 || *end != '-') goto out;
00113         ptr = (end + 1);
00114 
00115         if (sscanf(ptr, "%02x%02x", &v1, &v2) != 2) {
00116                 goto out;
00117         }
00118         uu->clock_seq[0] = v1;
00119         uu->clock_seq[1] = v2;
00120         ptr += 4;
00121 
00122         if (*ptr != '-') goto out;
00123         ptr++;
00124 
00125         for (i = 0; i < 6; i++) {
00126                 if (sscanf(ptr, "%02x", &v1) != 1) {
00127                         goto out;
00128                 }
00129                 uu->node[i] = v1;
00130                 ptr += 2;
00131         }
00132 
00133         ret = True;
00134 out:
00135         return ret;
00136 }


Sambaに対してSat Aug 29 21:23:41 2009に生成されました。  doxygen 1.4.7