1279377Simp/*-
2279377Simp * Copyright (c) 2010 Lawrence Stewart <lstewart@freebsd.org>
3279377Simp * Copyright (c) 2010 The FreeBSD Foundation
4279377Simp * All rights reserved.
5279377Simp *
6279377Simp * This software was developed by Lawrence Stewart while studying at the Centre
7279377Simp * for Advanced Internet Architectures, Swinburne University of Technology, made
8279377Simp * possible in part by grants from the FreeBSD Foundation and Cisco University
9279377Simp * Research Program Fund at Community Foundation Silicon Valley.
10279377Simp *
11279377Simp * Portions of this software were developed at the Centre for Advanced
12279377Simp * Internet Architectures, Swinburne University of Technology, Melbourne,
13279377Simp * Australia by Lawrence Stewart under sponsorship from the FreeBSD Foundation.
14279377Simp *
15279377Simp * Redistribution and use in source and binary forms, with or without
16279377Simp * modification, are permitted provided that the following conditions
17279377Simp * are met:
18279377Simp * 1. Redistributions of source code must retain the above copyright
19279377Simp *    notice, this list of conditions and the following disclaimer.
20279377Simp * 2. Redistributions in binary form must reproduce the above copyright
21279377Simp *    notice, this list of conditions and the following disclaimer in the
22279377Simp *    documentation and/or other materials provided with the distribution.
23279377Simp *
24279377Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
25279377Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26279377Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27279377Simp * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
28279377Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29279377Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30279377Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31279377Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32279377Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33279377Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34279377Simp * SUCH DAMAGE.
35279377Simp *
36279377Simp * $FreeBSD$
37279377Simp */
38279377Simp
39279377Simp/*
40279377Simp * A KPI for managing kernel helper modules which perform useful functionality
41279377Simp * within the kernel. Originally released as part of the NewTCP research project
42279377Simp * at Swinburne University of Technology's Centre for Advanced Internet
43279377Simp * Architectures, Melbourne, Australia, which was made possible in part by a
44279377Simp * grant from the Cisco University Research Program Fund at Community Foundation
45279377Simp * Silicon Valley. More details are available at:
46279377Simp *   http://caia.swin.edu.au/urp/newtcp/
47279377Simp */
48279377Simp
49279377Simp#ifndef	_SYS_KHELP_H_
50279377Simp#define	_SYS_KHELP_H_
51279377Simp
52279377Simpstruct helper;
53279377Simpstruct hookinfo;
54279377Simpstruct osd;
55279377Simp
56279377Simp/* Helper classes. */
57279377Simp#define	HELPER_CLASS_TCP	0x00000001
58279377Simp
59279377Simp/* Public KPI functions. */
60279377Simpint	khelp_register_helper(struct helper *h);
61279377Simp
62279377Simpint	khelp_deregister_helper(struct helper *h);
63279377Simp
64279377Simpint	khelp_init_osd(uint32_t classes, struct osd *hosd);
65279377Simp
66279377Simpint	khelp_destroy_osd(struct osd *hosd);
67279377Simp
68279377Simpvoid *	khelp_get_osd(struct osd *hosd, int32_t id);
69279377Simp
70279377Simpint32_t	khelp_get_id(char *hname);
71279377Simp
72279377Simpint	khelp_add_hhook(struct hookinfo *hki, uint32_t flags);
73279377Simp
74279377Simpint	khelp_remove_hhook(struct hookinfo *hki);
75279377Simp
76279377Simp#endif /* _SYS_KHELP_H_ */
77279377Simp