cipqos.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*******************************************************************************
  2. * Copyright (c) 2009, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef SRC_CIP_CIPQOS_H_
  7. #define SRC_CIP_CIPQOS_H_
  8. /** @file cipqos.h
  9. * @brief Public interface of the QoS Object
  10. *
  11. */
  12. #include "cip/cipconnectionmanager.h"
  13. #include "cip/ciptypes.h"
  14. #include "core/typedefs.h"
  15. /** @brief QoS Object class code */
  16. static const CipUint kCipQoSClassCode = 0x48U;
  17. /* public types */
  18. /** This type represents the group of DSCP values of the QoS object. */
  19. typedef struct cip_qos_dscp_values {
  20. CipUsint event; ///< Attr. #2: DSCP value for event messages
  21. CipUsint general; ///< Attr. #3: DSCP value for general messages
  22. CipUsint urgent; ///< Attr. #4: DSCP value for CIP transport class 0/1 Urgent
  23. ///< priority messages
  24. CipUsint scheduled; ///< Attr. #5: DSCP value for CIP transport class 0/1
  25. ///< Scheduled priority messages
  26. CipUsint high; ///< Attr. #6: DSCP value for CIP transport class 0/1 High
  27. ///< priority messages
  28. CipUsint low; ///< Attr. #7: DSCP value for CIP transport class 0/1 low
  29. ///< priority messages
  30. CipUsint explicit_msg; ///< Attr. #8: DSCP value for CIP explicit messages
  31. ///< (transport class 2/3 and UCMM) and all other
  32. ///< EtherNet/IP encapsulation messages
  33. } CipQosDscpValues;
  34. /** This type represents the QoS object */
  35. typedef struct {
  36. CipUsint q_frames_enable; ///< Attr. #1: Enables or disable sending 802.1Q
  37. ///< frames on CIP and IEEE 1588 messages
  38. CipQosDscpValues dscp; ///< Attributes #2 ... #8 of DSCP values - beware!
  39. ///< must not be the used set
  40. } CipQosObject;
  41. // public data
  42. extern CipQosObject g_qos;
  43. // public functions
  44. /** @brief Provide the matching DSCP value for a given connection object
  45. * priority level
  46. */
  47. CipUsint CipQosGetDscpPriority(ConnectionObjectPriority priority);
  48. /** @brief Create and initialize the QoS object
  49. */
  50. EipStatus CipQoSInit(void);
  51. /** @brief Updates the currently used set of DSCP priority values
  52. */
  53. void CipQosUpdateUsedSetQosValues(void);
  54. /** @brief Reset attribute values to default. Does not update currently used set
  55. */
  56. void CipQosResetAttributesToDefaultValues(void);
  57. #endif // SRC_CIP_CIPQOS_H_