Panda3D
 All Classes Functions Variables Enumerations
datagramUDPHeader.I
1 // Filename: datagramUDPHeader.I
2 // Created by: drose (01Aug01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: DatagramUDPHeader::get_datagram_checksum
18 // Access: Public
19 // Description: Returns the checksum appropriate for the indicated
20 // datagram.
21 ////////////////////////////////////////////////////////////////////
22 INLINE int DatagramUDPHeader::
24  DatagramIterator di(_header);
25  return di.get_uint16();
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: DatagramUDPHeader::get_header
30 // Access: Public
31 // Description: Returns a pointer to a block of data of length
32 // datagram_udp_header_size, which can be written to the
33 // network as the header information.
34 ////////////////////////////////////////////////////////////////////
35 INLINE string DatagramUDPHeader::
36 get_header() const {
37  return _header.get_message();
38 }
string get_message() const
Returns the datagram's data as a string.
Definition: datagram.I:431
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
string get_header() const
Returns a pointer to a block of data of length datagram_udp_header_size, which can be written to the ...
int get_datagram_checksum() const
Returns the checksum appropriate for the indicated datagram.
A class to retrieve the individual data elements previously stored in a Datagram. ...