ethernet_cable ethernet_probe
API Reference Manual  /  4 Model-to-Model Interfaces  / 

ethernet_common

Description
SIM_INTERFACE(ethernet_common) {
        void (*frame)(conf_object_t *NOTNULL obj, const frags_t *frame,
                      eth_frame_crc_status_t crc_status);
};
#define ETHERNET_COMMON_INTERFACE "ethernet_common"

This interface is implemented by objects that receive Ethernet frames, both Ethernet devices and Ethernet link endpoints.

There is a single function frame which sends an Ethernet frame, without preamble nor SFD (Start Frame Delimiter), but with a CRC field.

The crc_status parameter provides out-of-band information on the contents of the frame with regards to the CRC field using one of the values in the eth_frame_crc_status_t enum:

typedef enum {
        Eth_Frame_CRC_Match,
        Eth_Frame_CRC_Mismatch,
        Eth_Frame_CRC_Unknown
} eth_frame_crc_status_t;

When a device calls a link's frame function, it can set crc_status to any of the three values. If the link receives a Eth_Frame_CRC_Unknown, it will compute the CRC itself to set the status to Eth_Frame_CRC_Match or Eth_Frame_CRC_Mismatch.

When a link calls a device's frame function, crc_status will be set to either Eth_Frame_CRC_Match or Eth_Frame_CRC_Mismatch, and never Eth_Frame_CRC_Unknown.

When two devices are directly connected to each others without using a link, the interpretation of Eth_Frame_CRC_Unknown is up to the devices' implementation.

Execution Context
frameCell Context

ethernet_cable ethernet_probe