void interface_shutdown(void) { struct interface *iface; vlist_for_each_element(&interfaces, iface, node) if (iface->fd.fd > 0 && iface->multicast) { service_announce(iface, 0); service_reply_a(iface, 0); } vlist_for_each_element(&interfaces, iface, node) interface_close(iface); }
void hncp_subscribe(hncp o, hncp_subscriber s) { hncp_node n; hncp_tlv t; struct tlv_attr *a; list_add(&s->lh, &o->subscribers); if (s->local_tlv_change_callback) { vlist_for_each_element(&o->tlvs, t, in_tlvs) s->local_tlv_change_callback(s, &t->tlv, true); } hncp_for_each_node(o, n) { NODE_CHANGE_CALLBACK(s, n, true); if (s->tlv_change_callback) { hncp_node_for_each_tlv(n, a) s->tlv_change_callback(s, n, a, true); } }