00001 /* 00002 * $Id$ 00003 * 00004 * Copyright (C) 2010 iptelorg GmbH 00005 * 00006 * Permission to use, copy, modify, and distribute this software for any 00007 * purpose with or without fee is hereby granted, provided that the above 00008 * copyright notice and this permission notice appear in all copies. 00009 * 00010 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 00011 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 00012 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 00013 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 00014 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 00015 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 00016 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00017 */ 00029 /* 00030 * History: 00031 * -------- 00032 * 2010-08-18 initial version (andrei) 00033 */ 00034 00035 #ifndef __kstats_types_h 00036 #define __kstats_types_h 00037 00038 #include "counters.h" 00039 00040 /* types */ 00041 00042 typedef counter_val_t stat_val; 00043 /* stat_var is always used as a pointer in k, we missuse 00044 stat_var* for holding out counter id */ 00045 typedef void stat_var; 00046 /* get val callback 00047 * TODO: change it to counter_cbk_f compatible callback? 00048 */ 00049 typedef counter_val_t (*stat_function)(void); 00050 00051 /* statistic module interface */ 00052 struct stat_export_s { 00053 char* name; 00054 int flags; 00055 stat_var** stat_pointer; /* pointer to the memory location 00056 (where a counter handle will be stored) 00057 Note: it's a double pointer because of 00058 the original k version which needed it 00059 allocated in shm. This version 00060 will store the counter id at *stat_pointer. 00061 */ 00062 }; 00063 00064 typedef struct stat_export_s stat_export_t; 00065 00066 00067 #endif /*__kstats_types_h*/ 00068 00069 /* vi: set ts=4 sw=4 tw=79:ai:cindent: */
1.7.1