예제 #1
0
 def get_p4info(self):
     logging.debug("Retrieving P4Info file")
     req = p4runtime_pb2.GetForwardingPipelineConfigRequest()
     req.device_id = self.device_id
     req.response_type = p4runtime_pb2.GetForwardingPipelineConfigRequest.P4INFO_AND_COOKIE
     rep = self.stub.GetForwardingPipelineConfig(req)
     return rep.config.p4info
예제 #2
0
 def GetForwardingPipelineConfig(self, p4info, dry_run=False, **kwargs):
     request = p4runtime_pb2.GetForwardingPipelineConfigRequest()
     request.device_id = self.device_id
     request.response_type = p4runtime_pb2.GetForwardingPipelineConfigRequest.DEVICE_CONFIG_AND_COOKIE
     rep = self.client_stub.GetForwardingPipelineConfig(request)
     if rep is not None and self.p4info is not None:
         rep.config.p4info.CopyFrom(self.p4info)
예제 #3
0
    def GetForwardingPipelineConfig(self, **kwargs):
        # device_config = self.buildDeviceConfig(**kwargs)
        request = p4runtime_pb2.GetForwardingPipelineConfigRequest()
        request.device_id = self.device_id

        print(self.client_stub.GetForwardingPipelineConfig(request))