1 /* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3 
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8 
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13 
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
17 
18 #ifndef __NETIPX_IPX_H
19 #define __NETIPX_IPX_H 1
20 
21 #include <features.h>
22 
23 #include <sys/types.h>
24 #include <bits/sockaddr.h>
25 
26 __BEGIN_DECLS
27 
28 #define SOL_IPX    256          /* sockopt level */
29 
30 #define IPX_TYPE        1
31 #define IPX_NODE_LEN	6
32 #define IPX_MTU		576
33 
34 struct sockaddr_ipx
35   {
36     sa_family_t sipx_family;
37     u_int16_t sipx_port;
38     u_int32_t sipx_network;
39     unsigned char sipx_node[IPX_NODE_LEN];
40     u_int8_t sipx_type;
41     unsigned char sipx_zero;	/* 16 byte fill */
42   };
43 
44 /*
45  *	So we can fit the extra info for SIOCSIFADDR into the address nicely
46  */
47 
48 #define sipx_special	sipx_port
49 #define sipx_action	sipx_zero
50 #define IPX_DLTITF	0
51 #define IPX_CRTITF	1
52 
53 typedef struct ipx_route_definition
54   {
55     unsigned long ipx_network;
56     unsigned long ipx_router_network;
57     unsigned char ipx_router_node[IPX_NODE_LEN];
58   }
59 ipx_route_definition;
60 
61 typedef struct ipx_interface_definition
62   {
63     unsigned long ipx_network;
64     unsigned char ipx_device[16];
65     unsigned char ipx_dlink_type;
66 #define IPX_FRAME_NONE		0
67 #define IPX_FRAME_SNAP		1
68 #define IPX_FRAME_8022		2
69 #define IPX_FRAME_ETHERII	3
70 #define IPX_FRAME_8023		4
71 #define IPX_FRAME_TR_8022	5
72     unsigned char ipx_special;
73 #define IPX_SPECIAL_NONE	0
74 #define IPX_PRIMARY		1
75 #define IPX_INTERNAL		2
76     unsigned char ipx_node[IPX_NODE_LEN];
77   }
78 ipx_interface_definition;
79 
80 typedef struct ipx_config_data
81   {
82     unsigned char ipxcfg_auto_select_primary;
83     unsigned char ipxcfg_auto_create_interfaces;
84   }
85 ipx_config_data;
86 
87 /*
88  * OLD Route Definition for backward compatibility.
89  */
90 
91 struct ipx_route_def
92   {
93     unsigned long ipx_network;
94     unsigned long ipx_router_network;
95 #define IPX_ROUTE_NO_ROUTER	0
96     unsigned char ipx_router_node[IPX_NODE_LEN];
97     unsigned char ipx_device[16];
98     unsigned short ipx_flags;
99 #define IPX_RT_SNAP		8
100 #define IPX_RT_8022		4
101 #define IPX_RT_BLUEBOOK		2
102 #define IPX_RT_ROUTED		1
103   };
104 
105 #define SIOCAIPXITFCRT		(SIOCPROTOPRIVATE)
106 #define SIOCAIPXPRISLT		(SIOCPROTOPRIVATE + 1)
107 #define SIOCIPXCFGDATA		(SIOCPROTOPRIVATE + 2)
108 #define SIOCIPXNCPCONN		(SIOCPROTOPRIVATE + 3)
109 
110 __END_DECLS
111 
112 #endif /* netipx/ipx.h */
113