michael@0: /* michael@0: * Copyright (C) 2009 The Android Open Source Project michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #ifndef IFADDRS_ANDROID_EXT_H_included michael@0: #define IFADDRS_ANDROID_EXT_H_included michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: // Android (bionic) doesn't have getifaddrs(3)/freeifaddrs(3). michael@0: // We fake it here, so java_net_NetworkInterface.cpp can use that API michael@0: // with all the non-portable code being in this file. michael@0: michael@0: // Source-compatible subset of the BSD struct. michael@0: typedef struct ifaddrs { michael@0: // Pointer to next struct in list, or NULL at end. michael@0: struct ifaddrs* ifa_next; michael@0: michael@0: // Interface name. michael@0: char* ifa_name; michael@0: michael@0: // Interface flags. michael@0: unsigned int ifa_flags; michael@0: michael@0: // Interface network address. michael@0: struct sockaddr* ifa_addr; michael@0: michael@0: // Interface netmask. michael@0: struct sockaddr* ifa_netmask; michael@0: } ifaddrs; michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: int getifaddrs(ifaddrs** result); michael@0: void freeifaddrs(ifaddrs* addresses); michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif // IFADDRS_ANDROID_H_included