-
Notifications
You must be signed in to change notification settings - Fork 27
/
model_huawei_vrp.go
50 lines (42 loc) · 1.28 KB
/
model_huawei_vrp.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package dev
import (
"time"
"github.com/udhos/jazigo/conf"
)
func registerModelHuaweiVRP(logger hasPrintf, t *DeviceTable) {
a := conf.NewDevAttr()
/*
a.CommandList = []string{
"user-interface vty 0 4",
"screen-length 0", // disable paging
"quit",
"disp ver", // get system information
"disp curr", // get configuration
"user-interface vty 0 4",
"screen-length 24", // restore paging
}
a.NeedEnabledMode = true
a.EnableCommand = "sys"
a.EnabledPromptPattern = `\[[^\[\]]+\]$`
*/
a.CommandList = []string{
"screen-length 0 temporary", // disable paging
"disp ver", // get system information
"disp curr", // get configuration
}
a.DisabledPromptPattern = `<[^<>]+>$`
a.NeedLoginChat = true
a.UsernamePromptPattern = `Username:$`
a.PasswordPromptPattern = `Password:$`
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: "huawei-vrp"}
m.defaultAttr = a
if err := t.SetModel(m, logger); err != nil {
logger.Printf("registerModelHuaweiVRP: %v", err)
}
}