1139743Simp/*-
243412Snewton * Copyright (c) 1998 Mark Newton
343412Snewton * Copyright (c) 1995 Christos Zoulas
443412Snewton * All rights reserved.
543412Snewton *
643412Snewton * Redistribution and use in source and binary forms, with or without
743412Snewton * modification, are permitted provided that the following conditions
843412Snewton * are met:
943412Snewton * 1. Redistributions of source code must retain the above copyright
1043412Snewton *    notice, this list of conditions and the following disclaimer.
1143412Snewton * 2. Redistributions in binary form must reproduce the above copyright
1243412Snewton *    notice, this list of conditions and the following disclaimer in the
1343412Snewton *    documentation and/or other materials provided with the distribution.
1443412Snewton * 3. The name of the author may not be used to endorse or promote products
1543412Snewton *    derived from this software without specific prior written permission
1643412Snewton *
1743412Snewton * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1843412Snewton * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1943412Snewton * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2043412Snewton * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2143412Snewton * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2243412Snewton * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2343412Snewton * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2443412Snewton * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2543412Snewton * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2643412Snewton * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2749267Snewton *
2850477Speter * $FreeBSD$
2943412Snewton */
3043412Snewton
3143412Snewton#ifndef	_SVR4_SOCKIO_H_
3243412Snewton#define	_SVR4_SOCKIO_H_
3343412Snewton
3443412Snewton#define	SVR4_IFF_UP		0x0001
3543412Snewton#define	SVR4_IFF_BROADCAST	0x0002
3643412Snewton#define	SVR4_IFF_DEBUG		0x0004
3743412Snewton#define	SVR4_IFF_LOOPBACK	0x0008
3843412Snewton#define	SVR4_IFF_POINTOPOINT	0x0010
3943412Snewton#define	SVR4_IFF_NOTRAILERS	0x0020
4043412Snewton#define	SVR4_IFF_RUNNING	0x0040
4143412Snewton#define	SVR4_IFF_NOARP		0x0080
4243412Snewton#define	SVR4_IFF_PROMISC	0x0100
4343412Snewton#define	SVR4_IFF_ALLMULTI	0x0200
4443412Snewton#define	SVR4_IFF_INTELLIGENT	0x0400
4543412Snewton#define	SVR4_IFF_MULTICAST	0x0800
4643412Snewton#define	SVR4_IFF_MULTI_BCAST	0x1000
4743412Snewton#define	SVR4_IFF_UNNUMBERED	0x2000
4843412Snewton#define	SVR4_IFF_PRIVATE	0x8000
4943412Snewton
5043412Snewtonstruct svr4_ifreq {
5143412Snewton#define	SVR4_IFNAMSIZ	16
5243412Snewton	char	svr4_ifr_name[SVR4_IFNAMSIZ];
5343412Snewton	union {
5443412Snewton		struct	osockaddr	ifru_addr;
5543412Snewton		struct	osockaddr	ifru_dstaddr;
5643412Snewton		struct	osockaddr	ifru_broadaddr;
5743412Snewton		short			ifru_flags;
5843412Snewton		int			ifru_metric;
5943412Snewton		char			ifru_data;
6043412Snewton		char			ifru_enaddr[6];
6143412Snewton		int			if_muxid[2];
6243412Snewton
6343412Snewton	} ifr_ifru;
6443412Snewton
6543412Snewton#define	svr4_ifr_addr			ifr_ifru.ifru_addr
6643412Snewton#define	svr4_ifr_dstaddr		ifr_ifru.ifru_dstaddr
6743412Snewton#define	svr4_ifr_broadaddr		ifr_ifru.ifru_broadaddr
6843412Snewton#define	svr4_ifr_flags			ifr_ifru.ifru_flags
6943412Snewton#define	svr4_ifr_metric			ifr_ifru.ifru_metric
7043412Snewton#define	svr4_ifr_data			ifr_ifru.ifru_data
7143412Snewton#define	svr4_ifr_enaddr			ifr_ifru.ifru_enaddr
7243412Snewton#define	svr4_ifr_muxid			ifr_ifru.ifru_muxid
7343412Snewton
7443412Snewton};
7543412Snewton
7643412Snewtonstruct svr4_ifconf {
7743412Snewton	int	svr4_ifc_len;
7843412Snewton	union {
7943412Snewton		caddr_t			 ifcu_buf;
8043412Snewton		struct svr4_ifreq 	*ifcu_req;
8143412Snewton	} ifc_ifcu;
8243412Snewton
8343412Snewton#define	svr4_ifc_buf	ifc_ifcu.ifcu_buf
8443412Snewton#define	svr4_ifc_req	ifc_ifcu.ifcu_req
8543412Snewton};
8643412Snewton
8743412Snewton#define SVR4_SIOC	('i' << 8)
8843412Snewton
8943412Snewton#define	SVR4_SIOCGIFFLAGS	SVR4_IOWR('i', 17, struct svr4_ifreq)
9043412Snewton#define	SVR4_SIOCGIFCONF	SVR4_IOWR('i', 20, struct svr4_ifconf)
9143412Snewton#define	SVR4_SIOCGIFNUM		SVR4_IOR('i', 87, int)
9243412Snewton
9343412Snewton#endif /* !_SVR4_SOCKIO_H_ */
94