| 1 | /* |
| 2 | * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms are permitted |
| 6 | * provided that the above copyright notice and this paragraph are |
| 7 | * duplicated in all such forms and that any documentation, |
| 8 | * advertising materials, and other materials related to such |
| 9 | * distribution and use acknowledge that the software was developed |
| 10 | * by the University of California, Berkeley. The name of the |
| 11 | * University may not be used to endorse or promote products derived |
| 12 | * from this software without specific prior written permission. |
| 13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 15 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 16 | * |
| 17 | * @(#)ns_if.h 7.5 (Berkeley) %G% |
| 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * Interface address, xerox version. One of these structures |
| 22 | * is allocated for each interface with an internet address. |
| 23 | * The ifaddr structure contains the protocol-independent part |
| 24 | * of the structure and is assumed to be first. |
| 25 | */ |
| 26 | |
| 27 | struct ns_ifaddr { |
| 28 | struct ifaddr ia_ifa; /* protocol-independent info */ |
| 29 | #define ia_ifp ia_ifa.ifa_ifp |
| 30 | #define ia_flags ia_ifa.ifa_flags |
| 31 | /* union ns_net ia_net; /* network number of interface */ |
| 32 | #define ia_net ia_addr.sns_addr.x_net |
| 33 | struct ns_ifaddr *ia_next; /* next in list of xerox addresses */ |
| 34 | struct sockaddr_ns ia_addr; /* reserve space for my address */ |
| 35 | struct sockaddr_ns ia_dstaddr; /* space for my broadcast address */ |
| 36 | #define ia_broadaddr ia_dstaddr |
| 37 | struct sockaddr_ns ia_netmask; /* space for my network mask */ |
| 38 | }; |
| 39 | |
| 40 | struct ns_aliasreq { |
| 41 | char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ |
| 42 | struct sockaddr_ns ifra_addr; |
| 43 | struct sockaddr_ns ifra_broadaddr; |
| 44 | #define ifra_dstaddr ifra_broadaddr |
| 45 | }; |
| 46 | /* |
| 47 | * Given a pointer to an ns_ifaddr (ifaddr), |
| 48 | * return a pointer to the addr as a sockadd_ns. |
| 49 | */ |
| 50 | |
| 51 | #define IA_SNS(ia) (&(((struct ns_ifaddr *)(ia))->ia_addr)) |
| 52 | |
| 53 | /* This is not the right place for this but where is? */ |
| 54 | #define ETHERTYPE_NS 0x0600 |
| 55 | |
| 56 | #ifdef NSIP |
| 57 | struct nsip_req { |
| 58 | struct sockaddr rq_ns; /* must be ns format destination */ |
| 59 | struct sockaddr rq_ip; /* must be ip format gateway */ |
| 60 | short rq_flags; |
| 61 | }; |
| 62 | #endif |
| 63 | |
| 64 | #ifdef KERNEL |
| 65 | struct ns_ifaddr *ns_ifaddr; |
| 66 | struct ns_ifaddr *ns_iaonnetof(); |
| 67 | struct ifqueue nsintrq; /* XNS input packet queue */ |
| 68 | #endif |