1/* Copyright (C) 1991-2025 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   <https://www.gnu.org/licenses/>.  */
 17
 18#ifndef __NETIPX_IPX_H
 19#define __NETIPX_IPX_H 1
 20
 21#include <sys/types.h>
 22#include <stdint.h>
 23#include <bits/sockaddr.h>
 24
 25__BEGIN_DECLS
 26
 27#define SOL_IPX    256          /* sockopt level */
 28
 29#define IPX_TYPE        1
 30#define IPX_NODE_LEN	6
 31#define IPX_MTU		576
 32
 33struct sockaddr_ipx
 34  {
 35    sa_family_t sipx_family;
 36    uint16_t sipx_port;
 37    uint32_t sipx_network;
 38    unsigned char sipx_node[IPX_NODE_LEN];
 39    uint8_t sipx_type;
 40    unsigned char sipx_zero;	/* 16 byte fill */
 41  };
 42
 43/*
 44 *	So we can fit the extra info for SIOCSIFADDR into the address nicely
 45 */
 46
 47#define sipx_special	sipx_port
 48#define sipx_action	sipx_zero
 49#define IPX_DLTITF	0
 50#define IPX_CRTITF	1
 51
 52typedef struct ipx_route_definition
 53  {
 54    unsigned long ipx_network;
 55    unsigned long ipx_router_network;
 56    unsigned char ipx_router_node[IPX_NODE_LEN];
 57  }
 58ipx_route_definition;
 59
 60typedef struct ipx_interface_definition
 61  {
 62    unsigned long ipx_network;
 63    unsigned char ipx_device[16];
 64    unsigned char ipx_dlink_type;
 65#define IPX_FRAME_NONE		0
 66#define IPX_FRAME_SNAP		1
 67#define IPX_FRAME_8022		2
 68#define IPX_FRAME_ETHERII	3
 69#define IPX_FRAME_8023		4
 70#define IPX_FRAME_TR_8022	5
 71    unsigned char ipx_special;
 72#define IPX_SPECIAL_NONE	0
 73#define IPX_PRIMARY		1
 74#define IPX_INTERNAL		2
 75    unsigned char ipx_node[IPX_NODE_LEN];
 76  }
 77ipx_interface_definition;
 78
 79typedef struct ipx_config_data
 80  {
 81    unsigned char ipxcfg_auto_select_primary;
 82    unsigned char ipxcfg_auto_create_interfaces;
 83  }
 84ipx_config_data;
 85
 86/*
 87 * OLD Route Definition for backward compatibility.
 88 */
 89
 90struct ipx_route_def
 91  {
 92    unsigned long ipx_network;
 93    unsigned long ipx_router_network;
 94#define IPX_ROUTE_NO_ROUTER	0
 95    unsigned char ipx_router_node[IPX_NODE_LEN];
 96    unsigned char ipx_device[16];
 97    unsigned short ipx_flags;
 98#define IPX_RT_SNAP		8
 99#define IPX_RT_8022		4
100#define IPX_RT_BLUEBOOK		2
101#define IPX_RT_ROUTED		1
102  };
103
104#define SIOCAIPXITFCRT		(SIOCPROTOPRIVATE)
105#define SIOCAIPXPRISLT		(SIOCPROTOPRIVATE + 1)
106#define SIOCIPXCFGDATA		(SIOCPROTOPRIVATE + 2)
107#define SIOCIPXNCPCONN		(SIOCPROTOPRIVATE + 3)
108
109__END_DECLS
110
111#endif /* netipx/ipx.h */