Minor adjustments for Tomoyo for the fourth benchmark
[iot2.git] / iotjava / iotruntime / master / ProcessJailConfig.java
index 7b080fd..757313a 100644 (file)
@@ -316,6 +316,46 @@ public final class ProcessJailConfig {
        }
 
 
+       /**
+        * configureProcessJailDevicePolicies() method configures the device MAC policies
+        * <p>
+        * This method configures the device policies between device driver and device
+        *
+        * @param   strConfigHost                       String hostname to be configured
+        * @param   strRouterAddress            String router address
+        * @param   iPort                                       Integer port
+        * @return  void
+        */
+       public void configureProcessJailGWDevicePolicies(String strConfigHost, String strRouterAddress, int iPort) {
+
+               PrintWriter pwConfig = getPrintWriter(strConfigHost);
+               pwConfig.println("file read /home/iotuser/iot2/iotjava/iotruntime/\\*.jks");
+               pwConfig.println("file read /etc/resolv.conf");
+               pwConfig.println("file read /etc/hosts");
+               pwConfig.println("network inet dgram send " + strRouterAddress + " " + String.valueOf(iPort));
+       }
+
+
+       /**
+        * configureProcessJailDeviceDriverInetAddressPolicies() method configures the device MAC policies
+        * <p>
+        *
+        * @param   strConfigHost       String hostname to be configured
+        * @param   strAddress          String device IP address
+        * @return  void
+        */
+       public void configureProcessJailInetAddressPolicies(String strConfigHost, String strRouterAddress, String strAddress) {
+
+               PrintWriter pwConfig = getPrintWriter(strConfigHost);
+               //System.out.println("\n\nDEBUG: Writing the config host address setup!!!\n\n");
+               pwConfig.println("file read /etc/resolv.conf");
+               pwConfig.println("file read /etc/hosts");
+               pwConfig.println("file read /etc/host.conf");
+               pwConfig.println("network inet dgram send " + strRouterAddress + " " + String.valueOf(53));     // TCP/UDP access through router
+               pwConfig.println("network inet stream connect ::ffff:" + strAddress + " " + String.valueOf(80));        // HTTP access for this address
+       }
+
+
        /**
         * configureProcessJailControllerPolicies() method configures the main MAC policies for controller
         *