Lines Matching refs:protocol
69 (name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5)
74 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)
76 def protoname(self,protocol):
77 if protocol == avahi.PROTO_INET:
79 if protocol == avahi.PROTO_INET6:
89 def get_interface_name(self, interface, protocol):
90 if interface == avahi.IF_UNSPEC and protocol == avahi.PROTO_UNSPEC:
93 return str(self.siocgifname(interface)) + " " + str(self.protoname(protocol))
95 def service_resolved(self, interface, protocol, name, stype, domain, host, aprotocol, address, port, txt, flags):
96 print "Service data for service '%s' of type '%s' in domain '%s' on %i.%i:" % (name, stype, domain, interface, protocol)
100 self.update_label(interface, protocol, name, stype, domain, host, aprotocol, address, port, avahi.txt_array_to_string_array(txt))
115 def new_service(self, interface, protocol, name, stype, domain, flags):
116 print "Found service '%s' of type '%s' in domain '%s' on %i.%i." % (name, stype, domain, interface, protocol)
117 if self.zc_ifaces.has_key((interface,protocol)) == False:
119 ifn = self.get_interface_name(interface, protocol)
121 self.zc_ifaces[(interface,protocol)] = self.insert_row(self.treemodel, None, ifn, None,interface,protocol,None,domain)
122 if self.zc_domains.has_key((interface,protocol,domain)) == False:
123 self.zc_domains[(interface,protocol,domain)] = self.insert_row(self.treemodel, self.zc_ifaces[(interface,protocol)], domain,None,interface,protocol,None,domain)
124 if self.zc_types.has_key((interface,protocol,stype,domain)) == False:
125 thisDomain = self.zc_domains[(interface,protocol,domain)]
126 self.zc_types[(interface,protocol,stype,domain)] = self.insert_row(self.treemodel, thisDomain, self.lookup_type(stype), name, interface,None,None,None)
127 treeiter = self.insert_row(self.treemodel,self.zc_types[(interface,protocol,stype,domain)], name, name, interface,protocol,stype,domain)
128 self.services_browsed[(interface, protocol, name, stype, domain)] = treeiter
132 def remove_service(self, interface, protocol, name, stype, domain, flags):
133 print "Service '%s' of type '%s' in domain '%s' on %i.%i disappeared." % (name, stype, domain, interface, protocol)
135 treeiter=self.services_browsed[(interface, protocol, name, stype, domain)]
138 del self.services_browsed[(interface, protocol, name, stype, domain)]
140 treeiter=self.zc_types[(interface,protocol,stype,domain)]
143 del self.zc_types[(interface,protocol,stype,domain)]
145 treeiter=self.zc_domains[(interface,protocol,domain)]
148 del self.zc_domains[(interface,protocol,domain)]
150 treeiter=self.zc_ifaces[(interface,protocol)]
153 del self.zc_ifaces[(interface,protocol)]
155 def new_service_type(self, interface, protocol, stype, domain, flags):
159 if service_browsers.has_key((interface, protocol, stype, domain)):
162 print "Browsing for services of type '%s' in domain '%s' on %i.%i ..." % (stype, domain, interface, protocol)
164 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)
168 service_browsers[(interface, protocol, stype, domain)] = b
170 def browse_domain(self, interface, protocol, domain):
174 if service_type_browsers.has_key((interface, protocol, domain)):
178 print "Browsing domain '%s' on %i.%i ..." % (domain, interface, protocol)
181 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)
189 service_type_browsers[(interface, protocol, domain)] = b
191 new_service_type(interface, protocol, stype, domain)
193 def new_domain(self,interface, protocol, domain, flags):
194 if self.zc_ifaces.has_key((interface,protocol)) == False:
195 ifn = self.get_interface_name(interface, protocol)
196 self.zc_ifaces[(interface,protocol)] = self.insert_row(self.treemodel, None, ifn,None,interface,protocol,None,domain)
197 if self.zc_domains.has_key((interface,protocol,domain)) == False:
198 self.zc_domains[(interface,protocol,domain)] = self.insert_row(self.treemodel, self.zc_ifaces[(interface,protocol)], domain,None,interface,protocol,None,domain)
200 self.browse_domain(interface, protocol, domain)
214 def update_label(self,interface, protocol, name, stype, domain, host, aprotocol, address, port, txt):
223 infos = "<b>Service Type:</b> %s\n<b>Service Name:</b> %s\n<b>Domain Name:</b> %s\n<b>Interface:</b> %s %s\n<b>Address:</b> %s/%s:%i\n%s" % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
227 content, name, interface,protocol,stype,domain):
229 model.set(myiter,0,content,1,name,2,interface,3,protocol,4,stype,5,domain)