ng_socket.h revision 52885
188757Sache
288759Sache/*
388759Sache * ng_socket.h
488759Sache *
588759Sache * Copyright (c) 1996-1999 Whistle Communications, Inc.
688759Sache * All rights reserved.
788759Sache *
888759Sache * Subject to the following obligations and disclaimer of warranty, use and
988757Sache * redistribution of this software, in source or object code forms, with or
1088757Sache * without modifications are expressly permitted by Whistle Communications;
1188757Sache * provided, however, that:
1288757Sache * 1. Any and all reproductions of the source or object code must include the
1388757Sache *    copyright notice above and the following disclaimer of warranties; and
1488757Sache * 2. No rights are granted, in any manner or form, to use Whistle
1588757Sache *    Communications, Inc. trademarks, including the mark "WHISTLE
1688757Sache *    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
1788757Sache *    such appears in the above copyright notice or in the software.
1888757Sache *
1988757Sache * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
2088757Sache * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
2188757Sache * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
2288757Sache * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
2388757Sache * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
2488757Sache * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
2588759Sache * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
2688759Sache * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
2788759Sache * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
2888759Sache * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
2988759Sache * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
3088759Sache * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
3188759Sache * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
3288757Sache * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3388757Sache * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3488757Sache * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
3588757Sache * OF SUCH DAMAGE.
3688757Sache *
3788757Sache * Author: Julian Elischer <julian@whistle.com>
3888757Sache *
3988757Sache * $FreeBSD: head/sys/netgraph/ng_socket.h 52885 1999-11-05 02:18:08Z julian $
4088757Sache * $Whistle: ng_socket.h,v 1.5 1999/01/20 00:22:14 archie Exp $
4188757Sache */
4288757Sache
4388757Sache#ifndef _NETGRAPH_NG_SOCKET_H_
4488757Sache#define _NETGRAPH_NG_SOCKET_H_ 1
4588757Sache
4688757Sache/* Netgraph node type name and cookie */
4788757Sache#define	NG_SOCKET_NODE_TYPE	"socket"
4888759Sache#define	NGM_SOCKET_COOKIE	851601233
4988757Sache
5088757Sache/* Netgraph socket(2) constants */
51#define	NG_DATA			1
52#define	NG_CONTROL		2
53
54/* Commands */
55enum {
56	NGM_SOCK_CMD_NOLINGER = 1,	/* close the soket on with last hook */
57	NGM_SOCK_CMD_LINGER		/* Keep socket even if 0 hooks */
58};
59
60
61
62/* Netgraph version of struct sockaddr */
63struct sockaddr_ng {
64	u_char  sg_len;		/* total length */
65	u_char  sg_family;	/* address family */
66	char    sg_data[14];	/* actually longer; address value */
67};
68
69#endif /* _NETGRAPH_NG_SOCKET_H_ */
70
71