1238106Sdes/*
2238106Sdes * ng_socket.h
3238106Sdes */
4238106Sdes
5238106Sdes/*-
6238106Sdes * Copyright (c) 1996-1999 Whistle Communications, Inc.
7238106Sdes * All rights reserved.
8238106Sdes *
9238106Sdes * Subject to the following obligations and disclaimer of warranty, use and
10238106Sdes * redistribution of this software, in source or object code forms, with or
11238106Sdes * without modifications are expressly permitted by Whistle Communications;
12238106Sdes * provided, however, that:
13238106Sdes * 1. Any and all reproductions of the source or object code must include the
14238106Sdes *    copyright notice above and the following disclaimer of warranties; and
15238106Sdes * 2. No rights are granted, in any manner or form, to use Whistle
16238106Sdes *    Communications, Inc. trademarks, including the mark "WHISTLE
17238106Sdes *    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
18238106Sdes *    such appears in the above copyright notice or in the software.
19238106Sdes *
20238106Sdes * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
21238106Sdes * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
22238106Sdes * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
23238106Sdes * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
24269257Sdes * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
25269257Sdes * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
26269257Sdes * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
27269257Sdes * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
28269257Sdes * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
29269257Sdes * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
30269257Sdes * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
31269257Sdes * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
32269257Sdes * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33269257Sdes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34238106Sdes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35238106Sdes * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36238106Sdes * OF SUCH DAMAGE.
37238106Sdes *
38238106Sdes * Author: Julian Elischer <julian@freebsd.org>
39238106Sdes *
40238106Sdes * $FreeBSD$
41238106Sdes * $Whistle: ng_socket.h,v 1.5 1999/01/20 00:22:14 archie Exp $
42238106Sdes */
43238106Sdes
44238106Sdes#ifndef _NETGRAPH_NG_SOCKET_H_
45238106Sdes#define _NETGRAPH_NG_SOCKET_H_
46238106Sdes
47238106Sdes/* Netgraph node type name and cookie */
48238106Sdes#define	NG_SOCKET_NODE_TYPE	"socket"
49238106Sdes#define	NGM_SOCKET_COOKIE	851601233
50238106Sdes
51238106Sdes/* Netgraph socket(2) constants */
52238106Sdes#define	NG_DATA			1
53238106Sdes#define	NG_CONTROL		2
54238106Sdes
55238106Sdes/* Commands */
56238106Sdesenum {
57238106Sdes	NGM_SOCK_CMD_NOLINGER = 1,	/* close the socket with last hook */
58238106Sdes	NGM_SOCK_CMD_LINGER		/* Keep socket even if 0 hooks */
59238106Sdes};
60238106Sdes
61269257Sdes/* Netgraph version of struct sockaddr */
62269257Sdesstruct sockaddr_ng {
63238106Sdes	unsigned char	sg_len;		/* total length */
64238106Sdes	sa_family_t	sg_family;	/* address family */
65238106Sdes	char		sg_data[14];	/* actually longer; address value */
66238106Sdes};
67238106Sdes
68238106Sdes#endif /* _NETGRAPH_NG_SOCKET_H_ */
69238106Sdes
70238106Sdes