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