| 152 | } |
| 153 | |
| 154 | EipStatus RegisterCipClass(CipClass *cip_class) { |
| 155 | CipMessageRouterObject **message_router_object = &g_first_object; |
| 156 | |
| 157 | while (*message_router_object) { |
| 158 | message_router_object = &(*message_router_object)->next; /* follow the list until p points to an empty link (list end)*/ |
| 159 | |
| 160 | } |
| 161 | *message_router_object = (CipMessageRouterObject *) CipCalloc( |
| 162 | 1, sizeof(CipMessageRouterObject) ); /* create a new node at the end of the list*/ |
| 163 | if (*message_router_object == 0) { |
| 164 | return kEipStatusError; /* check for memory error*/ |
| 165 | |
| 166 | } |
| 167 | (*message_router_object)->cip_class = cip_class; /* fill in the new node*/ |
| 168 | (*message_router_object)->next = NULL; |
| 169 | |
| 170 | return kEipStatusOk; |
| 171 | } |
| 172 | |
| 173 | EipStatus NotifyMessageRouter(EipUint8 *data, |
| 174 | int data_length, |
no test coverage detected