1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Public Domain
5  * License:   Public Domain
6  * Authors:   Sean Kelly
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 module tango.stdc.posix.net.if_;
10 
11 private import tango.stdc.posix.config;
12 
13 extern (C):
14 
15 //
16 // Required
17 //
18 /*
19 struct if_nameindex // renamed to if_nameindex_t
20 {
21     uint    if_index;
22     char*   if_name;
23 }
24 
25 IF_NAMESIZE
26 
27 uint            if_nametoindex(in char*);
28 char*           if_indextoname(uint, char*);
29 if_nameindex_t* if_nameindex();
30 void            if_freenameindex(if_nameindex_t*);
31 */
32 
33 version( linux )
34 {
35     struct if_nameindex_t
36     {
37         uint    if_index;
38         char*   if_name;
39     }
40 
41     const IF_NAMESIZE = 16;
42 
43     uint            if_nametoindex(in char*);
44     char*           if_indextoname(uint, char*);
45     if_nameindex_t* if_nameindex();
46     void            if_freenameindex(if_nameindex_t*);
47 }
48 else version( darwin )
49 {
50     struct if_nameindex_t
51     {
52         uint    if_index;
53         char*   if_name;
54     }
55 
56     const IF_NAMESIZE = 16;
57 
58     uint            if_nametoindex(in char*);
59     char*           if_indextoname(uint, char*);
60     if_nameindex_t* if_nameindex();
61     void            if_freenameindex(if_nameindex_t*);
62 }
63 else version( FreeBSD )
64 {
65     struct if_nameindex_t
66     {
67         uint    if_index;
68         char*   if_name;
69     }
70 
71     const IF_NAMESIZE = 16;
72 
73     uint            if_nametoindex(in char*);
74     char*           if_indextoname(uint, char*);
75     if_nameindex_t* if_nameindex();
76     void            if_freenameindex(if_nameindex_t*);
77 }
78 else version( solaris )
79 {
80     struct if_nameindex_t
81     {
82         uint    if_index;
83         char*   if_name;
84     }
85 
86     const IF_NAMESIZE = 32;
87 
88     uint            if_nametoindex(in char*);
89     char*           if_indextoname(uint, char*);
90     if_nameindex_t* if_nameindex();
91     void            if_freenameindex(if_nameindex_t*);
92 }