Panda3D
datagramUDPHeader.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file datagramUDPHeader.I
10  * @author drose
11  * @date 2001-08-01
12  */
13 
14 /**
15  * Returns the checksum appropriate for the indicated datagram.
16  */
17 INLINE int DatagramUDPHeader::
19  DatagramIterator di(_header);
20  return di.get_uint16();
21 }
22 
23 /**
24  * Returns a pointer to a block of data of length datagram_udp_header_size,
25  * which can be written to the network as the header information.
26  */
27 INLINE std::string DatagramUDPHeader::
28 get_header() const {
29  return _header.get_message();
30 }
DatagramIterator::get_uint16
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
Definition: datagramIterator.I:145
DatagramIterator
A class to retrieve the individual data elements previously stored in a Datagram.
Definition: datagramIterator.h:27
Datagram::get_message
std::string get_message() const
Returns the datagram's data as a string.
Definition: datagram.I:314
DatagramUDPHeader::get_header
std::string get_header() const
Returns a pointer to a block of data of length datagram_udp_header_size, which can be written to the ...
Definition: datagramUDPHeader.I:28
DatagramUDPHeader::get_datagram_checksum
int get_datagram_checksum() const
Returns the checksum appropriate for the indicated datagram.
Definition: datagramUDPHeader.I:18