14cf49a43SJulian Elischer 24cf49a43SJulian Elischer /* 34cf49a43SJulian Elischer * netgraph.h 44cf49a43SJulian Elischer * 54cf49a43SJulian Elischer * Copyright (c) 1996-1999 Whistle Communications, Inc. 64cf49a43SJulian Elischer * All rights reserved. 74cf49a43SJulian Elischer * 84cf49a43SJulian Elischer * Subject to the following obligations and disclaimer of warranty, use and 94cf49a43SJulian Elischer * redistribution of this software, in source or object code forms, with or 104cf49a43SJulian Elischer * without modifications are expressly permitted by Whistle Communications; 114cf49a43SJulian Elischer * provided, however, that: 124cf49a43SJulian Elischer * 1. Any and all reproductions of the source or object code must include the 134cf49a43SJulian Elischer * copyright notice above and the following disclaimer of warranties; and 144cf49a43SJulian Elischer * 2. No rights are granted, in any manner or form, to use Whistle 154cf49a43SJulian Elischer * Communications, Inc. trademarks, including the mark "WHISTLE 164cf49a43SJulian Elischer * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 174cf49a43SJulian Elischer * such appears in the above copyright notice or in the software. 184cf49a43SJulian Elischer * 194cf49a43SJulian Elischer * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 204cf49a43SJulian Elischer * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 214cf49a43SJulian Elischer * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 224cf49a43SJulian Elischer * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 234cf49a43SJulian Elischer * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 244cf49a43SJulian Elischer * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 254cf49a43SJulian Elischer * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 264cf49a43SJulian Elischer * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 274cf49a43SJulian Elischer * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 284cf49a43SJulian Elischer * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 294cf49a43SJulian Elischer * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 304cf49a43SJulian Elischer * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 314cf49a43SJulian Elischer * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 324cf49a43SJulian Elischer * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 334cf49a43SJulian Elischer * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 344cf49a43SJulian Elischer * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 354cf49a43SJulian Elischer * OF SUCH DAMAGE. 364cf49a43SJulian Elischer * 374cf49a43SJulian Elischer * Author: Archie Cobbs <archie@whistle.com> 384cf49a43SJulian Elischer * $Whistle: netgraph.h,v 1.7 1999/01/20 00:57:23 archie Exp $ 394cf49a43SJulian Elischer */ 404cf49a43SJulian Elischer 414cf49a43SJulian Elischer #ifndef _NETGRAPH_H_ 424cf49a43SJulian Elischer #define _NETGRAPH_H_ 434cf49a43SJulian Elischer 444cf49a43SJulian Elischer #include <sys/types.h> 454cf49a43SJulian Elischer #include <netgraph/ng_message.h> 464cf49a43SJulian Elischer 474cf49a43SJulian Elischer __BEGIN_DECLS 484cf49a43SJulian Elischer int NgMkSockNode(const char *, int *, int *); 496dac8ac9SKris Kennaway int NgNameNode(int, const char *, const char *, ...) __printflike(3, 4); 504cf49a43SJulian Elischer int NgSendMsg(int, const char *, int, int, const void *, size_t); 516dac8ac9SKris Kennaway int NgSendAsciiMsg(int, const char *, const char *, ...) __printflike(3, 4); 524cf49a43SJulian Elischer int NgSendReplyMsg(int, const char *, 534cf49a43SJulian Elischer const struct ng_mesg *, const void *, size_t); 544cf49a43SJulian Elischer int NgRecvMsg(int, struct ng_mesg *, size_t, char *); 55d15ff417SRuslan Ermilov int NgAllocRecvMsg(int, struct ng_mesg **, char *); 56f8307e12SArchie Cobbs int NgRecvAsciiMsg(int, struct ng_mesg *, size_t, char *); 57d15ff417SRuslan Ermilov int NgAllocRecvAsciiMsg(int, struct ng_mesg **, char *); 584cf49a43SJulian Elischer int NgSendData(int, const char *, const u_char *, size_t); 594cf49a43SJulian Elischer int NgRecvData(int, u_char *, size_t, char *); 60d15ff417SRuslan Ermilov int NgAllocRecvData(int, u_char **, char *); 614cf49a43SJulian Elischer int NgSetDebug(int); 624cf49a43SJulian Elischer void NgSetErrLog(void (*)(const char *fmt, ...), 634cf49a43SJulian Elischer void (*)(const char *fmt, ...)); 644cf49a43SJulian Elischer __END_DECLS 654cf49a43SJulian Elischer 664cf49a43SJulian Elischer #endif 674cf49a43SJulian Elischer 68