org.onosproject.p4runtime.model.P4InfoParser Java Examples
The following examples show how to use
org.onosproject.p4runtime.model.P4InfoParser.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PipeconfLoader.java From ngsdn-tutorial with Apache License 2.0 | 5 votes |
private PiPipeconf buildPipeconf() throws P4InfoParserException { final URL p4InfoUrl = PipeconfLoader.class.getResource(P4INFO_PATH); final URL bmv2JsonUrlUrl = PipeconfLoader.class.getResource(BMV2_JSON_PATH); final PiPipelineModel pipelineModel = P4InfoParser.parse(p4InfoUrl); return DefaultPiPipeconf.builder() .withId(PIPECONF_ID) .withPipelineModel(pipelineModel) .addBehaviour(PiPipelineInterpreter.class, InterpreterImpl.class) .addBehaviour(Pipeliner.class, PipelinerImpl.class) .addExtension(P4_INFO_TEXT, p4InfoUrl) .addExtension(BMV2_JSON, bmv2JsonUrlUrl) .build(); }
Example #2
Source File: PipeconfLoader.java From onos-p4-tutorial with Apache License 2.0 | 5 votes |
private PiPipeconf buildPipeconf() throws P4InfoParserException { final URL p4InfoUrl = PipeconfLoader.class.getResource(P4INFO_PATH); final URL bmv2JsonUrlUrl = PipeconfLoader.class.getResource(BMV2_JSON_PATH); final PiPipelineModel pipelineModel = P4InfoParser.parse(p4InfoUrl); return DefaultPiPipeconf.builder() .withId(PIPECONF_ID) .withPipelineModel(pipelineModel) .addBehaviour(PiPipelineInterpreter.class, InterpreterImpl.class) .addBehaviour(Pipeliner.class, PipelinerImpl.class) .addExtension(P4_INFO_TEXT, p4InfoUrl) .addExtension(BMV2_JSON, bmv2JsonUrlUrl) .build(); }
Example #3
Source File: PipeconfLoader.java From onos-p4-tutorial with Apache License 2.0 | 5 votes |
private PiPipeconf buildPipeconf() throws P4InfoParserException { final URL p4InfoUrl = PipeconfLoader.class.getResource(P4INFO_PATH); final URL bmv2JsonUrlUrl = PipeconfLoader.class.getResource(BMV2_JSON_PATH); final PiPipelineModel pipelineModel = P4InfoParser.parse(p4InfoUrl); return DefaultPiPipeconf.builder() .withId(PIPECONF_ID) .withPipelineModel(pipelineModel) .addBehaviour(PiPipelineInterpreter.class, InterpreterImpl.class) .addBehaviour(Pipeliner.class, PipelinerImpl.class) .addExtension(P4_INFO_TEXT, p4InfoUrl) .addExtension(BMV2_JSON, bmv2JsonUrlUrl) .build(); }
Example #4
Source File: FabricPipeconfManager.java From onos with Apache License 2.0 | 5 votes |
private static PiPipelineModel parseP4Info(URL p4InfoUrl) { try { return P4InfoParser.parse(p4InfoUrl); } catch (P4InfoParserException e) { // FIXME: propagate exception that can be handled by whoever is // trying to build pipeconfs. throw new IllegalStateException(e); } }
Example #5
Source File: PipeconfLoader.java From onos with Apache License 2.0 | 5 votes |
private static PiPipelineModel parseP4Info(URL p4InfoUrl) { try { return P4InfoParser.parse(p4InfoUrl); } catch (P4InfoParserException e) { throw new IllegalStateException(e); } }
Example #6
Source File: PipeconfFactory.java From onos with Apache License 2.0 | 5 votes |
private PiPipeconf buildPipeconf() throws P4InfoParserException { final PiPipelineModel pipelineModel = P4InfoParser.parse(P4INFO_URL); return DefaultPiPipeconf.builder() .withId(PIPECONF_ID) .withPipelineModel(pipelineModel) .addBehaviour(PiPipelineInterpreter.class, PipelineInterpreterImpl.class) .addBehaviour(PortStatisticsDiscovery.class, PortStatisticsDiscoveryImpl.class) // Since mytunnel.p4 defines only 1 table, we re-use the existing single-table pipeliner. .addBehaviour(Pipeliner.class, DefaultSingleTablePipeline.class) .addExtension(P4_INFO_TEXT, P4INFO_URL) .addExtension(BMV2_JSON, BMV2_JSON_URL) .build(); }