"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ospd/parser.py" between
ospd-2.0.0.tar.gz and ospd-2.0.1.tar.gz

About: OSPd is a base class for scanner wrappers which share the same communication protocol: OSP (OpenVAS Scanner Protocol).

parser.py  (ospd-2.0.0):parser.py  (ospd-2.0.1)
skipping to change at line 37 skipping to change at line 37
DEFAULT_CERT_FILE = "/usr/var/lib/gvm/CA/servercert.pem" DEFAULT_CERT_FILE = "/usr/var/lib/gvm/CA/servercert.pem"
DEFAULT_CA_FILE = "/usr/var/lib/gvm/CA/cacert.pem" DEFAULT_CA_FILE = "/usr/var/lib/gvm/CA/cacert.pem"
DEFAULT_PORT = 0 DEFAULT_PORT = 0
DEFAULT_ADDRESS = "0.0.0.0" DEFAULT_ADDRESS = "0.0.0.0"
DEFAULT_NICENESS = 10 DEFAULT_NICENESS = 10
DEFAULT_UNIX_SOCKET_MODE = "0o700" DEFAULT_UNIX_SOCKET_MODE = "0o700"
DEFAULT_CONFIG_PATH = "~/.config/ospd.conf" DEFAULT_CONFIG_PATH = "~/.config/ospd.conf"
DEFAULT_UNIX_SOCKET_PATH = "/var/run/ospd/ospd.sock" DEFAULT_UNIX_SOCKET_PATH = "/var/run/ospd/ospd.sock"
DEFAULT_PID_PATH = "/var/run/ospd.pid" DEFAULT_PID_PATH = "/var/run/ospd.pid"
DEFAULT_LOCKFILE_DIR_PATH = "/var/run/ospd"
DEFAULT_STREAM_TIMEOUT = 10 # ten seconds DEFAULT_STREAM_TIMEOUT = 10 # ten seconds
DEFAULT_SCANINFO_STORE_TIME = 0 # in hours
ParserType = argparse.ArgumentParser ParserType = argparse.ArgumentParser
Arguments = argparse.Namespace Arguments = argparse.Namespace
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class CliParser: class CliParser:
def __init__(self, description): def __init__(self, description):
""" Create a command-line arguments parser for OSPD. """ """ Create a command-line arguments parser for OSPD. """
self._name = description self._name = description
skipping to change at line 85 skipping to change at line 87
) )
parser.add_argument( parser.add_argument(
'-u', '-u',
'--unix-socket', '--unix-socket',
default=DEFAULT_UNIX_SOCKET_PATH, default=DEFAULT_UNIX_SOCKET_PATH,
help='Unix file socket to listen on. Default: %(default)s', help='Unix file socket to listen on. Default: %(default)s',
) )
parser.add_argument( parser.add_argument(
'--pid-file', '--pid-file',
default=DEFAULT_PID_PATH, default=DEFAULT_PID_PATH,
help='Unix file socket to listen on.' help='Unix file socket to listen on. Default: %(default)s.',
)
parser.add_argument(
'--lock-file-dir',
default=DEFAULT_LOCKFILE_DIR_PATH,
help='Directory where lock files are placed. Default: %(default)s',
) )
parser.add_argument( parser.add_argument(
'-m', '-m',
'--socket-mode', '--socket-mode',
default=DEFAULT_UNIX_SOCKET_MODE, default=DEFAULT_UNIX_SOCKET_MODE,
help='Unix file socket mode. Default: %(default)s', help='Unix file socket mode. Default: %(default)s',
) )
parser.add_argument( parser.add_argument(
'-k', '-k',
'--key-file', '--key-file',
default=DEFAULT_KEY_FILE, default=DEFAULT_KEY_FILE,
help='Server key file. Default: %(default)s', help='Server key file. Default: %(default)s',
) )
parser.add_argument( parser.add_argument(
'-c', '-c',
'--cert-file', '--cert-file',
default=DEFAULT_CERT_FILE, default=DEFAULT_CERT_FILE,
skipping to change at line 141 skipping to change at line 146
) )
parser.add_argument( parser.add_argument(
'-l', '--log-file', help='Path to the logging file.' '-l', '--log-file', help='Path to the logging file.'
) )
parser.add_argument( parser.add_argument(
'--niceness', '--niceness',
default=DEFAULT_NICENESS, default=DEFAULT_NICENESS,
type=int, type=int,
help='Start the scan with the given niceness. Default %(default)s', help='Start the scan with the given niceness. Default %(default)s',
) )
parser.add_argument(
'--scaninfo-store-time',
default=DEFAULT_SCANINFO_STORE_TIME,
type=int,
help='Time in hours a scan is stored before being considered '
'forgotten and being delete from the scan table. '
'Default %(default)s, disabled.',
)
self.parser = parser self.parser = parser
def network_port(self, string): def network_port(self, string):
""" Check if provided string is a valid network port. """ """ Check if provided string is a valid network port. """
value = int(string) value = int(string)
if not 0 < value <= 65535: if not 0 < value <= 65535:
raise argparse.ArgumentTypeError( raise argparse.ArgumentTypeError(
'port must be in ]0,65535] interval' 'port must be in ]0,65535] interval'
 End of changes. 6 change blocks. 
3 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)