cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
SimArpPacket Class Reference

Class ARP Packet for simulation. More...

#include <SimArpPacket.hpp>

Public Member Functions

 SimArpPacket (int pktLen)
 
 SimArpPacket ()
 
void pushChunk (AxisArp arpChunk)
 
AxisArp pullChunk ()
 
int length ()
 
int size ()
 
void setHardwareType (ArpHwType htype)
 
ArpHwType getHardwareType ()
 
void setProtocolType (ArpProtType ptype)
 
ArpProtType getProtocolType ()
 
void setHardwareLength (ArpHwLen hlen)
 
ArpHwLen getHardwareLength ()
 
void setProtocolLength (ArpProtLen plen)
 
ArpProtLen getProtocolLength ()
 
void setOperation (ArpOper oper)
 
ArpProtType getOperation ()
 
void setSenderHwAddr (ArpSendHwAddr sha)
 
ArpSendHwAddr getSenderHwAddr ()
 
void setSenderProtAddr (ArpSendProtAddr spa)
 
ArpSendProtAddr getSenderProtAddr ()
 
void setTargetHwAddr (ArpTargHwAddr tha)
 
ArpTargHwAddr getTargetHwAddr ()
 
void setTargetProtAddr (ArpTargProtAddr tpa)
 
ArpTargProtAddr getTargetProtAddr ()
 

Detailed Description

Class ARP Packet for simulation.

This class defines an ARP packet as a stream of 'AxisArp' data chunks. Such an ARP packet consists of a double-ended queue that is used to accumulate all these data chunks. For the 10GbE MAC, the ARP chunks are 64 bits wide. ARP chunks are extracted from the Ethernet frame by the IPRX core and are transmitted to the ARP core.

Definition at line 49 of file SimArpPacket.hpp.

Constructor & Destructor Documentation

◆ SimArpPacket() [1/2]

SimArpPacket::SimArpPacket ( int  pktLen)
inline

Definition at line 86 of file SimArpPacket.hpp.

86  {
87  this->myName = "SimArpPacket";
88  setLen(0);
89  if (pktLen > 0 && pktLen <= MTU) {
90  int noBytes = pktLen;
91  while(noBytes > 8) {
92  pushChunk(AxisArp(0x0000000000000000, 0xFF, 0));
93  noBytes -= 8;
94  }
95  pushChunk(AxisArp(0x0000000000000000, lenToLE_tKeep(noBytes), TLAST));
96  }
97  }
void pushChunk(AxisArp arpChunk)
LE_tKeep lenToLE_tKeep(ap_uint< 4 > noValidBytes)
A function to set a number of '1' in an 8-bit field. It is used here to set the number of valid bytes...
Definition: nts_utils.cpp:307
#define TLAST
Definition: AxisRaw.hpp:116
#define MTU
Definition: udp.hpp:71
Here is the call graph for this function:

◆ SimArpPacket() [2/2]

SimArpPacket::SimArpPacket ( )
inline

Definition at line 98 of file SimArpPacket.hpp.

98  {
99  this->myName = "SimArpPacket";
100  setLen(0);
101  }

Member Function Documentation

◆ getHardwareLength()

ArpHwLen SimArpPacket::getHardwareLength ( )
inline

Definition at line 138 of file SimArpPacket.hpp.

138 { return pktQ[0].getArpHardwareLength(); }

◆ getHardwareType()

ArpHwType SimArpPacket::getHardwareType ( )
inline

Definition at line 131 of file SimArpPacket.hpp.

131 { return pktQ[0].getArpHardwareType(); }

◆ getOperation()

ArpProtType SimArpPacket::getOperation ( )
inline

Definition at line 145 of file SimArpPacket.hpp.

145 { return pktQ[0].getArpOperation(); }

◆ getProtocolLength()

ArpProtLen SimArpPacket::getProtocolLength ( )
inline

Definition at line 141 of file SimArpPacket.hpp.

141 { return pktQ[0].getArpProtocolLength(); }

◆ getProtocolType()

ArpProtType SimArpPacket::getProtocolType ( )
inline

Definition at line 135 of file SimArpPacket.hpp.

135 { return pktQ[0].getArpProtocolType(); }

◆ getSenderHwAddr()

ArpSendHwAddr SimArpPacket::getSenderHwAddr ( )
inline

Definition at line 148 of file SimArpPacket.hpp.

148 { return pktQ[1].getArpSenderHwAddr(); }
Here is the caller graph for this function:

◆ getSenderProtAddr()

ArpSendProtAddr SimArpPacket::getSenderProtAddr ( )
inline

Definition at line 153 of file SimArpPacket.hpp.

