/*1* libjingle2* Copyright 2013, Google Inc.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions are met:6*7* 1. Redistributions of source code must retain the above copyright notice,8* this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright notice,10* this list of conditions and the following disclaimer in the documentation11* and/or other materials provided with the distribution.12* 3. The name of the author may not be used to endorse or promote products13* derived from this software without specific prior written permission.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED16* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF17* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO18* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,19* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,20* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;21* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,22* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR23* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF24* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.25*/2627#ifndef TALK_BASE_IFADDRS_ANDROID_H_28#define TALK_BASE_IFADDRS_ANDROID_H_2930#include <stdio.h>31#include <sys/socket.h>32// Implementation of getifaddrs for Android.33// Fills out a list of ifaddr structs (see below) which contain information34// about every network interface available on the host.35// See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function).36#ifdef __cplusplus37extern "C" {38#endif39struct ifaddrs {40struct ifaddrs* ifa_next;41char* ifa_name;42unsigned int ifa_flags;43struct sockaddr* ifa_addr;44struct sockaddr* ifa_netmask;45// Real ifaddrs has broadcast, point to point and data members.46// We don't need them (yet?).47// We never initialize the following members. We only define them to match the ifaddrs struct.48union49{50struct sockaddr *ifu_broadaddr;51struct sockaddr *ifu_dstaddr;52} ifa_ifu;53void *ifa_data;54};55#ifdef __cplusplus56}57#endif5859int getifaddrs(struct ifaddrs** result);60void freeifaddrs(struct ifaddrs* addrs);6162#endif // TALK_BASE_IFADDRS_ANDROID_H_636465