brctldriver
v0.0.2
Published
Linux Bridge control utility commands wrapper
Downloads
1
Maintainers
Readme
brctldriver
Nodejs Linux bridge Control(brctl) utility wrapper
Supports the following API
- Create a Bridge
- Add Interface to the Bridge
- Enable the Bridge
- Disable the Bridge
- Delete the Bridge
- Get the Status of the Bridge
API:
- createBridge : (bridgname, callback)
- addInterface : (bridgname,ifname,callback)
- enableBridge : (bridgname, callback)
- disableBridge : (bridgname , callback)
- deleteBridge : (bridgename, callback)
- getStatus: (bridgename, callback) returns "running" or "notrunning"
Program Example
written in coffeescript.
This is just indicative program to demonstrate functionality . It cannot run as it is.
brctl = require('brctldriver')
brctl.createBridge "sw1", (result) =>
util.log "Bridge creation " + result
brctl.addInterface "sw1", "veth1",(result) =>
util.log "AddInterface result", result
This driver is used in Kaanalnet application to manage linux bridge, https://github.com/sureshkvl/kaanalnet/blob/master/src/builder/switchCtrl.coffee