The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/include/sys/uuid.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * CDDL HEADER START
    3  *
    4  * The contents of this file are subject to the terms of the
    5  * Common Development and Distribution License, Version 1.0 only
    6  * (the "License").  You may not use this file except in compliance
    7  * with the License.
    8  *
    9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   10  * or https://opensource.org/licenses/CDDL-1.0.
   11  * See the License for the specific language governing permissions
   12  * and limitations under the License.
   13  *
   14  * When distributing Covered Code, include this CDDL HEADER in each
   15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
   16  * If applicable, add the following below this CDDL HEADER, with the
   17  * fields enclosed by brackets "[]" replaced with your own identifying
   18  * information: Portions Copyright [yyyy] [name of copyright owner]
   19  *
   20  * CDDL HEADER END
   21  */
   22 /*
   23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
   24  * Use is subject to license terms.
   25  */
   26 
   27 #ifndef _SYS_UUID_H
   28 #define _SYS_UUID_H
   29 
   30 #ifdef  __cplusplus
   31 extern "C" {
   32 #endif
   33 
   34 /*
   35  * The copyright in this file is taken from the original Leach
   36  * & Salz UUID specification, from which this implementation
   37  * is derived.
   38  */
   39 
   40 /*
   41  * Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
   42  * Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
   43  * Digital Equipment Corporation, Maynard, Mass.  Copyright (c) 1998
   44  * Microsoft.  To anyone who acknowledges that this file is provided
   45  * "AS IS" without any express or implied warranty: permission to use,
   46  * copy, modify, and distribute this file for any purpose is hereby
   47  * granted without fee, provided that the above copyright notices and
   48  * this notice appears in all source code copies, and that none of the
   49  * names of Open Software Foundation, Inc., Hewlett-Packard Company,
   50  * or Digital Equipment Corporation be used in advertising or
   51  * publicity pertaining to distribution of the software without
   52  * specific, written prior permission.  Neither Open Software
   53  * Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital
   54  * Equipment Corporation makes any representations about the
   55  * suitability of this software for any purpose.
   56  */
   57 
   58 #include <sys/types.h>
   59 #include <sys/byteorder.h>
   60 
   61 typedef struct {
   62         uint8_t         nodeID[6];
   63 } uuid_node_t;
   64 
   65 /*
   66  * The uuid type used throughout when referencing uuids themselves
   67  */
   68 struct uuid {
   69         uint32_t        time_low;
   70         uint16_t        time_mid;
   71         uint16_t        time_hi_and_version;
   72         uint8_t         clock_seq_hi_and_reserved;
   73         uint8_t         clock_seq_low;
   74         uint8_t         node_addr[6];
   75 };
   76 
   77 #define UUID_PRINTABLE_STRING_LENGTH 37
   78 
   79 /*
   80  * Convert a uuid to/from little-endian format
   81  */
   82 #define UUID_LE_CONVERT(dest, src)                                      \
   83 {                                                                       \
   84         (dest) = (src);                                                 \
   85         (dest).time_low = LE_32((dest).time_low);                       \
   86         (dest).time_mid = LE_16((dest).time_mid);                       \
   87         (dest).time_hi_and_version = LE_16((dest).time_hi_and_version); \
   88 }
   89 
   90 #ifdef __cplusplus
   91 }
   92 #endif
   93 
   94 #endif /* _SYS_UUID_H */

Cache object: bf9e3397e27fa9eb3297d8cf9b9e3b29


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.