]>
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_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
30 * (C) COPYRIGHT Apple Computer, Inc. 1992-1996
35 * Copyright (c) 1988, 1989 Apple Computer, Inc.
37 * The information contained herein is subject to change without
38 * notice and should not be construed as a commitment by Apple
39 * Computer, Inc. Apple Computer, Inc. assumes no responsibility
40 * for any errors that may appear.
42 * Confidential and Proprietary to Apple Computer, Inc.
47 * Facility: Include file for NBP kernel module.
49 * Author: Kumar Vora, Creation Date: May-1-1989
52 * X01-001 Kumar Vora May-1-1989
58 #include <sys/appleapiopts.h>
60 /* NBP packet types */
62 #define NBP_BRRQ 0x01 /* Broadcast request */
63 #define NBP_LKUP 0x02 /* Lookup */
64 #define NBP_LKUP_REPLY 0x03 /* Lookup reply */
65 #define NBP_FWDRQ 0x04 /* Forward Request (router only) */
67 /* *** the following may be discontinued in the near future *** */
69 #define NBP_CONFIRM 0x09 /* Confirm, not sent on wire */
72 #define NBP_REGISTER 0x07 /* Register a name */
73 #define NBP_DELETE 0x08 /* Delete a name */
74 #define NBP_STATUS_REPLY 0x0a /* Status on register/delete */
75 #define NBP_CLOSE_NOTE 0x0b /* Close notification from DDP */
78 /* *** **************************************************** *** */
80 /* Protocol defaults */
82 #define NBP_RETRY_COUNT 8 /* Maximum repeats */
83 #define NBP_RETRY_INTERVAL 1 /* Retry timeout */
85 /* Special (partial) wildcard character */
86 #define NBP_SPL_WILDCARD 0xC5
87 #define NBP_ORD_WILDCARD '='
89 /* Packet definitions */
91 #define NBP_TUPLE_MAX 15 /* Maximum number of tuples in one DDP packet */
92 #define NBP_HDR_SIZE 2
94 typedef struct at_nbp
{
98 at_nbptuple_t tuple
[NBP_TUPLE_MAX
];
101 #define DEFAULT_ZONE(zone) (!(zone)->len || ((zone)->len == 1 && (zone)->str[0] == '*'))
104 #ifdef __APPLE_API_PRIVATE
106 /* Struct for name registry */
107 typedef struct _nve_
{
108 TAILQ_ENTRY(_nve_
) nve_link
; /* tailq macro glue */
109 gbuf_t
*tag
; /*pointer to the parent gbuf_t*/
110 /* *** there's no reason why tag has to
122 long unique_nbp_id
; /* long to be compatible with OT */
125 #define NBP_WILD_OBJECT 0x01
126 #define NBP_WILD_TYPE 0x02
127 #define NBP_WILD_MASK 0x03
129 typedef struct nbp_req
{
131 gbuf_t
*response
; /* the response datagram */
132 int space_unused
; /* Space available in the resp */
134 gbuf_t
*request
; /* The request datagram */
135 /* Saved for return address */
137 u_char flags
; /* Flags to indicate whether or */
138 /* not the request tuple has */
139 /* wildcards in it */
142 extern int nbp_insert_entry(nve_entry_t
*);
143 extern u_int
nbp_strhash (at_nvestr_t
*);
144 extern nve_entry_t
*nbp_find_nve(nve_entry_t
*);
145 extern int nbp_fillin_nve();
147 extern at_nvestr_t
*getSPLocalZone(int);
148 extern at_nvestr_t
*getLocalZone(int);
150 #endif /* __APPLE_API_PRIVATE */
152 #endif /* _NETAT_NBP_H_ */