Updates to support new TrafficProfiles that require a user-specified Direction in...
[packetcable.git] / packetcable-driver / src / main / java / org / pcmm / gates / IIPv6Classifier.java
1 /*
2  * Copyright (c) 2015 Cable Television Laboratories, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.pcmm.gates;
10
11 /**
12  * The IPv6 Classifier object also specifies the packet matching rules associated with a Gate, when IPv6 Addresses are
13  * used. As defined in Sections 6.4.3.1 and 6.4.3.2, for Unicast Gates multiple IPv6 Classifier objects may be included
14  * in the Gate-Set to allow for complex classifier rules. However, since the ordering of objects in a message and the
15  * order of processing those objects is not mandated, an AM SHOULD NOT send a GateSet with multiple IPv6
16  * Classifiers with the same ClassificationID, yet different Actions. When an AM is using IPv6 Classifier objects, at
17  * least one IPv6 Classifier MUST be provided by the PDP in all Gate-Set messages. For Unicast Gates more than one
18  * IPv6 Classifier is allowed. For Multicast Gates only one IPv6 Classifier is required to be supported. Since the IPv6
19  * Classifier is based on the DOCSIS IPv6 Classifier, all DOCSIS classifier semantics apply, with the exeption that at
20  * least one IPv6 Classifier be present in a Gate-Set message.
21  */
22 public interface IIPv6Classifier extends IExtendedClassifier {
23 //    short LENGTH = 64;
24 //    byte SNUM = 6;
25     byte STYPE = 3;
26
27     // flags: Flow Label match enable flag
28     FlowLabel getFlowLabelEnableFlag();
29
30     // Tc-low
31     byte getTcLow();
32
33     // Tc-high
34     byte getTcHigh();
35
36     // Tc-mask
37     byte getTcMask();
38
39     // Flow Label
40     int getFlowLabel();
41
42     // Next Header Type
43     short getNextHdr();
44
45     // Source Prefix Length
46     byte getSourcePrefixLen();
47
48     // Destination Prefix Length
49     byte getDestinationPrefixLen();
50
51     /**
52      * The valid activation state values
53      */
54     enum FlowLabel {
55
56         IRRELEVANT((byte) 0), VALID((byte) 1);
57
58         FlowLabel(byte value) {
59             this.value = value;
60         }
61
62         public byte getValue() {
63             return value;
64         }
65
66         public static FlowLabel valueOf(byte v) {
67             switch (v) {
68                 case 0:
69                     return FlowLabel.IRRELEVANT;
70                 case 1:
71                     return FlowLabel.VALID;
72                 default:
73                     throw new IllegalArgumentException("not supported value");
74             }
75         }
76
77         private byte value;
78
79     }
80
81 }