| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: at.h,v 1.7 2005/12/10 23:29:05 elad Exp $ */ | | 1 | /* $NetBSD: at.h,v 1.8 2014/12/02 19:33:44 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1990,1991 Regents of The University of Michigan. | | 4 | * Copyright (c) 1990,1991 Regents of The University of Michigan. |
5 | * All Rights Reserved. | | 5 | * All Rights Reserved. |
6 | * | | 6 | * |
7 | * Permission to use, copy, modify, and distribute this software and | | 7 | * Permission to use, copy, modify, and distribute this software and |
8 | * its documentation for any purpose and without fee is hereby granted, | | 8 | * its documentation for any purpose and without fee is hereby granted, |
9 | * provided that the above copyright notice appears in all copies and | | 9 | * provided that the above copyright notice appears in all copies and |
10 | * that both that copyright notice and this permission notice appear | | 10 | * that both that copyright notice and this permission notice appear |
11 | * in supporting documentation, and that the name of The University | | 11 | * in supporting documentation, and that the name of The University |
12 | * of Michigan not be used in advertising or publicity pertaining to | | 12 | * of Michigan not be used in advertising or publicity pertaining to |
13 | * distribution of the software without specific, written prior | | 13 | * distribution of the software without specific, written prior |
14 | * permission. This software is supplied as is without expressed or | | 14 | * permission. This software is supplied as is without expressed or |
| @@ -49,57 +49,65 @@ typedef __sa_family_t sa_family_t; | | | @@ -49,57 +49,65 @@ typedef __sa_family_t sa_family_t; |
49 | * Port was created by a privileged process. | | 49 | * Port was created by a privileged process. |
50 | * If ATPORT_RESERVED <= Port < ATPORT_LAST, | | 50 | * If ATPORT_RESERVED <= Port < ATPORT_LAST, |
51 | * Port was not necessarily created by a | | 51 | * Port was not necessarily created by a |
52 | * privileged process. | | 52 | * privileged process. |
53 | */ | | 53 | */ |
54 | #define ATPORT_FIRST 1 | | 54 | #define ATPORT_FIRST 1 |
55 | #define ATPORT_RESERVED 128 | | 55 | #define ATPORT_RESERVED 128 |
56 | #define ATPORT_LAST 255 | | 56 | #define ATPORT_LAST 255 |
57 | | | 57 | |
58 | /* | | 58 | /* |
59 | * AppleTalk address. | | 59 | * AppleTalk address. |
60 | */ | | 60 | */ |
61 | struct at_addr { | | 61 | struct at_addr { |
62 | u_int16_t s_net; | | 62 | uint16_t s_net; |
63 | u_int8_t s_node; | | 63 | uint8_t s_node; |
64 | }; | | 64 | }; |
65 | | | 65 | |
66 | #define ATADDR_ANYNET (u_int16_t)0x0000 | | 66 | #define ATADDR_ANYNET (uint16_t)0x0000 |
67 | #define ATADDR_ANYNODE (u_int8_t)0x00 | | 67 | #define ATADDR_ANYNODE (uint8_t)0x00 |
68 | #define ATADDR_ANYPORT (u_int8_t)0x00 | | 68 | #define ATADDR_ANYPORT (uint8_t)0x00 |
69 | #define ATADDR_BCAST (u_int8_t)0xff /* There is no BCAST for NET */ | | 69 | #define ATADDR_BCAST (uint8_t)0xff /* There is no BCAST for NET */ |
70 | | | 70 | |
71 | struct netrange { | | 71 | struct netrange { |
72 | u_int8_t nr_phase; | | 72 | uint8_t nr_phase; |
73 | u_int16_t nr_firstnet; | | 73 | uint16_t nr_firstnet; |
74 | u_int16_t nr_lastnet; | | 74 | uint16_t nr_lastnet; |
75 | }; | | 75 | }; |
76 | | | 76 | |
77 | /* | | 77 | /* |
78 | * Socket address, AppleTalk style. We keep magic information in the | | 78 | * Socket address, AppleTalk style. We keep magic information in the |
79 | * zero bytes. There are three types, NONE, CONFIG which has the phase | | 79 | * zero bytes. There are three types, NONE, CONFIG which has the phase |
80 | * and a net range, and IFACE which has the network address of an | | 80 | * and a net range, and IFACE which has the network address of an |
81 | * interface. IFACE may be filled in by the client, and is filled in | | 81 | * interface. IFACE may be filled in by the client, and is filled in |
82 | * by the kernel. | | 82 | * by the kernel. |
83 | */ | | 83 | */ |
84 | struct sockaddr_at { | | 84 | struct sockaddr_at { |
85 | u_int8_t sat_len; | | 85 | uint8_t sat_len; |
86 | sa_family_t sat_family; | | 86 | sa_family_t sat_family; |
87 | u_int8_t sat_port; | | 87 | uint8_t sat_port; |
88 | struct at_addr sat_addr; | | 88 | struct at_addr sat_addr; |
89 | union { | | 89 | union { |
90 | struct netrange r_netrange; | | 90 | struct netrange r_netrange; |
91 | char r_zero[8]; /* Hide a struct netrange in | | 91 | char r_zero[8]; /* Hide a struct netrange in |
92 | * here */ | | 92 | * here */ |
93 | } sat_range; | | 93 | } sat_range; |
94 | }; | | 94 | }; |
95 | | | 95 | |
96 | #define sat_zero sat_range.r_zero | | 96 | #define sat_zero sat_range.r_zero |
97 | | | 97 | |
98 | #ifdef _KERNEL | | 98 | #ifdef _KERNEL |
99 | #include <sys/protosw.h> | | 99 | #include <sys/protosw.h> |
100 | | | 100 | |
101 | extern struct domain atalkdomain; | | 101 | extern struct domain atalkdomain; |
102 | extern const struct protosw atalksw[]; | | 102 | extern const struct protosw atalksw[]; |
103 | #endif | | 103 | #endif |
104 | | | 104 | |
| | | 105 | #if defined(_KERNEL) || defined(_TEST) |
| | | 106 | #define ATALK_ADDRSTRLEN 10 |
| | | 107 | |
| | | 108 | extern struct domain atalkdomain; |
| | | 109 | int at_print(char *, size_t, const struct at_addr *); |
| | | 110 | int sat_print(char *, size_t, const void *); |
| | | 111 | #endif |
| | | 112 | |
105 | #endif /* !_NETATALK_AT_H_ */ | | 113 | #endif /* !_NETATALK_AT_H_ */ |