-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added support for
ip neighbour get
.
- Updated badges in README.
- Loading branch information
Showing
16 changed files
with
186 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import {TestFixture} from '../../../../src/common/interfaces/tests'; | ||
import {NeighbourGetOptions} from '../../../../src'; | ||
|
||
export const Tests: TestFixture<NeighbourGetOptions>[] = [ | ||
{ | ||
description : 'with no params', | ||
options : { | ||
to : '10.0.1.10', | ||
dev: 'eth0' | ||
}, | ||
expectedCmd : [ | ||
'', | ||
'ip', | ||
'-details', | ||
'-statistics', | ||
'-json', | ||
'neighbour', | ||
'get', | ||
'to', | ||
'10.0.1.10', | ||
'dev', | ||
'eth0' | ||
], | ||
expectedCmdToExec: ` ip -details -statistics -json neighbour get to 10.0.1.10 dev eth0` | ||
}, | ||
{ | ||
description : 'with proxy enabled', | ||
options : { | ||
proxy: true, | ||
to : '10.0.1.10', | ||
dev : 'eth0' | ||
}, | ||
expectedCmd : [ | ||
'', | ||
'ip', | ||
'-details', | ||
'-statistics', | ||
'-json', | ||
'neighbour', | ||
'get', | ||
'proxy', | ||
'to', | ||
'10.0.1.10', | ||
'dev', | ||
'eth0' | ||
], | ||
expectedCmdToExec: ` ip -details -statistics -json neighbour get proxy to 10.0.1.10 dev eth0` | ||
} | ||
]; | ||
|
||
export default Tests; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Neighbour get options. | ||
* @category Interfaces | ||
*/ | ||
export interface NeighbourGetOptions { | ||
/** Gets the proxy requests too. */ | ||
proxy?: true; | ||
/** The prefix selecting the neighbours to list. */ | ||
to: string; | ||
/** Only list the neighbours attached to this device. */ | ||
dev: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { JSONSchemaType } from 'ajv'; | ||
|
||
import { SchemaIds } from '../../common/constants/schemas'; | ||
import { NeighbourGetOptions } from './get.interfaces'; | ||
|
||
export const NeighbourGetSchema: JSONSchemaType<NeighbourGetOptions> = { | ||
$id: SchemaIds.RouteGet, | ||
type: 'object', | ||
required: ['to', 'dev'], | ||
properties: { | ||
proxy: { | ||
type: 'boolean', | ||
enum: [true], | ||
nullable: true | ||
}, | ||
to: { | ||
type: 'string', | ||
minLength: 1, | ||
format: 'ip' | ||
}, | ||
dev: { | ||
type: 'string', | ||
minLength: 1 | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.