Documentation is available at docsis_phs.php
- <?php
- /**
- * DOCSIS Payload Header Suppression
- *
- * @author David Eder <david@eder.us>
- * @copyright 2004 David Eder
- * @package docsis_config
- * @version .1
- */
- /**
- */
- require_once('docsis_common.php');
- require_once('docsis_error.php');
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION', 26);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_CLASSIFIER_REFERENCE', 1);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_CLASSIFIER_IDENTIFIER', 2);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_SERVICE_FLOW_REFERENCE', 3);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_SERVICE_FLOW_IDENTIFIER', 4);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_DSC_ACTION', 5);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_ERROR', 6);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSF', 7);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSI', 8);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSM', 9);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSS', 10);
- define('DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSV', 11);
- /**
- * DOCSIS Payload Header Suppression
- *
- * @package docsis_config
- */
- class docsis_payload_header_suppression extends docsis_encoder_complex
- {
- /**
- * Constructor
- *
- * @param int $code docsis code
- * @param array $value predefined values
- */
- function docsis_payload_header_suppression($code=DOCSIS_PAYLOAD_HEADER_SUPPRESSION, $value=array())
- {
- parent::docsis_encoder_complex($code, $value);
- }
- /**
- * Set Classifier Reference
- *
- * See Radio Frequency Interface Specification C.2.2.8.1
- *
- * @param int $value from 1 to 255
- */
- function set_classifier_reference($value)
- {
- if($value < 1 || $value > 255) trigger_error('Reference must be 1 to 255', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_CLASSIFIER_REFERENCE] =
- new docsis_encoder_uchar(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_CLASSIFIER_REFERENCE, $value);
- }
- /**
- * Set Classifier Identifier
- *
- * See Radio Frequency Interface Specification C.2.2.8.2
- *
- * @param int $value from 1 to 65535
- */
- function set_classifier_identifier($value)
- {
- if($value < 1 || $value > 65535) trigger_error('Identifier must be 1 to 65535', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_CLASSIFIER_IDENTIFIER] =
- new docsis_encoder_ushort(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_CLASSIFIER_IDENTIFIER, $value);
- }
- /**
- * Set Service Flow Reference
- *
- * See Radio Frequency Interface Specification C.2.2.8.3
- *
- * @param int $value from 1 to 65535
- */
- function set_service_flow_reference($value)
- {
- if($value < 1 || $value > 65535) trigger_error('Reference must be 1 to 65535', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_SERVICE_FLOW_REFERENCE] =
- new docsis_encoder_ushort(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_SERVICE_FLOW_REFERENCE, $value);
- }
- /**
- * Set Service Flow Identifier
- *
- * See Radio Frequency Interface Specification C.2.2.8.4
- *
- * @param int $value from 1 to 4294967295
- */
- function set_service_flow_identifier($value)
- {
- if($value < 1 || $value > 4294967295) trigger_error('Identifier must be 1 to 4294967295', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_SERVICE_FLOW_IDENTIFIER] =
- new docsis_encoder_uint(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_SERVICE_FLOW_IDENTIFIER, $value);
- }
- /**
- * Set Dynamic Service Change Action
- *
- * <ul>
- * <li>0 - Add PHS Rule</li>
- * <li>1 - Set PHS Rule</li>
- * <li>2 - Delete PHS Rule</li>
- * <li>3 - Delete all PHS Rules</li>
- * </ul>
- *
- * See Radio Frequency Interface Specification C.2.2.8.5
- *
- * @param int $value
- */
- function set_dsc_action($value)
- {
- if($value < 0 || $value > 3) trigger_error('Dynamic Service Change Action must be 0 to 3', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_DSC_ACTION] = new docsis_encoder_uchar(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_DSC_ACTION, $value);
- }
- /**
- * Set Error
- *
- * See Radio Frequency Interface Specification C.2.2.9
- *
- * @param docsis_error $value
- */
- function set_error($value)
- {
- // todo: must be a docsis_error
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_ERROR] = $value;
- }
- /**
- * Set Payload Header Suppression Field (PHSF)
- *
- * See Radio Frequency Interface Specification C.2.2.10.1
- *
- * @param string $value
- */
- function set_field($value)
- {
- // todo: ????
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSF] = new docsis_encoder_string(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSF, $value);
- }
- /**
- * Set Payload Header Suppression Index (PHSI)
- *
- * See Radio Frequency Interface Specification C.2.2.10.2
- *
- * @param int $value from 1 to 255
- */
- function set_index($value)
- {
- if($value < 1 || $value > 255) trigger_error('Index must be 1 to 255', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSI] = new docsis_encoder_uchar(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSI, $value);
- }
- /**
- * Set Payload Header Suppression Mask (PHSM)
- *
- * See Radio Frequency Interface Specification C.2.2.10.3
- *
- * @param string $value
- */
- function set_mask($value)
- {
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSM] = new docsis_encoder_string(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSM, $value);
- }
- /**
- * Set Payload Header Suppression Size (PHSS)
- *
- * See Radio Frequency Interface Specification C.2.2.10.4
- *
- * @param int $value
- */
- function set_size($value)
- {
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSS] = new docsis_encoder_uchar(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSS, $value);
- }
- /**
- * Set Payload Header Suppression Verification (PHSV)
- *
- * See Radio Frequency Interface Specification C.2.2.10.5
- *
- * @param boolean $value
- */
- function set_verify($value)
- {
- if($value < 0 || $value > 1) trigger_error('Verification must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSV] = new docsis_encoder_uchar(DOCSIS_PAYLOAD_HEADER_SUPPRESSION_PHSV, $value);
- }
- /**
- * Set Vendor Specific PHS Parameters
- *
- * See Radio Frequency Interface Specification C.2.2.10.
- *
- * @param docsis_vendor $value
- */
- function set_vendor($value)
- {
- // todo: must be a docsis_vendor
- $this->value[DOCSIS_VENDOR] = $value;
- }
- }
- ?>
Documentation generated on Mon, 14 Nov 2005 18:00:27 -0700 by phpDocumentor 1.3.0RC3