comm: add -Wall
[unleashed.git] / include / inet / nd.h
bloba2bcb45f66ddbac73461eaee23d26b25c66bfe43
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
25 /* Copyright (c) 1990 Mentat Inc. */
27 #ifndef _INET_ND_H
28 #define _INET_ND_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
33 #include <inet/common.h>
34 #include <inet/led.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #define ND_BASE ('N' << 8) /* base */
41 #define ND_GET (ND_BASE + 0) /* Get a value */
42 #define ND_SET (ND_BASE + 1) /* Set a value */
44 #ifdef _KERNEL
45 /* ND callback function prototypes */
46 typedef int (*ndgetf_t)(queue_t *, MBLKP, caddr_t, cred_t *);
47 typedef int (*ndsetf_t)(queue_t *, MBLKP, char *, caddr_t, cred_t *);
49 /* Named dispatch table entry */
50 typedef struct nde_s {
51 char *nde_name;
52 pfi_t nde_get_pfi;
53 pfi_t nde_set_pfi;
54 caddr_t nde_data;
55 } NDE;
57 /* Name dispatch table */
58 typedef struct nd_s {
59 int nd_free_count; /* number of unused nd table entries */
60 int nd_size; /* size (in bytes) of current table */
61 NDE *nd_tbl; /* pointer to table in heap */
62 } ND;
64 #define NDE_ALLOC_COUNT 32
65 #define NDE_ALLOC_SIZE (sizeof (NDE) * NDE_ALLOC_COUNT)
67 /* 64K STREAM limit - the max ndd info header. */
68 #define ND_MAX_BUF_LEN 65303
71 * See kernel/net/nd.c for comments on how to use these routines.
73 extern boolean_t nd_load(caddr_t *, char *, ndgetf_t, ndsetf_t, caddr_t);
74 extern void nd_unload(caddr_t *, char *);
75 extern void nd_free(caddr_t *);
76 extern int nd_getset(queue_t *, caddr_t, MBLKP);
79 * Canned nd_get and nd_set routines for use with nd_load().
81 extern int nd_get_default(queue_t *, MBLKP, caddr_t, cred_t *);
82 extern int nd_get_long(queue_t *, MBLKP, caddr_t, cred_t *);
83 extern int nd_get_names(queue_t *, MBLKP, caddr_t, cred_t *);
84 extern int nd_set_default(queue_t *, MBLKP, char *, caddr_t, cred_t *);
85 extern int nd_set_long(queue_t *, MBLKP, char *, caddr_t, cred_t *);
87 #endif /* _KERNEL */
89 #ifdef __cplusplus
91 #endif
93 #endif /* _INET_ND_H */