]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netat/nbp.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
33 * (C) COPYRIGHT Apple Computer, Inc. 1992-1996
38 * Copyright (c) 1988, 1989 Apple Computer, Inc.
40 * The information contained herein is subject to change without
41 * notice and should not be construed as a commitment by Apple
42 * Computer, Inc. Apple Computer, Inc. assumes no responsibility
43 * for any errors that may appear.
45 * Confidential and Proprietary to Apple Computer, Inc.
50 * Facility: Include file for NBP kernel module.
52 * Author: Kumar Vora, Creation Date: May-1-1989
55 * X01-001 Kumar Vora May-1-1989
61 #include <sys/appleapiopts.h>
63 #ifdef __APPLE_API_OBSOLETE
65 /* NBP packet types */
67 #define NBP_BRRQ 0x01 /* Broadcast request */
68 #define NBP_LKUP 0x02 /* Lookup */
69 #define NBP_LKUP_REPLY 0x03 /* Lookup reply */
70 #define NBP_FWDRQ 0x04 /* Forward Request (router only) */
72 /* *** the following may be discontinued in the near future *** */
74 #define NBP_CONFIRM 0x09 /* Confirm, not sent on wire */
77 #define NBP_REGISTER 0x07 /* Register a name */
78 #define NBP_DELETE 0x08 /* Delete a name */
79 #define NBP_STATUS_REPLY 0x0a /* Status on register/delete */
80 #define NBP_CLOSE_NOTE 0x0b /* Close notification from DDP */
83 /* *** **************************************************** *** */
85 /* Protocol defaults */
87 #define NBP_RETRY_COUNT 8 /* Maximum repeats */
88 #define NBP_RETRY_INTERVAL 1 /* Retry timeout */
90 /* Special (partial) wildcard character */
91 #define NBP_SPL_WILDCARD 0xC5
92 #define NBP_ORD_WILDCARD '='
94 /* Packet definitions */
96 #define NBP_TUPLE_MAX 15 /* Maximum number of tuples in one DDP packet */
97 #define NBP_HDR_SIZE 2
99 typedef struct at_nbp
{
100 #if BYTE_ORDER == BIG_ENDIAN
105 #if BYTE_ORDER == LITTLE_ENDIAN
111 at_nbptuple_t tuple
[NBP_TUPLE_MAX
];
114 #define DEFAULT_ZONE(zone) (!(zone)->len || ((zone)->len == 1 && (zone)->str[0] == '*'))
116 #ifdef KERNEL_PRIVATE
118 /* Struct for name registry */
119 typedef struct _nve_
{
120 TAILQ_ENTRY(_nve_
) nve_link
; /* tailq macro glue */
121 gbuf_t
*tag
; /*pointer to the parent gbuf_t*/
122 /* *** there's no reason why tag has to
134 long unique_nbp_id
; /* long to be compatible with OT */
137 #define NBP_WILD_OBJECT 0x01
138 #define NBP_WILD_TYPE 0x02
139 #define NBP_WILD_MASK 0x03
142 typedef struct nbp_req nbp_req_t
;
144 int (*func
)(nbp_req_t
*, nve_entry_t
*);
145 gbuf_t
*response
; /* the response datagram */
146 int space_unused
; /* Space available in the resp */
148 gbuf_t
*request
; /* The request datagram */
149 /* Saved for return address */
151 u_char flags
; /* Flags to indicate whether or */
152 /* not the request tuple has */
153 /* wildcards in it */
156 extern int nbp_insert_entry(nve_entry_t
*);
157 extern u_int
nbp_strhash (at_nvestr_t
*);
158 extern nve_entry_t
*nbp_find_nve(nve_entry_t
*);
159 extern int nbp_fillin_nve(at_entity_t
*, nve_entry_t
*);
161 extern at_nvestr_t
*getSPLocalZone(int);
162 extern at_nvestr_t
*getLocalZone(int);
164 #endif /* KERNEL_PRIVATE */
165 #endif /* __APPLE_API_OBSOLETE */
166 #endif /* _NETAT_NBP_H_ */