Lines Matching refs:hw
113 void avahi_hw_interface_update_rrs(AvahiHwInterface *hw, int remove_rrs) { in avahi_hw_interface_update_rrs() argument
117 assert(hw); in avahi_hw_interface_update_rrs()
118 m = hw->monitor; in avahi_hw_interface_update_rrs()
120 for (i = hw->interfaces; i; i = i->by_hardware_next) in avahi_hw_interface_update_rrs()
128 if (!hw->entry_group) in avahi_hw_interface_update_rrs()
129 … hw->entry_group = avahi_s_entry_group_new(m->server, avahi_host_rr_entry_group_callback, NULL); in avahi_hw_interface_update_rrs()
131 if (!hw->entry_group) in avahi_hw_interface_update_rrs()
134 if (avahi_s_entry_group_is_empty(hw->entry_group)) { in avahi_hw_interface_update_rrs()
139 avahi_format_mac_address(mac, sizeof(mac), hw->mac_address, hw->mac_address_size); in avahi_hw_interface_update_rrs()
142 …if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AVAHI_PROTO_UNSPEC, 0, name, "… in avahi_hw_interface_update_rrs()
144 avahi_s_entry_group_free(hw->entry_group); in avahi_hw_interface_update_rrs()
145 hw->entry_group = NULL; in avahi_hw_interface_update_rrs()
147 avahi_s_entry_group_commit(hw->entry_group); in avahi_hw_interface_update_rrs()
152 if (hw->entry_group && !avahi_s_entry_group_is_empty(hw->entry_group)) { in avahi_hw_interface_update_rrs()
154 avahi_log_info("Withdrawing workstation service for %s.", hw->name); in avahi_hw_interface_update_rrs()
156 if (avahi_s_entry_group_get_state(hw->entry_group) == AVAHI_ENTRY_GROUP_REGISTERING && in avahi_hw_interface_update_rrs()
160 avahi_s_entry_group_reset(hw->entry_group); in avahi_hw_interface_update_rrs()
166 AvahiHwInterface *hw; in avahi_interface_monitor_update_rrs() local
170 for (hw = m->hw_interfaces; hw; hw = hw->hardware_next) in avahi_interface_monitor_update_rrs()
171 avahi_hw_interface_update_rrs(hw, remove_rrs); in avahi_interface_monitor_update_rrs()
308 void avahi_hw_interface_free(AvahiHwInterface *hw, int send_goodbye) { in avahi_hw_interface_free() argument
309 assert(hw); in avahi_hw_interface_free()
311 avahi_hw_interface_update_rrs(hw, 1); in avahi_hw_interface_free()
313 while (hw->interfaces) in avahi_hw_interface_free()
314 avahi_interface_free(hw->interfaces, send_goodbye); in avahi_hw_interface_free()
316 if (hw->entry_group) in avahi_hw_interface_free()
317 avahi_s_entry_group_free(hw->entry_group); in avahi_hw_interface_free()
319 AVAHI_LLIST_REMOVE(AvahiHwInterface, hardware, hw->monitor->hw_interfaces, hw); in avahi_hw_interface_free()
320 avahi_hashmap_remove(hw->monitor->hashmap, &hw->index); in avahi_hw_interface_free()
322 avahi_free(hw->name); in avahi_hw_interface_free()
323 avahi_free(hw); in avahi_hw_interface_free()
326 AvahiInterface* avahi_interface_new(AvahiInterfaceMonitor *m, AvahiHwInterface *hw, AvahiProtocol p… in avahi_interface_new() argument
330 assert(hw); in avahi_interface_new()
337 i->hardware = hw; in avahi_interface_new()
356 AVAHI_LLIST_PREPEND(AvahiInterface, by_hardware, hw->interfaces, i); in avahi_interface_new()
378 AvahiHwInterface *hw; in avahi_hw_interface_new() local
383 if (!(hw = avahi_new(AvahiHwInterface, 1))) in avahi_hw_interface_new()
386 hw->monitor = m; in avahi_hw_interface_new()
387 hw->name = NULL; in avahi_hw_interface_new()
388 hw->flags_ok = 0; in avahi_hw_interface_new()
389 hw->mtu = 1500; in avahi_hw_interface_new()
390 hw->index = idx; in avahi_hw_interface_new()
391 hw->mac_address_size = 0; in avahi_hw_interface_new()
392 hw->entry_group = NULL; in avahi_hw_interface_new()
393 hw->ratelimit_begin.tv_sec = 0; in avahi_hw_interface_new()
394 hw->ratelimit_begin.tv_usec = 0; in avahi_hw_interface_new()
395 hw->ratelimit_counter = 0; in avahi_hw_interface_new()
397 AVAHI_LLIST_HEAD_INIT(AvahiInterface, hw->interfaces); in avahi_hw_interface_new()
398 AVAHI_LLIST_PREPEND(AvahiHwInterface, hardware, m->hw_interfaces, hw); in avahi_hw_interface_new()
400 avahi_hashmap_insert(m->hashmap, &hw->index, hw); in avahi_hw_interface_new()
403 avahi_interface_new(m, hw, AVAHI_PROTO_INET); in avahi_hw_interface_new()
405 avahi_interface_new(m, hw, AVAHI_PROTO_INET6); in avahi_hw_interface_new()
407 return hw; in avahi_hw_interface_new()
471 void avahi_hw_interface_check_relevant(AvahiHwInterface *hw) { in avahi_hw_interface_check_relevant() argument
474 assert(hw); in avahi_hw_interface_check_relevant()
476 for (i = hw->interfaces; i; i = i->by_hardware_next) in avahi_hw_interface_check_relevant()
530 AvahiHwInterface *hw; in avahi_interface_monitor_get_interface() local
537 if (!(hw = avahi_interface_monitor_get_hw_interface(m, idx))) in avahi_interface_monitor_get_interface()
540 for (i = hw->interfaces; i; i = i->by_hardware_next) in avahi_interface_monitor_get_interface()
744 AvahiHwInterface *hw; in avahi_interface_monitor_walk() local
747 if ((hw = avahi_interface_monitor_get_hw_interface(m, interface))) in avahi_interface_monitor_walk()
748 for (i = hw->interfaces; i; i = i->by_hardware_next) in avahi_interface_monitor_walk()