Expanded CMTS emulator to respond properly to gate add requests.
[packetcable.git] / packetcable-driver / src / main / java / org / pcmm / PCMMGlobalConfig.java
1 /**
2  @header@
3  */
4
5 package org.pcmm;
6
7 import org.pcmm.gates.IPCMMGate;
8
9 import java.util.Map;
10 import java.util.concurrent.ConcurrentHashMap;
11
12 /**
13  * TODO - Remove all uses of this class which is evil as it contains environmental settings
14  */
15 public class PCMMGlobalConfig {
16     // System
17     public static int Debug = 0;
18     public static int LogLevel = 0;
19     public static int DefaultBestEffortTrafficRate = 2500000;
20     // Service Flow Attributes Defaults
21     public static int DefaultBestEffortClassPriority = 69;
22     public static int DefaultUnsolicatedGrantSize = 1000;
23     public static int DefaultUnsolicatedGrantsPerInterval = 3;
24     public static int DefaultUnsolicatedGrantInterval = 8000;
25     // Gate Specification Defaults
26     public static int DSCPToSMark = 0;
27     public static int Priority = 0;
28     public static int PreEmption = 0;
29     public static int GateFlags = 0;
30     public static int GateTOSField = 0;
31     public static int GateTOSMask = 0;
32     public static int GateClass = 0;
33     // Authorization life timer
34     public static short GateT1 = 200;
35     // Authorization renew timer
36     public static short GateT2 = 300;
37     // Reservation life timer
38     public static short GateT3 = 0;
39     // Reservation renew timer
40     public static short GateT4 = 0;
41
42     // XXX - A new home for some of these @ org.pcmm.gates.impl.BestEffortService
43     public static int UGSTransmissionPolicy = 0x037F;
44     public static int BETransmissionPolicy = 0x0;
45     public static int BETrafficPriority = 0x0;
46     public static byte EClassifierPriority = 0x45;
47
48     // Temporary Configure Items For Demo or Lacking Design
49     public static int DefaultLowBestEffortTrafficRate = 500000;
50     public static int DefaultVideoSourcePort = 8081;
51     public static int DefaultAlternateSourcePort = 1369;
52     // public static String DefaultCMTS = "127.0.0.1"
53
54 /*  Demo Kit Layout
55     public static String DefaultCMTS = "10.32.4.3";
56     public static String SubscriberID = "10.32.104.2";
57     public static String dstIP = "10.32.4.208";
58     public static String srcIP = "10.32.154.2";
59 */
60
61 /*  LAB Bench Layout */
62 /*  Sunnyvale Lab
63 */
64     public static String DefaultCMTS = "10.200.90.3";
65     public static String SubscriberID = "10.50.201.51";
66     public static String dstIP = "10.200.90.10";
67     public static String srcIP = "10.50.201.51";
68
69  /*  Demo Kit Layout
70      public static String DefaultCMTS = "10.32.4.3";
71      public static String SubscriberID = "10.32.104.2";
72      public static String srcIP = "10.32.154.2";
73  */
74  
75 /*  LAB Bench Layout 
76      public static String DefaultCMTS = "10.32.15.3";
77      public static String SubscriberID = "10.32.115.143";
78      public static String dstIP = "10.32.0.234";
79      public static String srcIP = "10.32.215.111";
80
81     public static String DefaultCMTS = "10.32.15.3";
82     public static String SubscriberID = "10.32.115.143";
83     public static String dstIP = "10.32.0.234";
84     public static String srcIP = "10.32.215.111";
85 */
86
87     public static String DefautRadius = "192.168.50.2";
88     public static short srcPort = 8081;
89     public static short dstPort = 0;
90     public static int GateID1 = 0;
91     public static int GateID2 = 0;
92     public static void setGateID1(int n) {
93         GateID1 = n;
94     }
95     public static int getGateID1() {
96         return GateID1;
97     }
98     public static void setGateID2(int n) {
99         GateID2 = n;
100     }
101     public static int getGateID2() {
102         return GateID2;
103     }
104
105     /**
106      * Global TransactionId to Gate Request map allows recovery of CCAP GateIds
107      * TODO - need to find a better means to store shared state.
108      */
109
110     public static Map<Short, IPCMMGate> transactionGateMap = new ConcurrentHashMap<>();
111 }
112
113 /*
114  *
115  * // if(Constants.DEBUG.isEnabled()) { } public enum Constants { DEBUG(true),
116  * PRINT_VARS(false);
117  *
118  * private boolean enabled;
119  *
120  * private Constants(boolean enabled) { this.enabled = enabled; }
121  *
122  * public boolean isEnabled() { return enabled; } }
123  */