Esempio n. 1
0
    def handle_packet_in_event(self, logical_port_no, packet):
        self.log.debug('handle-packet-in', logical_port_no=logical_port_no)
        packet_in = ofp.ofp_packet_in(
            # buffer_id=0,
            reason=ofp.OFPR_ACTION,
            # table_id=0,
            # cookie=0,
            match=ofp.ofp_match(
                type=ofp.OFPMT_OXM,
                oxm_fields=[
                    ofp.ofp_oxm_field(
                        oxm_class=ofp.OFPXMC_OPENFLOW_BASIC,
                        ofb_field=in_port(logical_port_no)
                    )
                ]
            ),
            data=packet
        )

        packet_in = ofp.PacketIn(id=self.device.data_model.logical_device_id,
                                 packet_in=packet_in)
        '''
        # FIXME - change this to use kafka
        lh = self.device.data_model.adapter_agent.core.get_local_handler()
        lh.core.packet_in_queue.put(packet_in)
        '''

        kafka_send_pb('voltha.pktin', packet_in)
Esempio n. 2
0
 def handle_packet_in_event(self, _, msg):
     self.log.debug('handle-packet-in', msg=msg)
     logical_port_no, packet = msg
     packet_in = ofp.ofp_packet_in(
         # buffer_id=0,
         reason=ofp.OFPR_ACTION,
         # table_id=0,
         # cookie=0,
         match=ofp.ofp_match(type=ofp.OFPMT_OXM,
                             oxm_fields=[
                                 ofp.ofp_oxm_field(
                                     oxm_class=ofp.OFPXMC_OPENFLOW_BASIC,
                                     ofb_field=in_port(logical_port_no))
                             ]),
         data=packet)
     self.packet_in(packet_in)
 def handle_packet_in_event(self, _, msg):
     self.log.debug('handle-packet-in', msg=msg)
     logical_port_no, packet = msg
     packet_in = ofp.ofp_packet_in(
         # buffer_id=0,
         reason=ofp.OFPR_ACTION,
         # table_id=0,
         # cookie=0,
         match=ofp.ofp_match(
             type=ofp.OFPMT_OXM,
             oxm_fields=[
                 ofp.ofp_oxm_field(
                     oxm_class=ofp.OFPXMC_OPENFLOW_BASIC,
                     ofb_field=in_port(logical_port_no)
                 )
             ]
         ),
         data=packet
     )
     self.packet_in(packet_in)