]> git.saurik.com Git - apple/xnu.git/blob - bsd/net/ndrv_var.h
dd00bbeb2a53b4602cb4b3cc76eec4157a2ad56c
[apple/xnu.git] / bsd / net / ndrv_var.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
13 * file.
14 *
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /* Copyright (c) 1997, 1998 Apple Computer, Inc. All Rights Reserved */
26 /*
27 * @(#)ndrv.h 1.1 (MacOSX) 6/10/43
28 * Justin Walker - 970604
29 */
30
31 #ifndef _NET_NDRV_VAR_H
32 #define _NET_NDRV_VAR_H
33 #include <sys/appleapiopts.h>
34 #ifdef KERNEL
35 #ifdef __APPLE_API_PRIVATE
36
37 /*
38 * structure for storing a linked list of multicast addresses
39 * registered by this socket. May be variable in length.
40 */
41
42 struct ndrv_multiaddr
43 {
44 struct ndrv_multiaddr* next;
45 struct sockaddr addr;
46 };
47
48 /*
49 * The cb is plugged into the socket (so_pcb), and the ifnet structure
50 * of BIND is plugged in here.
51 * For now, it looks like a raw_cb up front...
52 */
53 struct ndrv_cb
54 {
55 struct ndrv_cb *nd_next; /* Doubly-linked list */
56 struct ndrv_cb *nd_prev;
57 struct socket *nd_socket; /* Back to the socket */
58 u_int32_t nd_signature; /* Just double-checking */
59 struct sockaddr_ndrv *nd_faddr;
60 struct sockaddr_ndrv *nd_laddr;
61 struct sockproto nd_proto; /* proto family, protocol */
62 int nd_descrcnt; /* # elements in nd_dlist - Obsolete */
63 TAILQ_HEAD(dlist, dlil_demux_desc) nd_dlist; /* Descr. list */
64 struct ifnet *nd_if; /* obsolete, maintained for binary compatibility */
65 u_long nd_send_tag;
66 u_long nd_tag;
67 u_long nd_family;
68 struct ndrv_multiaddr* nd_multiaddrs;
69 short nd_unit;
70 };
71
72 #define sotondrvcb(so) ((struct ndrv_cb *)(so)->so_pcb)
73 #define NDRV_SIGNATURE 0x4e445256 /* "NDRV" */
74
75 /* Nominal allocated space for NDRV sockets */
76 #define NDRVSNDQ 8192
77 #define NDRVRCVQ 8192
78
79 extern struct ndrv_cb ndrvl; /* Head of controlblock list */
80 #endif /* __APPLE_API_PRIVATE */
81 #endif /* KERNEL */
82 #endif /* _NET_NDRV_VAR_H */