153  { ArpSendProtAddr spaHi = ((ArpSendProtAddr)(pktQ[1].getArpSenderProtAddrHi()) << 16);
154  ArpSendProtAddr spaLo = ((ArpSendProtAddr)(pktQ[2].getArpSenderProtAddrLo()) << 0);
155  return(spaHi | spaLo); }
ap_uint< 32 > ArpSendProtAddr
Definition: AxisArp.hpp:101
Here is the caller graph for this function:

◆ getTargetHwAddr()

ArpTargHwAddr SimArpPacket::getTargetHwAddr ( )
inline

Definition at line 159 of file SimArpPacket.hpp.

159 { return pktQ[2].getArpTargetHwAddr(); }

◆ getTargetProtAddr()

ArpTargProtAddr SimArpPacket::getTargetProtAddr ( )
inline

Definition at line 163 of file SimArpPacket.hpp.

163 { return pktQ[3].getArpTargetProtAddr(); }
Here is the caller graph for this function:

◆ length()

int SimArpPacket::length ( )
inline

Definition at line 120 of file SimArpPacket.hpp.

120  {
121  return this->len;
122  }
Here is the caller graph for this function:

◆ pullChunk()

AxisArp SimArpPacket::pullChunk ( )
inline

Definition at line 113 of file SimArpPacket.hpp.

113  {
114  AxisArp headingChunk = this->front();
115  this->pop_front();
116  setLen(getLen() - headingChunk.getLen());
117  return headingChunk;
118  }
int getLen() const
Definition: AxisRaw.hpp:411
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pushChunk()

void SimArpPacket::pushChunk ( AxisArp  arpChunk)
inline

Definition at line 104 of file SimArpPacket.hpp.

104  {
105  if (this->size() > 0) {
106  // Always clear 'TLAST' bit of previous chunck
107  this->pktQ[this->size()-1].setLE_TLast(0);
108  }
109  this->push_back(arpChunk);
110  this->setLen(this->getLen() + arpChunk.getLen());
111  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHardwareLength()

void SimArpPacket::setHardwareLength ( ArpHwLen  hlen)
inline

Definition at line 137 of file SimArpPacket.hpp.

137 { pktQ[0].setArpHardwareLength(hlen);}
Here is the caller graph for this function:

◆ setHardwareType()

void SimArpPacket::setHardwareType ( ArpHwType  htype)
inline

Definition at line 129 of file SimArpPacket.hpp.

129 { pktQ[0].setArpHardwareType(htype); }
Here is the caller graph for this function:

◆ setOperation()

void SimArpPacket::setOperation ( ArpOper  oper)
inline

Definition at line 143 of file SimArpPacket.hpp.

143 { pktQ[0].setArpOperation(oper); }
Here is the caller graph for this function:

◆ setProtocolLength()

void SimArpPacket::setProtocolLength ( ArpProtLen  plen)
inline

Definition at line 140 of file SimArpPacket.hpp.

140 { pktQ[0].setArpProtocolLength(plen);}
Here is the caller graph for this function:

◆ setProtocolType()

void SimArpPacket::setProtocolType ( ArpProtType  ptype)
inline

Definition at line 133 of file SimArpPacket.hpp.

133 { pktQ[0].setArpProtocolType(ptype); }
Here is the caller graph for this function:

◆ setSenderHwAddr()

void SimArpPacket::setSenderHwAddr ( ArpSendHwAddr  sha)
inline

Definition at line 147 of file SimArpPacket.hpp.

147 { pktQ[1].setArpSenderHwAddr(sha); }
Here is the caller graph for this function:

◆ setSenderProtAddr()

void SimArpPacket::setSenderProtAddr ( ArpSendProtAddr  spa)
inline

Definition at line 150 of file SimArpPacket.hpp.

150  { pktQ[1].setArpSenderProtAddrHi(spa);
151  pktQ[2].setArpSenderProtAddrLo(spa); }
Here is the caller graph for this function:

◆ setTargetHwAddr()

void SimArpPacket::setTargetHwAddr ( ArpTargHwAddr  tha)
inline

Definition at line 157 of file SimArpPacket.hpp.

157 { pktQ[2].setArpTargetHwAddr(tha); }
Here is the caller graph for this function:

◆ setTargetProtAddr()

void SimArpPacket::setTargetProtAddr ( ArpTargProtAddr  tpa)
inline

Definition at line 161 of file SimArpPacket.hpp.

161 { pktQ[3].setArpTargetProtAddr(tpa); }
Here is the caller graph for this function:

◆ size()

int SimArpPacket::size ( )
inline

Definition at line 124 of file SimArpPacket.hpp.

124  {
125  return this->pktQ.size();
126  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: