]> git.saurik.com Git - apple/xnu.git/blame_incremental - bsd/netinet6/natpt_soctl.h
xnu-201.42.3.tar.gz
[apple/xnu.git] / bsd / netinet6 / natpt_soctl.h
... / ...
CommitLineData
1/* $KAME: natpt_soctl.h,v 1.8 2000/03/25 07:23:56 sumikawa Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32/* cmd for use with ioctl at the socket */
33/* _IO() no parameters */
34/* _IOR() copy out parameters */
35/* _IOW() copy in parameters */
36/* _IOWR() copy in/out parameters */
37
38#define SIOCSETIF _IOW ('n', 0, struct natpt_msgBox) /* Set interface side */
39#define SIOCGETIF _IOWR('n', 1, struct natpt_msgBox) /* Get interface sidde */
40#define SIOCENBTRANS _IOW ('n', 2, struct natpt_msgBox) /* Enable translation */
41#define SIOCDSBTRANS _IOW ('n', 3, struct natpt_msgBox) /* Disable translation */
42#define SIOCSETRULE _IOW ('n', 4, struct natpt_msgBox) /* Set rule */
43#define SIOCGETRULE _IOWR('n', 5, struct natpt_msgBox) /* Get rule */
44#define SIOCFLUSHRULE _IOW ('n', 6, struct natpt_msgBox) /* Flush rule */
45#define SIOCSETPREFIX _IOW ('n', 8, struct natpt_msgBox) /* Set prefix */
46#define SIOCGETPREFIX _IOWR('n', 9, struct natpt_msgBox) /* Get prefix */
47#define SIOCSETVALUE _IOW ('n', 10, struct natpt_msgBox) /* Set value */
48#define SIOCGETVALUE _IOW ('n', 11, struct natpt_msgBox) /* Get value */
49
50#define SIOCTESTLOG _IOW ('n', 12, struct natpt_msgBox) /* Test log */
51
52#define SIOCBREAK _IO ('n', 255) /* stop */
53
54
55typedef struct natpt_msgBox /* sizeof(): 44[byte] */
56{
57 int flags;
58/* in case SIOC(GET|SET)IF */
59#define IF_EXTERNAL (0x01)
60#define IF_INTERNAL (0x02)
61
62/* in case SIOT(SET|GET)RULE */
63#ifndef NATPT_STATIC
64#define NATPT_STATIC (0x01)
65#define NATPT_DYNAMIC (0x02)
66#define NATPT_FAITH (0x03)
67#endif
68
69/* in case SIOCFLUSHRULE ... bitwise */
70#define FLUSH_STATIC (0x01)
71#define FLUSH_DYNAMIC (0x02)
72
73/* in case SIOC(GET|SET)PREFIX */
74#define PREFIX_FAITH (0x01)
75#define PREFIX_NATPT (0x02)
76
77/* in case SIOC(GET|SET)VALUE */
78#define NATPT_DEBUG (0x01) /* natpt_debug := <value> */
79#define NATPT_DUMP (0x02) /* natpt_dump := <value> */
80
81 int size; /* sizeof(*freight) */
82 char *freight;
83 union
84 {
85 char M_ifName[IFNAMSIZ];
86 char M_aux[32];
87 } M_dat;
88} natpt_msgBox;
89
90#define m_ifName M_dat.M_ifName
91#define m_aux M_dat.M_aux