OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipconnectionmanager.c File Reference
#include <string.h>
#include <stdbool.h>
#include "cipconnectionmanager.h"
#include "opener_user_conf.h"
#include "cipcommon.h"
#include "cipmessagerouter.h"
#include "ciperror.h"
#include "endianconv.h"
#include "opener_api.h"
#include "encap.h"
#include "cipidentity.h"
#include "trace.h"
#include "cipconnectionobject.h"
#include "cipclass3connection.h"
#include "cipioconnection.h"
#include "cipassembly.h"
#include "cpf.h"
#include "appcontype.h"
#include "generic_networkhandler.h"
#include "cipepath.h"
#include "cipelectronickey.h"
#include "cipqos.h"
Include dependency graph for cipconnectionmanager.c:

Go to the source code of this file.

Data Structures

struct  ConnectionManagementHandling
 

Typedefs

typedef EipStatus(* HandleForwardOpenRequestFunction )(CipConnectionObject *connection_object, CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response)
 Function prototype for all Forward Open handle functions. More...
 

Functions

EipStatus AddConnectableObject (const EipUint32 class_id, OpenConnectionFunction open_connection_function)
 register open functions for an specific object. More...
 
void AddNewActiveConnection (const CipConnectionObject *const connection_object)
 Insert the given connection object to the list of currently active and managed connections. More...
 
void AddNullAddressItem (CipCommonPacketFormatData *common_data_packet_format_data)
 Adds a Null Address Item to the common data packet format data. More...
 
EipStatus AssembleForwardCloseResponse (EipUint16 connection_serial_number, EipUint16 originatior_vendor_id, EipUint32 originator_serial_number, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response, EipUint16 extended_error_code)
 
EipStatus AssembleForwardOpenResponse (CipConnectionObject *connection_object, CipMessageRouterResponse *message_router_response, EipUint8 general_status, EipUint16 extended_status)
 Assembles the Forward Open Response. More...
 
EipStatus CheckElectronicKeyData (EipUint8 key_format, void *key_data, EipUint16 *extended_status)
 Compare the electronic key received with a forward open request with the device's data. More...
 
CipConnectionObjectCheckForExistingConnection (const CipConnectionObject *const connection_object)
 check if the data given in the connection object match with an already established connection More...
 
void CheckForTimedOutConnectionsAndCloseTCPConnections (const CipConnectionObject *const connection_object, CloseSessionFunction CloseSessions)
 
void CloseConnection (CipConnectionObject *RESTRICT connection_object)
 Close the given connection. More...
 
EipStatus ConnectionManagerInit (EipUint16 unique_connection_id)
 Initialize the data of the connection manager object. More...
 
EipStatus ForwardClose (CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response, struct sockaddr *originator_address, const int encapsulation_session)
 
EipStatus ForwardOpen (CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response, struct sockaddr *originator_address, const int encapsulation_session)
 Check if resources for new connection available, generate ForwardOpen Reply message. More...
 
CipConnectionObjectGetConnectedObject (const EipUint32 connection_id)
 Get a connected object dependent on requested ConnectionID. More...
 
CipConnectionObjectGetConnectedOutputAssembly (const EipUint32 output_assembly_id)
 
CipUint GetConnectionId (void)
 Generate a new connection Id utilizing the Incarnation Id as described in the EIP specs. More...
 
ConnectionManagementHandlingGetConnectionManagementEntry (const EipUint32 class_id)
 
EipStatus GetConnectionOwner (CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response, struct sockaddr *originator_address, const int encapsulation_session)
 
unsigned int GetPaddedLogicalPath (const EipUint8 **logical_path_segment)
 gets the padded logical path TODO: enhance documentation More...
 
EipStatus HandleNonNullMatchingForwardOpenRequest (CipConnectionObject *connection_object, CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response)
 Handles a Non Null Matching Forward Open Request. More...
 
EipStatus HandleNonNullNonMatchingForwardOpenRequest (CipConnectionObject *connection_object, CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response)
 Handles a Non Null Non Matching Forward Open Request. More...
 
