Skip to content

Commit f3b2698

Browse files
authored
Fixing regex to be able to detect versions correctly for Huawei VRP (#660)
* Fixing regex to be able to detect versions correctly * Fixing the example to the correct device * Refine fingerprint pattern for VRP version matching * Fix regex pattern in fingerprint for VRP version
1 parent ec9eb1e commit f3b2698

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

xml/snmp_sysdescr.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,17 +3358,21 @@ Copyright (c) 1995-2005 by Cisco Systems
33583358
<param pos="0" name="os.device" value="WAP"/>
33593359
</fingerprint>
33603360

3361-
<fingerprint pattern="VRP.*Version ([\d.]+) \((.+?) (V[\d.]+R[\d.]+C[\d.]+(?:SPC|SPH|CP|HP)?\d*)">
3361+
<fingerprint pattern="VRP[^V]*Version ([\d.]+) \(([^\s]+) (V\d{3,3}R\d{3,3}(?:C\d{2,2})?(?:SPC\d+|SPH\d+|CP\d+|HP\d+)?)\)">
33623362
<description>HUAWEI VRP</description>
3363-
<example hw.model="CE6870EI" hw.series="V200R001C00SPC700" os.version="8.120">Huawei Versatile Routing Platform Software
3363+
<example hw.model="CE6870EI" hw.series="V200R001C00SPC700" os.device="CE6870EI" os.version="8.120">Huawei Versatile Routing Platform Software
33643364
VRP (R) software, Version 8.120 (CE6870EI V200R001C00SPC700) Copyright (C) 2012-2016 Huawei Technologies Co., Ltd.
33653365
</example>
3366-
<example hw.model="AR2200" hw.series="V200R003C00" os.version="5.120">Huawei Versatile Routing Platform Software
3366+
<example hw.model="AR2200" hw.series="V200R003C00" os.device="AR2200" os.version="5.120">Huawei Versatile Routing Platform Software
33673367
VRP (R) software, Version 5.120 (AR2200 V200R003C00) Copyright (C) 2011-2012 HUAWEI TECH CO., LTD
33683368
</example>
3369+
<example hw.model="5310EI" hw.series="V200R003" os.device="5310EI" os.version="5.111">Huawei Versatile Routing Platform Software
3370+
VRP (R) software, Version 5.111 (5310EI V200R003) Copyright (C) 2011-2012 HUAWEI TECH CO., LTD
3371+
</example>
33693372
<param pos="0" name="os.vendor" value="Huawei"/>
33703373
<param pos="0" name="os.product" value="VRP"/>
33713374
<param pos="1" name="os.version"/>
3375+
<param pos="2" name="os.device"/>
33723376
<param pos="2" name="hw.model"/>
33733377
<param pos="3" name="hw.series"/>
33743378
<param pos="0" name="hw.vendor" value="Huawei"/>

0 commit comments

Comments
 (0)