under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
struct if_msghdr *ifm = (struct if_msghdr *)rtm;
struct sockaddr_dl *sdl = (struct sockaddr_dl *)(ifm + 1);
struct if_msghdr *ifm = (struct if_msghdr *)rtm;
struct sockaddr_dl *sdl = (struct sockaddr_dl *)(ifm + 1);
- if (!(hw = avahi_interface_monitor_get_hw_interface(m, ifm->ifm_index)))
- if (!(hw = avahi_hw_interface_new(m, (AvahiIfIndex) ifm->ifm_index)))
+ if (!(hw = catta_interface_monitor_get_hw_interface(m, ifm->ifm_index)))
+ if (!(hw = catta_hw_interface_new(m, (CattaIfIndex) ifm->ifm_index)))
(ifm->ifm_flags & IFF_MULTICAST) &&
(m->server->config.allow_point_to_point || !(ifm->ifm_flags & IFF_POINTOPOINT));
(ifm->ifm_flags & IFF_MULTICAST) &&
(m->server->config.allow_point_to_point || !(ifm->ifm_flags & IFF_POINTOPOINT));
-/* avahi_format_mac_address(mac, sizeof(mac), hw->mac_address, hw->mac_address_size), */
+/* catta_format_mac_address(mac, sizeof(mac), hw->mac_address, hw->mac_address_size), */
- avahi_hw_interface_check_relevant(hw);
- avahi_hw_interface_update_rrs(hw, 0);
+ catta_hw_interface_check_relevant(hw);
+ catta_hw_interface_update_rrs(hw, 0);
- if (!(iface = avahi_interface_monitor_get_interface(m, (AvahiIfIndex) ifam->ifam_index, avahi_af_to_proto(sa->sa_family))))
+ if (!(iface = catta_interface_monitor_get_interface(m, (CattaIfIndex) ifam->ifam_index, catta_af_to_proto(sa->sa_family))))
- AvahiInterfaceAddress *addriface;
- if (!(addriface = avahi_interface_monitor_get_address(m, iface, &raddr)))
- if (!(addriface = avahi_interface_address_new(m, iface, &raddr, prefixlen)))
+ CattaInterfaceAddress *addriface;
+ if (!(addriface = catta_interface_monitor_get_address(m, iface, &raddr)))
+ if (!(addriface = catta_interface_address_new(m, iface, &raddr, prefixlen)))
- avahi_interface_check_relevant(iface);
- avahi_interface_update_rrs(iface, 0);
+ catta_interface_check_relevant(iface);
+ catta_interface_update_rrs(iface, 0);
-static void socket_event(AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent event,void *userdata) {
- AvahiInterfaceMonitor *m = (AvahiInterfaceMonitor *)userdata;
- AvahiPfRoute *nl = m->osdep.pfroute;
+static void socket_event(CattaWatch *w, int fd, CATTA_GCC_UNUSED CattaWatchEvent event,void *userdata) {
+ CattaInterfaceMonitor *m = (CattaInterfaceMonitor *)userdata;
+ CattaPfRoute *nl = m->osdep.pfroute;
if((bytes = recv(nl->fd, msg, 2048, MSG_DONTWAIT)) < 0) {
if (errno == EAGAIN || errno == EINTR)
return;
if((bytes = recv(nl->fd, msg, 2048, MSG_DONTWAIT)) < 0) {
if (errno == EAGAIN || errno == EINTR)
return;
- if (!(m->osdep.pfroute = avahi_new(AvahiPfRoute , 1))) {
- avahi_log_error(__FILE__": avahi_new() failed.");
+ if (!(m->osdep.pfroute = catta_new(CattaPfRoute , 1))) {
+ catta_log_error(__FILE__": catta_new() failed.");
goto fail;
}
m->osdep.pfroute->fd = fd;
if (!(m->osdep.pfroute->watch = m->server->poll_api->watch_new(m->server->poll_api,
m->osdep.pfroute->fd,
goto fail;
}
m->osdep.pfroute->fd = fd;
if (!(m->osdep.pfroute->watch = m->server->poll_api->watch_new(m->server->poll_api,
m->osdep.pfroute->fd,
-static void if_add_interface(struct lifreq *lifreq, AvahiInterfaceMonitor *m, int fd, int count)
+static void if_add_interface(struct lifreq *lifreq, CattaInterfaceMonitor *m, int fd, int count)
return;
}
flags = lifrcopy.lifr_flags;
if (ioctl(fd, SIOCGLIFMTU, &lifrcopy) < 0) {
return;
}
flags = lifrcopy.lifr_flags;
if (ioctl(fd, SIOCGLIFMTU, &lifrcopy) < 0) {
return;
}
mtu = lifrcopy.lifr_metric;
if (ioctl(fd, SIOCGLIFADDR, &lifrcopy) < 0) {
return;
}
mtu = lifrcopy.lifr_metric;
if (ioctl(fd, SIOCGLIFADDR, &lifrcopy) < 0) {
- if (!(hw = avahi_interface_monitor_get_hw_interface(m, (AvahiIfIndex) index))) {
- if (!(hw = avahi_hw_interface_new(m, (AvahiIfIndex) index)))
+ if (!(hw = catta_interface_monitor_get_hw_interface(m, (CattaIfIndex) index))) {
+ if (!(hw = catta_hw_interface_new(m, (CattaIfIndex) index)))
!(flags & IFF_LOOPBACK) &&
(flags & IFF_MULTICAST) &&
(m->server->config.allow_point_to_point || !(flags & IFF_POINTOPOINT));
!(flags & IFF_LOOPBACK) &&
(flags & IFF_MULTICAST) &&
(m->server->config.allow_point_to_point || !(flags & IFF_POINTOPOINT));
- if (!(addriface = avahi_interface_monitor_get_address(m, iface, &addr)))
- if (!(addriface = avahi_interface_address_new(m, iface, &addr, prefixlen)))
+ if (!(addriface = catta_interface_monitor_get_address(m, iface, &addr)))
+ if (!(addriface = catta_interface_address_new(m, iface, &addr, prefixlen)))
- avahi_hw_interface_check_relevant(hw);
- avahi_hw_interface_update_rrs(hw, 0);
+ catta_hw_interface_check_relevant(hw);
+ catta_hw_interface_update_rrs(hw, 0);
mib[5] = 0; /* no flags */
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
{
mib[5] = 0; /* no flags */
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
{
- avahi_log_error("sysctl failed: %s", strerror(errno));
- avahi_log_error("route-sysctl-estimate");
+ catta_log_error("sysctl failed: %s", strerror(errno));
+ catta_log_error("route-sysctl-estimate");
return;
}
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
return;
}
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
- avahi_interface_monitor_check_relevant(m);
- avahi_interface_monitor_update_rrs(m, 0);
- avahi_log_info("Network interface enumeration completed.");
+ catta_interface_monitor_check_relevant(m);
+ catta_interface_monitor_update_rrs(m, 0);
+ catta_log_info("Network interface enumeration completed.");
return;
}
lifc.lifc_buf = NULL;
lifn.lifn_family = AF_UNSPEC;
lifn.lifn_flags = 0;
if (ioctl(sockfd, SIOCGLIFNUM, &lifn) < 0) {
return;
}
lifc.lifc_buf = NULL;
lifn.lifn_family = AF_UNSPEC;
lifn.lifn_flags = 0;
if (ioctl(sockfd, SIOCGLIFNUM, &lifn) < 0) {
- if ((lifc.lifc_buf = avahi_malloc(lifc.lifc_len)) == NULL) {
- avahi_log_error("malloc failed in avahi_interface_monitor_sync");
+ if ((lifc.lifc_buf = catta_malloc(lifc.lifc_len)) == NULL) {
+ catta_log_error("malloc failed in catta_interface_monitor_sync");
- avahi_interface_monitor_check_relevant(m);
- avahi_interface_monitor_update_rrs(m, 0);
+ catta_interface_monitor_check_relevant(m);
+ catta_interface_monitor_update_rrs(m, 0);