EipStatus HandleNullMatchingForwardOpenRequest (CipConnectionObject *connection_object, CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response)
 Handles a Null Matching Forward Open request. More...
 
EipStatus HandleNullNonMatchingForwardOpenRequest (CipConnectionObject *connection_object, CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response)
 Handles a Null Non Matching Forward Open Request. More...
 
EipStatus HandleReceivedConnectedData (const EipUint8 *const data, int data_length, struct sockaddr_in *from_address)
 Notify the connection manager that data for a connection has been received. More...
 
void InitializeConnectionManager (CipClass *class)
 
void InitializeConnectionManagerData (void)
 
EipBool8 IsConnectedOutputAssembly (const EipUint32 instance_number)
 
EipStatus ManageConnections (MilliSeconds elapsed_time)
 Check if any of the connection timers (TransmissionTrigger or WatchdogTimeout) have timed out. More...
 
EipUint8 ParseConnectionPath (CipConnectionObject *connection_object, CipMessageRouterRequest *message_router_request, EipUint16 *extended_error)
 Parse the connection path of a forward open request. More...
 
void RemoveFromActiveConnections (CipConnectionObject *const connection_object)
 Removes connection from the list of active connections. More...
 
EipStatus TriggerConnections (unsigned int output_assembly, unsigned int input_assembly)
 Trigger the production of an application triggered connection. More...
 

Variables

DoublyLinkedList connection_list
 
EipUint16 device_type_
 
ConnectionManagementHandling g_connection_management_list [2+OPENER_CIP_NUM_APPLICATION_SPECIFIC_CONNECTABLE_OBJECTS]
 
CipConnectionObject g_dummy_connection_object
 
EipUint32 g_incarnation_id
 Holds the connection ID's "incarnation ID" in the upper 16 bits. More...
 
const size_t g_kForwardOpenHeaderLength = 36
 
EipUint16 product_code_
 
CipRevision revision_
 
EipUint16 vendor_id_
 

Typedef Documentation

typedef EipStatus(* HandleForwardOpenRequestFunction)(CipConnectionObject *connection_object, CipInstance *instance, CipMessageRouterRequest *message_router_request, CipMessageRouterResponse *message_router_response)

Function prototype for all Forward Open handle functions.

Definition at line 306 of file cipconnectionmanager.c.

Function Documentation

void AddNewActiveConnection ( const CipConnectionObject *const  connection_object)

Insert the given connection object to the list of currently active and managed connections.

By adding a connection to the active connection list the connection manager will perform the supervision and handle the timing (e.g., timeout, production inhibit, etc).

Parameters
connection_objectpointer to the connection object to be added.

Definition at line 1406 of file cipconnectionmanager.c.

References ConnectionObjectSetState(), DoublyLinkedListInsertAtHead(), and kConnectionObjectStateEstablished.

Referenced by EstablishClass3Connection(), and EstablishIoConnection().

Here is the call graph for this function:

Here is the caller graph for this function:

void AddNullAddressItem ( CipCommonPacketFormatData common_data_packet_format_data)

Adds a Null Address Item to the common data packet format data.

Parameters
common_data_packet_format_dataThe CPF data packet where the Null Address Item shall be added

Definition at line 846 of file cipconnectionmanager.c.

References CipCommonPacketFormatData::address_item, CipCommonPacketFormatData::data_item, kCipItemIdNullAddress, kCipItemIdUnconnectedDataItem, AddressItem::length, AddressItem::type_id, and DataItem::type_id.

Referenced by AssembleForwardCloseResponse(), and AssembleForwardOpenResponse().

Here is the caller graph for this function:

EipStatus AssembleForwardCloseResponse ( EipUint16  connection_serial_number,
EipUint16  originatior_vendor_id,
EipUint32  originator_serial_number,
CipMessageRouterRequest message_router_request,
CipMessageRouterResponse message_router_response,
EipUint16  extended_error_code 
)
EipStatus AssembleForwardOpenResponse ( CipConnectionObject connection_object,
CipMessageRouterResponse message_router_response,
EipUint8  general_status,
EipUint16  extended_status 
)

