TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Ethernet.h File Reference
#include "temu-c/Support/Bitmanip.h"
#include "temu-c/Support/Buffer.h"
#include "temu-c/Support/Objsys.h"
#include <stdint.h>
Include dependency graph for Ethernet.h:

Go to the source code of this file.

Data Structures

struct  temu_EthFrame
 
struct  temu_MACIface
 
struct  temu_PHYIface
 
struct  temu_EthernetIface
 
struct  temu_MDIOIface
 

Macros

#define TEMU_ETH_CRC_ERR   1
 
#define TEMU_ETH_ETH_CRC_NOT_SET   (1 << 1)
 
#define TEMU_ETH_IP_CRC_NOT_SET   (1 << 2)
 
#define TEMU_ETH_UDP_CRC_NOT_SET   (1 << 3)
 
#define TEMU_ETH_TCP_CRC_NOT_SET   (1 << 4)
 
#define TEMU_ETH_NON_STANDARD_PREAMBLE   (1 << 5)
 
#define TEMU_MAC_IFACE_TYPE   "temu::MACIface"
 
#define TEMU_PHY_IFACE_TYPE   "temu::PHYIface"
 
#define TEMU_ETH_100BASE_T4   (1 << (15 - 8))
 
#define TEMU_ETH_100BASE_X_FD   (1 << (14 - 8))
 
#define TEMU_ETH_100BASE_X_HD   (1 << (13 - 8))
 
#define TEMU_ETH_10BASE_FD   (1 << (12 - 8))
 
#define TEMU_ETH_10BASE_HD   (1 << (11 - 8))
 
#define TEMU_ETH_100BASE_T2_FD   (1 << (10 - 8))
 
#define TEMU_ETH_100BASE_T2_HD   (1 << (9 - 8))
 
#define TEMU_ETH_1000BASE_X_FD   (1 << 15)
 
#define TEMU_ETH_1000BASE_X_HD   (1 << 14)
 
#define TEMU_ETH_1000BASE_T_FD   (1 << 13)
 
#define TEMU_ETH_1000BASE_T_HD   (1 << 12)
 
#define TEMU_ETHERNET_IFACE_TYPE   "temu::EthernetIface"
 
#define TEMU_MDIO_IFACE_TYPE   "temu::MDIOIface"
 
#define TEMU_ETH_MIN_PAYLOAD   46
 
#define TEMU_ETH_MAX_PAYLOAD   1500
 
#define TEMU_ETH_LAYER1_HEADER_LENGTH   (7 + 1 + 12 + 2)
 
#define TEMU_ETH_LAYER2_HEADER_LENGTH   (6 + 6 + 2)
 
#define TEMU_ETH_CRC_LENGTH   4
 
#define TEMU_ETH_INTERPACKET_GAP   12
 
#define TEMU_ETH_PAYLOAD_OFFSET   (6 + 6 + 2)
 
#define TEMU_ETH_MAX_FRAME_LENGTH   1518
 
#define TEMU_ETH_802_1Q_MAX_FRAME_LENGTH   1522
 
#define TEMU_ETHTYPE_IPV4   0x0800
 
#define TEMU_ETHTYPE_ARP   0x0806
 
#define TEMU_ETHTYPE_WAKE_ON_LAN   0x0842
 
#define TEMU_ETHTYPE_SRP   0x22ea
 
#define TEMU_ETHTYPE_RARP   0x8035
 
#define TEMU_ETHTYPE_802_1Q   0x8100
 
#define TEMU_ETHTYPE_IPV6   0x86dd
 
#define TEMU_ETHTYPE_PTP   0x88f7
 
#define TEMU_ETHTYPE_TTE_CTRL   0x891d
 
#define TEMU_ETH_IPV4_VERS_IHL_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 0)
 
#define TEMU_ETH_IPV4_DSCP_ECN_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 1)
 
#define TEMU_ETH_IPV4_TOTAL_LENGTH_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 2)
 
#define TEMU_ETH_IPV4_FRAGMENTATION_INFO_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 6)
 
#define TEMU_ETH_IPV4_TTL_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 8)
 
#define TEMU_ETH_IPV4_PROTOCOL_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 9)
 
#define TEMU_ETH_IPV4_CRC_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 10)
 
#define TEMU_ETH_IPV4_SRC_IP_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 12)
 
#define TEMU_ETH_IPV4_DST_IP_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 16)
 
#define TEMU_IP_PROT_TCP   0x06
 
#define TEMU_IP_PROT_UDP   0x11
 
#define TEMU_TCP_CRC_OFFSET   16
 
