OpENer - Open Source EtherNet/IP(TM) I/O Target Stack
2.1
|
Go to the source code of this file.
Functions | |
EipStatus | CipMessageRouterInit (void) |
Initialize the data structures of the message router. More... | |
void | DeleteAllClasses (void) |
Free all data allocated by the classes created in the CIP stack. More... | |
EipStatus | NotifyMessageRouter (EipUint8 *data, int data_length, const struct sockaddr *const originator_address, const int encapsulation_session) |
Notify the MessageRouter that an explicit message (connected or unconnected) has been received. This function will be called from the encapsulation layer. The CPF structure is already parsed an can be accessed via the global variable: g_stCPFDataItem. More... | |
EipStatus | RegisterCipClass (CipClass *cip_class) |
Register a CIP Class to the message router. More... | |
Variables | |
CipMessageRouterResponse | g_message_router_response |
Structure for storing the Response generated by an explict message. More... | |
EipStatus CipMessageRouterInit | ( | void | ) |
Initialize the data structures of the message router.
Definition at line 78 of file cipmessagerouter.c.
References CreateCipClass(), CipMessageRouterResponse::data, g_message_data_reply_buffer, GetAttributeSingle(), InitializeCipMessageRouterClass(), InsertService(), kEipStatusError, kEipStatusOk, kGetAttributeSingle, and CipMessageRouterResponse::reserved.
Referenced by CipStackInit().
void DeleteAllClasses | ( | void | ) |
Free all data allocated by the classes created in the CIP stack.
Definition at line 271 of file cipmessagerouter.c.
References cip_instance::attributes, cip_message_router_object::cip_class, cip_instance::cip_class, CipFree(), cip_class::class_instance, cip_class::class_name, g_first_object, cip_class::instances, cip_message_router_object::next, cip_instance::next, cip_class::number_of_attributes, and cip_class::services.
Referenced by ShutdownCipStack().
EipStatus NotifyMessageRouter | ( | EipUint8 * | data, |
int | data_length, | ||
const struct sockaddr *const | originator_address, | ||
const int | encapsulation_session | ||
) |
Notify the MessageRouter that an explicit message (connected or unconnected) has been received. This function will be called from the encapsulation layer. The CPF structure is already parsed an can be accessed via the global variable: g_stCPFDataItem.
data | pointer to the data buffer of the message directly at the beginning of the CIP part. |
data_length | number of bytes in the data buffer |
originator_address | The address of the originator as received |
encapsulation_session | The associated encapsulation session of the explicit message |
Definition at line 173 of file cipmessagerouter.c.
References cip_message_router_object::cip_class, CipEpath::class_id, cip_class::class_name, CreateMessageRouterRequestStructure(), CipMessageRouterResponse::data, CipMessageRouterResponse::data_length, g_message_data_reply_buffer, CipMessageRouterResponse::general_status, GetRegisteredObject(), kCipErrorPathDestinationUnknown, kCipErrorSuccess, kEipStatusError, kEipStatusOk, kEipStatusOkSend, NotifyClass(), OPENER_ASSERT, OPENER_TRACE_ERR, OPENER_TRACE_INFO, CipMessageRouterResponse::reply_service, CipMessageRouterRequest::request_path, CipMessageRouterResponse::reserved, and CipMessageRouterResponse::size_of_additional_status.
Referenced by NotifyCommonPacketFormat(), and NotifyConnectedCommonPacketFormat().
Register a CIP Class to the message router.
Register a class at the message router. In order that the message router can deliver explicit messages each class has to register. Will be automatically done when invoking create createCIPClass.
cip_class | CIP class to be registered |
cip_class | Pointer to a class object to be registered. |
Definition at line 154 of file cipmessagerouter.c.
References cip_message_router_object::cip_class, CipCalloc(), g_first_object, kEipStatusError, kEipStatusOk, and cip_message_router_object::next.
Referenced by CreateCipClass().
CipMessageRouterResponse g_message_router_response |
Structure for storing the Response generated by an explict message.
This buffer will be used for storing the result. The response message will be generated by assembleLinearMsg.
Definition at line 14 of file cipmessagerouter.c.
Referenced by NotifyCommonPacketFormat(), and NotifyConnectedCommonPacketFormat().