On Thu, Jun 9, 2011 at 2:52 PM, Tiago Serra <[email protected]> wrote:
> Hi, how can i show hosts in the hosts list? and how to retrieve the list of 
> host added, before adding i need to verify if is a new host.

Well interesting question. I'm cc-ing also the [g,u]soc-mailing list
because this might interest other guys. By the way, it's quite
complicated to explain. The hostlist is modeled as a "remote" service
which used through the virtual service bus of PM. The definitions of
the builtin services are defined inside umit/pm/core/bus.py. The last
part of the file present the interface of the hostlist service:

    @register_interface('pm.hostlist')
    class SvcHostList(object):
        """
        This service is used to share a list of hosts
        """
        def populate(self, interface): pass
        def info(self, intf, ip, mac): pass

        def get(self): pass
        def get_target(self, l2_addr=None, l3_addr=None, hostname=None, \
                       netmask=None): pass

Then the functions exported by this virtual service are really
implemented inside audits/passive/profiler/sources/main.py. The code
makes use of decorators defined in the bus.py file. The real functions
implementing the behavior of the service are prefixed with '__impl_'.
Then the GUI component of PM, the HostList, uses this virtual service
to populate the tree model.

So regarding your specific question, you can use the get or the
get_target function.You will get a list of objects deriving
ProfileProvider class (defined in umit/pm/core/providers.py).
Regarding publishing new profile to the hostlist you have to modify
the profiler plugin and implement a new function like push_profile or
something similar or a new parsing method like _parse_bonjour by
adding a new function to your specific hook chain.

--
Best regards,
Francesco Piccinno

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Umit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/umit-devel

Reply via email to