The data transfer object (DTO) service class will hold the results of each service that is found after a TCP scan. A service will have three criteria:
- Service port
- Name
- Description
We will call this class when using the Nmap results parser, as follows:
class ServiceDTO:
# Class Constructor
def __init__(self, port, name, description):
self.description = description
self.port = port
self.name = name