-/* $Id: sainfo.h,v 1.3 2004/06/11 16:00:17 ludvigm Exp $ */
+/* $NetBSD: sainfo.h,v 1.5 2006/10/03 08:01:56 vanhu Exp $ */
+
+/* Id: sainfo.h,v 1.5 2006/07/09 17:19:38 manubsd Exp */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* If idsrc == NULL, that is anonymous entry.
*/
- time_t lifetime;
- int lifebyte;
- int pfs_group; /* only use when pfs is required. */
- vchar_t *id_i; /* identifier of the authorized initiator */
- struct sainfoalg *algs[MAXALGCLASS];
+#ifdef ENABLE_HYBRID
+ vchar_t *group;
+#endif
- LIST_ENTRY(sainfo) chain;
+ time_t lifetime;
+ int lifebyte;
+ int pfs_group; /* only use when pfs is required. */
+ vchar_t *id_i; /* identifier of the authorized initiator */
+ struct sainfoalg *algs[MAXALGCLASS];
+ int dynamic; /* created through vpn control socket */
+ int in_list;
+ int refcount;
+ LIST_ENTRY(sainfo) chain;
};
/* algorithm type */
struct sainfoalg {
int alg;
- int encklen; /* key length if encryption algorithm */
+ int encklen; /* key length of encryption algorithm */
struct sainfoalg *next;
};
-extern struct sainfo *getsainfo __P((const vchar_t *,
- const vchar_t *, const vchar_t *));
-extern struct sainfo *newsainfo __P((void));
-extern void delsainfo __P((struct sainfo *));
-extern void inssainfo __P((struct sainfo *));
-extern void remsainfo __P((struct sainfo *));
-extern void flushsainfo __P((void));
-extern void initsainfo __P((void));
-extern struct sainfoalg *newsainfoalg __P((void));
-extern void delsainfoalg __P((struct sainfoalg *));
-extern void inssainfoalg __P((struct sainfoalg **, struct sainfoalg *));
-extern const char * sainfo2str __P((const struct sainfo *));
+extern struct sainfo *getsainfo (const vchar_t *,
+ const vchar_t *, const vchar_t *, int);
+extern struct sainfo *getsainfo_by_dst_id (const vchar_t *, const vchar_t *);
+extern struct sainfo *create_sainfo (void);
+extern void delsainfo (struct sainfo *);
+extern void inssainfo (struct sainfo *);
+extern void remsainfo (struct sainfo *);
+void retain_sainfo(struct sainfo *si);
+void release_sainfo(struct sainfo *si);
+extern void flushsainfo (void);
+extern void flushsainfo_dynamic (u_int32_t);
+extern void initsainfo (void);
+extern struct sainfoalg *newsainfoalg (void);
+extern void delsainfoalg (struct sainfoalg *);
+extern void inssainfoalg (struct sainfoalg **, struct sainfoalg *);
+extern const char * sainfo2str (const struct sainfo *);
#endif /* _SAINFO_H */