Due to a ransomware attack, the wiki was reverted to a July 2022 version. . We apologize for the lack of a more recent valid backup.
...
Next, we need to tell Karaf about our new command by editing shell-config.xml, located in ONOS_ROOT/cli/src/main/resources/OSGI-INF/blueprint/. We append add the following to the contents between the <command-bundle></command-bundle>
clause in the file:
Code Block | ||||
---|---|---|---|---|
| ||||
<command> <!--Our command implementation's FQDN--> <action class="org.onlab.onos.cli.net.ForwardingMapCommand"/> <!--A command completer for Host IDs--> <completers> <ref component-id="hostIdCompleter"/> <null/> </completers> </command> |
Returning to our directory structure diagram, our collection of additions/modifications are:
Code Block | ||
---|---|---|
| ||
ONOS_ROOT/apps/pom.xml (apps parent POM)
| |
| /ifwd/pom.xml (application POM)
| |
| /src/main/java/org/onlab/onos/ifwd/IntentReactiveForwarding.java (the application)
| | |
| | /package-info.java (optional documentation/annotations)
| |
| /test/java/org/onlab/onos/ifwd/ (Unit tests go here)
|
/core/api/src/main/java/org/onlab/onos/net/apps/ForwardingMapService.java (the service interface)
|
/cli/src/main/java/org/onlab/onos/cli/net/ForwardingMapCommand.java (the command)
|
/resources/OSGI-INF/blueprint/shell-config.xml (Karaf shell configuration) |
Verification
Once we rebuild ONOS, we can test our command out.
...