Assembles the Forward Open Response.

Parameters
connection_objectpointer to connection Object
message_router_responsepointer to message router response
general_statusthe general status of the response
extended_statusextended status in the case of an error otherwise 0
Returns
status kEipStatusOk .. no reply need to be sent back kEipStatusOkSend .. need to send reply kEipStatusError .. error

Definition at line 740 of file cipconnectionmanager.c.

References AddDintToMessage(), AddIntToMessage(), CipMessageRouterResponse::additional_status, AddNullAddressItem(), CipCommonPacketFormatData::address_info_item, cip_connection_object::cip_consumed_connection_id, cip_connection_object::cip_produced_connection_id, cip_connection_object::connection_serial_number, ConnectionObjectSetState(), CipMessageRouterResponse::data, CipCommonPacketFormatData::data_item, CipMessageRouterResponse::data_length, g_common_packet_format_data_item, CipMessageRouterResponse::general_status, CipCommonPacketFormatData::item_count, kCipErrorNotEnoughData, kCipErrorSuccess, kCipErrorTooMuchData, kCipItemIdUnconnectedDataItem, kConnectionManagerExtendedStatusCodeErrorInvalidOToTConnectionSize, kConnectionManagerExtendedStatusCodeErrorInvalidTToOConnectionSize, kConnectionObjectStateNonExistent, kEipStatusOkSend, kForwardOpen, cip_connection_object::o_to_t_requested_packet_interval, OPENER_TRACE_INFO, cip_connection_object::originator_serial_number, cip_connection_object::originator_vendor_id, CipMessageRouterResponse::reply_service, CipMessageRouterResponse::size_of_additional_status, cip_connection_object::t_to_o_requested_packet_interval, DataItem::type_id, and SocketAddressInfoItem::type_id.

Referenced by ForwardOpen(), HandleNonNullMatchingForwardOpenRequest(), HandleNonNullNonMatchingForwardOpenRequest(), HandleNullMatchingForwardOpenRequest(), and HandleNullNonMatchingForwardOpenRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

EipStatus CheckElectronicKeyData ( EipUint8  key_format,
void *  key_data,
EipUint16 extended_status 
)

Compare the electronic key received with a forward open request with the device's data.

Parameters
key_formatformat identifier given in the forward open request
key_datapointer to the electronic key data received in the forward open request
extended_statusthe extended error code in case an error happened
Returns
general status on the establishment
  • EIP_OK ... on success
  • On an error the general status code to be put into the response

Definition at line 972 of file cipconnectionmanager.c.

References device_type_, ElectronicKeyFormat4GetDeviceType(), ElectronicKeyFormat4GetMajorRevision(), ElectronicKeyFormat4GetMajorRevisionCompatibility(), ElectronicKeyFormat4GetMinorRevision(), ElectronicKeyFormat4GetProductCode(), ElectronicKeyFormat4GetVendorId(), kConnectionManagerExtendedStatusCodeErrorDeviceTypeError, kConnectionManagerExtendedStatusCodeErrorInvalidSegmentTypeInPath, kConnectionManagerExtendedStatusCodeErrorRevisionMismatch, kConnectionManagerExtendedStatusCodeErrorVendorIdOrProductcodeError, kConnectionManagerExtendedStatusCodeSuccess, kEipStatusError, kEipStatusOk, CipRevision::major_revision, CipRevision::minor_revision, product_code_, and vendor_id_.

Referenced by ParseConnectionPath().

Here is the call graph for this function:

Here is the caller graph for this function:

CipConnectionObject * CheckForExistingConnection ( const CipConnectionObject *const  connection_object)

check if the data given in the connection object match with an already established connection

The comparison is done according to the definitions in the CIP specification Section 3-5.5.2: The following elements have to be equal: Vendor ID, Connection Serial Number, Originator Serial Number

Parameters
connection_objectconnection object containing the comparison elements from the forward open request
Returns
  • NULL if no equal established connection exists
  • pointer to the equal connection object

Definition at line 954 of file cipconnectionmanager.c.

