diff options
author | marcel <marcel@FreeBSD.org> | 2013-07-24 04:24:21 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2013-07-24 04:24:21 +0000 |
commit | 4ca16da195c36ede5b081eb06be9cf18b7025fc4 (patch) | |
tree | 5a9b936ca0a1586a327a35bf012dd92454f71b1c /sys/sys/uuid.h | |
parent | 512fdf0a5e5fc67140a2137d3923a289e4a06d1f (diff) | |
download | FreeBSD-src-4ca16da195c36ede5b081eb06be9cf18b7025fc4.zip FreeBSD-src-4ca16da195c36ede5b081eb06be9cf18b7025fc4.tar.gz |
Decouple the UUID generator from network interfaces by having MAC
addresses added to the UUID generator using uuid_ether_add(). The
UUID generator keeps an arbitrary number of MAC addresses, under
the assumption that they are rarely removed (= uuid_ether_del()).
This achieves the following:
1. It brings up closer to having the network stack as a loadable
module.
2. It allows the UUID generator to filter MAC addresses for best
results (= highest chance of uniqeness).
3. MAC addresses can come from anywhere, irrespactive of whether
it's used for an interface or not.
A side-effect of the change is that when no MAC addresses have been
added, a random multicast MAC address is created once and re-used if
needed. Previusly, when a random MAC address was needed, it was
created for every call. Thus, a change in behaviour is introduced
for when no MAC addresses exist.
Obtained from: Juniper Networks, Inc.
Diffstat (limited to 'sys/sys/uuid.h')
-rw-r--r-- | sys/sys/uuid.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/uuid.h b/sys/sys/uuid.h index 0f40bb2..0748f61 100644 --- a/sys/sys/uuid.h +++ b/sys/sys/uuid.h @@ -58,6 +58,9 @@ struct sbuf; struct uuid *kern_uuidgen(struct uuid *, size_t); +int uuid_ether_add(const uint8_t *); +int uuid_ether_del(const uint8_t *); + int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); |