ieee_oui.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* -
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2013 The FreeBSD Foundation
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above
  12. * copyright notice, this list of conditions and the following
  13. * disclaimer in the documentation and/or other materials provided
  14. * with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
  17. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  18. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  19. * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
  20. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  22. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  23. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  25. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  26. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. *
  29. * Author: George V. Neville-Neil
  30. *
  31. */
  32. /* Organizationally Unique Identifier assigned by IEEE 14 Nov 2013 */
  33. #define OUI_FREEBSD_BASE 0x589cfc000000
  34. #define OUI_FREEBSD(nic) (OUI_FREEBSD_BASE | (nic))
  35. /*
  36. * OUIs are most often used to uniquely identify network interfaces
  37. * and occupy the first 3 bytes of both destination and source MAC
  38. * addresses. The following allocations exist so that various
  39. * software systems associated with FreeBSD can have unique IDs in the
  40. * absence of hardware. The use of OUIs for this purpose is not fully
  41. * fleshed out but is now in common use in virtualization technology.
  42. *
  43. * Allocations from this range are expected to be made using COMMON
  44. * SENSE by developers. Do NOT take a large range just because
  45. * they're currently wide open. Take the smallest useful range for
  46. * your system. We have (2^24 - 2) available addresses (see Reserved
  47. * Values below) but that is far from infinite.
  48. *
  49. * In the event of a conflict arbitration of allocation in this file
  50. * is subject to core@ approval.
  51. *
  52. * Applications are differentiated based on the high order bit(s) of
  53. * the remaining three bytes. Our first allocation has all 0s, the
  54. * next allocation has the highest bit set. Allocating in this way
  55. * gives us 254 allocations of 64K addresses. Address blocks can be
  56. * concatenated if necessary.
  57. *
  58. * Reserved Values: 0x000000 and 0xffffff are reserved and MUST NOT BE
  59. * allocated for any reason.
  60. */
  61. /* Allocate 20 bits to bhyve */
  62. #define OUI_FREEBSD_BHYVE_LOW OUI_FREEBSD(0x000001)
  63. #define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x0fffff)
  64. /*
  65. * Allocate 16 bits for a pool to give to various interfaces that need a
  66. * generated address, but don't quite need to slice off a whole section of
  67. * the OUI (e.g. cloned interfaces, one-off NICs of various vendors).
  68. *
  69. * ether_gen_addr should be used to generate an address from this pool.
  70. */
  71. #define OUI_FREEBSD_GENERATED_MASK 0x10ffff
  72. #define OUI_FREEBSD_GENERATED_LOW OUI_FREEBSD(0x100000)
  73. #define OUI_FREEBSD_GENERATED_HIGH OUI_FREEBSD(OUI_FREEBSD_GENERATED_MASK)
  74. /* Allocate 16 bits for emulated NVMe devices */
  75. #define OUI_FREEBSD_NVME_MASK 0x20ffff
  76. #define OUI_FREEBSD_NVME_LOW OUI_FREEBSD(0x200000)
  77. #define OUI_FREEBSD_NVME_HIGH OUI_FREEBSD(OUI_FREEBSD_NVME_MASK)