References ConnectionObjectGetState(), doubly_linked_list_node::data, EqualConnectionTriad(), DoublyLinkedList::first, kConnectionObjectStateEstablished, and doubly_linked_list_node::next.

Referenced by ForwardOpen().

Here is the call graph for this function:

Here is the caller graph for this function:

void CheckForTimedOutConnectionsAndCloseTCPConnections ( const CipConnectionObject *const  connection_object,
CloseSessionFunction  CloseSessions 
)

Definition at line 1506 of file cipconnectionmanager.c.

References ConnectionObjectEqualOriginator(), ConnectionObjectGetState(), doubly_linked_list_node::data, DoublyLinkedList::first, kConnectionObjectStateTimedOut, and doubly_linked_list_node::next.

Referenced by Class3ConnectionTimeoutHandler(), and HandleIoConnectionTimeOut().

Here is the call graph for this function:

Here is the caller graph for this function:

void CloseConnection ( CipConnectionObject *RESTRICT  connection_object)

Close the given connection.

This function will take the data form the connection and correctly closes the connection (e.g., open sockets)

Parameters
connection_objectpointer to the connection object structure to be closed

Definition at line 1385 of file cipconnectionmanager.c.

References CloseUdpSocket(), ConnectionObjectGetTransportClassTriggerTransportClass(), ConnectionObjectInitializeEmpty(), kConnectionObjectTransportClassTriggerTransportClass3, kUdpCommuncationDirectionConsuming, kUdpCommuncationDirectionProducing, and RemoveFromActiveConnections().

Referenced by Class3ConnectionTimeoutHandler(), and EstablishClass3Connection().

Here is the call graph for this function:

Here is the caller graph for this function:

EipStatus ConnectionManagerInit ( EipUint16  unique_connection_id)

Initialize the data of the connection manager object.

Parameters
unique_connection_idA unique connection id
Returns
kEipStatusOk if successful, otherwise kEipStatusError

Definition at line 207 of file cipconnectionmanager.c.

References AddConnectableObject(), CreateCipClass(), EstablishClass3Connection(), EstablishIoConnection(), ForwardClose(), ForwardOpen(), g_incarnation_id, GetAttributeAll(), GetAttributeSingle(), GetConnectionOwner(), InitializeConnectionManager(), InitializeConnectionManagerData(), InsertService(), kEipStatusError, kEipStatusOk, kForwardClose, kForwardOpen, kGetAttributeAll, kGetAttributeSingle, and kGetConnectionOwner.

Referenced by CipStackInit().

Here is the call graph for this function:

Here is the caller graph for this function:

EipStatus ForwardOpen ( CipInstance instance,
CipMessageRouterRequest message_router_request,
CipMessageRouterResponse message_router_response,
struct sockaddr *  originator_address,
const int  encapsulation_session 
)

Check if resources for new connection available, generate ForwardOpen Reply message.

Forward Open four cases Non-Null/Not matching - open a connection Non-Null/Matching - error Null/Not matching - ping a device/configure Null/Matching - reconfigure

Null connection - both O->T and T->O connection parameter field are null Non-Null connection - one or both O->T and T->O connection parameter field are not null Matching - Connection Triad matches an existing connection (Connection Serial Number, Originator Vendor ID and Originator Serial Number)

Parameters
instancepointer to CIP object instance
message_router_requestpointer to Message Router Request.
message_router_responsepointer to Message Router Response.
originator_addressaddress struct of the originator as received
encapsulation_sessionassociated encapsulation session of the explicit message
Returns
>0 .. success, 0 .. no reply to send back -1 .. error

Definition at line 492 of file cipconnectionmanager.c.

References AssembleForwardOpenResponse(), cip_connection_object::associated_encapsulation_session, CheckForExistingConnection(), ConnectionObjectGetOToTConnectionType(), ConnectionObjectGetTToOConnectionType(), ConnectionObjectInitializeFromMessage(), CipMessageRouterRequest::data, kCipErrorConnectionFailure, kConnectionManagerExtendedStatusCodeErrorInvalidOToTConnectionType, kConnectionManagerExtendedStatusCodeErrorInvalidTToOConnectionType, kConnectionObjectConnectionTypeInvalid, kConnectionObjectConnectionTypeNull, OPENER_TRACE_INFO, and cip_connection_object::originator_address.

