1216615Slstewart/*- 2216615Slstewart * Copyright (c) 2010 Lawrence Stewart <lstewart@freebsd.org> 3216615Slstewart * Copyright (c) 2010 The FreeBSD Foundation 4216615Slstewart * All rights reserved. 5216615Slstewart * 6216615Slstewart * This software was developed by Lawrence Stewart while studying at the Centre 7220560Slstewart * for Advanced Internet Architectures, Swinburne University of Technology, made 8220560Slstewart * possible in part by grants from the FreeBSD Foundation and Cisco University 9220560Slstewart * Research Program Fund at Community Foundation Silicon Valley. 10216615Slstewart * 11216615Slstewart * Portions of this software were developed at the Centre for Advanced 12216615Slstewart * Internet Architectures, Swinburne University of Technology, Melbourne, 13216615Slstewart * Australia by Lawrence Stewart under sponsorship from the FreeBSD Foundation. 14216615Slstewart * 15216615Slstewart * Redistribution and use in source and binary forms, with or without 16216615Slstewart * modification, are permitted provided that the following conditions 17216615Slstewart * are met: 18216615Slstewart * 1. Redistributions of source code must retain the above copyright 19216615Slstewart * notice, this list of conditions and the following disclaimer. 20216615Slstewart * 2. Redistributions in binary form must reproduce the above copyright 21216615Slstewart * notice, this list of conditions and the following disclaimer in the 22216615Slstewart * documentation and/or other materials provided with the distribution. 23216615Slstewart * 24216615Slstewart * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 25216615Slstewart * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26216615Slstewart * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27216615Slstewart * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 28216615Slstewart * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29216615Slstewart * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30216615Slstewart * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31216615Slstewart * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32216615Slstewart * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33216615Slstewart * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34216615Slstewart * SUCH DAMAGE. 35216615Slstewart * 36216615Slstewart * $FreeBSD$ 37216615Slstewart */ 38216615Slstewart 39216615Slstewart/* 40216615Slstewart * A KPI for managing kernel helper modules which perform useful functionality 41220560Slstewart * within the kernel. Originally released as part of the NewTCP research project 42220560Slstewart * at Swinburne University of Technology's Centre for Advanced Internet 43220560Slstewart * Architectures, Melbourne, Australia, which was made possible in part by a 44220560Slstewart * grant from the Cisco University Research Program Fund at Community Foundation 45220560Slstewart * Silicon Valley. More details are available at: 46216615Slstewart * http://caia.swin.edu.au/urp/newtcp/ 47216615Slstewart */ 48216615Slstewart 49216615Slstewart#ifndef _SYS_KHELP_H_ 50216615Slstewart#define _SYS_KHELP_H_ 51216615Slstewart 52216615Slstewartstruct helper; 53216615Slstewartstruct hookinfo; 54216615Slstewartstruct osd; 55216615Slstewart 56216615Slstewart/* Helper classes. */ 57216615Slstewart#define HELPER_CLASS_TCP 0x00000001 58216615Slstewart 59216615Slstewart/* Public KPI functions. */ 60216615Slstewartint khelp_register_helper(struct helper *h); 61216615Slstewart 62216615Slstewartint khelp_deregister_helper(struct helper *h); 63216615Slstewart 64216615Slstewartint khelp_init_osd(uint32_t classes, struct osd *hosd); 65216615Slstewart 66216615Slstewartint khelp_destroy_osd(struct osd *hosd); 67216615Slstewart 68216615Slstewartvoid * khelp_get_osd(struct osd *hosd, int32_t id); 69216615Slstewart 70216615Slstewartint32_t khelp_get_id(char *hname); 71216615Slstewart 72216615Slstewartint khelp_add_hhook(struct hookinfo *hki, uint32_t flags); 73216615Slstewart 74216615Slstewartint khelp_remove_hhook(struct hookinfo *hki); 75216615Slstewart 76216615Slstewart#endif /* _SYS_KHELP_H_ */ 77