Documentation is available at docsis_class_of_service.php
- <?php
- /**
- * DOCSIS Class of Service
- *
- * @author David Eder <david@eder.us>
- * @copyright 2004 David Eder
- * @package docsis_config
- * @version .1
- */
- /**
- */
- require_once('docsis_common.php');
- define('DOCSIS_CLASS_OF_SERVICE', 4);
- define('DOCSIS_CLASS_ID', 1);
- define('DOCSIS_CLASS_MAX_RATE_DOWN', 2);
- define('DOCSIS_CLASS_MAX_RATE_UP', 3);
- define('DOCSIS_CLASS_PRIORITY_UP', 4);
- define('DOCSIS_CLASS_GUARANTEED_UP', 5);
- define('DOCSIS_CLASS_MAX_BURST_UP', 6);
- define('DOCSIS_CLASS_PRIVACY_ENABLE', 7);
- /**
- * DOCSIS Class of Service
- *
- * @package docsis_config
- */
- class docsis_class_of_service extends docsis_encoder_complex
- {
- /**
- * Constructor
- *
- * @param int $code docsis code
- * @param array $value predefined values
- */
- function docsis_class_of_service($code=DOCSIS_CLASS_OF_SERVICE, $value=array())
- {
- parent::docsis_encoder_complex($code, $value);
- }
- /**
- * Set Class ID
- *
- * @param int $value from 1 to 16
- */
- function set_id($value)
- {
- if($value < 1 || $value > 16) trigger_error('ID must be 1 to 16', E_USER_WARNING);
- $this->value[DOCSIS_CLASS_ID] = new docsis_encoder_uchar(DOCSIS_CLASS_ID, $value);
- }
- /**
- * Set Maximum Downstream Rate
- *
- * For a single SID modem, the value of this field specifies the maximum downstream rate in bits per second that the CMTS is permitted to forward
- * to CPE unicast MAC addresses learned or configured as mapping to the registering modem.
- *
- * For a multiple SID modem, the aggregate value of these fields specifies the maximum downstream rate in bits per second that the CMTS is
- * permitted to forward to CPE unicast MAC addresses learned or configured as mapping to the registering modem.
- *
- * This is the peak rate for Packet PDU Data (including destination MAC address and the CRC) over a one-second interval. This does not include
- * MAC packets addressed to broadcast or multicast MAC addresses. The CMTS must limit downstream forwarding to this rate. The CMTS may delay,
- * rather than drop, over-limit packets.
- *
- * @param int $value from 0 to 52000000
- */
- function set_max_rate_down($value)
- {
- if($value < 0 || $value > 52000000) trigger_error('Max Rate Down must be 0 to 52000000', E_USER_WARNING);
- $this->value[DOCSIS_CLASS_MAX_RATE_DOWN] = new docsis_encoder_uint(DOCSIS_CLASS_MAX_RATE_DOWN, $value);
- }
- /**
- * Set Maximum Upstream Rate
- *
- * The value of this field specifies the maximum upstream rate in bits per second that the CM is permitted to forward to the RF Network.
- *
- * This is the peak rate for Packet PDU Data (including destination address and the CRC) over a one-second interval. The CM must limit all
- * upstream forwarding (both contention and reservation-based), for the corresponding SID, to this rate. The CM must include Packet PDU Data
- * packets addressed to broadcast or multicast addresses when calculating this rate.
- *
- * The CM must enforce this limit on all upstream data transmissions, including data sent in contention. The CMTS should generate an alarm
- * if a modem exceeds its allowable rate.
- *
- * @param int $value from 0 to 10000000
- */
- function set_max_rate_up($value)
- {
- if($value < 0 || $value > 10000000) trigger_error('Max Rate Up must be 0 to 10000000', E_USER_WARNING);
- $this->value[DOCSIS_CLASS_MAX_RATE_UP] = new docsis_encoder_uint(DOCSIS_CLASS_MAX_RATE_UP, $value);
- }
- /**
- * Set Upstream Channel Priority
- *
- * The value of this field specifies the relative priority assigned to this service class for data transmission in the upstream channel.
- * Higher numbers indicate higher priority.
- *
- * @param int $value from 0 to 7
- */
- function set_priority_up($value)
- {
- if($value < 0 || $value > 7) trigger_error('Upstrem Priority must be 0 to 7', E_USER_WARNING);
- $this->value[DOCSIS_CLASS_PRIORITY_UP] = new docsis_encoder_uchar(DOCSIS_CLASS_PRIORITY_UP, $value);
- }
- /**
- * Set Guaranteed Minimum Upstream Channel Data Rate
- *
- * The value of this field specifies the data rate in bit/sec which will be guaranteed to this servie class on the upstream channel.
- *
- * @param int $value from 0 to 10000000
- */
- function set_guaranteed_up($value)
- {
- if($value < 0 || $value > 10000000) trigger_error('Guaranteed Up must be 0 to 10000000', E_USER_WARNING);
- $this->value[DOCSIS_CLASS_GUARANTEED_UP] = new docsis_encoder_uint(DOCSIS_CLASS_GUARANTEED_UP, $value);
- }
- /**
- * Set Maximum Upstream Channel Transmit Burst
- *
- * The value of this field specifies the maximum transmit burst (in bytes) which this service class is allowed on the upstream channel. A value
- * of zero means there is no limit. Note: This value does not include any physical layer overhead.
- *
- * @param int $value
- */
- function set_max_burst_up($value)
- {
- $this->value[DOCSIS_CLASS_MAX_BURST_UP] = new docsis_encoder_ushort(DOCSIS_CLASS_MAX_BURST_UP, $value);
- }
- /**
- * Set Class-of-Service Privacy Enable
- *
- * This setting enables/disables Baseline Privacy on a provisioned CoS.
- *
- * @param boolean $value
- */
- function set_privacy_enable($value)
- {
- if($value < 0 || $value > 1) trigger_error('Baseline Privacy must be 0 or 1', E_USER_WARNING);
- $this->value[DOCSIS_CLASS_PRIVACY_ENABLE] = new docsis_encoder_uchar(DOCSIS_CLASS_PRIVACY_ENABLE, $value);
- }
- }
- ?>
Documentation generated on Mon, 14 Nov 2005 17:59:47 -0700 by phpDocumentor 1.3.0RC3