OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / klips / net / ipsec / ipsec_proto.h
1 /*
2  * @(#) prototypes for FreeSWAN functions 
3  *
4  * Copyright (C) 2001  Richard Guy Briggs  <rgb@freeswan.org>
5  *                 and Michael Richardson  <mcr@freeswan.org>
6  * 
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 2 of the License, or (at your
10  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
11  * 
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * for more details.
16  *
17  * RCSID $Id: ipsec_proto.h,v 1.2 2001/11/26 09:16:15 rgb Exp $
18  *
19  */
20
21 #ifndef _IPSEC_PROTO_H_
22
23 #include "ipsec_param.h"
24
25 /* 
26  * This file is a kernel only file that declares prototypes for
27  * all intra-module function calls and global data structures.
28  *
29  * Include this file last.
30  *
31  */
32
33 /* ipsec_sa.c */
34 extern struct ipsec_sa *ipsec_sadb_hash[SADB_HASHMOD];
35 extern spinlock_t       tdb_lock;
36 extern int ipsec_sadb_init(void);
37
38 extern struct ipsec_sa *ipsec_sa_getbyid(struct sa_id*);
39 extern /* void */ int ipsec_sa_del(struct ipsec_sa *);
40 extern /* void */ int ipsec_sa_delchain(struct ipsec_sa *);
41 extern /* void */ int ipsec_sa_put(struct ipsec_sa *);
42
43 extern int ipsec_sa_init(struct ipsec_sa *, struct encap_msghdr *);
44 extern int ipsec_sadb_cleanup(__u8);
45 extern int ipsec_sa_wipe(struct ipsec_sa *);
46
47 /* debug declarations */
48
49 /* ipsec_proc.c */
50 extern int  ipsec_proc_init(void);
51 extern void ipsec_proc_cleanup(void);
52
53 /* ipsec_radij.c */
54 extern int ipsec_makeroute(struct sockaddr_encap *ea,
55                            struct sockaddr_encap *em,
56                            struct sa_id said,
57                            uint32_t pid,
58                            struct sk_buff *skb,
59                            struct ident *ident_s,
60                            struct ident *ident_d);
61
62 extern int ipsec_breakroute(struct sockaddr_encap *ea,
63                             struct sockaddr_encap *em,
64                             struct sk_buff **first,
65                             struct sk_buff **last);
66
67 int ipsec_radijinit(void);
68 int ipsec_cleareroutes(void);
69 int ipsec_radijcleanup(void);
70
71 /* ipsec_life.c */
72 extern enum ipsec_life_alive ipsec_lifetime_check(struct ipsec_lifetime64 *il64,
73                                                   const char *lifename,
74                                                   const char *saname,
75                                                   enum ipsec_life_type ilt,
76                                                   enum ipsec_direction idir,
77                                                   struct ipsec_sa *ips);
78
79
80 extern int ipsec_lifetime_format(char *buffer,
81                                  int   buflen,
82                                  char *lifename,
83                                  enum ipsec_life_type timebaselife,
84                                  struct ipsec_lifetime64 *lifetime);
85
86 extern void ipsec_lifetime_update_hard(struct ipsec_lifetime64 *lifetime,
87                                        __u64 newvalue);
88
89 extern void ipsec_lifetime_update_soft(struct ipsec_lifetime64 *lifetime,
90                                        __u64 newvalue);
91
92
93
94
95 #ifdef CONFIG_IPSEC_DEBUG
96
97 extern int debug_xform;
98 extern int debug_eroute;
99 extern int debug_spi;
100
101 #endif /* CONFIG_IPSEC_DEBUG */
102
103
104
105
106 #define _IPSEC_PROTO_H
107 #endif /* _IPSEC_PROTO_H_ */
108
109 /*
110  * $Log: ipsec_proto.h,v $
111  * Revision 1.2  2001/11/26 09:16:15  rgb
112  * Merge MCR's ipsec_sa, eroute, proc and struct lifetime changes.
113  *
114  * Revision 1.1.2.1  2001/09/25 02:21:01  mcr
115  *      ipsec_proto.h created to keep prototypes rather than deal with
116  *      cyclic dependancies of structures and prototypes in .h files.
117  *
118  *
119  *
120  * Local variables:
121  * c-file-style: "linux"
122  * End:
123  *
124  */
125