Skip to content

Commit e73757e

Browse files
committed
documented CPE API
1 parent b6ce410 commit e73757e

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

libnmap/objects/cpe.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,61 @@ def __repr__(self):
2828
return self._cpestring
2929

3030
def get_part(self):
31+
"""
32+
Returns the cpe part (/o, /h, /a)
33+
"""
3134
return self._cpedict['part']
3235

3336
def get_vendor(self):
37+
"""
38+
Returns the vendor name
39+
"""
3440
return self._cpedict['vendor']
3541

3642
def get_product(self):
43+
"""
44+
Returns the product name
45+
"""
3746
return self._cpedict['product']
3847

3948
def get_version(self):
49+
"""
50+
Returns the version of the cpe
51+
"""
4052
return self._cpedict['version']
4153

4254
def get_update(self):
55+
"""
56+
Returns the update version
57+
"""
4358
return self._cpedict['update']
4459

4560
def get_edition(self):
61+
"""
62+
Returns the cpe edition
63+
"""
4664
return self._cpedict['edition']
4765

4866
def get_language(self):
67+
"""
68+
Returns the cpe language
69+
"""
4970
return self._cpedict['language']
5071

5172
def is_application(self):
73+
"""
74+
Returns True if cpe describes an application
75+
"""
5276
return (self.get_part() == '/a')
5377

5478
def is_hardware(self):
79+
"""
80+
Returns True if cpe describes a hardware
81+
"""
5582
return (self.get_part() == '/h')
5683

5784
def is_operating_system(self):
85+
"""
86+
Returns True if cpe describes an operating system
87+
"""
5888
return (self.get_part() == '/o')

libnmap/objects/os.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import warnings
22
from libnmap.objects.cpe import CPE
33

4+
45
class OSFPPortUsed(object):
56
"""
67
Port used class: this enables the user of NmapOSFingerprint class

0 commit comments

Comments
 (0)