1*1eaf0ac3Slogwang /* 2*1eaf0ac3Slogwang * ng_socket.h 3*1eaf0ac3Slogwang */ 4*1eaf0ac3Slogwang 5*1eaf0ac3Slogwang /*- 6*1eaf0ac3Slogwang * Copyright (c) 1996-1999 Whistle Communications, Inc. 7*1eaf0ac3Slogwang * All rights reserved. 8*1eaf0ac3Slogwang * 9*1eaf0ac3Slogwang * Subject to the following obligations and disclaimer of warranty, use and 10*1eaf0ac3Slogwang * redistribution of this software, in source or object code forms, with or 11*1eaf0ac3Slogwang * without modifications are expressly permitted by Whistle Communications; 12*1eaf0ac3Slogwang * provided, however, that: 13*1eaf0ac3Slogwang * 1. Any and all reproductions of the source or object code must include the 14*1eaf0ac3Slogwang * copyright notice above and the following disclaimer of warranties; and 15*1eaf0ac3Slogwang * 2. No rights are granted, in any manner or form, to use Whistle 16*1eaf0ac3Slogwang * Communications, Inc. trademarks, including the mark "WHISTLE 17*1eaf0ac3Slogwang * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 18*1eaf0ac3Slogwang * such appears in the above copyright notice or in the software. 19*1eaf0ac3Slogwang * 20*1eaf0ac3Slogwang * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 21*1eaf0ac3Slogwang * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 22*1eaf0ac3Slogwang * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 23*1eaf0ac3Slogwang * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 24*1eaf0ac3Slogwang * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 25*1eaf0ac3Slogwang * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 26*1eaf0ac3Slogwang * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 27*1eaf0ac3Slogwang * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 28*1eaf0ac3Slogwang * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 29*1eaf0ac3Slogwang * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 30*1eaf0ac3Slogwang * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 31*1eaf0ac3Slogwang * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 32*1eaf0ac3Slogwang * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 33*1eaf0ac3Slogwang * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34*1eaf0ac3Slogwang * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35*1eaf0ac3Slogwang * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36*1eaf0ac3Slogwang * OF SUCH DAMAGE. 37*1eaf0ac3Slogwang * 38*1eaf0ac3Slogwang * Author: Julian Elischer <[email protected]> 39*1eaf0ac3Slogwang * 40*1eaf0ac3Slogwang * $FreeBSD$ 41*1eaf0ac3Slogwang * $Whistle: ng_socket.h,v 1.5 1999/01/20 00:22:14 archie Exp $ 42*1eaf0ac3Slogwang */ 43*1eaf0ac3Slogwang 44*1eaf0ac3Slogwang #ifndef _NETGRAPH_NG_SOCKET_H_ 45*1eaf0ac3Slogwang #define _NETGRAPH_NG_SOCKET_H_ 46*1eaf0ac3Slogwang 47*1eaf0ac3Slogwang /* Netgraph node type name and cookie */ 48*1eaf0ac3Slogwang #define NG_SOCKET_NODE_TYPE "socket" 49*1eaf0ac3Slogwang #define NGM_SOCKET_COOKIE 851601233 50*1eaf0ac3Slogwang 51*1eaf0ac3Slogwang /* Netgraph socket(2) constants */ 52*1eaf0ac3Slogwang #define NG_DATA 1 53*1eaf0ac3Slogwang #define NG_CONTROL 2 54*1eaf0ac3Slogwang 55*1eaf0ac3Slogwang /* Commands */ 56*1eaf0ac3Slogwang enum { 57*1eaf0ac3Slogwang NGM_SOCK_CMD_NOLINGER = 1, /* close the socket with last hook */ 58*1eaf0ac3Slogwang NGM_SOCK_CMD_LINGER /* Keep socket even if 0 hooks */ 59*1eaf0ac3Slogwang }; 60*1eaf0ac3Slogwang 61*1eaf0ac3Slogwang /* Netgraph version of struct sockaddr */ 62*1eaf0ac3Slogwang struct sockaddr_ng { 63*1eaf0ac3Slogwang unsigned char sg_len; /* total length */ 64*1eaf0ac3Slogwang sa_family_t sg_family; /* address family */ 65*1eaf0ac3Slogwang char sg_data[14]; /* actually longer; address value */ 66*1eaf0ac3Slogwang }; 67*1eaf0ac3Slogwang 68*1eaf0ac3Slogwang #endif /* _NETGRAPH_NG_SOCKET_H_ */ 69*1eaf0ac3Slogwang 70