Commit ba7a5cc1 authored by David Miller's avatar David Miller

Added TLVs for Low Latency DOCSIS.

Added TLVs for Diplexer Band Edges.
Added TLVs for ePTA.
Signed-off-by: David Miller's avatard.miller@cablelabs.com <d.miller@kyrio.com>
parent 3804bbbe
cfeversion=1.1.14
currentyear=2015
cfeversion=1.1.15
currentyear=2019
......@@ -2,6 +2,49 @@ Welcome to the CableLabs Config File Editor.
Release Notes ::
Release Version 1.1.15
Revised Feb 12, 2019
- Fixed TLV-62 issue with multiple UDC Group IDs.
- Removed from the TLV database.
* [70/71].36 Aggregate Service Flow Reference (defined in CANN, not defined in MULPI)
* [70/71].41 Data Rate Unit Setting
* 77 DOCSIS Time Protocol Enable (redefined, no longer used in config files)
- Added new TLVs to the TLV database.
* [24/25].40.3 AQM Algorithm
* [24/25].40.4 Immediate AQM Min Threshold
* [24/25].40.5 Immediate AQM Range Exponent of Ramp Function
* [24/25].40.6 Latency Histogram Encodings
* 24.44 Guaranteed Grant Interval (GGI)
* 24.45 Guaranteed Grant Rate (GGR)
* 24.46 Guaranteed Request Interval (GRI)
* [70/71].7 Traffic Priority
* 70.8 Upstream Maximum Sustained Traffic Rate
* 71.8 Downstream Maximum Sustained Traffic Rate
* [70/71].9 Maximum Traffic Burst
* [70/71].10 Minimum Reserved Traffic Rate
* [70/71].11 Assumed Minimum Reserved Rate Packet Size
* 70.27 Upstream Peak Traffic Rate
* 71.27 Downstream Peak Traffic Rate
* [70/71].42 Low Latency Aggregate Service Flow Encodings
* [70/71].42.1 Low Latency Service Flow Reference
* [70/71].42.3 Classic SF SCN
* [70/71].42.4 Low Latency SF SCN
* [70/71].42.5 AQM Coupling Factor Exponent
* [70/71].42.6 Scheduling Weight
* [70/71].42.7 Queue Protection Enable
* [70/71].42.8 QPLatencyThreshold (CRITICALqL_us)
* [70/71].42.9 QPQueuingScoreThreshold (CRITICALqLSCORE_us)
* [70/71].42.10 QPDrainRateExponent(LG_AGING)
* 83 DTP Mode Configuration
* 84 Diplexer Band Edges
* 84.1 Diplexer Upstream Upper Band Edge
* 84.2 Diplexer Downstream Lower Band Edge
* 84.3 Diplexer Downstream Upper Band Edge
* 222 ePTA TLV Encapsulation
* 222.1 ePTA Enable
Release Version 1.1.14
Revised Mar 20, 2015
- Fixed TLV-43 issue with TLV definition lengths.
......
This diff is collapsed.
Manifest-Version: 1.0
Created-By: 1.1.14 (Cable Television Laboratories - DOCSIS)
Created-By: 1.1.15 (Cable Television Laboratories - DOCSIS)
Main-Class: com.cablelabs.cfgeditor.views.TeikaceMain
Class-Path: lib/AbsoluteLayout.jar lib/AdventNetLogging.jar
lib/AdventNetSnmp.jar lib/docsis_mmh.jar lib/swing-layout-1.0.jar
......@@ -7,7 +7,7 @@ Class-Path: lib/AbsoluteLayout.jar lib/AdventNetLogging.jar
Name: com/cablelabs/cfgeditor/views
Specification-Title: ConfigFileEditor
Specification-Version: 1.1.14
Specification-Version: 1.1.15
Specification-Vendor: CableLabs
Implementation-Title: com.cablelabs.cfgeditor.views
Implementation-Version: 6481
......
......@@ -16,40 +16,36 @@ package com.cablelabs.cfgeditor.models;
public class HexTlvDecoder extends TLVDecoder {
public HexTlvDecoder() {
}
}
public String decodeValue(byte[] valueBytes) {
String valueString = "";
for (int i = 0; i < valueBytes.length; i++) {
if (i == 0) {
if (i == 0) {
valueString = valueString + byteToHex(valueBytes[i]).toUpperCase();
} else {
valueString = valueString + " " + byteToHex(valueBytes[i]).toUpperCase();
valueString = valueString + " " + byteToHex(valueBytes[i]).toUpperCase();
}
}
return valueString;
// return TLVNode.hexString(valueBytes).toString();
}
private static String byteToHex(byte byteData) {
StringBuffer sb = new StringBuffer();
sb.append(toHexChar((byteData >>> 4) & 0x0F));
sb.append(toHexChar(byteData & 0x0F));
return sb.toString();
}
private static char toHexChar(int i) {
if ((0<= i) && (i <= 9)) {
return (char) ('0' + i);
} else {
return (char) ('a' + (i-10));
}
}
}
private static String byteToHex(byte byteData) {
StringBuffer sb = new StringBuffer();
sb.append(toHexChar((byteData >>> 4) & 0x0F));
sb.append(toHexChar(byteData & 0x0F));
return sb.toString();
}
private static char toHexChar(int i) {
if ((0<= i) && (i <= 9)) {
return (char) ('0' + i);
} else {
return (char) ('a' + (i-10));
}
}
public int unsignedByteToInt(byte b) {
return (int) b & 0xFF;
}
}
}
......@@ -24,102 +24,67 @@ public class HexTlvEncoder extends TLVEncoder {
public byte[] encodeValue(String valueString) {
byte[] tempv = new byte[0];
//int j = 0;
int k = 0;
int k = 0;
int finalByte = 0;
String[] newStringValues = valueString.split(" ");
byte[] byteArray = new byte[newStringValues.length];
for (int i = 0; i < newStringValues.length; i++) {
//System.out.println("Each Hex value is " + newStringValues[i]);
//int temp1 = new Integer(newStringValues[i]).intValue();
//byteArray[i] = (byte) temp1;
// byteArray[i] = new Byte(newStringValues[i]).byteValue();
/*
if (newStringValues[i].startsWith("a") || newStringValues[i].startsWith("A") || newStringValues[i].startsWith("b") ||
newStringValues[i].startsWith("B") || newStringValues[i].startsWith("c") || newStringValues[i].startsWith("C") ||
newStringValues[i].startsWith("d") || newStringValues[i].startsWith("D") || newStringValues[i].startsWith("e") ||
newStringValues[i].startsWith("E") || newStringValues[i].startsWith("f") || newStringValues[i].startsWith("F") ||
newStringValues[i].endsWith("a") || newStringValues[i].endsWith("A") || newStringValues[i].endsWith("b") ||
newStringValues[i].endsWith("B") || newStringValues[i].endsWith("c") || newStringValues[i].endsWith("C") ||
newStringValues[i].endsWith("d") || newStringValues[i].endsWith("D") || newStringValues[i].endsWith("e") ||
newStringValues[i].endsWith("E") || newStringValues[i].endsWith("f") || newStringValues[i].endsWith("F") ) {
int val = Integer.parseInt(newStringValues[i],16);
byteArray[i] = (byte) ((val >>>0)&0xff);
System.out.println("The byte is " + byteArray[i]);
} else {
int temp1 = new Integer(newStringValues[i]).byteValue();
byteArray[i] = (byte) temp1;
}
*/
//System.out.println("Converting " + newStringValues[i]);
//System.out.println("length is " + newStringValues[i].length());
//System.out.println("length/2 is " + newStringValues[i].length()/2);
String eachOctet = newStringValues[i];
//byte bArray[] = new byte[hexStr.length()/2];
for(int j=0; j<(eachOctet.length()/2); j++){
//System.out.println("first " + eachOctet);
byte firstNibble = Byte.parseByte(eachOctet.substring(2*j,2*j+1),16);
//System.out.println("firstNibble " + firstNibble);
byte secondNibble = Byte.parseByte(eachOctet.substring(2*j+1,2*j+2),16);
//System.out.println("secondNibble " + secondNibble);
finalByte = (secondNibble) | (firstNibble << 4 ); // bit-operations only with numbers, not bytes.
//System.out.println("finalByte " + finalByte);
byteArray[i] = (byte) finalByte;
}
//return bArray;
//byteArray[i] = (byte) finalByte;
}
return byteArray;
String[] newStringValues = valueString.split(" ");
byte[] byteArray = new byte[newStringValues.length];
for (int i = 0; i < newStringValues.length; i++) {
String eachOctet = newStringValues[i];
//byte bArray[] = new byte[hexStr.length()/2];
for(int j=0; j<(eachOctet.length()/2); j++){
//System.out.println("first " + eachOctet);
byte firstNibble = Byte.parseByte(eachOctet.substring(2*j,2*j+1),16);
//System.out.println("firstNibble " + firstNibble);
byte secondNibble = Byte.parseByte(eachOctet.substring(2*j+1,2*j+2),16);
//System.out.println("secondNibble " + secondNibble);
finalByte = (secondNibble) | (firstNibble << 4 ); // bit-operations only with numbers, not bytes.
//System.out.println("finalByte " + finalByte);
byteArray[i] = (byte) finalByte;
}
}
return byteArray;
}
private byte[] toByteArray(int value) {
byte[] byteArray = new byte[0];
try {
byteArray = new BigInteger(Integer.toString(value)).toByteArray();
} catch(Exception e){
System.out.println("Exception occured in encodeValue " + e);
}
try {
byteArray = new BigInteger(Integer.toString(value)).toByteArray();
} catch(Exception e){
System.out.println("Exception occured in encodeValue " + e);
}
return byteArray;
}
public byte[] encodeValue() {
int tempv = 0;
try {
String nodeValue = currentTlvNode.getValue().toString();
tempv = Integer.parseInt(nodeValue);
} catch(Exception e){
System.out.println("Exception occured in encodeValue " + e);
}
return toByteArray(tempv);
}
try {
String nodeValue = currentTlvNode.getValue().toString();
tempv = Integer.parseInt(nodeValue);
} catch(Exception e){
System.out.println("Exception occured in encodeValue " + e);
}
return toByteArray(tempv);
}
private byte[] toByteArrayForLength(byte[] bytes, int reqLength) {
byte[] byteArray = new byte[reqLength];
int i = bytes.length;
int j = reqLength;
while (i > 0) {
if (j > 0) {
byteArray[j-1] = bytes[i-1];
j--;
}
i--;
}
byte[] byteArray = new byte[reqLength];
int i = bytes.length;
int j = reqLength;
while (i > 0) {
if (j > 0) {
byteArray[j-1] = bytes[i-1];
j--;
}
i--;
}
return byteArray;
}
public byte[] encodeType() {
//int integerType = currentTlvNode.getType();
//return toByteArray(integerType) ;
public byte[] encodeType() {
//int integerType = currentTlvNode.getType();
//return toByteArray(integerType);
System.out.println("Current tlvnode from encodeType in HexTlvEncoder is " + currentTlvNode);
int integerType = currentTlvNode.getType();
int integerType = currentTlvNode.getType();
System.out.println("Type from encodeType in TLVEncoder is " + integerType);
long lvalue = new BigInteger(new Integer(integerType).toString()).longValue();
byte[] c = new byte[1];
......@@ -134,7 +99,6 @@ public class HexTlvEncoder extends TLVEncoder {
}
public byte[] encodeLength() {
int standardLength = TeikacePreferencesDialog.lengthOfConfig;
byte[] temp = new byte[2];
byte[] lengthBytes = new byte[standardLength];
......
/*
* Created on Feb 5, 2004
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package com.cablelabs.cfgeditor.models;
import java.math.BigInteger;
import com.cablelabs.cfgeditor.utils.TeikaceVector;
import java.util.StringJoiner;
public class Int16ListTlvDecoder extends TLVDecoder {
public Int16ListTlvDecoder() {
}
public String decodeValue(byte[] valueBytes) {
int intSize = 2;
TeikaceVector v = new TeikaceVector();
v.addBytes(valueBytes);
TeikaceVector tmpv = new TeikaceVector();
StringJoiner sj = new StringJoiner(" ");
int valueLength = valueBytes.length;
BigInteger value;
// System.out.println("Int16ListDecoder.decodeValue currentTlvNode=" + currentTlvNode);
for (int pos = 0; pos < v.size(); pos++) {
tmpv.clear();
tmpv.addBytes((v.getSubList(pos, pos+intSize)).getByteArray());
pos += (intSize - 1);
if ((Byte) tmpv.get(0) < 0) {
tmpv.add(0, new Byte("0")); // to make it unsigned
}
try {
value = new BigInteger(tmpv.getByteArray());
//System.out.println(" Value inside decode method " + value);
sj.add(value.toString());
} catch(Exception e) {
System.out.println("Exception occured in decodeValue " + e);
}
}
return sj.toString();
}
}
/*
* Created on Apr 6, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.cablelabs.cfgeditor.models;
import java.math.BigInteger;
import com.cablelabs.cfgeditor.utils.TeikaceVector;
public class Int16ListTlvEncoder extends TLVEncoder {
private TLVNode currentTlvNode;
public Int16ListTlvEncoder() {
}
public byte[] encodeValue(String valueString) {
int intSize = 2;
// System.out.println("Int16ListTlvEncoder.encodeValue: valueString=" + valueString + " intSize=" + intSize);
String[] newStringValues = valueString.split(" ");
TeikaceVector v = new TeikaceVector();
TeikaceVector tmpv = new TeikaceVector();
for (int i = 0; i < newStringValues.length; i++) {
String eachVal = newStringValues[i];
try {
BigInteger val = new BigInteger(eachVal);
tmpv.clear();
tmpv.addBytes(val.toByteArray());
while (tmpv.size() < intSize) {
tmpv.add(0, new Byte("0"));
}
v.addBytes(tmpv.getByteArray());
} catch(Exception e) {
System.out.println("Exception occured in encodeValue " + e);
}
}
return v.getByteArray();
}
}
/*
* Created on Feb 5, 2004
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package com.cablelabs.cfgeditor.models;
import java.math.BigInteger;
import com.cablelabs.cfgeditor.utils.TeikaceVector;
import java.util.StringJoiner;
public class Int8ListTlvDecoder extends TLVDecoder {
public Int8ListTlvDecoder() {
}
public String decodeValue(byte[] valueBytes) {
int intSize = 1;
TeikaceVector v = new TeikaceVector();
v.addBytes(valueBytes);
TeikaceVector tmpv = new TeikaceVector();
StringJoiner sj = new StringJoiner(" ");
int valueLength = valueBytes.length;
BigInteger value;
// System.out.println("Int8ListDecoder.decodeValue currentTlvNode=" + currentTlvNode);
for (int pos = 0; pos < v.size(); pos++) {
tmpv.clear();
tmpv.addBytes((v.getSubList(pos, pos+intSize)).getByteArray());
pos += (intSize - 1);
if ((Byte) tmpv.get(0) < 0) {
tmpv.add(0, new Byte("0")); // to make it unsigned
}
try {
value = new BigInteger(tmpv.getByteArray());
//System.out.println(" Value inside decode method " + value);
sj.add(value.toString());
} catch(Exception e) {
System.out.println("Exception occured in decodeValue " + e);
}
}
return sj.toString();
}
}
/*
* Created on Apr 6, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.cablelabs.cfgeditor.models;
import java.math.BigInteger;
import com.cablelabs.cfgeditor.utils.TeikaceVector;
public class Int8ListTlvEncoder extends TLVEncoder {
private TLVNode currentTlvNode;
public Int8ListTlvEncoder() {
}
public byte[] encodeValue(String valueString) {
int intSize = 1;
// System.out.println("IntListTlvEncoder.encodeValue: valueString=" + valueString + " intSize=" + intSize);
String[] newStringValues = valueString.split(" ");
TeikaceVector v = new TeikaceVector();
TeikaceVector tmpv = new TeikaceVector();
for (int i = 0; i < newStringValues.length; i++) {
String eachVal = newStringValues[i];
try {
BigInteger val = new BigInteger(eachVal);
tmpv.clear();
tmpv.addBytes(val.toByteArray());
while (tmpv.size() < intSize) {
tmpv.add(0, new Byte("0"));
}
v.addBytes(tmpv.getByteArray());
} catch(Exception e) {
System.out.println("Exception occured in encodeValue " + e);
}
}
return v.getByteArray();
}
}
......@@ -21,68 +21,39 @@ public class IntegerTlvDecoder extends TLVDecoder {
*
*/
public IntegerTlvDecoder() {
super();
super();
}
/*public String decodeValue(byte[] valueBytes) {
int valueLength = valueBytes.length;
String hexValue = "";
int shift = 0;
for(int pos=0; pos < valueLength ; pos++)
{
System.out.println("this is the byte array value from " +
"Integer decodeValue " + valueBytes[pos]);
hexValue += UnicodeFormatter.byteToHex(valueBytes[pos]);
}
int intValue = Integer.parseInt(hexValue, 16);
return Integer.toString(intValue);
} */
// int tempv = Integer.parseInt(valueString, 16);
// Integer inttotalvalue = new Integer(tempv);
// return inttotalvalue.toString();
// }
public String decodeValue(byte[] valueBytes) {
int valueLength = valueBytes.length;
//for (int pos1=0; pos1<valueLength; pos1++) {
// System.out.println("each byte4 is " + valueBytes[pos1]);
//}
Long value= new Long(0);
int shift = 0;
for (int pos=valueLength-1; pos>=0 ; pos--) {
//System.out.println("this is the byte array value from " + "Integer decodeValue " + valueBytes[pos]);
value += unsignedByteToLong(valueBytes[pos]) << shift;
//System.out.println(" Value inside decode method " + value);
shift += 8;
}
return Long.toString(value);
}
int valueLength = valueBytes.length;
Long value= new Long(0);
int shift = 0;
for (int pos=valueLength-1; pos>=0 ; pos--) {
//System.out.println("this is the byte array value from " + "Integer decodeValue " + valueBytes[pos]);
value += unsignedByteToLong(valueBytes[pos]) << shift;
//System.out.println(" Value inside decode method " + value);
shift += 8;
}
return Long.toString(value);
}
public String decodeValue(Byte[] valueBytes) {
int valueLength = valueBytes.length;
for (int pos1=valueLength-1; pos1>=0 ; pos1--) {
System.out.println("each byte is " + valueBytes[pos1]);
}
Long value= new Long(0);
int shift = 0;
for (int pos=valueLength-1; pos>=0 ; pos--) {
//System.out.println("this is the byte array value from " + "Integer decodeValue " + valueBytes[pos]);
value += unsignedByteToLong(valueBytes[pos].byteValue()) << shift;
//System.out.println(" Value inside decode method " + value);
shift += 8;
}
return Long.toString(value);
}
int valueLength = valueBytes.length;
for (int pos1=valueLength-1; pos1>=0 ; pos1--) {
System.out.println("each byte is " + valueBytes[pos1]);
}
Long value= new Long(0);
int shift = 0;
for (int pos=valueLength-1; pos>=0 ; pos--) {
//System.out.println("this is the byte array value from " + "Integer decodeValue " + valueBytes[pos]);
value += unsignedByteToLong(valueBytes[pos].byteValue()) << shift;
//System.out.println(" Value inside decode method " + value);
shift += 8;
}
return Long.toString(value);
}
public long unsignedByteToLong(byte b) {
return (long) b & 0xFF;
}
}
......@@ -14,89 +14,61 @@ import java.math.BigInteger;
*/
public class IntegerTlvEncoder extends TLVEncoder {
public IntegerTlvEncoder() {
}
public byte[] encodeValue(String valueString) {
byte[] tempb1 = new byte[4];
int i = 4;
//int j = 0;
//int k = 0;
try {
long lvalue = new BigInteger(valueString).longValue();
//System.out.println("The long value is " + lvalue);
//tempv = new BigInteger(valueString).toByteArray();
byte[] b = new byte[4];
for (int k = 0; k < 4; k++) {
b[3-k] = (byte) (lvalue >>> (k*8));
//System.out.println("byte b is " + b[3-k]);
}
for (int m = 0; m < 4; m++) {
System.out.println("byte m is " + b[m]);
}
byte[] tempb = new byte[4];
int p = 0;
for (int n = 3; n >= 0; n--) {
tempb[n]= b[p];
p++;
}
System.out.println("Length of tempb is " + tempb.length);
for (int j = 3; j >=0 ; j--) {
System.out.println("byte b from last to first is " + tempb[j]);
if (tempb[j] != 0) {
break;
} else {
i--;
}
//tempv[3-j] = (byte) (lvalue >>> (j*8));
//System.out.println("byte b from last to first is " + b[j]);
}
//byte[] tempv = new byte[i];
byte[] tempv1 = new byte[i];
byte[] tempv = new byte[i];
//System.out.println("The value of i is " + i);
System.out.println("The tempbof 0 of i is " + tempb[0]);
for (int l = 0; l < i; l++) {
tempv1[l] = tempb[l];
System.out.println("Assigning b to tempv1 is " + tempv1[l]);
}
System.out.println("The length of tempv1 is " + tempv1.length);
int c = tempv1.length;
int d = c;
for (int a = 0; a < c; a++) {
//System.out.println("The tempv1 byte is " + tempv1[c-1]);
tempv[a] = tempv1[d-1];
System.out.println("The tempv byte is " + tempv[a]);
d--;
}
System.out.println("The length of tempv is " + tempv.length);
return tempv;
} catch(Exception e){
System.out.println("Exception occured in encodeValue " + e);
}
return tempb1;
}
/* public byte[] encodeValue(String valueString) {
String stringValueOfByte;
int intValueofString = Integer.parseInt( valueString );
byte intEncodeValue[] = toByteArray(intValueofString);
return intEncodeValue;
}
/*
public String encodeValue() {
String nodeValue = currentTlvNode.getValue().toString();
return nodeValue;
}
private byte[] toByteArray(int value) {
byte[] byteArray = new byte[0];
try {
byteArray = new BigInteger(Integer.toString(value)).toByteArray();
public byte[] encodeValue(String valueString) {
byte[] tempb1 = new byte[4];
int i = 4;
try {
long lvalue = new BigInteger(valueString).longValue();
//System.out.println("The long value is " + lvalue);
//tempv = new BigInteger(valueString).toByteArray();
byte[] b = new byte[4];
for (int k = 0; k < 4; k++) {
b[3-k] = (byte) (lvalue >>> (k*8));
//System.out.println("byte b is " + b[3-k]);
}
for (int m = 0; m < 4; m++) {
System.out.println("byte m is " + b[m]);
}
byte[] tempb = new byte[4];
int p = 0;
for (int n = 3; n >= 0; n--) {
tempb[n]= b[p];
p++;
}
System.out.println("Length of tempb is " + tempb.length);
for (int j = 3; j >=0 ; j--) {
System.out.println("byte b from last to first is " + tempb[j]);
if (tempb[j] != 0) {
break;
} else {
i--;
}
}
//byte[] tempv = new byte[i];
byte[] tempv1 = new byte[i];
byte[] tempv = new byte[i];
//System.out.println("The value of i is " + i);
System.out.println("The tempbof 0 of i is " + tempb[0]);
for (int l = 0; l < i; l++) {
tempv1[l] = tempb[l];
System.out.println("Assigning b to tempv1 is " + tempv1[l]);
}
System.out.println("The length of tempv1 is " + tempv1.length);
int c = tempv1.length;
int d = c;
for (int a = 0; a < c; a++) {
//System.out.println("The tempv1 byte is " + tempv1[c-1]);
tempv[a] = tempv1[d-1];