[VOL-1037, VOL-1035] This commit consists of flow and groups
handling (from NBI to Adapters, including decomposition),

Change-Id: I4f6d9ecd3dee8a9b161708b20b0a68d030c0cb23
diff --git a/adapters/ponsim_olt/ponsim_olt.py b/adapters/ponsim_olt/ponsim_olt.py
index e47d14d..1806a33 100644
--- a/adapters/ponsim_olt/ponsim_olt.py
+++ b/adapters/ponsim_olt/ponsim_olt.py
@@ -358,12 +358,12 @@
         cap = OFPPF_1GB_FD | OFPPF_FIBER
         return PortCapability(
             port = LogicalPort (
-                id='nni',
+                # id='nni',
                 ofp_port=ofp_port(
-                    port_no=port_no,
+                    # port_no=port_no,
                     hw_addr=mac_str_to_tuple(
-                    '00:00:00:00:00:%02x' % self.ofp_port_no),
-                    name='nni',
+                    '00:00:00:00:00:%02x' % port_no),
+                    # name='nni',
                     config=0,
                     state=OFPPS_LIVE,
                     curr=cap,
@@ -371,8 +371,10 @@
                     peer=cap,
                     curr_speed=OFPPF_1GB_FD,
                     max_speed=OFPPF_1GB_FD
-                )
-            )
+                ),
+                device_id=device.id,
+                device_port_no=port_no
+        )
         )
 
     # TODO - change for core 2.0
@@ -458,34 +460,12 @@
         self.log.info('stopped-receiving-grpc-frames')
 
 
-    # VOLTHA's flow decomposition removes the information about which flows
-    # are trap flows where traffic should be forwarded to the controller.
-    # We'll go through the flows and change the output port of flows that we
-    # know to be trap flows to the OF CONTROLLER port.
+    @inlineCallbacks
     def update_flow_table(self, flows):
-        stub = ponsim_pb2.PonSimStub(self.get_channel())
-        self.log.info('pushing-olt-flow-table')
-        for flow in flows:
-            classifier_info = {}
-            for field in fd.get_ofb_fields(flow):
-                if field.type == fd.ETH_TYPE:
-                    classifier_info['eth_type'] = field.eth_type
-                    self.log.debug('field-type-eth-type',
-                                   eth_type=classifier_info['eth_type'])
-                elif field.type == fd.IP_PROTO:
-                    classifier_info['ip_proto'] = field.ip_proto
-                    self.log.debug('field-type-ip-proto',
-                                   ip_proto=classifier_info['ip_proto'])
-            if ('ip_proto' in classifier_info and (
-                    classifier_info['ip_proto'] == 17 or
-                    classifier_info['ip_proto'] == 2)) or (
-                    'eth_type' in classifier_info and
-                    classifier_info['eth_type'] == 0x888e):
-                for action in fd.get_actions(flow):
-                    if action.type == ofp.OFPAT_OUTPUT:
-                        action.output.port = ofp.OFPP_CONTROLLER
-            self.log.info('out_port', out_port=fd.get_out_port(flow))
+        yield self.get_channel()
+        stub = ponsim_pb2.PonSimStub(self.channel)
 
+        self.log.info('pushing-olt-flow-table')
         stub.UpdateFlowTable(FlowTable(
             port=0,
             flows=flows