Some time ago I had the idea of exporting internal initng events to scripts, 
but that time I hadn't any reasonable method to do so...

Some days ago, while programming a honeypot at work, I got a very good idea, I 
don't really know why, but I imagined how to implement a generic object 
serializer.

I don't have any real code, but there's my idea:

  struct {
        char type;
        char *out_fmt;
  } serializer_vtypes[] = {
        { VARTYPE_STRING, "%s=%s\n" },
        { VARTYPE_INT,    "%s=%d\n" },
  };

  struct vsd_s {
        char *name;
        int in_type;
        void *offset;

        list_h list;
  };

Then, we can put a vsd_s inside the thing we want to serialize, and do 
something like:

  serialized_event =  serialize(event, event->vsd);

For now, i don't see a need to export anything complex, so we should be able 
to simply use printf, but if we do need something more complex we can replace
out_fmt with a function and add a size element to vsd_s.

What do you think guys?
-- 
_______________________________________________
Initng mailing list
[email protected]
http://jw.dyndns.org/mailman/listinfo/initng

Reply via email to