Referenced by ConnectionManagerInit().

Here is the call graph for this function:

Here is the caller graph for this function:

CipConnectionObject* GetConnectedObject ( const EipUint32  connection_id)

Get a connected object dependent on requested ConnectionID.

Parameters
connection_idConnection ID of the Connection Object to get
Returns
pointer to connected Object NULL .. connection not present in device

Definition at line 920 of file cipconnectionmanager.c.

References ConnectionObjectGetCipConsumedConnectionID(), ConnectionObjectGetState(), doubly_linked_list_node::data, DoublyLinkedList::first, kConnectionObjectStateEstablished, and doubly_linked_list_node::next.

Referenced by HandleReceivedConnectedData(), and NotifyConnectedCommonPacketFormat().

Here is the call graph for this function:

Here is the caller graph for this function:

CipConnectionObject* GetConnectedOutputAssembly ( const EipUint32  output_assembly_id)

Get a connection object for a given output assembly.

Parameters
output_assembly_idrequested output assembly of requested connection
Returns
pointer to connected Object 0 .. connection not present in device

Definition at line 935 of file cipconnectionmanager.c.

References ConnectionObjectGetInstanceType(), ConnectionObjectGetState(), doubly_linked_list_node::data, DoublyLinkedList::first, kConnectionObjectInstanceTypeIOExclusiveOwner, kConnectionObjectStateEstablished, kConnectionObjectStateTimedOut, and doubly_linked_list_node::next.

Referenced by GetExclusiveOwnerConnection().

Here is the call graph for this function:

Here is the caller graph for this function:

CipUint GetConnectionId ( void  )

Generate a new connection Id utilizing the Incarnation Id as described in the EIP specs.

A unique connectionID is formed from the boot-time-specified "incarnation ID" and the per-new-connection-incremented connection number/counter.

Returns
new connection id

Definition at line 177 of file cipconnectionmanager.c.

References g_incarnation_id.

Referenced by ConnectionObjectGeneralConfiguration().

Here is the caller graph for this function:

ConnectionManagementHandling * GetConnectionManagementEntry ( const EipUint32  class_id)

Definition at line 1465 of file cipconnectionmanager.c.

Referenced by HandleNonNullNonMatchingForwardOpenRequest().

Here is the caller graph for this function:

EipStatus GetConnectionOwner ( CipInstance instance,
CipMessageRouterRequest message_router_request,
CipMessageRouterResponse message_router_response,
struct sockaddr *  originator_address,
const int  encapsulation_session 
)

Definition at line 636 of file cipconnectionmanager.c.

References kEipStatusOk.

Referenced by ConnectionManagerInit().

Here is the caller graph for this function:

unsigned int GetPaddedLogicalPath ( const EipUint8 **  logical_path_segment)

gets the padded logical path TODO: enhance documentation

Parameters
logical_path_segmentTheLogical Path Segment
Returns
The padded logical path

Definition at line 155 of file cipconnectionmanager.c.

References OPENER_TRACE_ERR.

EipStatus HandleNonNullMatchingForwardOpenRequest ( CipConnectionObject connection_object,
CipInstance instance,
CipMessageRouterRequest message_router_request,
CipMessageRouterResponse message_router_response 
)

Handles a Non Null Matching Forward Open Request.

Non-Null, Matching request - Return General Status = kCipErrorConnectionFailure, Extended Status = kConnectionManagerExtendedStatusCodeErrorConnectionInUseOrDuplicateForwardOpen

Definition at line 375 of file cipconnectionmanager.c.

References AssembleForwardOpenResponse(), kCipErrorConnectionFailure, kConnectionManagerExtendedStatusCodeErrorConnectionInUseOrDuplicateForwardOpen, and OPENER_TRACE_INFO.

Here is the call graph for this function:

