Click Dynamic loading (fwd)

Prem Gopalan gopalan at purdue.edu
Sun Apr 23 05:28:30 EDT 2000


Hi Eddie:
	I'm sorry for the previous mail; please ignore those questions.I
got Click to use a pseudo-IPC mechanism to enqueue packets to a User
process. In Linux Kernel I had to export sys_msgrcv etc in ksyms.c and
modify the msgQ IPC implementation to make it possible to send and receive
messages(packets) from/to the USer level(client) process. So things are
finally working out now. I hope to use MICO (Gnu's CORBA) to download
source files and then make an archive out of it.
	
Please let me know this : If I modify your 'click-install' code such that
only the new modules are compiled and installed but  the configuration
file is not rewritten to then I can save the packets being lost due to the
config file being ripped off ..right ? A new "container' element can take
care to call the current module loaded. This is just the basic idea now. I
just want to know the feasibility. 

Thanks,
Prem Gopalan.


On Thu, 20 Apr 2000, Eddie Kohler wrote:

> BENJIE!
> 
> They are creating their own archive. so they want to know how the
> downloadable package stuff works in general.
> 
> The way to include dynamically loadable packages is to use 'ar'.
> 
> If you have a Click configuration in 'FILE.click', the steps are something
> like this. I'll write it down as if you were doing it by hand. This all
> assumes that you are using the Linux kernel module. If you are using the
> 'click' user-level program, write back. Some things are different.
> 
> (1) Check to see if 'FILE.click' is an ar(1) archive. ar(1) archives begin
> with the magic string "!<arch>\n".
> 
> If it is NOT an archive, turn it into an archive in the following way:
> 
>    % mv FILE.click /tmp/config
>    % ar cr FILE.click /tmp/config
> 
> (2) Add `myclass.cc' to the archive. Also add 'myclass.hh' if you have that
> 
>    % ar r FILE.click myclass.cc [myclass.hh]
> 
> NOTE: You do not need to add the .o file. click-install will compile it
> from the source automatically.
> 
> (3) Extract the configuration and add a _requirement_. This will force
> click-install to download myclass.o.
> 
>    % echo 'require(myclass)' > /tmp/config
>    % ar p FILE.click config >> /tmp/config
>    % ar r FILE.click /tmp/config
> 
> (4) You are now done and can run 'click-install FILE.click'.
> 
> HOWEVER!!!!!!!!!!!!!!!
> 
> The myclass.cc file needs to follow some guidelines to work efffectively as
> a downloadable module. It must have init_module and cleanup_module
> functions. It must call click_provide and click_unprovide (in init_module
> and cleanup_module, respectively) to inform the main Click module when it
> is loaded and unloaded. Finally, if your module contains new element types,
> you need to write code that informs the Click module that the new element
> types exist, and that removes the element types when the module is
> unloaded. This sounds like a lot but it is not that hard. I advise you to
> create a very simple configuration containing one Classifier element. Then
> run that configuration through 'click-fastclassifier' and look at its
> output. The output will be an archive including source code; the source
> code demonstrates what you need to do.
> 
> Please write back if this is confusing.
> love,
> ed
> 
> 



Prem Gopalan
Home phone: 1-765-746-1896





More information about the click mailing list