Merge "Remove "response" from yang."
[packetcable.git] / protocol_plugins.packetcable / src / main / java / org / pcmm / gates / IClassifier.java
1 /**
2  @header@
3  */
4
5
6 package org.pcmm.gates;
7
8 import java.net.InetAddress;
9
10 import org.pcmm.base.IPCMMBaseObject;
11
12 /**
13  *
14  *
15  *
16  */
17 public interface IClassifier extends IPCMMBaseObject {
18
19     static final short LENGTH = 24;
20     static final byte SNUM = 6;
21     static final byte STYPE = 1;
22
23     static enum Protocol {
24         /*ICMP((short) 1), IGMP((short) 2), */
25         NONE((short)0), TCP((short) 6), UDP((short) 17);
26
27         Protocol(short v) {
28             this.value = v;
29         }
30
31         public static Protocol valueOf(short v) {
32             switch (v) {
33             case 0:
34                 return NONE;
35           /*
36             case 1:
37                 return ICMP;
38             case 2:
39                 return IGMP;
40           */
41             case 6:
42                 return TCP;
43             default:
44                 return UDP;
45             }
46         }
47         private short value;
48
49         public short getValue() {
50             return value;
51         }
52     }
53
54     /**
55      * IP Destination Address or IPv6 Destination Address is the termination
56      * point for the IP flow
57      *
58      * @return destination IP address.
59      */
60     InetAddress getDestinationIPAddress();
61
62     void setDestinationIPAddress(InetAddress address);
63
64     short getDestinationPort();
65
66     void setDestinationPort(short p);
67
68     /**
69      * Source IP, IP Source Address, or IPv6 Source Address (in the case of
70      * Extended Classifier or IPv6 Classifier) is the IP address (as seen at the
71      * CMTS) of the originator of the IP flow.
72      *
73      * @return source IP address.
74      */
75     InetAddress getSourceIPAddress();
76
77     void setSourceIPAddress(InetAddress a);
78
79     short getSourcePort();
80
81     void setSourcePort(short p);
82
83     /**
84      * Protocol field, in a legacy Classifier or Extended Classifier, identifies
85      * the type of protocol (e.g., IP, ICMP, etc.). The Next Header Type field
86      * serves a similar function in the IPv6 Classifier.
87      *
88      * @return the protocol.
89      */
90     Protocol getProtocol();
91
92     /**
93      * @see <a
94      *      href="http://www.iana.org/assignments/protocol-numbers/protocol-numbers.txt">protocols</a>
95      * @param p
96      */
97     void setProtocol(Protocol p);
98
99     /**
100      * Priority may be used to distinguish between multiple classifiers that
101      * match a particular packet. This is typically set to a default value since
102      * classifiers are generally intended to be unique.
103      *
104      * @return priority.
105      */
106     byte getPriority();
107
108     /**
109      * sets the priority;
110      *
111      * @param p
112      *            priority
113      */
114     void setPriority(byte p);
115
116     byte getDSCPTOS();
117
118     void setDSCPTOS(byte v);
119
120     byte getDSCPTOSMask();
121
122     void setDSCPTOSMask(byte v);
123
124     // DSCP/TOS Field
125     // 
126     // DSCP/TOS Mask
127
128 }