42 #ifndef _DWMIPV4UDPPACKET_HH_ 43 #define _DWMIPV4UDPPACKET_HH_ 116 template <
typename T>
127 template <
typename T>
143 std::istream &
Read(std::istream & is);
148 std::ostream &
Write(std::ostream & os)
const;
153 ssize_t
Read(
int fd);
159 ssize_t
Write(
int fd)
const;
165 size_t Read(FILE * f);
171 size_t Write(FILE *f)
const;
177 int Read(gzFile gzf);
183 int Write(gzFile gzf)
const;
195 int BZWrite(BZFILE *bzf)
const;
207 bool SendTo(
int fd)
const;
226 #endif // _DWMIPV4UDPPACKET_HH_ This class abstracts a UNIX socket descriptor.
Definition: DwmSocket.hh:62
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmGZWritable.hh:57
bool SendTo(int fd) const
Sends the packet via the given descriptor fd.
Dwm::Writable pure virtual class definition.
std::string ToString() const
Returns the payload as a string.
std::istream & Read(std::istream &is)
Reads from an istream. Returns the istream.
int BZRead(BZFILE *bzf)
Reads the packet from the given BZFILE bzf.
Dwm::Readable pure virtual class definition.
bool SetPayload(const T &payload)
Sets the contained payload to payload.
Definition: DwmIpv4UdpPacket.hh:128
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.
uint32_t StreamedLength() const
Returns the numbers of bytes that should be written if one of the Write() members is called...
bool GetPayload(T &payload) const
Copies the payload into payload.
Definition: DwmIpv4UdpPayload.hh:119
Encapsulates a UDP payload.
Definition: DwmIpv4UdpPayload.hh:64
Ipv4UdpPacket()
Constructor.
Dwm::Ipv4UdpPayload class definition.
const Ipv4PacketHeader & IpHeader() const
Returns a const reference to the IP header.
Definition: DwmBZ2IO.hh:67
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: DwmGZReadable.hh:57
bool GetPayload(T &payload) const
Copies the contained payload into payload.
Definition: DwmIpv4UdpPacket.hh:117
Dwm::IO class definition.
uint32_t StreamedLength() const
Returns the number of bytes that would be written if one of the Write() members were called...
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
~Ipv4UdpPacket()
Destructor. If we own the underlying data, we free it.
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 BZWrite(BZFILE *bzf) const
Writes the packet to the given BZFILE bzf.
std::string Payload() const
Returns the payload as a string.
Definition: DwmIpv4UdpPacket.hh:106
const Ipv4UdpHeader & UdpHeader() const
Returns a const refernece to the UDP header.
Encapsulates a UDP packet, including the IP header.
Definition: DwmIpv4UdpPacket.hh:61
bool SetPayload(const T &payload)
Sets the payload to payload.
Definition: DwmIpv4UdpPayload.hh:136