[Openvas-devel] Replacing libopenvas with glib...

Felix Wolfsteller felix.wolfsteller at intevation.de
Tue Jan 6 12:10:41 CET 2009


On Thursday 20 November 2008 12:46:42 Stjepan Gros wrote:
> I was looking a bit into arglists.c and it seems basically to be a
> hash table that allows different objects to be stored and quickly
> retrieved. The closest data structure in GLib seems to be GHashTable.
> The problem is that GHashTable stores pointers so another layer above
> it is necessary in order to replace arglists.c. In conclusion, it
> would be relatively easy to modify arglists.c to use glib's functions
> while the rest of the code stays unchanged.

About arglist removal from client:
The arglist idea is heavily misused all over the place. I think the way to go 
is to identify places where the content (key and type) of the arglist are 
actually known in the right beginning and to transform these code segments 
one by one.

Sometimes a new structure will be born, sometimes maybe not, because a plain 
list or GHashTable suffices.

For example in the client, nearly all GTK- Widgets are indexed by arglists, 
making it a mess to access them, because
1) You have to know under which key the widget is stored.
2) Some arglists are indeed lists of arglist containing similar or the same 
keys (grep for "FRAME")
So, to access a widget, arg_get_xyz has to be called, comparing the key string 
against every key string in one or many arglists until it has been found. 
Replacing this mechanism (quite a ton of work) would 
1) reduce the code base
2) make it faster
3) make OpenVAS client use less memory
4) make the gui easier to handle for developers.

Might be worth a change request in the middle near future.
Maybe we can collect some ideas about arglist removal, I have to admit that I 
think that I did not quite get Jans idea  (below).

--felix


On Thursday 20 November 2008 12:46:42 Stjepan Gros wrote:
>
> > I am not aware of anyone approaching this.
> > It is not a too simple task.
> >
> > My idea was that we should start with a
> > struct NVT_Desc {} in OpenVAS-Client and step-by-step
> > change to this strucure (which members are some Glib Datacontainers)
> > all over the client. Probably some lessons need to be learned.
> > Once finished this, the gained experience should be good
> > enough to approach the server.
>
> I couldn't figure out from this short description what you exactly intend
> to do.
>>
>
> > In the meantime we'll try to make the server as light as possible
> > to increase readability of this code ;-)
>
> _______________________________________________
> Openvas-devel mailing list
> Openvas-devel at wald.intevation.org
> http://lists.wald.intevation.org/mailman/listinfo/openvas-devel


-- 
Felix Wolfsteller |  ++49-541-335 08 3451  |  http://www.intevation.de/
PGP Key: 39DE0100
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner



More information about the Openvas-devel mailing list