| 366 | } |
| 367 | |
| 368 | void |
| 369 | be_uuid_dec(void const *buf, struct uuid *uuid) |
| 370 | { |
| 371 | u_char const *p; |
| 372 | int i; |
| 373 | |
| 374 | p = buf; |
| 375 | uuid->time_low = be32dec(p); |
| 376 | uuid->time_mid = be16dec(p + 4); |
| 377 | uuid->time_hi_and_version = be16dec(p + 6); |
| 378 | uuid->clock_seq_hi_and_reserved = p[8]; |
| 379 | uuid->clock_seq_low = p[9]; |
| 380 | for (i = 0; i < _UUID_NODE_LEN; i++) |
| 381 | uuid->node[i] = p[10 + i]; |
| 382 | } |
| 383 | |
| 384 | int |
| 385 | validate_uuid(const char *str, size_t size, struct uuid *uuid, int flags) |