Home | History | Annotate | Download | only in avahi-discover

Lines Matching refs:protocol

74             (name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5)
79 self.server.ResolveService( int(interface), int(protocol), name, stype, domain, avahi.PROTO_UNSPEC, dbus.UInt32(0), reply_handler=self.service_resolved, error_handler=self.print_error)
81 def protoname(self,protocol):
82 if protocol == avahi.PROTO_INET:
84 if protocol == avahi.PROTO_INET6:
94 def get_interface_name(self, interface, protocol):
95 if interface == avahi.IF_UNSPEC and protocol == avahi.PROTO_UNSPEC:
98 return str(self.siocgifname(interface)) + " " + str(self.protoname(protocol))
100 def service_resolved(self, interface, protocol, name, stype, domain, host, aprotocol, address, port, txt, flags):
101 print "Service data for service '%s' of type '%s' in domain '%s' on %i.%i:" % (name, stype, domain, interface, protocol)
105 self.update_label(interface, protocol, name, stype, domain, host, aprotocol, address, port, avahi.txt_array_to_string_array(txt))
120 def new_service(self, interface, protocol, name, stype, domain, flags):
121 print "Found service '%s' of type '%s' in domain '%s' on %i.%i." % (name, stype, domain, interface, protocol)
122 if self.zc_ifaces.has_key((interface,protocol)) == False:
124 ifn = self.get_interface_name(interface, protocol)
126 self.zc_ifaces[(interface,protocol)] = self.insert_row(self.treemodel, None, ifn, None,interface,protocol,None,domain)
127 if self.zc_domains.has_key((interface,protocol,domain)) == False:
128 self.zc_domains[(interface,protocol,domain)] = self.insert_row(self.treemodel, self.zc_ifaces[(interface,protocol)], domain,None,interface,protocol,None,domain)
129 if self.zc_types.has_key((interface,protocol,stype,domain)) == False:
130 thisDomain = self.zc_domains[(interface,protocol,domain)]
131 self.zc_types[(interface,protocol,stype,domain)] = self.insert_row(self.treemodel, thisDomain, self.lookup_type(stype), name, interface,None,None,None)
132 treeiter = self.insert_row(self.treemodel,self.zc_types[(interface,protocol,stype,domain)], name, name, interface,protocol,stype,domain)
133 self.services_browsed[(interface, protocol, name, stype, domain)] = treeiter
137 def remove_service(self, interface, protocol, name, stype, domain, flags):
138 print "Service '%s' of type '%s' in domain '%s' on %i.%i disappeared." % (name, stype, domain, interface, protocol)
140 treeiter=self.services_browsed[(interface, protocol, name, stype, domain)]
143 del self.services_browsed[(interface, protocol, name, stype, domain)]
145 treeiter=self.zc_types[(interface,protocol,stype,domain)]
148 del self.zc_types[(interface,protocol,stype,domain)]
150 treeiter=self.zc_domains[(interface,protocol,domain)]
153 del self.zc_domains[(interface,protocol,domain)]
155 treeiter=self.zc_ifaces[(interface,protocol)]
158 del self.zc_ifaces[(interface,protocol)]
160 def new_service_type(self, interface, protocol, stype, domain, flags):
164 if service_browsers.has_key((interface, protocol, stype, domain)):
167 print "Browsing for services of type '%s' in domain '%s' on %i.%i ..." % (stype, domain, interface, protocol)
169 b = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, self.server.ServiceBrowserNew(interface, protocol, stype, domain, dbus.UInt32(0))), avahi.DBUS_INTERFACE_SERVICE_BROWSER)
173 service_browsers[(interface, protocol, stype, domain)] = b
175 def browse_domain(self, interface, protocol, domain):
179 if service_type_browsers.has_key((interface, protocol, domain)):
183 print "Browsing domain '%s' on %i.%i ..." % (domain, interface, protocol)
186 b = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, self.server.ServiceTypeBrowserNew(interface, protocol, domain, dbus.UInt32(0))), avahi.DBUS_INTERFACE_SERVICE_TYPE_BROWSER)
194 service_type_browsers[(interface, protocol, domain)] = b
196 new_service_type(interface, protocol, stype, domain)
198 def new_domain(self,interface, protocol, domain, flags):
199 if self.zc_ifaces.has_key((interface,protocol)) == False:
200 ifn = self.get_interface_name(interface, protocol)
201 self.zc_ifaces[(interface,protocol)] = self.insert_row(self.treemodel, None, ifn,None,interface,protocol,None,domain)
202 if self.zc_domains.has_key((interface,protocol,domain)) == False:
203 self.zc_domains[(interface,protocol,domain)] = self.insert_row(self.treemodel, self.zc_ifaces[(interface,protocol)], domain,None,interface,protocol,None,domain)
205 self.browse_domain(interface, protocol, domain)
219 def update_label(self,interface, protocol, name, stype, domain, host, aprotocol, address, port, txt):
233 infos = infos % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
237 content, name, interface,protocol,stype,domain):
239 model.set(myiter,0,content,1,name,2,str(interface),3,str(protocol),4,stype,5,domain)