#define TEMU_UDP_CRC_OFFSET   6
 
#define ETH_BCAST_ADDR   UINT64_C(0xffffffffffff)
 
#define ETH_ETHERTYPE_MIN   1536
 
#define ETH_CRC_MAGIC   0xC704DD7B
 
#define ETH_CRC_POLY_NORM   0x04C11DB7
 
#define ETH_CRC_POLY_REV   0xEDB88320
 
#define ETH_CRC_POLY_REV_RECIP   0x82608EDB
 
#define ETH_CRC_POLY_LE   0xedb88320
 
#define ETH_CRC_POLY_BE   0x04c11db6
 

Typedefs

typedef struct temu_PHYIface temu_PHYIface
 
typedef struct temu_MACIface temu_MACIface
 
typedef struct temu_EthernetIface temu_EthernetIface
 

Functions

 TEMU_IFACE_REFERENCE_TYPE (temu_MAC)
 
 TEMU_IFACE_REFERENCE_TYPE (temu_PHY)
 
 TEMU_IFACE_REFERENCE_TYPE (temu_Ethernet)
 
 TEMU_IFACE_REFERENCE_TYPE (temu_MDIO)
 

Macro Definition Documentation

#define ETH_BCAST_ADDR   UINT64_C(0xffffffffffff)

Definition at line 295 of file Ethernet.h.

#define ETH_CRC_MAGIC   0xC704DD7B

Definition at line 322 of file Ethernet.h.

#define ETH_CRC_POLY_BE   0x04c11db6

Definition at line 328 of file Ethernet.h.

#define ETH_CRC_POLY_LE   0xedb88320

Definition at line 327 of file Ethernet.h.

#define ETH_CRC_POLY_NORM   0x04C11DB7

Definition at line 323 of file Ethernet.h.

#define ETH_CRC_POLY_REV   0xEDB88320

Definition at line 324 of file Ethernet.h.

#define ETH_CRC_POLY_REV_RECIP   0x82608EDB

Definition at line 325 of file Ethernet.h.

#define ETH_ETHERTYPE_MIN   1536

Definition at line 320 of file Ethernet.h.

#define TEMU_ETH_1000BASE_T_FD   (1 << 13)

Definition at line 135 of file Ethernet.h.

#define TEMU_ETH_1000BASE_T_HD   (1 << 12)

Definition at line 136 of file Ethernet.h.

#define TEMU_ETH_1000BASE_X_FD   (1 << 15)

Definition at line 133 of file Ethernet.h.

#define TEMU_ETH_1000BASE_X_HD   (1 << 14)

Definition at line 134 of file Ethernet.h.

#define TEMU_ETH_100BASE_T2_FD   (1 << (10 - 8))

Definition at line 129 of file Ethernet.h.

#define TEMU_ETH_100BASE_T2_HD   (1 << (9 - 8))

Definition at line 130 of file Ethernet.h.

#define TEMU_ETH_100BASE_T4   (1 << (15 - 8))

Definition at line 124 of file Ethernet.h.

#define TEMU_ETH_100BASE_X_FD   (1 << (14 - 8))

Definition at line 125 of file Ethernet.h.

#define TEMU_ETH_100BASE_X_HD   (1 << (13 - 8))

Definition at line 126 of file Ethernet.h.

#define TEMU_ETH_10BASE_FD   (1 << (12 - 8))

Definition at line 127 of file Ethernet.h.

#define TEMU_ETH_10BASE_HD   (1 << (11 - 8))

Definition at line 128 of file Ethernet.h.

#define TEMU_ETH_802_1Q_MAX_FRAME_LENGTH   1522

Definition at line 190 of file Ethernet.h.

#define TEMU_ETH_CRC_ERR   1

Definition at line 63 of file Ethernet.h.

#define TEMU_ETH_CRC_LENGTH   4

Definition at line 186 of file Ethernet.h.

#define TEMU_ETH_ETH_CRC_NOT_SET   (1 << 1)

Definition at line 65 of file Ethernet.h.

#define TEMU_ETH_INTERPACKET_GAP   12

Definition at line 187 of file Ethernet.h.

#define TEMU_ETH_IP_CRC_NOT_SET   (1 << 2)

Definition at line 66 of file Ethernet.h.

#define TEMU_ETH_IPV4_CRC_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 10)

Definition at line 212 of file Ethernet.h.

#define TEMU_ETH_IPV4_DSCP_ECN_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 1)

Definition at line 207 of file Ethernet.h.

#define TEMU_ETH_IPV4_DST_IP_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 16)

Definition at line 214 of file Ethernet.h.

