/* * Copyright (c) 2016 Intel Corporation. All rights reserved. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #pragma once #include /* IFF_RUNNING is not defined, reset it by IFF_UP */ #ifndef IFF_RUNNING #define IFF_RUNNING IFF_UP #endif /* here is minimal subset of ifaddr API required for sockets & UDP providers */ struct ifaddrs { struct ifaddrs *ifa_next; /* Next item in list */ char *ifa_name; /* Name of interface */ unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */ struct sockaddr *ifa_addr; /* Address of interface */ struct sockaddr *ifa_netmask; /* Netmask of interface */ struct sockaddr_storage in_addrs; struct sockaddr_storage in_netmasks; char ad_name[16]; size_t speed; }; int getifaddrs(struct ifaddrs **ifap); void freeifaddrs(struct ifaddrs *ifa);