[BACK]Return to cache.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / systat

Annotation of src/usr.bin/systat/cache.h, Revision 1.1

1.1     ! canacar     1: /* $Id: cache.h,v 1.5 2008/06/12 01:19:47 canacar Exp $ */
        !             2: /*
        !             3:  * Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
        !             4:  *
        !             5:  * Permission to use, copy, modify, and distribute this software for any
        !             6:  * purpose with or without fee is hereby granted, provided that the above
        !             7:  * copyright notice and this permission notice appear in all copies.
        !             8:  *
        !             9:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
        !            10:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
        !            11:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
        !            12:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
        !            13:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
        !            14:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
        !            15:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
        !            16:  */
        !            17:
        !            18: #ifndef _CACHE_H_
        !            19: #define _CACHE_H_
        !            20:
        !            21: #include "config.h"
        !            22:
        !            23: #include <sys/queue.h>
        !            24: #ifdef HAVE_TREE_H
        !            25: #include <sys/tree.h>
        !            26: #else
        !            27: #include "tree.h"
        !            28: #endif
        !            29:
        !            30:
        !            31: struct sc_ent {
        !            32:         RB_ENTRY(sc_ent)    tlink;
        !            33:        TAILQ_ENTRY(sc_ent) qlink;
        !            34: #ifdef HAVE_PFSYNC_STATE
        !            35:        u_int32_t           id[2];
        !            36: #else
        !            37:        struct pf_addr      addr[2];
        !            38: #endif
        !            39:        double              peak;
        !            40:        double              rate;
        !            41:        time_t              t;
        !            42:        u_int32_t           bytes;
        !            43: #ifndef HAVE_PFSYNC_STATE
        !            44:         u_int16_t           port[2];
        !            45:         u_int8_t            af;
        !            46:         u_int8_t            proto;
        !            47: #endif
        !            48: };
        !            49:
        !            50: int cache_init(int);
        !            51: void cache_endupdate(void);
        !            52: struct sc_ent *cache_state(pf_state_t *);
        !            53: extern int cache_max, cache_size;
        !            54:
        !            55:
        !            56: #endif