Source for file rfc3411.php

Documentation is available at rfc3411.php

  1. <?php
  2. /**
  3. * phpsnmp - a PHP SNMP library
  4. *
  5. * Copyright (C) 2004 David Eder <david@eder,us>
  6. *
  7. * Based on snmp - a Python SNMP library
  8. * Copyright (C) 2003 Unicity Pty Ltd <libsnmp@unicity.com.au>
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * @author David Eder <david@eder.us>
  25. * @copyright 2004 David Eder
  26. * @package phpSNMP
  27. * @subpackage rfc1155
  28. * @version .7
  29. */
  30.  
  31. /**
  32. */
  33.  
  34. require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'rfc1155.php');
  35.  
  36. /**
  37. * SNMP V3 Engine ID
  38. *
  39. * @package phpSNMP
  40. * @subpackage rfc3411
  41. */
  42. class rfc3411_EngineID extends rfc1155_OctetString
  43. {
  44. /**
  45. * Constructor
  46. *
  47. * @param string $value
  48. */
  49. function rfc3411_EngineID($value)
  50. {
  51. if($value != '')
  52. {
  53. if(strlen($value) < 5 || strlen($value) > 32)
  54. trigger_error('rfc3411_EngineID must be of length 5 to 32', E_USER_WARNING);
  55. if(!(ord($value{0}) & 0x80) && strlen($value) != 12)
  56. trigger_error('rfc3411_EngineID size mismatch', E_USER_WARNING);
  57. }
  58. parent::rfc1155_OctetString($value);
  59. }
  60. }
  61. ?>

Documentation generated on Mon, 14 Nov 2005 17:55:36 -0700 by phpDocumentor 1.3.0RC3