flowacct_impl.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _IPP_FLOWACCT_FLOWACCT_IMPL_H
#define _IPP_FLOWACCT_FLOWACCT_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <inet/ipp_common.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Header file for implementation of flowacct */
#ifdef _KERNEL
#define _FLOWACCT_DEBUG
#ifdef _FLOWACCT_DEBUG
#define flowacct0dbg(a) printf a
#else
#define flowacct0dbg(a) /* */
#define flowacct1dbg(a) /* */
#define flowacct2dbg(a) /* */
#endif /* _FLOWACCT_DEBUG */
#define FLOWACCT_PURGE_FLOW 0x01
#define FLOWACCT_FLOW_TIMER 0x02
#define FLOWACCT_JUST_ONE 0x03
/* Flow Table Size */
/* To identify objects in the list - could be a flow or an item */
#define FLOWACCT_FLOW 0x01
#define FLOWACCT_ITEM 0x02
/* Whether an object has to be physically removed from the table */
#define FLOWACCT_DEL_OBJ 0x01
#define FLOWACCT_MSEC_TO_USEC (1000)
#define FLOWACCT_MSEC_TO_NSEC (1000000)
/*
* Default values for timer and timeout - taken from SBM
* timer 15 secs (15000 msec) and timeout 60 secs (60000 msec).
*/
#define FLOWACCT_DEF_TIMER (15000)
#define FLOWACCT_DEF_TIMEOUT (60000)
/* List holding an obj - flow or item */
typedef struct list_hdr_s {
struct list_hdr_s *next;
struct list_hdr_s *prev;
struct list_hdr_s *timeout_next;
struct list_hdr_s *timeout_prev;
void *objp;
} list_hdr_t;
/* List of list of flows */
typedef struct list_head_s {
} list_head_t;
/* Global stats for flowacct */
typedef struct flowacct_stat_s {
#define FLOWACCT_STATS_COUNT 6
#define FLOWACCT_STATS_STRING "Flowacct statistics"
/* Item common to a flow (identified by 5-tuple) */
typedef struct flow_item_s {
} flow_item_t;
/* Flow attributes */
typedef struct flow_s {
} flow_t;
/* From the IP header */
typedef struct header {
uint16_t ident;
} header_t;
typedef struct flowacct_data_s {
char *act_name; /* action name of next action */
/* TRhe flow table. We'll use the last bucket for timeout purposes */
#define FLOWACCT_DATA_SZ sizeof (flowacct_data_t)
#define FLOWACCT_HDR_SZ sizeof (list_hdr_t)
#define FLOWACCT_HEAD_SZ sizeof (list_head_t)
#define FLOWACCT_FLOW_SZ sizeof (flow_t)
#define FLOWACCT_ITEM_SZ sizeof (flow_item_t)
#define FLOWACCT_HEADER_SZ sizeof (header_t)
extern void flowacct_timer(int, flowacct_data_t *);
extern void flowacct_timeout_flows(void *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _IPP_FLOWACCT_FLOWACCT_IMPL_H */