Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: users

How exactly does the API function in ClamAV source?

 

 

ClamAV users RSS feed   Index | Next | Previous | View Threaded


StormontS at imsweb

May 18, 2009, 8:26 AM

Post #1 of 4 (652 views)
Permalink
How exactly does the API function in ClamAV source?

We are thinking of utilizing ClamAV, but we wanted to know exactly how the API is implemented. Does the client makes a socket connection to a daemon. Or does the client load a shared object file which includes the provided functionality. Or does the client make a shell call to use a command line utility. Or is there some other method?



________________________________
Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml


acabng at digitalfuture

May 18, 2009, 9:02 AM

Post #2 of 4 (608 views)
Permalink
Re: How exactly does the API function in ClamAV source? [In reply to]

Stormont, Stephen (IMS) wrote:
> We are thinking of utilizing ClamAV, but we wanted to know exactly how the API is implemented. Does the client makes a socket connection to a daemon. Or does the client load a shared object file which includes the provided functionality. Or does the client make a shell call to use a command line utility. Or is there some other method?

Hi,
All the three.
Your options are:

1- link your code to libclamav
2- run the clamav daemon (clamd), connect to it via a tcp or unix
socket, and speak the clamd proto
3- run one of the provided clients and parse their output. clamscan is
linked to libclamav, clamdscan talks to the daemon instead.

Everything is documented at http://www.clamav.net/doc/latest/html/
and in the tools manpages.


-acab
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml


uhlar at fantomas

May 19, 2009, 6:05 AM

Post #3 of 4 (609 views)
Permalink
Re: How exactly does the API function in ClamAV source? [In reply to]

Hello,

> Stormont, Stephen (IMS) wrote:
> > We are thinking of utilizing ClamAV, but we wanted to know exactly how
> > the API is implemented. Does the client makes a socket connection to a
> > daemon. Or does the client load a shared object file which includes the
> > provided functionality. Or does the client make a shell call to use a
> > command line utility. Or is there some other method?

please configure your mailer to wrap lines below 80 characters per line.
72 to 75 is usually OK.

Thank you.

On 18.05.09 18:02, aCaB wrote:
> All the three.
> Your options are:
>
> 1- link your code to libclamav
> 2- run the clamav daemon (clamd), connect to it via a tcp or unix
> socket, and speak the clamd proto

1 and 2 should be swapped. Note that libclamav also provider scanning
directly, not only via clamd. I don't know about lightweight library that
only supports clamd, via file name/descriptor passing or by sending through
socket.

> 3- run one of the provided clients and parse their output. clamscan is
> linked to libclamav, clamdscan talks to the daemon instead.
>
> Everything is documented at http://www.clamav.net/doc/latest/html/
> and in the tools manpages.

--
Matus UHLAR - fantomas, uhlar [at] fantomas ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
"One World. One Web. One Program." - Microsoft promotional advertisement
"Ein Volk, ein Reich, ein Fuhrer!" - Adolf Hitler
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml


rcooper at dwford

May 19, 2009, 8:01 AM

Post #4 of 4 (593 views)
Permalink
Re: How exactly does the API function inClamAV source? [In reply to]

----Original Message----
From: clamav-users-bounces [at] lists
[mailto:clamav-users-bounces [at] lists] On Behalf Of Matus UHLAR -
fantomas Sent: Tuesday, May 19, 2009 9:06 AM To:
clamav-users [at] lists Subject: Re: [Clamav-users] How exactly does
the API function inClamAV source?

> Hello,
>
>> Stormont, Stephen (IMS) wrote:
>>> We are thinking of utilizing ClamAV, but we wanted to know exactly how
>>> the API is implemented. Does the client makes a socket connection to a
>>> daemon. Or does the client load a shared object file which includes the
>>> provided functionality. Or does the client make a shell call to use a
>>> command line utility. Or is there some other method?
>
> please configure your mailer to wrap lines below 80 characters per line.
> 72 to 75 is usually OK.
>
> Thank you.
>
> On 18.05.09 18:02, aCaB wrote:
>> All the three.
>> Your options are:
>>
>> 1- link your code to libclamav
>> 2- run the clamav daemon (clamd), connect to it via a tcp or unix
>> socket, and speak the clamd proto
>
> 1 and 2 should be swapped. Note that libclamav also provider scanning
> directly, not only via clamd. I don't know about lightweight library that
> only supports clamd, via file name/descriptor passing or by sending
> through
> socket.

Look in the docs directory for clamd.pdf and go through chapter 5. It
explains how to talk to the clamd daemon via tcp/unix sockets. Of course
clamd must be running in this case but it vastly reduces the programming
requirements to program a daemon using the lib. MailScanner used/can use the
perl mod for directly handling the scanning but this results in each child
loading the lib and databases, using clamd through sockets does not bring
along this extra overhead.



>
>> 3- run one of the provided clients and parse their output. clamscan is
>> linked to libclamav, clamdscan talks to the daemon instead.
>>
>> Everything is documented at http://www.clamav.net/doc/latest/html/
>> and in the tools manpages.
>
> --
> Matus UHLAR - fantomas, uhlar [at] fantomas ; http://www.fantomas.sk/
> Warning: I wish NOT to receive e-mail advertising to this address.
> Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
> "One World. One Web. One Program." - Microsoft promotional advertisement
> "Ein Volk, ein Reich, ein Fuhrer!" - Adolf Hitler
> _______________________________________________
> Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
> http://www.clamav.net/support/ml



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

ClamAV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.