X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-compat-howl%2Faddress.c;h=81b6e6bd4ef1076024790699e8a2f1e659bb9541;hb=7a5b2f69af7d36d6cd4153142f125fa011784e03;hp=c79b34d1f6357520a388dc01fb8f1c5400b08720;hpb=a96f0540a6eb9a9cfaabef829982576ebec6e596;p=catta diff --git a/avahi-compat-howl/address.c b/avahi-compat-howl/address.c index c79b34d..81b6e6b 100644 --- a/avahi-compat-howl/address.c +++ b/avahi-compat-howl/address.c @@ -1,18 +1,16 @@ -/* $Id$ */ - /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it 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. - + avahi is distributed in the hope that it will be useful, but WITHOUT 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 License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -31,6 +29,8 @@ #include #include +#include + #include "howl.h" #include "warn.h" @@ -83,10 +83,10 @@ sw_result sw_ipv4_address_init_from_name( assert(name); AVAHI_WARN_LINKAGE; - + if (!(he = gethostbyname(name))) return SW_E_UNKNOWN; - + self->m_addr = *(uint32_t*) he->h_addr; return SW_OKAY; } @@ -111,7 +111,7 @@ sw_result sw_ipv4_address_init_from_this_host(sw_ipv4_address *self) { assert(self); AVAHI_WARN_LINKAGE; - + /* This is so fucked up ... */ memset(&sa, 0, sizeof(sa)); @@ -133,16 +133,16 @@ sw_result sw_ipv4_address_init_from_this_host(sw_ipv4_address *self) { close(fd); self->m_addr = sa.sin_addr.s_addr; - + return SW_OKAY; } -sw_result sw_ipv4_address_fina(sw_ipv4_address self) { +sw_result sw_ipv4_address_fina(AVAHI_GCC_UNUSED sw_ipv4_address self) { AVAHI_WARN_LINKAGE; /* This is ridiculous ... */ - + return SW_OKAY; } @@ -168,10 +168,10 @@ sw_string sw_ipv4_address_name( if (len < INET_ADDRSTRLEN) return NULL; - + if (!(inet_ntop(AF_INET, &self.m_addr, name, len))) return NULL; - + return name; } @@ -185,9 +185,9 @@ sw_result sw_ipv4_address_decompose( uint32_t a; AVAHI_WARN_LINKAGE; - + a = ntohl(self.m_addr); - + assert(a1); assert(a2); assert(a3); @@ -197,7 +197,7 @@ sw_result sw_ipv4_address_decompose( *a2 = (uint8_t) (a >> 16); *a3 = (uint8_t) (a >> 8); *a4 = (uint8_t) (a); - + return SW_OKAY; }