#define TEMU_ETH_IPV4_FRAGMENTATION_INFO_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 6)

Definition at line 209 of file Ethernet.h.

#define TEMU_ETH_IPV4_PROTOCOL_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 9)

Definition at line 211 of file Ethernet.h.

#define TEMU_ETH_IPV4_SRC_IP_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 12)

Definition at line 213 of file Ethernet.h.

#define TEMU_ETH_IPV4_TOTAL_LENGTH_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 2)

Definition at line 208 of file Ethernet.h.

#define TEMU_ETH_IPV4_TTL_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 8)

Definition at line 210 of file Ethernet.h.

#define TEMU_ETH_IPV4_VERS_IHL_OFFSET   (TEMU_ETH_PAYLOAD_OFFSET + 0)

Definition at line 206 of file Ethernet.h.

#define TEMU_ETH_LAYER1_HEADER_LENGTH   (7 + 1 + 12 + 2)

Definition at line 184 of file Ethernet.h.

#define TEMU_ETH_LAYER2_HEADER_LENGTH   (6 + 6 + 2)

Definition at line 185 of file Ethernet.h.

#define TEMU_ETH_MAX_FRAME_LENGTH   1518

Definition at line 189 of file Ethernet.h.

#define TEMU_ETH_MAX_PAYLOAD   1500

Definition at line 183 of file Ethernet.h.

#define TEMU_ETH_MIN_PAYLOAD   46

Definition at line 182 of file Ethernet.h.

#define TEMU_ETH_NON_STANDARD_PREAMBLE   (1 << 5)

Definition at line 69 of file Ethernet.h.

#define TEMU_ETH_PAYLOAD_OFFSET   (6 + 6 + 2)

Definition at line 188 of file Ethernet.h.

#define TEMU_ETH_TCP_CRC_NOT_SET   (1 << 4)

Definition at line 68 of file Ethernet.h.

#define TEMU_ETH_UDP_CRC_NOT_SET   (1 << 3)

Definition at line 67 of file Ethernet.h.

#define TEMU_ETHERNET_IFACE_TYPE   "temu::EthernetIface"

Definition at line 161 of file Ethernet.h.

#define TEMU_ETHTYPE_802_1Q   0x8100

Definition at line 200 of file Ethernet.h.

#define TEMU_ETHTYPE_ARP   0x0806

Definition at line 196 of file Ethernet.h.

#define TEMU_ETHTYPE_IPV4   0x0800

Definition at line 195 of file Ethernet.h.

#define TEMU_ETHTYPE_IPV6   0x86dd

Definition at line 201 of file Ethernet.h.

#define TEMU_ETHTYPE_PTP   0x88f7

Definition at line 202 of file Ethernet.h.

#define TEMU_ETHTYPE_RARP   0x8035

Definition at line 199 of file Ethernet.h.

#define TEMU_ETHTYPE_SRP   0x22ea

Definition at line 198 of file Ethernet.h.

#define TEMU_ETHTYPE_TTE_CTRL   0x891d

Definition at line 203 of file Ethernet.h.

#define TEMU_ETHTYPE_WAKE_ON_LAN   0x0842

Definition at line 197 of file Ethernet.h.

#define TEMU_IP_PROT_TCP   0x06

Definition at line 216 of file Ethernet.h.

#define TEMU_IP_PROT_UDP   0x11

Definition at line 217 of file Ethernet.h.

#define TEMU_MAC_IFACE_TYPE   "temu::MACIface"

Definition at line 97 of file Ethernet.h.

#define TEMU_MDIO_IFACE_TYPE   "temu::MDIOIface"

Definition at line 179 of file Ethernet.h.

#define TEMU_PHY_IFACE_TYPE   "temu::PHYIface"

Definition at line 120 of file Ethernet.h.

#define TEMU_TCP_CRC_OFFSET   16

Definition at line 220 of file Ethernet.h.

#define TEMU_UDP_CRC_OFFSET   6

Definition at line 221 of file Ethernet.h.

Typedef Documentation

Definition at line 80 of file Ethernet.h.

typedef struct temu_MACIface temu_MACIface

Definition at line 79 of file Ethernet.h.

typedef struct temu_PHYIface temu_PHYIface

Definition at line 78 of file Ethernet.h.

Function Documentation

TEMU_IFACE_REFERENCE_TYPE ( temu_MAC  )
TEMU_IFACE_REFERENCE_TYPE ( temu_PHY  )
TEMU_IFACE_REFERENCE_TYPE ( temu_Ethernet  )
TEMU_IFACE_REFERENCE_TYPE ( temu_MDIO  )