Source for file docsis_baseline_privacy.php

Documentation is available at docsis_baseline_privacy.php

  1. <?php
  2. /**
  3. * DOCSIS Baseline Privacy
  4. *
  5. * @author David Eder <david@eder.us>
  6. * @copyright 2004 David Eder
  7. * @package docsis_config
  8. * @version .1
  9. */
  10.  
  11. /**
  12. */
  13. require_once('docsis_common.php');
  14.  
  15. define('DOCSIS_BASELINE_PRIVACY', 17);
  16. define('DOCSIS_BP_AUTH_TIMEOUT', 1);
  17. define('DOCSIS_BP_REAUTH_TIMEOUT', 2);
  18. define('DOCSIS_BP_AUTH_GRACE', 3);
  19. define('DOCSIS_BP_OP_TIMEOUT', 4);
  20. define('DOCSIS_BP_REKEY_TIMEOUT', 5);
  21. define('DOCSIS_BP_TEK_GRACE_TIMEOUT', 6);
  22. define('DOCSIS_BP_AUTH_REJECT_TIMEOUT', 7);
  23. define('DOCSIS_BP_SA_MAP_TIMEOUT', 8);
  24. define('DOCSIS_BP_SA_MAX_RETRIES', 9);
  25.  
  26. /**
  27. * Baseline Privacy
  28. *
  29. * @package docsis_config
  30. */
  31. class docsis_baseline_privacy extends docsis_encoder_complex
  32. {
  33. /**
  34. * Constructor
  35. *
  36. * @param int $code docsis code
  37. * @param array $value array of predefined fields
  38. */
  39. function docsis_baseline_privacy($code=DOCSIS_BASELINE_PRIVACY, $value=array())
  40. {
  41. parent::docsis_encoder_complex($code, $value);
  42. }
  43.  
  44. /**
  45. * Set Authorize Wait Timeout
  46. *
  47. * See Baseline Privacy Plus Interface Specification A.1.1.1.1
  48. *
  49. * @param int $value seconds from 1 to 30
  50. */
  51. function set_auth_timeout($value)
  52. {
  53. if($value < 1 || $value > 30) trigger_error('Auth Timeout must be 1 to 30', E_USER_WARNING);
  54. $this->value[DOCSIS_BP_AUTH_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_AUTH_TIMEOUT, $value);
  55. }
  56.  
  57. /**
  58. * Set Reauthorize Wait Timeout
  59. *
  60. * See Baseline Privacy Plus Interface Specification A.1.1.1.2
  61. *
  62. * @param int $value seconds from 1 to 30
  63. */
  64. function set_reauth_timeout($value)
  65. {
  66. if($value < 1 || $value > 30) trigger_error('Re-auth Timeout must be 1 to 30', E_USER_WARNING);
  67. $this->value[DOCSIS_BP_REAUTH_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_REAUTH_TIMEOUT, $value);
  68. }
  69.  
  70. /**
  71. * Set Authorize Grace Time
  72. *
  73. * See Baseline Privacy Plus Interface Specification A.1.1.1.3
  74. *
  75. * @param int $value seconds from 1 to 6047999
  76. */
  77. function set_auth_grace($value)
  78. {
  79. if($value < 1 || $value > 6047999) trigger_error('Auth Grace must be 1 to 6047999', E_USER_WARNING);
  80. $this->value[DOCSIS_BP_AUTH_GRACE] = new docsis_encoder_uint(DOCSIS_BP_AUTH_GRACE, $value);
  81. }
  82.  
  83. /**
  84. * Set Operational Wait Timeout
  85. *
  86. * See Baseline Privacy Plus Interface Specification A.1.1.1.4
  87. *
  88. * @param int $value seconds from 1 to 10
  89. */
  90. function set_op_timeout($value)
  91. {
  92. if($value < 1 || $value > 10) trigger_error('Operational Timeout must be 1 to 10', E_USER_WARNING);
  93. $this->value[DOCSIS_BP_OP_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_OP_TIMEOUT, $value);
  94. }
  95.  
  96. /**
  97. * Set Rekey Wait Timeout
  98. *
  99. * See Baseline Privacy Plus Interface Specification A.1.1.1.5
  100. *
  101. * @param int $value seconds from 1 to 10
  102. */
  103. function set_rekey_timeout($value)
  104. {
  105. if($value < 1 || $value > 10) trigger_error('Rekey Timeout must be 1 to 10', E_USER_WARNING);
  106. $this->value[DOCSIS_BP_REKEY_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_REKEY_TIMEOUT, $value);
  107. }
  108.  
  109. /**
  110. * Set TEK Grace Time
  111. *
  112. * See Baseline Privacy Plus Interface Specification A.1.1.1.6
  113. *
  114. * @param int $value seconds from 1 to 302399
  115. */
  116. function set_tek_grace_timeout($value)
  117. {
  118. if($value < 1 || $value > 302399) trigger_error('TEK Grace Timeout must be 1 to 302399', E_USER_WARNING);
  119. $this->value[DOCSIS_BP_TEK_GRACE_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_TEK_GRACE_TIMEOUT, $value);
  120. }
  121.  
  122. /**
  123. * Set Authorize Reject Wait Timeout
  124. *
  125. * See Baseline Privacy Plus Interface Specification A.1.1.1.7
  126. *
  127. * @param int $value seconds from 1 to 600
  128. */
  129. function set_auth_reject_timeout($value)
  130. {
  131. if($value < 1 || $value > 600) trigger_error('Auth Reject Timeout must be 1 to 600', E_USER_WARNING);
  132. $this->value[DOCSIS_BP_AUTH_REJECT_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_AUTH_REJECT_TIMEOUT, $value);
  133. }
  134.  
  135. /**
  136. * Set SA Map Wait Timeout
  137. *
  138. * See Baseline Privacy Plus Interface Specification A.1.1.1.8
  139. *
  140. * @param int $value seconds from 1 to 10
  141. */
  142. function set_sa_map_timeout($value)
  143. {
  144. if($value < 1 || $value > 10) trigger_error('SA MAP Timeout must be 1 to 10', E_USER_WARNING);
  145. $this->value[DOCSIS_BP_SA_MAP_TIMEOUT] = new docsis_encoder_uint(DOCSIS_BP_SA_MAP_TIMEOUT, $value);
  146. }
  147.  
  148. /**
  149. * Set SA Map Max Retries
  150. *
  151. * See Baseline Privacy Plus Interface Specification A.1.1.1.9
  152. *
  153. * @param int $value retries from 0 to 10
  154. */
  155. function set_sa_max_retries($value)
  156. {
  157. if($value < 0 || $value > 10) trigger_error('SA MAX Retries must be 0 to 10', E_USER_WARNING);
  158. $this->value[DOCSIS_BP_SA_MAX_RETRIES] = new docsis_encoder_uint(DOCSIS_BP_SA_MAX_RETRIES, $value);
  159. }
  160. }
  161. ?>

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