Get detailed information about all protocols
(self)
| 73 | return ports |
| 74 | |
| 75 | def get_protocol_info(self) -> Dict[str, Dict[str, Any]]: |
| 76 | """Get detailed information about all protocols""" |
| 77 | info = {} |
| 78 | for protocol, validator_class in self.validators.items(): |
| 79 | try: |
| 80 | temp_validator = validator_class() |
| 81 | info[protocol] = { |
| 82 | 'name': validator_class.__name__, |
| 83 | 'description': validator_class.__doc__ or f"{protocol.upper()} protocol validator", |
| 84 | 'default_ports': temp_validator.get_default_ports() if hasattr(temp_validator, 'get_default_ports') else [], |
| 85 | 'class': validator_class.__name__ |
| 86 | } |
| 87 | except Exception as e: |
| 88 | logger.warning(f"Failed to get info for {protocol}: {e}") |
| 89 | info[protocol] = { |
| 90 | 'name': validator_class.__name__, |
| 91 | 'description': f"Error loading {protocol}: {e}", |
| 92 | 'default_ports': [], |
| 93 | 'class': validator_class.__name__ |
| 94 | } |
| 95 | |
| 96 | return info |
| 97 | |
| 98 | def validate_protocols(self, protocols: List[str], port_scan_results: Dict, |
| 99 | max_threads: int = 10, timeout: int = 5, **kwargs) -> Dict[str, Dict]: |
no test coverage detected