Documentation is available at docsis_capabilities.php
- <?php
- /**
- * DOCSIS Capabilities
- *
- * @author David Eder <david@eder.us>
- * @copyright 2004 David Eder
- * @package docsis_config
- * @version .1
- */
- /**
- */
- require_once('docsis_common.php');
- define('DOCSIS_CAPABILITIES', 5);
- define('DOCSIS_CAPABILITIES_CONCENTRATION', 1);
- define('DOCSIS_CAPABILITIES_VERSION', 2);
- define('DOCSIS_CAPABILITIES_FRAGMENTATION', 3);
- define('DOCSIS_CAPABILITIES_PAYLOAD_HEADER', 4);
- define('DOCSIS_CAPABILITIES_IGMP', 5);
- define('DOCSIS_CAPABILITIES_PRIVACY', 6);
- define('DOCSIS_CAPABILITIES_DOWNSTREAM_SAID', 7);
- define('DOCSIS_CAPABILITIES_UPSTREAM_SID', 8);
- define('DOCSIS_CAPABILITIES_FILTER', 9);
- define('DOCSIS_CAPABILITIES_TRANSMIT_EQUALIZER_TAPS_PER_SYMBOL', 10);
- define('DOCSIS_CAPABILITIES_TRANSMIT_EQUALIZER_TAPS', 11);
- define('DOCSIS_CAPABILITIES_DCC', 12);
- /**
- * DOCSIS Capabilities
- *
- * The value field describes the capabilities of a particular modem, i.e., implementation dependent limits o the particular features or number of
- * features which the modem can support.
- *
- * @package docsis_config
- */
- class docsis_capabilities extends docsis_encoder_complex
- {
- /**
- * Constructor
- *
- * @param int $code docsis code
- * @param array $value predefined values
- */
- function docsis_capabilities($code=DOCSIS_CAPABILITIES, $value=array())
- {
- parent::docsis_encoder_complex($code, $value);
- }
- /**
- * Set Concatenation Support
- *
- * @param boolean $value
- */
- function set_concatenation($value)
- {
- if($value < 0 || $value > 1) trigger_error('Concatenation must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_CONCENTRATION] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_CONCENTRATION, $value);
- }
- /**
- * Set DOCSIS Version
- *
- * @param int $value 0 indicates DOCSIS v1.0, 1 indicates DOCSIS v1.1
- */
- function set_version($value)
- {
- if($value < 0 || $value > 1) trigger_error('Version must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_VERSION] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_VERSION, $value);
- }
- /**
- * Set Fragmentation Support
- *
- * @param boolean $value
- */
- function set_fragmentation($value)
- {
- if($value < 0 || $value > 1) trigger_error('Fragmentation must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_FRAGMENTATION] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_FRAGMENTATION, $value);
- }
- /**
- * Set Payload Header Suppression Support
- *
- * @param boolean $value
- */
- function set_payload_header_suppression($value)
- {
- if($value < 0 || $value > 1) trigger_error('Payload Header Suppression must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_PAYLOAD_HEADER] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_PAYLOAD_HEADER, $value);
- }
- /**
- * Set IGMP Support
- *
- * @param boolean $value
- */
- function set_igmp($value)
- {
- if($value < 0 || $value > 1) trigger_error('IGMP must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_IGMP] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_IGMP, $value);
- }
- /**
- * Set Privacy Support
- *
- * @param boolean $value
- */
- function set_privacy($value)
- {
- if($value < 0 || $value > 1) trigger_error('Privacy must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_PRIVACY] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_PRIVACY, $value);
- }
- /**
- * Set Downstream SAID Support
- *
- * @param int $value number of downstream SAIDs the CM can support. 0 defaults to 1.
- */
- function set_downstream_said($value)
- {
- $this->value[DOCSIS_CAPABILITIES_DOWNSTREAM_SAID] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_DOWNSTREAM_SAID, $value);
- }
- /**
- * Set Upstream SID Support
- *
- * @param int $value number of upstream SIDs the modem can support. 0 defaults to 1.
- */
- function set_upstream_sid($value)
- {
- $this->value[DOCSIS_CAPABILITIES_UPSTREAM_SID] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_UPSTREAM_SID, $value);
- }
- /**
- * Set Optional Filtering Support
- *
- * @param boolean $p 802.1P filtering
- * @param boolean $q 802.1Q filtering
- */
- function set_filter($p, $q)
- {
- if($p < 0 || $p > 1) trigger_error('P must be 0 or 1', E_USER_WARNING);
- if($q < 0 || $q > 1) trigger_error('Q must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_FILTER] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_FILTER, $p + $q + $q);
- }
- /**
- * Set Transmit Equalizer Taps per Symbol
- *
- * @param int $value must be 1, 2, or 4
- */
- function set_transmit_equalizer_taps_per_symbol($value)
- {
- if($value != 1 && $value != 2 && $value != 4) trigger_error('Transmit Equalizer Taps per Symbol must be 1, 2 or 4', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_TRANSMIT_EQUALIZER_TAPS_PER_SYMBOL] =
- new docsis_encoder_uchar(DOCSIS_CAPABILITIES_TRANSMIT_EQUALIZER_TAPS_PER_SYMBOL, $value);
- }
- /**
- * Set Number of Transmit Equalizer Taps
- *
- * @param int $value must be 8 to 64
- */
- function set_transmit_equalizer_taps($value)
- {
- if($value < 8 || $value > 64) trigger_error('Transmit Equalizer Taps must be 8 to 64', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_TRANSMIT_EQUALIZER_TAPS] = new docsis_encoder_uchar(TRANSMIT_EQUALIZER_TAPS, $value);
- }
- /**
- * Set DCC Support
- *
- * @param boolean $value
- */
- function set_dcc($value)
- {
- if($value < 0 || $value > 1) trigger_error('DCC must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CAPABILITIES_DCC] = new docsis_encoder_uchar(DOCSIS_CAPABILITIES_DCC, $value);
- }
- }
- ?>
Documentation generated on Mon, 14 Nov 2005 17:59:37 -0700 by phpDocumentor 1.3.0RC3