42 #ifndef _DWMIPV4TCPPACKET_HH_ 43 #define _DWMIPV4TCPPACKET_HH_ 120 template <
typename T>
131 template <
typename T>
147 std::istream &
Read(std::istream & is);
152 std::ostream &
Write(std::ostream & os)
const;
158 ssize_t
Read(
int fd);
164 ssize_t
Write(
int fd)
const;
170 size_t Read(FILE *f);
176 size_t Write(FILE *f)
const;
182 int Read(gzFile gzf);
188 int Write(gzFile gzf)
const;
200 int BZWrite(BZFILE *bzf)
const;
212 bool SendTo(
int fd)
const;
231 #endif // _DWMIPV4TCPPACKET_HH_ This class abstracts a UNIX socket descriptor.
Definition: DwmSocket.hh:62
const Ipv4TcpHeader & TcpHeader() const
Returns a const refernece to the TCP header.
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmGZWritable.hh:57
Dwm::Writable pure virtual class definition.
Dwm::BZ2Readable pure virtual class definition.
bool SetPayload(const T &payload)
Sets the packet payload to payload.
Definition: DwmIpv4TcpPacket.hh:132
bool SetPayload(const T &payload)
Sets the payload to payload.
Definition: DwmIpv4TcpPayload.hh:144
Dwm::GZReadable pure virtual class definition.
Dwm::Readable pure virtual class definition.
bool SendTo(int fd) const
Sends the packet via the given descriptor fd.
const Ipv4PacketHeader & IpHeader() const
Returns a const reference to the IP header.
int BZWrite(BZFILE *bzf) const
Writes the packet to the given BZFILE bzf.
bool GetPayload(T &payload) const
Copies the packet payload into payload.
Definition: DwmIpv4TcpPacket.hh:121
uint32_t StreamedLength() const
Returns the number of bytes that would be written if we called one of the Write() members...
Encapsulates a TCP payload.
Definition: DwmIpv4TcpPayload.hh:68
Dwm::Ipv4TcpPayload class definition.
std::ostream & Write(std::ostream &os) const
Writes to an ostream. Returns the ostream.
This class is a pure virtual class, defining an interface for classes that can read their contents fr...
Definition: DwmBZ2Readable.hh:57
Dwm::Socket class definition.
~Ipv4TcpPacket()
Destructor. If we own the underlying data, we free it.
Dwm::BZ2Writable pure virtual class definition.
Encapsulates a TCP packet, including the IP header.
Definition: DwmIpv4TcpPacket.hh:65
Ipv4TcpPacket()
Constructor.
std::string Payload() const
Returns the payload as a string.
Definition: DwmIpv4TcpPacket.hh:110
std::string ToString() const
Returns the payload as a string.
uint32_t StreamedLength() const
Returns the numbers of bytes that should be written if one of the Write() members is called...
Definition: DwmBZ2IO.hh:67
This class is a pure virtual class, defining an interface for classes that can read their contents fr...
Definition: DwmGZReadable.hh:57
Dwm::IO class definition.
This class defines an interface for classes that can write their contents to an ostream, file descriptor or FILE pointer.
Definition: DwmWritable.hh:58
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmBZ2Writable.hh:57
Dwm::GZWritable pure virtual class definition.
std::istream & Read(std::istream &is)
Reads from an istream. Returns the istream.
This class defines an interface for classes that can read their contents from an istream, file descriptor or FILE pointer.
Definition: DwmReadable.hh:58
int BZRead(BZFILE *bzf)
Reads the packet from the given BZFILE bzf.
bool GetPayload(T &payload) const
Copies the payload into payload.
Definition: DwmIpv4TcpPayload.hh:127