ciptcpipinterface.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /** @brief TCP/IP Interface class code */
  15. static const CipUint kCipTcpIpInterfaceClassCode = 0xF5u;
  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. /** @brief Declaration of the TCP/IP object's structure type
  26. */
  27. typedef struct {
  28. CipDword status; /**< attribute #1 TCP status */
  29. CipDword config_capability; /**< attribute #2 bitmap of capability flags */
  30. CipDword config_control; /**< attribute #3 bitmap: control the interface configuration method: static / BOOTP / DHCP */
  31. CipEpath physical_link_object; /**< attribute #4 references the Ethernet Link object for this interface */
  32. CipTcpIpInterfaceConfiguration interface_configuration;/**< attribute #5 IP, network mask, gateway, name server 1 & 2, domain name*/
  33. CipString hostname; /**< #6 host name*/
  34. CipUsint mcast_ttl_value; /**< #8 the time to live value to be used for multi-cast connections */
  35. /** #9 The multicast configuration for this device */
  36. MulticastAddressConfiguration mcast_config;
  37. /** #13 Number of seconds of inactivity before TCP connection is closed */
  38. CipUint encapsulation_inactivity_timeout;
  39. } CipTcpIpObject;
  40. /* global public variables */
  41. extern CipTcpIpObject g_tcpip; /**< declaration of TCP/IP object instance 1 data */
  42. /* public functions */
  43. /** @brief Initializing the data structures of the TCP/IP interface object
  44. *
  45. * @return kEipStatusOk on success, otherwise kEipStatusError
  46. */
  47. EipStatus CipTcpIpInterfaceInit(void);
  48. /** @brief Clean up the allocated data of the TCP/IP interface object.
  49. *
  50. * Currently this is the host name string and the domain name string.
  51. *
  52. */
  53. void ShutdownTcpIpInterface(void);
  54. /** @brief Public Method to get Encapsulation Inactivity Timeout Value
  55. *
  56. *
  57. */
  58. EipUint16 GetEncapsulationInactivityTimeout(CipInstance *instance);
  59. #endif /* OPENER_CIPTCPIPINTERFACE_H_ */