1 /* 2 httperf -- a tool for measuring web server performance 3 Copyright 2000-2007 Hewlett-Packard Company 4 5 This file is part of httperf, a web server performance measurment 6 tool. 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License as 10 published by the Free Software Foundation; either version 2 of the 11 License, or (at your option) any later version. 12 13 In addition, as a special exception, the copyright holders give 14 permission to link the code of this work with the OpenSSL project's 15 "OpenSSL" library (or with modified versions of it that use the same 16 license as the "OpenSSL" library), and distribute linked combinations 17 including the two. You must obey the GNU General Public License in 18 all respects for all of the code used other than "OpenSSL". If you 19 modify this file, you may extend this exception to your version of the 20 file, but you are not obligated to do so. If you do not wish to do 21 so, delete this exception statement from your version. 22 23 This program is distributed in the hope that it will be useful, 24 but WITHOUT ANY WARRANTY; without even the implied warranty of 25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 General Public License for more details. 27 28 You should have received a copy of the GNU General Public License 29 along with this program; if not, write to the Free Software 30 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 31 02110-1301, USA 32 */ 33 34 #ifndef localevent_h 35 #define localevent_h 36 37 typedef enum Event_Type 38 { 39 EV_NULL = 0, 40 EV_PERF_SAMPLE, 41 42 EV_HOSTNAME_LOOKUP_START, 43 EV_HOSTNAME_LOOKUP_STOP, 44 45 EV_SESS_NEW, 46 EV_SESS_FAILED, 47 EV_SESS_DESTROYED, 48 49 EV_CONN_NEW, 50 EV_CONN_CONNECTING, 51 EV_CONN_CONNECTED, 52 EV_CONN_CLOSE, /* connection closed */ 53 EV_CONN_DESTROYED, 54 EV_CONN_FAILED, /* failed for reasons other than timeout */ 55 EV_CONN_TIMEOUT, 56 57 EV_CALL_NEW, 58 EV_CALL_ISSUE, 59 EV_CALL_SEND_START, 60 EV_CALL_SEND_RAW_DATA, 61 EV_CALL_SEND_STOP, 62 EV_CALL_RECV_START, 63 EV_CALL_RECV_HDR, 64 EV_CALL_RECV_RAW_DATA, 65 EV_CALL_RECV_DATA, 66 EV_CALL_RECV_FOOTER, 67 EV_CALL_RECV_STOP, 68 EV_CALL_DESTROYED, 69 70 EV_NUM_EVENT_TYPES 71 } 72 Event_Type; 73 74 typedef struct Event 75 { 76 Event_Type type; 77 Object *obj; 78 Any_Type arg; 79 } 80 Event; 81 82 typedef void (*Event_Handler) (Event_Type type, Object *obj, 83 Any_Type registration_time_arg, 84 Any_Type signal_time_arg); 85 86 extern void event_register_handler (Event_Type et, Event_Handler handler, 87 Any_Type arg); 88 extern void event_signal (Event_Type type, Object *obj, Any_Type arg); 89 90 #endif /* localevent_h */ 91