Catch up with reality, this is GCC 3.4.4.
[dragonfly.git] / sys / emulation / svr4 / svr4_sockio.h
1 /*
2  * Copyright (c) 1998 Mark Newton
3  * Copyright (c) 1995 Christos Zoulas
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. The name of the author may not be used to endorse or promote products
15  *    derived from this software without specific prior written permission
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  * 
28  * $FreeBSD: src/sys/svr4/svr4_sockio.h,v 1.3 1999/08/28 00:51:22 peter Exp $
29  * $DragonFly: src/sys/emulation/svr4/Attic/svr4_sockio.h,v 1.2 2003/06/17 04:28:57 dillon Exp $
30  */
31
32 #ifndef _SVR4_SOCKIO_H_
33 #define _SVR4_SOCKIO_H_
34
35 #define SVR4_IFF_UP             0x0001
36 #define SVR4_IFF_BROADCAST      0x0002
37 #define SVR4_IFF_DEBUG          0x0004
38 #define SVR4_IFF_LOOPBACK       0x0008
39 #define SVR4_IFF_POINTOPOINT    0x0010
40 #define SVR4_IFF_NOTRAILERS     0x0020
41 #define SVR4_IFF_RUNNING        0x0040
42 #define SVR4_IFF_NOARP          0x0080  
43 #define SVR4_IFF_PROMISC        0x0100
44 #define SVR4_IFF_ALLMULTI       0x0200
45 #define SVR4_IFF_INTELLIGENT    0x0400
46 #define SVR4_IFF_MULTICAST      0x0800
47 #define SVR4_IFF_MULTI_BCAST    0x1000
48 #define SVR4_IFF_UNNUMBERED     0x2000
49 #define SVR4_IFF_PRIVATE        0x8000  
50
51 struct svr4_ifreq {
52 #define SVR4_IFNAMSIZ   16
53         char    svr4_ifr_name[SVR4_IFNAMSIZ];
54         union {
55                 struct  osockaddr       ifru_addr;
56                 struct  osockaddr       ifru_dstaddr;
57                 struct  osockaddr       ifru_broadaddr;
58                 short                   ifru_flags;
59                 int                     ifru_metric;
60                 char                    ifru_data;      
61                 char                    ifru_enaddr[6];
62                 int                     if_muxid[2];
63
64         } ifr_ifru;
65
66 #define svr4_ifr_addr                   ifr_ifru.ifru_addr
67 #define svr4_ifr_dstaddr                ifr_ifru.ifru_dstaddr
68 #define svr4_ifr_broadaddr              ifr_ifru.ifru_broadaddr
69 #define svr4_ifr_flags                  ifr_ifru.ifru_flags
70 #define svr4_ifr_metric                 ifr_ifru.ifru_metric
71 #define svr4_ifr_data                   ifr_ifru.ifru_data
72 #define svr4_ifr_enaddr                 ifr_ifru.ifru_enaddr
73 #define svr4_ifr_muxid                  ifr_ifru.ifru_muxid
74
75 };
76
77 struct svr4_ifconf {
78         int     svr4_ifc_len;
79         union {
80                 caddr_t                  ifcu_buf;
81                 struct svr4_ifreq       *ifcu_req;
82         } ifc_ifcu;
83
84 #define svr4_ifc_buf    ifc_ifcu.ifcu_buf
85 #define svr4_ifc_req    ifc_ifcu.ifcu_req
86 };
87
88 #define SVR4_SIOC       ('i' << 8)
89
90 #define SVR4_SIOCGIFFLAGS       SVR4_IOWR('i', 17, struct svr4_ifreq)
91 #define SVR4_SIOCGIFCONF        SVR4_IOWR('i', 20, struct svr4_ifconf)
92 #define SVR4_SIOCGIFNUM         SVR4_IOR('i', 87, int)
93
94 #endif /* !_SVR4_SOCKIO_H_ */