cipqos.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*******************************************************************************
  2. * Copyright (c) 2009, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef OPENER_CIPQOS_H_
  7. #define OPENER_CIPQOS_H_
  8. /** @file cipqos.h
  9. * @brief Public interface of the QoS Object
  10. *
  11. */
  12. #include "typedefs.h"
  13. #include "ciptypes.h"
  14. #include "cipconnectionmanager.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 priority messages */
  23. CipUsint scheduled; /**< Attr. #5: DSCP value for CIP transport class 0/1 Scheduled priority messages */
  24. CipUsint high; /**< Attr. #6: DSCP value for CIP transport class 0/1 High priority messages */
  25. CipUsint low; /**< Attr. #7: DSCP value for CIP transport class 0/1 low priority messages */
  26. CipUsint explicit_msg; /**< Attr. #8: DSCP value for CIP explicit messages (transport class 2/3 and UCMM)
  27. and all other EtherNet/IP encapsulation messages */
  28. } CipQosDscpValues;
  29. /** This type represents the QoS object */
  30. typedef struct {
  31. CipUsint q_frames_enable; /**< Attr. #1: Enables or disable sending 802.1Q frames on CIP and IEEE 1588 messages */
  32. CipQosDscpValues dscp; /**< Attributes #2 ... #8 of DSCP values - beware! must not be the used set */
  33. } CipQosObject;
  34. /* public data */
  35. extern CipQosObject g_qos;
  36. /* public functions */
  37. /** @brief Provide the matching DSCP value for a given connection object priority level
  38. */
  39. CipUsint CipQosGetDscpPriority(ConnectionObjectPriority priority);
  40. /** @brief Create and initialize the QoS object
  41. */
  42. EipStatus CipQoSInit(void);
  43. /** @brief Updates the currently used set of DSCP priority values
  44. */
  45. void CipQosUpdateUsedSetQosValues(void);
  46. /** @brief Reset attribute values to default. Does not update currently used set */
  47. void CipQosResetAttributesToDefaultValues(void);
  48. #endif /* OPENER_CIPQOS_H_*/