source: trunk/packages/xen-3.1/xen-3.1/tools/vnet/vnet-module/sa_algorithm.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.9 KB
Line 
1/*
2 * Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free software Foundation, Inc.,
16 * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
17 *
18 */
19#ifndef __VNET_SA_ALGORITHM_H__
20#define __VNET_SA_ALGORITHM_H__
21
22#include <linux/types.h>
23#include <linux/pfkeyv2.h>
24
25typedef struct SADigestInfo {
26    u16 icv_truncbits;
27    u16 icv_fullbits;
28} SADigestInfo;
29
30typedef struct SACipherInfo {
31    u16 blockbits;
32    u16 defkeybits;
33} SACipherInfo;
34
35typedef struct SACompressInfo {
36    u16 threshold;
37} SACompressInfo;
38
39typedef struct SAAlgorithm {
40    char *name;
41    u8 available;
42    union {
43        SADigestInfo digest;
44        SACipherInfo cipher;
45        SACompressInfo compress;
46    } info;
47    struct sadb_alg alg;
48} SAAlgorithm;
49
50extern SAAlgorithm *sa_digest_by_id(int alg_id);
51extern SAAlgorithm *sa_cipher_by_id(int alg_id);
52extern SAAlgorithm *sa_compress_by_id(int alg_id);
53extern SAAlgorithm *sa_digest_by_name(char *name);
54extern SAAlgorithm *sa_cipher_by_name(char *name);
55extern SAAlgorithm *sa_compress_by_name(char *name);
56extern SAAlgorithm *sa_digest_by_index(unsigned int idx);
57extern SAAlgorithm *sa_cipher_by_index(unsigned int idx);
58extern SAAlgorithm *sa_compress_by_index(unsigned int idx);
59extern void sa_algorithm_probe_all(void);
60
61#define MAX_KEY_BITS 512
62
63#endif /* ! __VNET_SA_ALGORITHM_H__ */
Note: See TracBrowser for help on using the repository browser.