/** * returns the next available packet id * * @return integer * @access public * */ public function nextPacketId() { if (++Net_DNS2_Lookups::$next_packet_id > 65535) { Net_DNS2_Lookups::$next_packet_id = 1; } return Net_DNS2_Lookups::$next_packet_id; }
* POSSIBILITY OF SUCH DAMAGE. * * @category Networking * @package Net_DNS2 * @author Mike Pultz <*****@*****.**> * @copyright 2010 Mike Pultz <*****@*****.**> * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @version SVN: $Id: Lookups.php 215 2013-10-28 04:20:36Z mike.pultz $ * @link http://pear.php.net/package/Net_DNS2 * @since File available since Release 0.6.0 * */ // // initalize the packet id value // Net_DNS2_Lookups::$next_packet_id = mt_rand(0, 65535); // // build the reverse lookup tables; this is just so we don't have to // have duplicate static content laying around. // Net_DNS2_Lookups::$rr_types_by_id = array_flip(Net_DNS2_Lookups::$rr_types_by_name); Net_DNS2_Lookups::$classes_by_id = array_flip(Net_DNS2_Lookups::$classes_by_name); Net_DNS2_Lookups::$rr_types_class_to_id = array_flip(Net_DNS2_Lookups::$rr_types_id_to_class); Net_DNS2_Lookups::$algorithm_name_to_id = array_flip(Net_DNS2_Lookups::$algorithm_id_to_name); Net_DNS2_Lookups::$digest_name_to_id = array_flip(Net_DNS2_Lookups::$digest_id_to_name); Net_DNS2_Lookups::$rr_qtypes_by_id = array_flip(Net_DNS2_Lookups::$rr_qtypes_by_name); Net_DNS2_Lookups::$rr_metatypes_by_id = array_flip(Net_DNS2_Lookups::$rr_metatypes_by_name); Net_DNS2_Lookups::$protocol_by_id = array_flip(Net_DNS2_Lookups::$protocol_by_name); /** * This class provides simple lookups used througout the Net_DNS2 code *