EipStatus HandleNullMatchingForwardOpenRequest ( CipConnectionObject connection_object,
CipInstance instance,
CipMessageRouterRequest message_router_request,
CipMessageRouterResponse message_router_response 
)

Handles a Null Matching Forward Open request.

Either reconfigure a target device’s application, or return General Status kCipErrorConnectionFailure and Extended Status kConnectionManagerExtendedStatusCodeNullForwardOpenNotSupported

Definition at line 350 of file cipconnectionmanager.c.

References AssembleForwardOpenResponse(), kCipErrorConnectionFailure, kConnectionManagerExtendedStatusCodeNullForwardOpenNotSupported, and OPENER_TRACE_INFO.

Here is the call graph for this function:

EipStatus HandleNullNonMatchingForwardOpenRequest ( CipConnectionObject connection_object,
CipInstance instance,
CipMessageRouterRequest message_router_request,
CipMessageRouterResponse message_router_response 
)

Handles a Null Non Matching Forward Open Request.

Null, Non-Matching - Either ping device, or configure a device’s application, or return General Status kCipErrorConnectionFailure and Extended Status kConnectionManagerExtendedStatusCodeNullForwardOpenNotSupported

Definition at line 324 of file cipconnectionmanager.c.

References AssembleForwardOpenResponse(), kCipErrorConnectionFailure, kConnectionManagerExtendedStatusCodeNullForwardOpenNotSupported, and OPENER_TRACE_INFO.

Here is the call graph for this function:

void InitializeConnectionManager ( CipClass class)

Definition at line 183 of file cipconnectionmanager.c.

References cip_instance::cip_class, cip_class::class_instance, cip_class::highest_attribute_number, InsertAttribute(), kCipUint, kGetableSingle, kGetableSingleAndAll, and kNotSetOrGetable.

Referenced by ConnectionManagerInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void InitializeConnectionManagerData ( void  )

Definition at line 1528 of file cipconnectionmanager.c.

References InitializeClass3ConnectionData(), and InitializeIoConnectionData().

Referenced by ConnectionManagerInit().

Here is the call graph for this function:

Here is the caller graph for this function:

EipBool8 IsConnectedOutputAssembly ( const EipUint32  instance_number)

Definition at line 1424 of file cipconnectionmanager.c.

References ConnectionObjectIsTypeIOConnection(), cip_connection_object::consumed_path, doubly_linked_list_node::data, DoublyLinkedList::first, connection_path_epath::instance_id, and doubly_linked_list_node::next.

Referenced by SetAssemblyAttributeSingle().

Here is the call graph for this function:

Here is the caller graph for this function:

EipUint8 ParseConnectionPath ( CipConnectionObject connection_object,
CipMessageRouterRequest message_router_request,
EipUint16 extended_error 
)

Parse the connection path of a forward open request.

This function will take the connection object and the received data stream and parse the connection path.

Parameters
connection_objectpointer to the connection object structure for which the connection should be established
message_router_requestpointer to the received request structure. The position of the data stream pointer has to be at the connection length entry
extended_errorthe extended error code in case an error happened
Returns
general status on the establishment
  • kEipStatusOk ... on success
  • On an error the general status code to be put into the response

Definition at line 1050 of file cipconnectionmanager.c.

