+++ /dev/null
-/*\r
- * Copyright (c) 1984, 1985, 1986, 1987, 1993\r
- * The Regents of the University of California. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. All advertising materials mentioning features or use of this software\r
- * must display the following acknowledgement:\r
- * This product includes software developed by the University of\r
- * California, Berkeley and its contributors.\r
- * 4. Neither the name of the University nor the names of its contributors\r
- * may be used to endorse or promote products derived from this software\r
- * without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- *\r
- * @(#)ns.h 8.1 (Berkeley) 6/10/93\r
- * $Id: ns.h,v 1.1.1.1 2003/11/19 01:48:56 kyu3 Exp $\r
- */\r
-\r
-#ifndef _NETNS_NS_H_\r
-#define _NETNS_NS_H_\r
-\r
-/*\r
- * Constants and Structures defined by the Xerox Network Software\r
- * per "Internet Transport Protocols", XSIS 028112, December 1981\r
- */\r
-\r
-/*\r
- * Protocols\r
- */\r
-#define NSPROTO_RI 1 /* Routing Information */\r
-#define NSPROTO_ECHO 2 /* Echo Protocol */\r
-#define NSPROTO_ERROR 3 /* Error Protocol */\r
-#define NSPROTO_PE 4 /* Packet Exchange */\r
-#define NSPROTO_SPP 5 /* Sequenced Packet */\r
-#define NSPROTO_RAW 255 /* Placemarker*/\r
-#define NSPROTO_MAX 256 /* Placemarker*/\r
-\r
-\r
-/*\r
- * Port/Socket numbers: network standard functions\r
- */\r
-\r
-#define NSPORT_RI 1 /* Routing Information */\r
-#define NSPORT_ECHO 2 /* Echo */\r
-#define NSPORT_RE 3 /* Router Error */\r
-\r
-/*\r
- * Ports < NSPORT_RESERVED are reserved for priveleged\r
- * processes (e.g. root).\r
- */\r
-#define NSPORT_RESERVED 3000\r
-\r
-/* flags passed to ns_output as last parameter */\r
-\r
-#define NS_FORWARDING 0x1 /* most of idp header exists */\r
-#define NS_ROUTETOIF 0x10 /* same as SO_DONTROUTE */\r
-#define NS_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */\r
-\r
-#define NS_MAXHOPS 15\r
-\r
-/* flags passed to get/set socket option */\r
-#define SO_HEADERS_ON_INPUT 1\r
-#define SO_HEADERS_ON_OUTPUT 2\r
-#define SO_DEFAULT_HEADERS 3\r
-#define SO_LAST_HEADER 4\r
-#define SO_NSIP_ROUTE 5\r
-#define SO_SEQNO 6\r
-#define SO_ALL_PACKETS 7\r
-#define SO_MTU 8\r
-\r
-\r
-/*\r
- * NS addressing\r
- */\r
-union ns_host {\r
- u_char c_host[6];\r
- u_short s_host[3];\r
-};\r
-\r
-union ns_net {\r
- u_char c_net[4];\r
- u_short s_net[2];\r
-};\r
-\r
-union ns_net_u {\r
- union ns_net net_e;\r
- u_long long_e;\r
-};\r
-\r
-struct ns_addr {\r
- union ns_net x_net;\r
- union ns_host x_host;\r
- u_short x_port;\r
-};\r
-\r
-/*\r
- * Socket address, Xerox style\r
- */\r
-struct sockaddr_ns {\r
- u_char sns_len;\r
- u_char sns_family;\r
- struct ns_addr sns_addr;\r
- char sns_zero[2];\r
-};\r
-#define sns_port sns_addr.x_port\r
-\r
-#ifdef vax\r
-#define ns_netof(a) (*(long *) & ((a).x_net)) /* XXX - not needed */\r
-#endif\r
-#define ns_neteqnn(a,b) (((a).s_net[0]==(b).s_net[0]) && \\r
- ((a).s_net[1]==(b).s_net[1]))\r
-#define ns_neteq(a,b) ns_neteqnn((a).x_net, (b).x_net)\r
-#define satons_addr(sa) (((struct sockaddr_ns *)&(sa))->sns_addr)\r
-#define ns_hosteqnh(s,t) ((s).s_host[0] == (t).s_host[0] && \\r
- (s).s_host[1] == (t).s_host[1] && (s).s_host[2] == (t).s_host[2])\r
-#define ns_hosteq(s,t) (ns_hosteqnh((s).x_host,(t).x_host))\r
-#define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \\r
- ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0))\r
-\r
-#ifdef KERNEL\r
-extern struct domain nsdomain;\r
-union ns_host ns_thishost;\r
-union ns_host ns_zerohost;\r
-union ns_host ns_broadhost;\r
-union ns_net ns_zeronet;\r
-union ns_net ns_broadnet;\r
-u_short ns_cksum();\r
-#else\r
-\r
-#include <sys/cdefs.h>\r
-\r
-__BEGIN_DECLS\r
-extern struct ns_addr ns_addr (const char *);\r
-extern char *ns_ntoa (struct ns_addr);\r
-__END_DECLS\r
-\r
-#endif\r
-\r
-#endif\r