Home | History | Annotate | Download | only in racoon
      1 /*	$NetBSD: evt.h,v 1.4 2006/09/09 16:22:09 manu Exp $	*/
      2 
      3 /* Id: evt.h,v 1.5 2006/01/19 10:24:09 fredsen Exp */
      4 
      5 /*
      6  * Copyright (C) 2004 Emmanuel Dreyfus
      7  * All rights reserved.
      8  *
      9  * Redistribution and use in source and binary forms, with or without
     10  * modification, are permitted provided that the following conditions
     11  * are met:
     12  * 1. Redistributions of source code must retain the above copyright
     13  *    notice, this list of conditions and the following disclaimer.
     14  * 2. Redistributions in binary form must reproduce the above copyright
     15  *    notice, this list of conditions and the following disclaimer in the
     16  *    documentation and/or other materials provided with the distribution.
     17  * 3. Neither the name of the project nor the names of its contributors
     18  *    may be used to endorse or promote products derived from this software
     19  *    without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31  * SUCH DAMAGE.
     32  */
     33 
     34 #ifndef _EVT_H
     35 #define _EVT_H
     36 
     37 struct evtdump {
     38 	size_t len;
     39 	struct sockaddr_storage src;
     40 	struct sockaddr_storage dst;
     41 	time_t timestamp;
     42 	int type;
     43 	/*
     44 	 * Optionnal list of struct isakmp_data
     45 	 * for type EVTT_ISAKMP_CFG_DONE
     46 	 */
     47 };
     48 
     49 /* type */
     50 #define EVTT_UNSEPC		0
     51 #define EVTT_PHASE1_UP		1
     52 #define EVTT_PHASE1_DOWN	2
     53 #define EVTT_XAUTH_SUCCESS	3
     54 #define EVTT_ISAKMP_CFG_DONE	4
     55 #define EVTT_PHASE2_UP		5
     56 #define EVTT_PHASE2_DOWN	6
     57 #define EVTT_DPD_TIMEOUT	7
     58 #define EVTT_PEER_NO_RESPONSE	8
     59 #define EVTT_PEER_DELETE	9
     60 #define EVTT_RACOON_QUIT	10
     61 #define EVTT_XAUTH_FAILED	11
     62 #define EVTT_OVERFLOW		12	/* Event queue overflowed */
     63 #define EVTT_PEERPH1AUTH_FAILED	13
     64 #define EVTT_PEERPH1_NOPROP	14	/* NO_PROPOSAL_CHOSEN & friends */
     65 #define EVTT_NO_ISAKMP_CFG	15	/* no need to wait for mode_cfg */
     66 
     67 struct evt {
     68 	struct evtdump *dump;
     69 	TAILQ_ENTRY(evt) next;
     70 };
     71 
     72 TAILQ_HEAD(evtlist, evt);
     73 
     74 #define EVTLIST_MAX	32
     75 
     76 #ifdef ENABLE_ADMINPORT
     77 struct evtdump *evt_pop(void);
     78 vchar_t *evt_dump(void);
     79 void evt_push(struct sockaddr *, struct sockaddr *, int, vchar_t *);
     80 #endif
     81 
     82 #ifdef ENABLE_ADMINPORT
     83 #define EVT_PUSH(src, dst, type, optdata) evt_push(src, dst, type, optdata);
     84 #else
     85 #define EVT_PUSH(src, dst, type, optdata) ;
     86 #endif
     87 
     88 #endif /* _EVT_H */
     89