OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipethernetlink.c File Reference
#include <string.h>
#include "cipethernetlink.h"
#include "cipcommon.h"
#include "cipmessagerouter.h"
#include "ciperror.h"
#include "endianconv.h"
#include "opener_api.h"
#include "trace.h"
Include dependency graph for cipethernetlink.c:

Go to the source code of this file.

Data Structures

struct  CipEthernetLinkInterfaceCapability
 
struct  CipEthernetLinkInterfaceControl
 
struct  speed_duplex_array_entry
 
struct  speed_duplex_options
 

Typedefs

typedef struct
speed_duplex_array_entry 
CipEthernetLinkSpeedDuplexArrayEntry
 
typedef struct speed_duplex_options CipEthernetLinkSpeedDuplexOptions
 

Functions

EipStatus CipEthernetLinkInit ()
 Initialize the Ethernet Link Objects data. More...
 
int EncodeInterfaceCapability (EipUint8 **pa_acMsg)
 
int EncodeInterfaceControl (EipUint8 **pa_acMsg)
 
int EncodeInterfaceCounters (EipUint8 **pa_acMsg)
 
int EncodeMediaCounters (EipUint8 **pa_acMsg)
 
EipStatus GetAttributeSingleEthernetLink (CipInstance *RESTRICT const instance, CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response, struct sockaddr *originator_address, const int encapsulation_session)
 

Variables

CipUdint dummy_attribute_udint = 0
 
CipUsint dummy_attribute_usint = 0
 Configures the MAC address of the Ethernet Link object*. More...
 
CipEthernetLinkInterfaceCapability interface_capability
 
CipEthernetLinkInterfaceControl interface_control
 
CipShortString interface_label = { .length = 0, .string = NULL }
 
CipEthernetLinkSpeedDuplexArrayEntry speed_duplex_object
 

Typedef Documentation

Function Documentation

EipStatus CipEthernetLinkInit ( void  )

Initialize the Ethernet Link Objects data.

Returns
kEipStatusOk if initialization was successful, otherwise kEipStatusError

Definition at line 68 of file cipethernetlink.c.

References CIP_ETHERNETLINK_CLASS_CODE, CreateCipClass(), dummy_attribute_udint, dummy_attribute_usint, g_ethernet_link, GetAttributeAll(), GetAttributeSingleEthernetLink(), GetCipInstance(), InsertAttribute(), InsertService(), CipEthernetLinkObject::interface_flags, CipEthernetLinkObject::interface_speed, kCip6Usint, kCipAny, kCipDword, kCipShortString, kCipUdint, kCipUsint, kEipStatusError, kEipStatusOk, kGetableAll, kGetableSingleAndAll, kGetAttributeAll, kGetAttributeSingle, and CipEthernetLinkObject::physical_address.

Referenced by CipStackInit().

Here is the call graph for this function:

Here is the caller graph for this function:

int EncodeInterfaceCapability ( EipUint8 **  pa_acMsg)

Definition at line 150 of file cipethernetlink.c.

References CipEthernetLinkInterfaceCapability::capability_bits, EncodeData(), speed_duplex_array_entry::interface_duplex_mode, speed_duplex_array_entry::interface_speed, kCipDword, kCipUint, kCipUsint, speed_duplex_options::speed_duplex_array, speed_duplex_options::speed_duplex_array_count, and CipEthernetLinkInterfaceCapability::speed_duplex_options.

Referenced by GetAttributeSingleEthernetLink().

Here is the call graph for this function:

Here is the caller graph for this function:

int EncodeInterfaceControl ( EipUint8 **  pa_acMsg)

Definition at line 139 of file cipethernetlink.c.

References CipEthernetLinkInterfaceControl::control_bits, EncodeData(), CipEthernetLinkInterfaceControl::forced_interface_speed, kCipUint, and kCipWord.

Referenced by GetAttributeSingleEthernetLink().

Here is the call graph for this function:

Here is the caller graph for this function:

int EncodeInterfaceCounters ( EipUint8 **  pa_acMsg)

Definition at line 121 of file cipethernetlink.c.

References dummy_attribute_udint, EncodeData(), and kCipUdint.

Referenced by GetAttributeSingleEthernetLink().

Here is the call graph for this function:

Here is the caller graph for this function:

int EncodeMediaCounters ( EipUint8 **  pa_acMsg)

Definition at line 130 of file cipethernetlink.c.

References dummy_attribute_udint, EncodeData(), and kCipUdint.

Referenced by GetAttributeSingleEthernetLink().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Variable Documentation

CipUdint dummy_attribute_udint = 0
CipUsint dummy_attribute_usint = 0

Configures the MAC address of the Ethernet Link object*.

Parameters
mac_addressThe MAC address of the Ethernet Link

Definition at line 49 of file cipethernetlink.c.

Referenced by CipEthernetLinkInit().

CipEthernetLinkInterfaceCapability interface_capability
Initial value:
= {
.capability_bits = 1, .speed_duplex_options = { .speed_duplex_array_count =
1,
.speed_duplex_array =
}

Definition at line 61 of file cipethernetlink.c.

Initial value:
= { .control_bits = 0,
.forced_interface_speed =
0 }

Definition at line 53 of file cipethernetlink.c.

CipShortString interface_label = { .length = 0, .string = NULL }

Definition at line 52 of file cipethernetlink.c.

Initial value:
= { .interface_speed =
100, .
interface_duplex_mode
= 1 }

Definition at line 57 of file cipethernetlink.c.