cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
Class IPv4 Packet for simulation. More...
#include <SimIp4Packet.hpp>
Public Member Functions | |
SimIp4Packet () | |
SimIp4Packet (int pktLen, int hdrLen=20) | |
void | pushChunk (AxisIp4 ip4Chunk) |
AxisIp4 | pullChunk () |
int | length () |
int | size () |
void | clear () |
void | clone (SimIp4Packet &ipPkt) |
Clone an IP packet. More... | |
void | cloneHeader (SimIp4Packet &ipPkt) |
Clone the header of an IP packet. More... | |
void | setIpVersion (int version) |
int | getIpVersion () |
void | setIpInternetHeaderLength (int ihl) |
int | getIpInternetHeaderLength () |
void | setIpTypeOfService (int tos) |
int | getIpTypeOfService () |
void | setIpTotalLength (int totLen) |
int | getIpTotalLength () |
void | setIpIdentification (int id) |
int | getIpIdentification () |
void | setIpFragmentOffset (int offset) |
int | getIpFragmentOffset () |
void | setIpFlags (int flags) |
void | setIpTimeToLive (Ip4TtL ttl) |
int | getIpTimeToLive () |
void | setIpProtocol (int prot) |
int | getIpProtocol () |
void | setIpHeaderChecksum (int csum) |
Ip4HdrCsum | getIpHeaderChecksum () |
void | setIpSourceAddress (int addr) |
Ip4Addr | getIpSourceAddress () |
LE_Ip4Addr | getLE_IpSourceAddress () |
void | setIpDestinationAddress (int addr) |
Ip4Addr | getIpDestinationAddress () |
LE_Ip4Addr | getLE_IpDestinationAddress () |
void | setTcpSourcePort (int port) |
int | getTcpSourcePort () |
LE_TcpPort | getLE_TcpSourcePort () |
void | setTcpDestinationPort (int port) |
int | getTcpDestinationPort () |
LE_TcpPort | getLE_TcpDestinationPort () |
void | setTcpSequenceNumber (TcpSeqNum num) |
TcpSeqNum | getTcpSequenceNumber () |
void | setTcpAcknowledgeNumber (TcpAckNum num) |
TcpAckNum | getTcpAcknowledgeNumber () |
void | setTcpDataOffset (int offset) |
int | getTcpDataOffset () |
void | setTcpControlFin (int bit) |
TcpCtrlBit | getTcpControlFin () |
void | setTcpControlSyn (int bit) |
TcpCtrlBit | getTcpControlSyn () |
void | setTcpControlRst (int bit) |
TcpCtrlBit | getTcpControlRst () |
void | setTcpControlPsh (int bit) |
TcpCtrlBit | getTcpControlPsh () |
void | setTcpControlAck (int bit) |
TcpCtrlBit | getTcpControlAck () |
void | setTcpControlUrg (int bit) |
TcpCtrlBit | getTcpControlUrg () |
void | setTcpWindow (int win) |
int | getTcpWindow () |
void | setTcpChecksum (int csum) |
int | getTcpChecksum () |
void | setTcpUrgentPointer (int ptr) |
int | getTcpUrgentPointer () |
void | setTcpOptionKind (int val) |
int | getTcpOptionKind () |
void | setTcpOptionMss (int val) |
int | getTcpOptionMss () |
void | setUdpSourcePort (UdpPort port) |
UdpPort | getUdpSourcePort () |
void | setUdpDestinationPort (UdpPort port) |
UdpPort | getUdpDestinationPort () |
void | setUdpLength (UdpLen len) |
UdpLen | getUdpLength () |
void | setUdpChecksum (UdpCsum csum) |
UdpCsum | getUdpChecksum () |
string | getIpHeader () |
string | getIpPayload () |
SimIcmpPacket | getIcmpPacket () |
SimUdpDatagram | getUdpDatagram () |
SimTcpSegment | getTcpSegment () |
Ip4DatLen | getTcpSegmentLength () |
bool | addIpPayload (SimUdpDatagram &udpDgm, int len=-1) |
Append some data to this packet from a UDP datagram. More... | |
bool | addIpPayload (SimIcmpPacket icmpPkt) |
Append the data payload of this packet as an ICMP packet. More... | |
bool | setIpPayload (SimIcmpPacket icmpPkt) |
Set the data payload of this packet as an ICMP packet. More... | |
string | getTcpData () |
Get TCP data from the current IPv4 packet. More... | |
bool | isFIN () |
Returns true if packet is a FIN. More... | |
bool | isSYN () |
Returns true if packet is a SYN. More... | |
bool | isACK () |
Returns true if packet is an ACK. More... | |
bool | isWellFormed (const char *callerName, bool checkIp4TotLen=true, bool checkIp4HdrCsum=true, bool checkUdpLen=true, bool checkLy4Csum=true) |
Checks if the IP header and embedded protocol fields are properly set. More... | |
void | printHdr (const char *callerName) |
Print the header details of an IP packet. More... | |
void | printRaw (const char *callerName) |
Raw print of an IP packet (.i.e, as AxisRaw chunks). More... | |
Ip4HdrCsum | reCalculateIpHeaderChecksum () |
Recalculate the IPv4 header checksum of a packet. More... | |
int | tcpRecalculateChecksum () |
Recalculate the checksum of a TCP segment after it was modified. More... | |
int | sizeOfTcpData () |
Return the size of the TCP data payload in octets. More... | |
bool | verifyIpHeaderChecksum () |
Recalculate the IPv4 header checksum and compare it with the one embedded into the packet. More... | |
UdpCsum | udpRecalculateChecksum () |
Recalculate checksum of an UDP datagram after it was modified. More... | |
bool | tcpVerifyChecksum () |
Recalculate the TCP checksum and compare it with the one embedded into the segment. More... | |
bool | udpVerifyChecksum () |
Recalculate the UDP checksum and compare it with the one embedded into the datagram. More... | |
bool | writeToDatFile (ofstream &outFileStream) |
Dump this IP packet as AxisIp4 chunks into a file. More... | |
void | writeTcpDataToDatFile (ofstream &outFile) |
Dump the TCP payload of this IP packet into a file. Data is written as a string. More... | |
Class IPv4 Packet for simulation.
This class defines an IPv4 packet as a set of 'AxisIp4' data chunks. Such an IPv4 packet consists of a double-ended queue that is used to accumulate all these data chunks. For the 10GbE MAC, the IPv4 chunks are 64 bits wide. IPv4 packets are processed by cores IPRX, IPTX, TOE, UDP and ICMP.
Definition at line 55 of file SimIp4Packet.hpp.
|
inline |
Definition at line 206 of file SimIp4Packet.hpp.
|
inline |
Definition at line 211 of file SimIp4Packet.hpp.
|
inline |
Append the data payload of this packet as an ICMP packet.
[in] | icmpPkt | The ICMP packet to use as IPv4 payload. |
Definition at line 859 of file SimIp4Packet.hpp.
|
inline |
Append some data to this packet from a UDP datagram.
[in] | udpDgrm | A ref. to the UDP datagram to use as data source. |
[in] | len | The number of bytes to append (must be a multiple of 8 bytes). If it is not specified, the entire datagram is appended. |
Definition at line 763 of file SimIp4Packet.hpp.
|
inline |
|
inline |
Clone an IP packet.
[in] | ipPkt | A reference to the packet to clone. |
Definition at line 278 of file SimIp4Packet.hpp.
|
inline |
Clone the header of an IP packet.
[in] | ipPkt | A reference to the packet to clone. |
Definition at line 291 of file SimIp4Packet.hpp.
|
inline |
Definition at line 518 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 361 of file SimIp4Packet.hpp.
|
inline |
Definition at line 356 of file SimIp4Packet.hpp.
|
inline |
Definition at line 373 of file SimIp4Packet.hpp.
|
inline |
Definition at line 369 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get TCP data from the current IPv4 packet.
Definition at line 1059 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 667 of file SimIp4Packet.hpp.
|
inline |
Definition at line 741 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 464 of file SimIp4Packet.hpp.
|
inline |
Definition at line 593 of file SimIp4Packet.hpp.
|
inline |
Definition at line 437 of file SimIp4Packet.hpp.
|
inline |
Definition at line 450 of file SimIp4Packet.hpp.
|
inline |
|
inline |
Returns true if packet is an ACK.
Definition at line 1108 of file SimIp4Packet.hpp.
|
inline |
Returns true if packet is a FIN.
Definition at line 1088 of file SimIp4Packet.hpp.
|
inline |
Returns true if packet is a SYN.
Definition at line 1098 of file SimIp4Packet.hpp.
|
inline |
Checks if the IP header and embedded protocol fields are properly set.
[in] | callerName | The name of the calling function or process. |
[in] | checkIp4TotLen | A default argument to disable this test. |
[in] | checkIp4HdrCsum | A default argument to disable this test. |
[in] | checkUdpLen | A default argument to disable this test. |
[in] | checkLy4Csum | A default argument to disable this test. |
Definition at line 1129 of file SimIp4Packet.hpp.
|
inline |
|
inline |
Print the header details of an IP packet.
[in] | callerName,the | name of the calling function or process. |
Definition at line 1225 of file SimIp4Packet.hpp.
|
inline |
Raw print of an IP packet (.i.e, as AxisRaw chunks).
[in] | callerName | The name of the calling function or process. |
Definition at line 1309 of file SimIp4Packet.hpp.
|
inline |
Definition at line 251 of file SimIp4Packet.hpp.
|
inline |
Definition at line 241 of file SimIp4Packet.hpp.
|
inline |
Recalculate the IPv4 header checksum of a packet.
Definition at line 1326 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the data payload of this packet as an ICMP packet.
[in] | icmpPkt | The ICMP packet to use as IPv4 payload. |
Definition at line 959 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 390 of file SimIp4Packet.hpp.
|
inline |
Definition at line 388 of file SimIp4Packet.hpp.
|
inline |
Definition at line 386 of file SimIp4Packet.hpp.
|
inline |
Definition at line 394 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 406 of file SimIp4Packet.hpp.
|
inline |
Definition at line 408 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 403 of file SimIp4Packet.hpp.
|
inline |
|
inline |
Definition at line 457 of file SimIp4Packet.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the size of the TCP data payload in octets.
Definition at line 1355 of file SimIp4Packet.hpp.
|
inline |
Recalculate the checksum of a TCP segment after it was modified.
Definition at line 1340 of file SimIp4Packet.hpp.
|
inline |
Recalculate the TCP checksum and compare it with the one embedded into the segment.
Definition at line 1399 of file SimIp4Packet.hpp.
|
inline |
Recalculate checksum of an UDP datagram after it was modified.
Definition at line 1384 of file SimIp4Packet.hpp.
|
inline |
Recalculate the UDP checksum and compare it with the one embedded into the datagram.
Definition at line 1417 of file SimIp4Packet.hpp.
|
inline |
Recalculate the IPv4 header checksum and compare it with the one embedded into the packet.
Definition at line 1366 of file SimIp4Packet.hpp.
|
inline |
Dump the TCP payload of this IP packet into a file. Data is written as a string.
[in] | outFile | A ref to the gold file to write. |
Definition at line 1453 of file SimIp4Packet.hpp.
|
inline |
Dump this IP packet as AxisIp4 chunks into a file.
[in] | outFileStream | A reference to the file stream to write. |
Definition at line 1438 of file SimIp4Packet.hpp.