86 const unsigned int connection_number,
87 const unsigned int output_assembly,
88 const unsigned int input_assembly,
89 const unsigned int config_assembly) {
101 const unsigned int output_assembly,
102 const unsigned int input_assembly,
103 const unsigned int config_assembly) {
107 g_input_only_connections[connection_number].
input_assembly = input_assembly;
114 const unsigned int output_assembly,
115 const unsigned int input_assembly,
116 const unsigned int config_assembly) {
136 if (NULL == io_connection) {
140 if (NULL == io_connection) {
170 if (NULL != io_connection) {
174 return io_connection;
182 if ( (g_exlusive_owner_connections[i].output_assembly ==
183 connection_object->consumed_path.instance_id)
185 connection_object->produced_path.instance_id)
187 connection_object->configuration_path.instance_id) ) {
191 connection_object->produced_path.instance_id);
193 != exclusive_owner ) {
206 connection_close_function(&(g_exlusive_owner_connections[i].
213 "Hit an Ownership conflict with timed out connection");
228 if (g_input_only_connections[i].output_assembly
229 == connection_object->consumed_path.instance_id) {
230 if (g_input_only_connections[i].input_assembly
231 != connection_object->produced_path.instance_id) {
236 if (g_input_only_connections[i].config_assembly
237 != connection_object->configuration_path.instance_id) {
247 connection_data[j]) )
249 &(g_input_only_connections[i].
250 connection_data[j]) ) )
253 connection_close_function(
254 &g_input_only_connections[i].connection_data[j]);
263 connection_data[j]) ) ) {
280 if (g_listen_only_connections[i].output_assembly
281 == connection_object->consumed_path.instance_id) {
282 if (g_listen_only_connections[i].input_assembly
283 != connection_object->produced_path.instance_id) {
288 if (g_listen_only_connections[i].config_assembly
289 != connection_object->configuration_path.instance_id) {
297 connection_object->produced_path.instance_id) ) {
307 connection_data[j]) )
309 &(g_listen_only_connections[i].
310 connection_data[j]) ) )
313 connection_close_function(
314 &g_listen_only_connections[i].connection_data[j]);
323 connection_data[j]) ) ) {
339 while (NULL != node) {
348 (kEipInvalidSocket !=
349 producer_multicast_connection->
socket[
355 return producer_multicast_connection;
366 while (NULL != node) {
377 return next_non_control_master_connection;
388 OPENER_TRACE_INFO(
"Close all instance type %d only connections\n", instance_type);
390 while (NULL != node) {
409 while (NULL != node) {
420 while (NULL != node) {
432 memset( g_exlusive_owner_connections, 0,
435 memset( g_input_only_connections, 0,
437 memset( g_listen_only_connections, 0,
bool ConnectionObjectIsTypeNonLOIOConnection(const CipConnectionObject *const connection_object)
unsigned int output_assembly
bool ConnectionObjectIsTypeIOConnection(const CipConnectionObject *const connection_object)
Tracing infrastructure for OpENer.
#define OPENER_CIP_NUM_LISTEN_ONLY_CONNS
Define the number of supported listen only connections. Each of these connections has to be configure...
DoublyLinkedListNode * first
CipConnectionObject * GetConnectedOutputAssembly(const EipUint32 output_assembly_id)
Listen Only connection data.
#define OPENER_ASSERT(assertion)
ConnectionObjectConnectionType ConnectionObjectGetTToOConnectionType(const CipConnectionObject *const connection_object)
CipConnectionObject * GetNextNonControlMasterConnection(const EipUint32 input_point)
check if there exists an producing multicast exclusive owner or listen only connection that should pr...
unsigned int output_assembly
CipConnectionObject * GetExistingProducerMulticastConnection(const EipUint32 input_point)
Check if there exists already an exclusive owner or listen only connection which produces the input a...
#define OPENER_CIP_NUM_INPUT_ONLY_CONNS
Define the number of supported input only connections. Each of these connections has to be configured...
void ConnectionObjectSetInstanceType(CipConnectionObject *const connection_object, const ConnectionObjectInstanceType instance_type)
unsigned int input_assembly
ConnectionCloseFunction connection_close_function
ListenOnlyConnection g_listen_only_connections[OPENER_CIP_NUM_LISTEN_ONLY_CONNS]
void CheckIoConnectionEvent(unsigned int output_assembly_id, unsigned int input_assembly_id, IoConnectionEvent io_connection_event)
Inform the application on changes occurred for a connection.
void ConnectionObjectDeepCopy(CipConnectionObject *RESTRICT destination, const CipConnectionObject *RESTRICT const source)
Copy the given connection data from source to destination.
void CloseAllConnectionsForInputWithSameType(const EipUint32 input_point, const ConnectionObjectInstanceType instance_type)
Close all connection producing the same input and have the same type (i.e., listen only or input only...
Exclusive Owner connection data.
void ConfigureListenOnlyConnectionPoint(const unsigned int connection_number, const unsigned int output_assembly, const unsigned int input_assembly, const unsigned int config_assembly)
Configures the connection point for a listen only connection.
unsigned int config_assembly
bool ConnectionWithSameConfigPointExists(const EipUint32 config_point)
Check if there is an established connection that uses the same config point.
DoublyLinkedListNode * next
bool ConnectionObjectEqualOriginator(const CipConnectionObject *const object1, const CipConnectionObject *const object2)
ConnectionObjectInstanceType
void ConfigureInputOnlyConnectionPoint(const unsigned int connection_number, const unsigned int output_assembly, const unsigned int input_assembly, const unsigned int config_assembly)
Configures the connection point for an input only connection.
#define OPENER_TRACE_INFO(...)
CipConnectionPathEpath produced_path
void ConfigureExclusiveOwnerConnectionPoint(const unsigned int connection_number, const unsigned int output_assembly, const unsigned int input_assembly, const unsigned int config_assembly)
Configures the connection point for an exclusive owner connection.
#define OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS
Define the number of supported exclusive owner connections. Each of these connections has to be confi...
ConnectionObjectState ConnectionObjectGetState(const CipConnectionObject *const connection_object)
CipConnectionPathEpath configuration_path
CipConnectionObject connection_data
InputOnlyConnection g_input_only_connections[OPENER_CIP_NUM_INPUT_ONLY_CONNS]
void CloseAllConnections(void)
DoublyLinkedList connection_list
#define OPENER_CIP_NUM_INPUT_ONLY_CONNS_PER_CON_PATH
Define the number of supported input only connections per connection path.
unsigned int input_assembly
CipConnectionPathEpath consumed_path
CipConnectionObject * GetIoConnectionForConnectionData(CipConnectionObject *const RESTRICT connection_object, EipUint16 *const extended_error)
check if for the given connection data received in a forward_open request a suitable connection is av...
CipConnectionObject * GetListenOnlyConnection(const CipConnectionObject *const RESTRICT connection_object, EipUint16 *const extended_error)
Takes an ConnectionObject and searches and returns an Listen Only Connection based on the ConnectionO...
ExclusiveOwnerConnection g_exlusive_owner_connections[OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS]
CipConnectionObject connection_data[OPENER_CIP_NUM_LISTEN_ONLY_CONNS_PER_CON_PATH]
ConnectionObjectInstanceType ConnectionObjectGetInstanceType(const CipConnectionObject *const connection_object)
unsigned int config_assembly
void InitializeIoConnectionData(void)
CipConnectionObject * GetExclusiveOwnerConnection(const CipConnectionObject *const RESTRICT connection_object, EipUint16 *const extended_error)
Takes an ConnectionObject and searches and returns an Exclusive Owner Connection based on the Connect...
CipConnectionObject * GetInputOnlyConnection(const CipConnectionObject *const RESTRICT connection_object, EipUint16 *const extended_error)
Takes an ConnectionObject and searches and returns an Input Only Connection based on the ConnectionOb...
#define OPENER_CIP_NUM_LISTEN_ONLY_CONNS_PER_CON_PATH
Define the number of supported Listen only connections per connection path.