diff options
author | pjd <pjd@FreeBSD.org> | 2007-04-09 19:18:09 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-04-09 19:18:09 +0000 |
commit | d74643dd36f6687fce16dbff6031cfe3a1c0e3f6 (patch) | |
tree | c30a7fb99fcc2631ac00c1b1a7ff64df0164ef16 | |
parent | a7cca495b24eb83efe8dfe00eeb21e74e99a1dc9 (diff) | |
download | FreeBSD-src-d74643dd36f6687fce16dbff6031cfe3a1c0e3f6.zip FreeBSD-src-d74643dd36f6687fce16dbff6031cfe3a1c0e3f6.tar.gz |
Add kern.hostuuid sysctl, which will be used to keep host's UUID.
Reviewed by: mlaier, rink, brooks, rwatson
-rw-r--r-- | sys/kern/kern_mib.c | 3 | ||||
-rw-r--r-- | sys/sys/kernel.h | 1 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 16755d4..0a5220d 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -301,6 +301,9 @@ SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW, u_long hostid; SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID"); +char hostuuid[64] = "00000000-0000-0000-0000-000000000000"; +SYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid, + sizeof(hostuuid), "Host UUID"); /* * This is really cheating. These actually live in the libc, something diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 92ceeb2..ff38d8f 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -56,6 +56,7 @@ /* 1.1 */ extern unsigned long hostid; +extern char *hostuuid; extern char hostname[MAXHOSTNAMELEN]; extern char domainname[MAXHOSTNAMELEN]; extern char kernelname[MAXPATHLEN]; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index ef96c81..d56359b 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -389,7 +389,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define KERN_USRSTACK 33 /* int: address of USRSTACK */ #define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */ #define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */ -#define KERN_MAXID 36 /* number of valid kern ids */ +#define KERN_HOSTUUID 36 /* string: host UUID identifier */ +#define KERN_MAXID 37 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -427,6 +428,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); { "usrstack", CTLTYPE_INT }, \ { "logsigexit", CTLTYPE_INT }, \ { "iov_max", CTLTYPE_INT }, \ + { "hostuuid", CTLTYPE_STRING }, \ } /* |