add UNLEASHED_OBJ to unleashed.mk
[unleashed.git] / include / inet / ipp_common.h
blobd7380896b6899760c4c5e7c63658ecada2a3414f
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _INET_IPP_COMMON_H
27 #define _INET_IPP_COMMON_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 #ifdef _KERNEL
34 #include <ipp/ipp.h>
37 * IPP -- IP Policy -- interface.
39 * WARNING: Everything in this file is private, belonging to the IPP
40 * subsystem. The interfaces and declarations made here are subject
41 * to change.
44 extern uint32_t ipp_action_count;
46 /* Whether ip policy is enabled at callout position proc */
47 #define IPP_ENABLED(proc, ipst) ((ipp_action_count != 0) && \
48 (~((ipst)->ips_ip_policy_mask) & (proc)))
50 /* Extracts 8 bit traffic class from IPV6 flow label field */
51 #ifdef _BIG_ENDIAN
52 #define __IPV6_TCLASS_FROM_FLOW(n) (((n)>>20) & 0xff)
53 #else
54 #define __IPV6_TCLASS_FROM_FLOW(n) ((((n)<<4) | (((n)>>12) & 0xf)) & 0xff)
55 #endif /* _BIG_ENDIAN */
57 typedef enum {
58 IPP_LOCAL_IN = 0x01,
59 IPP_LOCAL_OUT = 0x02,
60 IPP_FWD_IN = 0x04,
61 IPP_FWD_OUT = 0x08
62 } ip_proc_t;
64 /* IP private data structure */
65 typedef struct ip_priv {
66 ip_proc_t proc;
67 uint32_t ill_index;
68 } ip_priv_t;
70 /* The entry point for ip policy processing */
71 #ifdef ILL_CONDEMNED
72 extern mblk_t *ip_process(ip_proc_t, mblk_t *, ill_t *, ill_t *);
73 #endif
74 extern void ip_priv_free(void *);
75 #endif /* _KERNEL */
78 #ifdef __cplusplus
80 #endif
82 #endif /* _INET_IPP_COMMON_H */