References CheckElectronicKeyData(), CipEpathGetLogicalValue(), connection_path_epath::class_id, cip_connection_object::configuration_path, ConnectionObjectGetOToTConnectionType(), ConnectionObjectGetTransportClassTriggerProductionTrigger(), ConnectionObjectGetTransportClassTriggerTransportClass(), ConnectionObjectGetTToOConnectionType(), ConnectionObjectSetProductionInhibitTime(), cip_connection_object::consumed_connection_path, cip_connection_object::consumed_connection_path_length, cip_connection_object::consumed_path, CipMessageRouterRequest::data, cip_connection_object::electronic_key, ElectronicKeyFormat4Delete(), ElectronicKeyFormat4GetDeviceType(), ElectronicKeyFormat4GetMajorRevision(), ElectronicKeyFormat4GetMinorRevision(), ElectronicKeyFormat4GetProductCode(), ElectronicKeyFormat4GetVendorId(), ElectronicKeyFormat4New(), g_config_data_buffer, g_config_data_length, g_kForwardOpenHeaderLength, GetCipInstance(), GetElectronicKeyFormat4FromMessage(), GetPathDataSegmentSubtype(), GetPathLogicalSegmentElectronicKeyFormat(), GetPathLogicalSegmentLogicalType(), GetPathLogicalSegmentSpecialTypeLogicalType(), GetPathNetworkSegmentSubtype(), GetPathSegmentType(), GetSintFromMessage(), kCipErrorConnectionFailure, kCipErrorNotEnoughData, kCipErrorPathSegmentError, kCipErrorTooMuchData, kConnectionManagerExtendedStatusCodeErrorInvalidSegmentTypeInPath, kConnectionManagerExtendedStatusCodeInconsistentApplicationPathCombo, kConnectionManagerGeneralStatusPathSegmentErrorInUnconnectedSend, kConnectionObjectConnectionTypeNull, kConnectionObjectTransportClassTriggerProductionTriggerCyclic, kConnectionObjectTransportClassTriggerTransportClass3, kDataSegmentSubtypeSimpleData, kEipStatusOk, kElectronicKeySegmentFormatKeyFormat4, CipElectronicKey::key_data, CipElectronicKey::key_format, kLogicalSegmentLogicalTypeClassId, kLogicalSegmentLogicalTypeConnectionPoint, kLogicalSegmentLogicalTypeInstanceId, kLogicalSegmentLogicalTypeSpecial, kLogicalSegmentSpecialTypeLogicalFormatElectronicKey, kNetworkSegmentSubtypeProductionInhibitTimeInMilliseconds, kSegmentTypeDataSegment, kSegmentTypeLogicalSegment, kSegmentTypeNetworkSegment, OPENER_TRACE_ERR, OPENER_TRACE_INFO, OPENER_TRACE_WARN, cip_connection_object::produced_path, cip_connection_object::production_inhibit_time, and CipMessageRouterRequest::request_path_size.

Referenced by HandleNonNullNonMatchingForwardOpenRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

void RemoveFromActiveConnections ( CipConnectionObject *const  connection_object)

Removes connection from the list of active connections.

Parameters
connection_objectConnection object to be removed from the active connection list

Definition at line 1413 of file cipconnectionmanager.c.

References DoublyLinkedListRemoveNode(), DoublyLinkedList::first, doubly_linked_list_node::next, and OPENER_TRACE_ERR.

Referenced by CloseCommunicationChannelsAndRemoveFromActiveConnectionsList(), and CloseConnection().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

DoublyLinkedList connection_list

Definition at line 53 of file cipconnectionobject.c.

EipUint16 device_type_

Attribute 2: Device Type

Definition at line 42 of file cipidentity.c.

Referenced by CheckElectronicKeyData().

List holding information on the object classes and open/close function pointers to which connections may be established.

Definition at line 56 of file cipconnectionmanager.c.

CipConnectionObject g_dummy_connection_object

buffer connection object needed for forward open

Definition at line 59 of file cipconnectionmanager.c.

EipUint32 g_incarnation_id

Holds the connection ID's "incarnation ID" in the upper 16 bits.

Definition at line 62 of file cipconnectionmanager.c.

Referenced by ConnectionManagerInit(), and GetConnectionId().

const size_t g_kForwardOpenHeaderLength = 36

the length in bytes of the forward open command specific data till the start of the connection path (including con path size)

Definition at line 38 of file cipconnectionmanager.c.

Referenced by ParseConnectionPath().

EipUint16 product_code_

Attribute 3: Product Code

Definition at line 43 of file cipidentity.c.

Referenced by CheckElectronicKeyData().

CipRevision revision_

Attribute 4: Revision / USINT Major, USINT Minor

Definition at line 44 of file cipidentity.c.

EipUint16 vendor_id_

Attribute 1: Vendor ID

Definition at line 41 of file cipidentity.c.

Referenced by CheckElectronicKeyData().