123ba0142SJun-ichiro itojun Hagino 2*9b10f59aSPedro F. Giffuni /*- 3*9b10f59aSPedro F. Giffuni * SPDX-License-Identifier: BSD-1-Clause 4*9b10f59aSPedro F. Giffuni * 523ba0142SJun-ichiro itojun Hagino * Copyright (c) 1995, 1999 623ba0142SJun-ichiro itojun Hagino * Berkeley Software Design, Inc. All rights reserved. 723ba0142SJun-ichiro itojun Hagino * 823ba0142SJun-ichiro itojun Hagino * Redistribution and use in source and binary forms, with or without 923ba0142SJun-ichiro itojun Hagino * modification, are permitted provided that the following conditions 1023ba0142SJun-ichiro itojun Hagino * are met: 1123ba0142SJun-ichiro itojun Hagino * 1. Redistributions of source code must retain the above copyright 1223ba0142SJun-ichiro itojun Hagino * notice, this list of conditions and the following disclaimer. 1323ba0142SJun-ichiro itojun Hagino * 1423ba0142SJun-ichiro itojun Hagino * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND 1523ba0142SJun-ichiro itojun Hagino * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1623ba0142SJun-ichiro itojun Hagino * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1723ba0142SJun-ichiro itojun Hagino * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE 1823ba0142SJun-ichiro itojun Hagino * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1923ba0142SJun-ichiro itojun Hagino * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2023ba0142SJun-ichiro itojun Hagino * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2123ba0142SJun-ichiro itojun Hagino * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2223ba0142SJun-ichiro itojun Hagino * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2323ba0142SJun-ichiro itojun Hagino * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2423ba0142SJun-ichiro itojun Hagino * SUCH DAMAGE. 2523ba0142SJun-ichiro itojun Hagino * 2623ba0142SJun-ichiro itojun Hagino * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp 2723ba0142SJun-ichiro itojun Hagino */ 2823ba0142SJun-ichiro itojun Hagino 2923ba0142SJun-ichiro itojun Hagino #ifndef _IFADDRS_H_ 3023ba0142SJun-ichiro itojun Hagino #define _IFADDRS_H_ 3123ba0142SJun-ichiro itojun Hagino 3223ba0142SJun-ichiro itojun Hagino struct ifaddrs { 3323ba0142SJun-ichiro itojun Hagino struct ifaddrs *ifa_next; 3423ba0142SJun-ichiro itojun Hagino char *ifa_name; 356ed0f50fSEd Schouten unsigned int ifa_flags; 3623ba0142SJun-ichiro itojun Hagino struct sockaddr *ifa_addr; 3723ba0142SJun-ichiro itojun Hagino struct sockaddr *ifa_netmask; 3823ba0142SJun-ichiro itojun Hagino struct sockaddr *ifa_dstaddr; 3923ba0142SJun-ichiro itojun Hagino void *ifa_data; 4023ba0142SJun-ichiro itojun Hagino }; 4123ba0142SJun-ichiro itojun Hagino 4223ba0142SJun-ichiro itojun Hagino /* 4323ba0142SJun-ichiro itojun Hagino * This may have been defined in <net/if.h>. Note that if <net/if.h> is 4423ba0142SJun-ichiro itojun Hagino * to be included it must be included before this header file. 4523ba0142SJun-ichiro itojun Hagino */ 4623ba0142SJun-ichiro itojun Hagino #ifndef ifa_broadaddr 4723ba0142SJun-ichiro itojun Hagino #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ 4823ba0142SJun-ichiro itojun Hagino #endif 4923ba0142SJun-ichiro itojun Hagino 502554d76fSBruce M Simpson struct ifmaddrs { 512554d76fSBruce M Simpson struct ifmaddrs *ifma_next; 522554d76fSBruce M Simpson struct sockaddr *ifma_name; 532554d76fSBruce M Simpson struct sockaddr *ifma_addr; 542554d76fSBruce M Simpson struct sockaddr *ifma_lladdr; 552554d76fSBruce M Simpson }; 562554d76fSBruce M Simpson 5723ba0142SJun-ichiro itojun Hagino #include <sys/cdefs.h> 5823ba0142SJun-ichiro itojun Hagino 5923ba0142SJun-ichiro itojun Hagino __BEGIN_DECLS 60bb28f3c2SWarner Losh extern int getifaddrs(struct ifaddrs **); 61bb28f3c2SWarner Losh extern void freeifaddrs(struct ifaddrs *); 622554d76fSBruce M Simpson extern int getifmaddrs(struct ifmaddrs **); 632554d76fSBruce M Simpson extern void freeifmaddrs(struct ifmaddrs *); 6423ba0142SJun-ichiro itojun Hagino __END_DECLS 6523ba0142SJun-ichiro itojun Hagino 6623ba0142SJun-ichiro itojun Hagino #endif 67