-
Notifications
You must be signed in to change notification settings - Fork 2
Workflow
This document introduces the workflow of how to design your own netcore for freebird framework to manage your machine network.
Step 1 > Create a netcore from freebird-base
Step 2 > Use netcore commit APIs to pass messages from low-layer to freebird.
- These APIs include:
- nc.commitReady()
- nc.commitDevIncoming(), nc.commitDevLeaving(), nc.commitDevNetChanging(), nc.commitDevReporting()
- nc.commitGadIncoming(), nc.commitGadReporting(), nc.dangerouslyCommitGadReporting()
- Short descriptions of these commit APIs
- Example: commitDevIncoming, commitGadIncoming
Step 3 > Implement the template method nc._cookRawDev
- This method is called by freebird to transform the low-layer raw device into instance of the Device class.
- You have to use dev.set('net', netInfoObj) and dev.set('attrs', devAttrsObj) to set up the device network information and attributes.
- Example
Step 4 > Implement the template method nc._cookRawGad
- This method is called by freebird to transform the low-layer raw gadget into instance of the Gadget class.
- You have to use gad.set('panel ', panelInfoObj) and gad.set('attrs', gadAttrsObj) to set up the gadget application information and attributes.
- Example
Step 5 > Implement the network management drivers and register them with nc.registerNetDrivers().
- Mandatory drivers: start, stop, reset, permitJoin, remove, and ping
- Optional drivers: ban, unban
- If any of the mandatory drivers is missing, freebird will throw you an error at starting.
- Example
Step 6 > Implement the device operation drivers and register them with nc.registerDevDrivers().
- Mandatory drivers: read and write
- Optional drivers: identify
- If any of the mandatory drivers is missing, freebird will throw you an error at starting.
- Example
Step 7 > Implement the gadget operation drivers and register them with nc.registerGadDrivers().
- Mandatory drivers: read, write, and exec
- Optional drivers: readReportCfg and writeReportCfg
- Example
When the developer meets the above requirements. Netcore will be able to work in the freebird framework.
freebird team
Overview
Main Classes
Design Your Own Netcore
- Workflow
- APIs for Implementer
- Unified data model
- What should be implemented
Appendix
- Device data object format
- Gadget data object format