Debian Codegraph @

share/libc/ifaddrs.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef FC_IFADDRS
24 #define FC_IFADDRS
25 #include "features.h"
26 __PUSH_FC_STDLIB
27
28 #include "__fc_define_sockaddr.h"
29
30 __BEGIN_DECLS
31
32 /* Linux header */
33 struct ifaddrs {
34 struct ifaddrs *ifa_next;
35 char *ifa_name;
36 unsigned int ifa_flags;
37 struct sockaddr *ifa_addr;
38 struct sockaddr *ifa_netmask;
39 struct sockaddr *ifa_dstaddr;
40 union __fc_ifaddrs_ifa_ifu {
41 struct sockaddr *ifu_broadaddr;
42 struct sockaddr *ifu_dstaddr;
43 } ifa_ifu;
44 # ifndef ifa_broadaddr
45 # define ifa_broadaddr ifa_ifu.ifu_broadaddr
46 # endif
47 # ifndef ifa_dstaddr
48 # define ifa_dstaddr ifa_ifu.ifu_dstaddr
49 # endif
50 void *ifa_data;
51 };
52
53 struct ifmaddrs {
54 struct ifmaddrs *ifma_next;
55 struct sockaddr *ifma_name;
56 struct sockaddr *ifma_addr;
57 struct sockaddr *ifma_lladdr;
58 };
59
60 extern int getifaddrs(struct ifaddrs **);
61 extern void freeifaddrs(struct ifaddrs *);
62 extern int getifmaddrs(struct ifmaddrs **);
63 extern void freeifmaddrs(struct ifmaddrs *);
64
65 __END_DECLS
66
67 __POP_FC_STDLIB
68 #endif