| |
- exceptions.ValueError(exceptions.StandardError)
-
- BufferTooLongError
- _ClamdGeneric(__builtin__.object)
-
- ClamdNetworkSocket
- ClamdUnixSocket
- socket.error(exceptions.IOError)
-
- ConnectionError
class ClamdNetworkSocket(_ClamdGeneric) |
|
Class for using clamd with a network socket |
|
- Method resolution order:
- ClamdNetworkSocket
- _ClamdGeneric
- __builtin__.object
Methods defined here:
- __init__(self, host='127.0.0.1', port=3310, timeout=None)
- Network Class initialisation
host (string) : hostname or ip address
port (int) : TCP port
timeout (float or None) : socket timeout
Methods inherited from _ClamdGeneric:
- EICAR(self)
- returns Eicar test string
- contscan_file(self, file)
- Scan a file or directory given by filename
Do not stop on error or virus found.
Scan with archive support enabled.
file (string): filename or directory (MUST BE ABSOLUTE PATH !)
return either :
- (dict): {filename1: ('FOUND', 'virusname'), filename2: ('ERROR', 'reason')}
- None: if no virus found
May raise:
- ConnectionError: in case of communication problem
- multiscan_file(self, file)
- Scan a file or directory given by filename using multiple threads (faster on SMP machines).
Do not stop on error or virus found.
Scan with archive support enabled.
file (string): filename or directory (MUST BE ABSOLUTE PATH !)
return either :
- (dict): {filename1: ('FOUND', 'virusname'), filename2: ('ERROR', 'reason')}
- None: if no virus found
May raise:
- ConnectionError: in case of communication problem
- ping(self)
- Send a PING to the clamav server, which should reply
by a PONG.
return: True if the server replies to PING
May raise:
- ConnectionError: if the server do not reply by PONG
- reload(self)
- Force Clamd to reload signature database
return: (string) "RELOADING"
May raise:
- ConnectionError: in case of communication problem
- scan_file(self, file)
- Scan a file or directory given by filename and stop on first virus or error found.
Scan with archive support enabled.
file (string) : filename or directory (MUST BE ABSOLUTE PATH !)
return either :
- (dict): {filename1: "virusname"}
- None: if no virus found
May raise :
- ConnectionError: in case of communication problem
- socket.timeout: if timeout has expired
- scan_stream(self, buffer_to_test)
- Scan a buffer
buffer_to_test (string): buffer to scan
return either:
- (dict): {filename1: "virusname"}
- None: if no virus found
May raise :
- BufferTooLongError: if the buffer size exceeds clamd limits
- ConnectionError: in case of communication problem
- shutdown(self)
- Force Clamd to shutdown and exit
return: nothing
May raise:
- ConnectionError: in case of communication problem
- stats(self)
- Get Clamscan stats
return: (string) clamscan stats
May raise:
- ConnectionError: in case of communication problem
- version(self)
- Get Clamscan version
return: (string) clamscan version
May raise:
- ConnectionError: in case of communication problem
Data descriptors inherited from _ClamdGeneric:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class ClamdUnixSocket(_ClamdGeneric) |
|
Class for using clamd with an unix socket |
|
- Method resolution order:
- ClamdUnixSocket
- _ClamdGeneric
- __builtin__.object
Methods defined here:
- __init__(self, filename=None, timeout=None)
- Unix Socket Class initialisation
filename (string) : unix socket filename or None to get the socket from /etc/clamav/clamd.conf
timeout (float or None) : socket timeout
Methods inherited from _ClamdGeneric:
- EICAR(self)
- returns Eicar test string
- contscan_file(self, file)
- Scan a file or directory given by filename
Do not stop on error or virus found.
Scan with archive support enabled.
file (string): filename or directory (MUST BE ABSOLUTE PATH !)
return either :
- (dict): {filename1: ('FOUND', 'virusname'), filename2: ('ERROR', 'reason')}
- None: if no virus found
May raise:
- ConnectionError: in case of communication problem
- multiscan_file(self, file)
- Scan a file or directory given by filename using multiple threads (faster on SMP machines).
Do not stop on error or virus found.
Scan with archive support enabled.
file (string): filename or directory (MUST BE ABSOLUTE PATH !)
return either :
- (dict): {filename1: ('FOUND', 'virusname'), filename2: ('ERROR', 'reason')}
- None: if no virus found
May raise:
- ConnectionError: in case of communication problem
- ping(self)
- Send a PING to the clamav server, which should reply
by a PONG.
return: True if the server replies to PING
May raise:
- ConnectionError: if the server do not reply by PONG
- reload(self)
- Force Clamd to reload signature database
return: (string) "RELOADING"
May raise:
- ConnectionError: in case of communication problem
- scan_file(self, file)
- Scan a file or directory given by filename and stop on first virus or error found.
Scan with archive support enabled.
file (string) : filename or directory (MUST BE ABSOLUTE PATH !)
return either :
- (dict): {filename1: "virusname"}
- None: if no virus found
May raise :
- ConnectionError: in case of communication problem
- socket.timeout: if timeout has expired
- scan_stream(self, buffer_to_test)
- Scan a buffer
buffer_to_test (string): buffer to scan
return either:
- (dict): {filename1: "virusname"}
- None: if no virus found
May raise :
- BufferTooLongError: if the buffer size exceeds clamd limits
- ConnectionError: in case of communication problem
- shutdown(self)
- Force Clamd to shutdown and exit
return: nothing
May raise:
- ConnectionError: in case of communication problem
- stats(self)
- Get Clamscan stats
return: (string) clamscan stats
May raise:
- ConnectionError: in case of communication problem
- version(self)
- Get Clamscan version
return: (string) clamscan version
May raise:
- ConnectionError: in case of communication problem
Data descriptors inherited from _ClamdGeneric:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
|