X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-compat-howl%2Faddress.c;h=81b6e6bd4ef1076024790699e8a2f1e659bb9541;hb=9b37aa18c9edd20b73beb4155e8d8e018656251f;hp=1d9fbbe3724d2b78120cab28ea8786081a98d7a8;hpb=854f901f491ccda79aee11edc3d59109cb229d28;p=catta diff --git a/avahi-compat-howl/address.c b/avahi-compat-howl/address.c index 1d9fbbe..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 @@ -85,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; } @@ -113,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)); @@ -135,7 +133,7 @@ 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; } @@ -144,7 +142,7 @@ sw_result sw_ipv4_address_fina(AVAHI_GCC_UNUSED sw_ipv4_address self) { AVAHI_WARN_LINKAGE; /* This is ridiculous ... */ - + return SW_OKAY; } @@ -170,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; } @@ -187,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); @@ -199,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; }