2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 This header defines an API to register a function that will be called when
25 the network stack is being initialized. This gives a kernel extensions an
26 opportunity to install filters before sockets are created and network
31 #include <sys/kernel_types.h>
34 @typedef net_init_func_ptr
35 @discussion net_init_func_ptr will be called once the networking stack
36 initialized and before network operations occur.
38 typedef void (*net_init_func_ptr
)(void);
41 @function net_init_add
42 @discussion Add a function to be called during network initialization. Your
43 kext must not unload until the function you register is called if
44 net_init_add returns success.
45 @param init_func A pointer to a function to be called when the stack is
47 @result EINVAL - the init_func value was NULL.
48 EALREADY - the network has already been initialized
49 ENOMEM - there was not enough memory to perform this operation
52 errno_t
net_init_add(net_init_func_ptr init_func
);
54 #ifdef BSD_KERNEL_PRIVATE
55 /* net_init_run is called from bsd_init */
56 extern void net_init_run(void);
57 #endif /* BSD_KERNEL_PRIVATE */
59 #endif /* _NET_INIT_H_ */