ether.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*!
  2. * Copyright (C) Fraunhofer-Institut for Photonic Microsystems (IPMS)
  3. * Maria-Reiche-Str. 2
  4. * 01109 Dresden
  5. *
  6. * Unauthorized copying of this file, via any medium is strictly prohibited
  7. * Proprietary and confidential
  8. *
  9. * \file ether.h
  10. * \author zimmerli
  11. * \date 2020-01-20
  12. * \brief Ethernet Types
  13. *
  14. */
  15. #ifndef ETHER_H_
  16. #define ETHER_H_
  17. /* 802.1Q Annex I */
  18. /* the traffic acronyms describes the traffic priority in range [0=lowest .. 7=highest] */
  19. #define ETH_PRIO_BG 1 /* Background */
  20. #define ETH_PRIO_BE 0 /* Best Effort */
  21. #define ETH_PRIO_EE 2 /* Excellent Effort */
  22. #define ETH_PRIO_CA 3 /* Critical Application */
  23. #define ETH_PRIO_VI 4 /* Video */
  24. #define ETH_PRIO_VO 5 /* Voice */
  25. #define ETH_PRIO_IC 6 /* Internetwork Control */
  26. #define ETH_PRIO_NC 7 /* Network Control */
  27. extern const char *ETH_PRIO_NAMES[8];
  28. #define VLAN_TAG(pcp, dei, vid) (((pcp & 0x07) << 13) | ((dei & 0x01) << 12) | (vid & 0xFFF))
  29. #define ETH_TYPE_IP 0x0800
  30. #define ETH_TYPE_VLAN 0x8100
  31. #define ETH_TYPE_LOCALEXP1 0x88B5
  32. #define ETH_TYPE_LOCALEXP2 0x88B6
  33. #define ETH_TYPE_LLDP 0x88CC
  34. #define ETH_TYPE_UADP 0xB62C
  35. #endif /* ETHER_H_ */