-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
udhos
committed
Jun 14, 2017
1 parent
96473ec
commit 2bdccff
Showing
4 changed files
with
52 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package dev | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/udhos/jazigo/conf" | ||
) | ||
|
||
func registerModelDatacomDmswitch(logger hasPrintf, t *DeviceTable) { | ||
a := conf.NewDevAttr() | ||
|
||
a.CommandList = []string{ | ||
"no terminal paging", // disable paging | ||
"show system", | ||
"show firmware", | ||
"show running-config", | ||
"terminal paging", // enable paging | ||
} | ||
|
||
a.DisabledPromptPattern = `[^#\s]+#$` | ||
|
||
a.NeedLoginChat = true | ||
a.UsernamePromptPattern = `login:\s*$` | ||
a.PasswordPromptPattern = `Password:\s*$` | ||
a.ReadTimeout = 10 * time.Second | ||
a.MatchTimeout = 20 * time.Second | ||
a.SendTimeout = 5 * time.Second | ||
a.CommandReadTimeout = 15 * time.Second // larger timeout for slow 'sh run' | ||
a.CommandMatchTimeout = 25 * time.Second // larger timeout for slow 'sh run' | ||
a.QuoteSentCommandsFormat = `!![%s]` | ||
|
||
m := &Model{name: "dmswitch"} | ||
m.defaultAttr = a | ||
if err := t.SetModel(m, logger); err != nil { | ||
logger.Printf("registerModelDatacomDmswitch: %v", err) | ||
} | ||
} |
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,8 @@ | ||
Escape character is '^]'. | ||
|
||
|
||
|
||
dmswitch-lab login: lab | ||
Password: | ||
dmswitch-lab# | ||
dmswitch-lab#exit |