ONOS-7058 Refactored default pipeconfs in new pipelines directory

- Minimal refactoring of P4 programs
- Removed symlinks to BMv2 JSON/P4Info
- Bumped p4c commit (which fixes known parser bug)
- Renamed "default" pipeconf to "basic" (ONOS-6818)

Change-Id: I319f8b142ab22dba9b15457e28cd62d17f78a423
diff --git a/apps/pi-demo/common/src/main/java/org/onosproject/pi/demo/app/common/AbstractUpgradableFabricApp.java b/apps/pi-demo/common/src/main/java/org/onosproject/pi/demo/app/common/AbstractUpgradableFabricApp.java
index 18f1e8c..d3c1a14 100644
--- a/apps/pi-demo/common/src/main/java/org/onosproject/pi/demo/app/common/AbstractUpgradableFabricApp.java
+++ b/apps/pi-demo/common/src/main/java/org/onosproject/pi/demo/app/common/AbstractUpgradableFabricApp.java
@@ -75,7 +75,9 @@
 import static java.util.stream.Collectors.toSet;
 import static java.util.stream.Stream.concat;
 import static org.onlab.util.Tools.groupedThreads;
-import static org.onosproject.net.device.DeviceEvent.Type.*;
+import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_ADDED;
+import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_AVAILABILITY_CHANGED;
+import static org.onosproject.net.device.DeviceEvent.Type.DEVICE_UPDATED;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
@@ -151,7 +153,7 @@
     /**
      * Creates a new PI fabric app.
      *
-     * @param appName     app name
+     * @param appName      app name
      * @param appPipeconfs collection of compatible pipeconfs
      */
     protected AbstractUpgradableFabricApp(String appName, Collection<PiPipeconf> appPipeconfs) {
@@ -181,7 +183,6 @@
 
         appId = coreService.registerApplication(appName);
         deviceService.addListener(deviceListener);
-        appPipeconfs.forEach(piPipeconfService::register);
 
         init();
 
@@ -201,9 +202,6 @@
         scheduledExecutorService.shutdown();
         deviceService.removeListener(deviceListener);
         flowRuleService.removeFlowRulesById(appId);
-        appPipeconfs.stream()
-                .map(PiPipeconf::id)
-                .forEach(piPipeconfService::remove);
 
         appActive = false;
         APP_HANDLES.remove(appName);
@@ -228,7 +226,7 @@
         one, it generates the necessary flow rules and starts the deploy process on each device.
          */
         scheduledExecutorService.scheduleAtFixedRate(this::checkTopologyAndGenerateFlowRules,
-                0, CHECK_TOPOLOGY_INTERVAL_SECONDS, TimeUnit.SECONDS);
+                                                     0, CHECK_TOPOLOGY_INTERVAL_SECONDS, TimeUnit.SECONDS);
     }
 
     private void setAppFreezed(boolean appFreezed) {
@@ -453,11 +451,11 @@
     /**
      * Returns a new, pre-configured flow rule builder.
      *
-     * @param did       a device id
-     * @param tableName a table name
+     * @param did     a device id
+     * @param tableId a table id
      * @return a new flow rule builder
      */
-    protected FlowRule.Builder flowRuleBuilder(DeviceId did, String tableName) throws FlowRuleGeneratorException {
+    protected FlowRule.Builder flowRuleBuilder(DeviceId did, PiTableId tableId) throws FlowRuleGeneratorException {
 
         final Device device = deviceService.getDevice(did);
         if (!device.is(PiPipelineInterpreter.class)) {
@@ -465,10 +463,10 @@
         }
         final PiPipelineInterpreter interpreter = device.as(PiPipelineInterpreter.class);
         final int flowRuleTableId;
-        if (interpreter.mapPiTableId(PiTableId.of(tableName)).isPresent()) {
-            flowRuleTableId = interpreter.mapPiTableId(PiTableId.of(tableName)).get();
+        if (interpreter.mapPiTableId(tableId).isPresent()) {
+            flowRuleTableId = interpreter.mapPiTableId(tableId).get();
         } else {
-            throw new FlowRuleGeneratorException(format("Unknown table %s in interpreter", tableName));
+            throw new FlowRuleGeneratorException(format("Unknown table '%s' in interpreter", tableId));
         }
 
         return DefaultFlowRule.builder()