]> git.saurik.com Git - apple/xnu.git/blame - bsd/net/init.h
xnu-792.tar.gz
[apple/xnu.git] / bsd / net / init.h
CommitLineData
91447636
A
1/*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*!
23 @header init.h
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
27 operations occur.
28 */
29#ifndef _NET_INIT_H_
30#define _NET_INIT_H_
31#include <sys/kernel_types.h>
32
33/*!
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.
37 */
38typedef void (*net_init_func_ptr)(void);
39
40/*!
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
46 initialized.
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
50 0 - success
51 */
52errno_t net_init_add(net_init_func_ptr init_func);
53
54#ifdef BSD_KERNEL_PRIVATE
55/* net_init_run is called from bsd_init */
56extern void net_init_run(void);
57#endif /* BSD_KERNEL_PRIVATE */
58
59#endif /* _NET_INIT_H_ */