~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/vnet/vnet-module/sa_algorithm.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
25
typedef struct SADigestInfo {
 
26
    u16 icv_truncbits;
 
27
    u16 icv_fullbits;
 
28
} SADigestInfo;
 
29
 
 
30
typedef struct SACipherInfo {
 
31
    u16 blockbits;
 
32
    u16 defkeybits;
 
33
} SACipherInfo;
 
34
 
 
35
typedef struct SACompressInfo {
 
36
    u16 threshold;
 
37
} SACompressInfo;
 
38
 
 
39
typedef 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
 
 
50
extern SAAlgorithm *sa_digest_by_id(int alg_id);
 
51
extern SAAlgorithm *sa_cipher_by_id(int alg_id);
 
52
extern SAAlgorithm *sa_compress_by_id(int alg_id);
 
53
extern SAAlgorithm *sa_digest_by_name(char *name);
 
54
extern SAAlgorithm *sa_cipher_by_name(char *name);
 
55
extern SAAlgorithm *sa_compress_by_name(char *name);
 
56
extern SAAlgorithm *sa_digest_by_index(unsigned int idx);
 
57
extern SAAlgorithm *sa_cipher_by_index(unsigned int idx);
 
58
extern SAAlgorithm *sa_compress_by_index(unsigned int idx);
 
59
extern void sa_algorithm_probe_all(void);
 
60
 
 
61
#define MAX_KEY_BITS 512
 
62
 
 
63
#endif /* ! __VNET_SA_ALGORITHM_H__ */