1 | import iproute from 'iproute'
|
2 |
|
3 | let route = {
|
4 | type: 'unicast',
|
5 | to: '224.0.0.0/4',
|
6 | scope: 'link'
|
7 | }
|
8 |
|
9 | export function add(args, callback) {
|
10 | route.dev = args.interface
|
11 | iproute.route.add(route, (err) => {
|
12 | if (err) console.log(err)
|
13 | if (typeof callback == 'function') callback()
|
14 | })
|
15 | }
|
16 |
|
17 | export function del(args, callback) {
|
18 | route.dev = args.interface
|
19 | iproute.route.delete(route, (err) => {
|
20 | if (err) console.log(err)
|
21 | if (typeof callback == 'function') callback()
|
22 | })
|
23 | }
|