cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
Internet Control Message Protocol server (ICMP) of the Network Transport Stack (NTS). More...
Modules | |
ICMP_TEST | |
Testbench for the Internet Control Message Protocol server (ICMP) of the Network Transport Stack (NTS). | |
Files | |
file | test_icmp.cpp |
: Testbench for the Internet Control Message Protocol (ICMP) server. | |
file | test_icmp.cpp |
: Testbench for the Internet Control Message Protocol (ICMP) server. | |
Macros | |
#define | THIS_NAME "ICMP" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_CMB 1 << 1 |
#define | TRACE_ICC 1 << 2 |
#define | TRACE_ICI 1 << 3 |
#define | TRACE_IHA 1 << 4 |
#define | TRACE_IPD 1 << 5 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF) |
Typedefs | |
typedef ap_uint< 17 > | Sum17 |
typedef ap_uint< 17 > | LE_Sum17 |
Functions | |
void | pIcmpChecksumChecker (stream< AxisIp4 > &siIPRX_Data, stream< AxisIp4 > &soIPd_Data, stream< ValBool > &soIPd_DropCmd, stream< IcmpCsum > &soICi_Csum) |
void | pControlMessageBuilder (stream< AxisIcmp > &siUOE_Data, stream< AxisIp4 > &siIPRX_Derr, stream< AxisIcmp > &soIHa_Data, stream< AxisIp4 > &soIHa_IpHdr, stream< IcmpCsum > &soICi_Csum) |
void | pIpHeaderAppender (Ip4Addr piMMIO_Ip4Address, stream< AxisIcmp > &siCMb_Data, stream< AxisIp4 > &siIHa_IpHdr, stream< AxisIp4 > &soICi_Data) |
void | pInvalidPacketDropper (stream< AxisIp4 > &siICc_Data, stream< ValBool > &siICc_DropCmd, stream< AxisIp4 > &soICi_Data) |
void | pIcmpChecksumInserter (stream< AxisIp4 > siXYz_Data[2], stream< IcmpCsum > siUVw_Csum[2], stream< AxisIp4 > &soIPTX_Data) |
void | icmp (Ip4Addr piMMIO_Ip4Address, stream< AxisIp4 > &siIPRX_Data, stream< AxisIp4 > &siIPRX_Derr, stream< AxisIcmp > &siUOE_Data, stream< AxisIp4 > &soIPTX_Data) |
Main process of the Internet Control Message Protocol (ICMP) Server. More... | |
void | icmp_top (Ip4Addr piMMIO_Ip4Address, stream< AxisRaw > &siIPRX_Data, stream< AxisRaw > &siIPRX_Derr, stream< AxisRaw > &siUOE_Data, stream< AxisRaw > &soIPTX_Data) |
Top of the Internet Control Message Protocol (ICMP) Server. More... | |
Variables | |
bool | gTraceEvent |
const IcmpType | ICMP_ECHO_REPLY = 0x00 |
const IcmpType | ICMP_DESTINATION_UNREACHABLE = 0x03 |
const IcmpType | ICMP_ECHO_REQUEST = 0x08 |
const IcmpType | ICMP_TIME_EXCEEDED = 0x0B |
const IcmpCode | ICMP_TTL_EXPIRED_IN_TRANSIT = 0x00 |
const IcmpCode | ICMP_DESTINATION_PORT_UNREACHABLE = 0x03 |
const Ip4Prot | ICMP_PROTOCOL = 0x01 |
Internet Control Message Protocol server (ICMP) of the Network Transport Stack (NTS).
void icmp | ( | Ip4Addr | piMMIO_Ip4Address, |
stream< AxisIp4 > & | siIPRX_Data, | ||
stream< AxisIp4 > & | siIPRX_Derr, | ||
stream< AxisIcmp > & | siUOE_Data, | ||
stream< AxisIp4 > & | soIPTX_Data | ||
) |
Main process of the Internet Control Message Protocol (ICMP) Server.
[in] | piMMIO_MacAddress | The MAC address from MMIO (in network order). |
[in] | siIPRX_Data | The data stream from the IP Rx handler (IPRX). |
[in] | siIPRX_Derr | Erroneous IP data stream from [IPRX]. |
[in] | siUOE_Data | A copy of the first IPv4 bytes that caused the error. |
[out] | soIPTX_Data | The data stream to the IpTxHandler (IPTX). |
This process is in charge of building and sending control and error messages back to the IP address that initiated the control request or that caused an error in the first place. The process performs the 3 following main tasks: 1) It implements the ICMP Echo Reply message used by the ping command. 2) It creates an error message of type "Time Exceeded" upon reception of an IPv4 packet which TTL has expired. 3) It creates an error message of type 'Destination Port Unreachable' if an UDP datagram is received for a port that is not opened in listening mode.
Definition at line 686 of file icmp.cpp.
void icmp_top | ( | Ip4Addr | piMMIO_Ip4Address, |
stream< AxisRaw > & | siIPRX_Data, | ||
stream< AxisRaw > & | siIPRX_Derr, | ||
stream< AxisRaw > & | siUOE_Data, | ||
stream< AxisRaw > & | soIPTX_Data | ||
) |
Top of the Internet Control Message Protocol (ICMP) Server.
[in] | piMMIO_MacAddress | The MAC address from MMIO (in network order). |
[in] | siIPRX_Data | The data stream from the IP Rx handler (IPRX). |
[in] | siIPRX_Derr | Erroneous IP data stream from [IPRX]. |
[in] | siUOE_Data | A copy of the first IPv4 bytes that caused the error. |
[out] | soIPTX_Data | The data stream to the IpTxHandler (IPTX). |
ENTITY - INTERNET CONTROL MESSAGE PROTOCOL (ICMP) SERVER
Definition at line 832 of file icmp.cpp.
void pControlMessageBuilder | ( | stream< AxisIcmp > & | siUOE_Data, |
stream< AxisIp4 > & | siIPRX_Derr, | ||
stream< AxisIcmp > & | soIHa_Data, | ||
stream< AxisIp4 > & | soIHa_IpHdr, | ||
stream< IcmpCsum > & | soICi_Csum | ||
) |
Control Message Builder (CMb)
[in] | siUOE_Data | The data stream from the UDP offload engine (UDP). |
[in] | siIPRX_Derr | Erroneous IP data stream from IpRxHandler (IPRX). |
[out] | soIHa_Data | Data stream to IpHeaderAppender (IHa). |
[out] | soIHa_Hdr | Header data stream to IpHeaderAppender (IHa). |
[out] | soICi_Csum | ICMP checksum to ICi. |
This process is dedicated to the building of 2 types of error messages: 1) It creates an error message of type "Time Exceeded" upon reception of an IPv4 packet which TTL has expired. 2) It creates an error message of type 'Destination Port Unreachable' if an UDP datagram is received for a port that is not opened in listening mode.
Definition at line 316 of file icmp.cpp.
void pIcmpChecksumChecker | ( | stream< AxisIp4 > & | siIPRX_Data, |
stream< AxisIp4 > & | soIPd_Data, | ||
stream< ValBool > & | soIPd_DropCmd, | ||
stream< IcmpCsum > & | soICi_Csum | ||
) |
ICMP header Checksum accumulator and Checker (ICc)
[in] | siIPRX_Data | The data stream from the IP Rx handler (IPRX). |
[out] | soIPd_Data | The data stream to IcmpPacketDropper (IPd) |
[out] | soIPd_DropCmd | THe drop command information for [IPd]. |
[out] | soICi_Csum | ICMP checksum to IcmpChecksumInserter (ICi). |
This process handles the incoming data stream from the IPRX. It assesses the validity of the ICMP checksum while forwarding the data stream to the InvalidPacketDropper (IPd). If the incoming packet is an ICMP_REQUEST, the packet forwarded to [IPd] is turned into an ICMP_REPLY by overwriting the 'Type' field. To avoid the recomputing of the entire ICMP checksum, an incremental checksum update is performed as described in RFC-1624. The resulting new header checksum is then forwarded to the IcmpChecksumInserter (ICi).
The format of the incoming ICMP message embedded into an IPv4 packet is as follows: 6 5 4 3 2 1 0 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Frag Ofst (L) |Flags| FO(H) | Identification | Total Length |Type of Service|Version| IHL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | Header Checksum | Protocol | Time to Live | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Code | Type | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Rest of Header (content varies based on the ICMP Type and Code) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Definition at line 117 of file icmp.cpp.
void pIcmpChecksumInserter | ( | stream< AxisIp4 > | siXYz_Data[2], |
stream< IcmpCsum > | siUVw_Csum[2], | ||
stream< AxisIp4 > & | soIPTX_Data | ||
) |
IP Checksum Inserter (ICi)
[in] | siXYz_Data | Data stream array from IPd and IHa. |
[in] | siUVw_Csum | ICMP checksum array from ICc and CMb. |
[out] | soIPTX_Data | The data stream to the IpTxHandler (IPTX). |
This process inserts both the IP header checksum and the ICMP checksum into the outgoing packet.
Definition at line 602 of file icmp.cpp.
void pInvalidPacketDropper | ( | stream< AxisIp4 > & | siICc_Data, |
stream< ValBool > & | siICc_DropCmd, | ||
stream< AxisIp4 > & | soICi_Data | ||
) |
Invalid Packet Dropper (IPd)
[in] | siICc_Data | Data stream from IcmpChecksumChecker (ICc). |
[in] | siICc_DropCmd | The drop command information from [ICc]. |
[out] | soICi_Data | Data stream to IcmpChecksumInserter (ICi). |
This process drops the messages which arrive with a bad checksum. All the other ICMP messages are forwarded to the IcmpChecksumInserter (ICi).
Definition at line 542 of file icmp.cpp.
void pIpHeaderAppender | ( | Ip4Addr | piMMIO_Ip4Address, |
stream< AxisIcmp > & | siCMb_Data, | ||
stream< AxisIp4 > & | siIHa_IpHdr, | ||
stream< AxisIp4 > & | soICi_Data | ||
) |
IP Header Appender (IHa)
[in] | piMMIO_Ip4Address | The IPv4 address from MMIO (in network order). |
[in] | siCMb_Data | Data stream from ControlMessageBuilder (CMb). |
[in] | siIHa_IpHdr | The IP header part of a data stream. |
[out] | soICi_Data | Data stream to IcmpChecksumInserter (ICi). |
Definition at line 436 of file icmp.cpp.
|
extern |
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (TRACE_MPd | TRACE_IBUF)
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 151 of file tb_nal.cpp.