ciptcpipinterface.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*******************************************************************************
  2. * Copyright (c) 2009, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef OPENER_CIPTCPIPINTERFACE_H_
  7. #define OPENER_CIPTCPIPINTERFACE_H_
  8. /** @file ciptcpipinterface.h
  9. * @brief Public interface of the TCP/IP Interface Object
  10. *
  11. */
  12. #include "typedefs.h"
  13. #include "ciptypes.h"
  14. extern CipTcpIpNetworkInterfaceConfiguration interface_configuration_;
  15. static const EipUint16 kCipTcpIpInterfaceClassCode = 0xF5; /**< TCP/IP Interface Object class code */
  16. /** @brief Multicast Configuration struct, called Mcast config
  17. *
  18. */
  19. typedef struct multicast_address_configuration {
  20. CipUsint alloc_control; /**< 0 for default multicast address generation algorithm; 1 for multicast addresses according to Num MCast and MCast Start Addr */
  21. CipUsint reserved_shall_be_zero; /**< shall be zero */
  22. CipUint number_of_allocated_multicast_addresses; /**< Number of IP multicast addresses allocated */
  23. CipUdint starting_multicast_address; /**< Starting multicast address from which Num Mcast addresses are allocated */
  24. } MulticastAddressConfiguration;
  25. /* global public variables */
  26. extern CipUsint g_time_to_live_value; /**< Time-to-live value for IP multicast packets. Default is 1; Minimum is 1; Maximum is 255 */
  27. extern CipUint g_encapsulation_inactivity_timeout; /**< Number of seconds of inactivity before TCP connection is closed, Default is 120 */
  28. extern MulticastAddressConfiguration g_multicast_configuration; /**< Multicast configuration */
  29. /* public functions */
  30. /** @brief Initializing the data structures of the TCP/IP interface object
  31. *
  32. * @return kEipStatusOk on success, otherwise kEipStatusError
  33. */
  34. EipStatus CipTcpIpInterfaceInit(void);
  35. /** @brief Clean up the allocated data of the TCP/IP interface object.
  36. *
  37. * Currently this is the host name string and the domain name string.
  38. *
  39. */
  40. void ShutdownTcpIpInterface(void);
  41. /** @brief Public Method to get Encapsulation Inactivity Timeout Value
  42. *
  43. *
  44. */
  45. EipUint16 GetEncapsulationInactivityTimeout(CipInstance *instance);
  46. #endif /* OPENER_CIPTCPIPINTERFACE_H_ */