Skip to content

Commit 028dba8

Browse files
author
Mohamed Daif
committed
adds driver for Ericsson's Broadband Access Nodes
1 parent ac97763 commit 028dba8

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

src/Exscript/protocols/drivers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from Exscript.protocols.drivers.isam import IsamDriver
2323
from Exscript.protocols.drivers.zte import ZteDriver
2424
from Exscript.protocols.drivers.vxworks import VxworksDriver
25-
25+
from Exscript.protocols.drivers.ericsson_ban import EricssonBanDriver
2626

2727
driver_classes = []
2828
drivers = []
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (C) 2007-2010 Samuel Abels.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License version 2, as
5+
# published by the Free Software Foundation.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15+
"""
16+
A driver for devices running Ericsson's Broadband Access Nodes (BAN) OS
17+
"""
18+
import re
19+
from Exscript.protocols.drivers.driver import Driver
20+
21+
_user_re = [re.compile(r'user:', re.I)]
22+
_password_re = [re.compile(r'pass:', re.I)]
23+
_prompt_re = [re.compile(r'[\r\n][\-\w+\.]+(?:\([^\)]+\))?% ?$|(?:\(y/n\)\[n\])')]
24+
_error_re = [re.compile(r'\(error\)')]
25+
26+
_ban_re = re.compile(r"BLM\d+ - Broadband Loop Multiplexer", re.I)
27+
28+
_banner_re = re.compile(r"Last login", re.I)
29+
30+
_login_fail_re = [r'Login failed']
31+
32+
33+
class EricssonBanDriver(Driver):
34+
def __init__(self):
35+
Driver.__init__(self, 'ericsson_ban')
36+
37+
self.user_re = _user_re
38+
self.password_re = _password_re
39+
self.prompt_re = _prompt_re
40+
self.error_re = _error_re
41+
self.login_error_re = _login_fail_re
42+
43+
# def auto_authorize(self, conn, account, flush, bailout):
44+
# conn.send('enable\r\n')
45+
# conn.app_authorize(account, flush, bailout)
46+
47+
def check_head_for_os(self, string):
48+
if _ban_re.search(string):
49+
return 90
50+
return 0
51+
52+
def check_response_for_os(self, string):
53+
if _banner_re.search(string):
54+
return 20
55+
return 0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BLM1500 - Broadband Loop Multiplexer
2+
Copyright 2001-2012 Ericsson Inc.
3+
Fabric & Control Processor (ttyp0)
4+
5+
6+
7+
GJDIR-G02E-T-EG (BLZDS011112) booted Thu Jun 26 08:49:43 EEST 2014, up for 9149:44:25
8+
9+
10+
user: myuser
11+
pass:
12+
13+
Notice: This is a private computer system.
14+
Unauthorized access or use may lead to prosecution.
15+
--------------------------------------------------------------------------------
16+
Last login | Sun Jan 15 13:26:50 EEST 2015 (0 days 00:07:24 ago)
17+
Last login From | CLI-10.10.10.24
18+
Failed login attempts | 0
19+
Failures due to lockout | 0
20+
Last failed attempt | Sun Jun 15 12:23:04 EEST 2015 (0 days 00:07:33 ago)
21+
Last failure from | CLI-10.10.10.24
22+
Password expires | NEVER
23+
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)