netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
uuid.c File Reference
`#include <arpa/inet.h>`
`#include <errno.h>`
`#include <grp.h>`
`#include <inttypes.h>`
`#include <pwd.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/types.h>`
`#include <atalk/afp.h>`
`#include <atalk/ldapconfig.h>`
`#include <atalk/logger.h>`
`#include <atalk/util.h>`
`#include <atalk/uuid.h>`
`#include "aclldap.h"`
`#include "cache.h"`

## Functions
void | localuuid_from_id (unsigned char *buf, uuidtype_t type, unsigned int id)
void | uuid_string2bin (const char *uuidstring, unsigned char *uuid)
| convert ascii string that can include dashes to binary uuid.
const char * | uuid_bin2string (const unsigned char *uuid)
| Convert 16 byte binary uuid to neat ascii represantation including dashes.
int | getuuidfromname (const char *name, uuidtype_t type, unsigned char *uuid)
int | getnamefromuuid (const uuidp_t uuidp, char **name, uuidtype_t *type)

## Variables
char * | uuidtype [] = {"", "USER", "GROUP", "LOCAL"}
static unsigned char | local_group_uuid []
static unsigned char | local_user_uuid []

## Function Documentation

## ◆ getnamefromuuid()

int getnamefromuuid | ( | const uuidp_t | uuidp,
|  | char ** | name,
|  | uuidtype_t * | type )

Parameters

  uuidp | pointer to a uuid
  name | returns allocated buffer from ldap_getnamefromuuid
  type | returns USER, GROUP or LOCAL

Returns
  0 on success !=0 on errror

Note
  Caller must free name appropriately.

## ◆ getuuidfromname()

int getuuidfromname | ( | const char * | name,
|  | uuidtype_t | type,
|  | unsigned char * | uuid )

Parameters

  name | give me his name
  type | and type (UUID_USER or UUID_GROUP)
  uuid | pointer to uuid_t storage that the caller must provide

Returns
  0 on success !=0 on errror

## ◆ localuuid_from_id()

void localuuid_from_id | ( | unsigned char * | buf,
|  | uuidtype_t | type,
|  | unsigned int | id )

## ◆ uuid_bin2string()

const char * uuid_bin2string | ( | const unsigned char * | uuid | ) |

Convert 16 byte binary uuid to neat ascii represantation including dashes.

Use defined or default ascii mask for dash placement

Returns
  pointer to static buffer

## ◆ uuid_string2bin()

void uuid_string2bin | ( | const char * | uuidstring,
|  | unsigned char * | uuid )

convert ascii string that can include dashes to binary uuid.

Note
  caller must provide a buffer.

## Variable Documentation

## ◆ local_group_uuid

unsigned char local_group_uuid[]
| static

Initial value:
= {0xab, 0xcd, 0xef,
0xab, 0xcd, 0xef,
0xab, 0xcd, 0xef,
0xab, 0xcd, 0xef
}

## ◆ local_user_uuid

unsigned char local_user_uuid[]
| static

Initial value:
= {0xff, 0xff, 0xee, 0xee, 0xdd, 0xdd,
0xcc, 0xcc, 0xbb, 0xbb, 0xaa, 0xaa
}

## ◆ uuidtype

char* uuidtype[] = {"", "USER", "GROUP", "LOCAL"}