/* 
 * cryptint_kernel.h: header for kernel module
 * Copyright (C) 2002 Axel Burri <axel@purrly.ch>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */

#ifndef CRYPTINT_KERNEL_H
#define CRYPTINT_KERNEL_H

#include <linux/types.h>
/* TODO: this is bad (redifined here) */
#define MAX_SIG_LEN 100 /* max length of signature */


#define CRYPTINT_DATA_MAXLEN 500

struct cryptint_msg_t {
    unsigned int type;
    char data[CRYPTINT_DATA_MAXLEN];
};

#define CRYPTINT_QOS_PLAINTEXT_SIZE 10
struct cryptint_msg_qos_verify_t {
    unsigned int type;
    __u32 addr;
    __u8 qos;
    unsigned int sig_type;
    size_t sig_length;
    __u8 plain[CRYPTINT_QOS_PLAINTEXT_SIZE];
    __u8 sig[MAX_SIG_LEN];
};

struct cryptint_msg_qos_sign_t {
    unsigned int type;
    unsigned int sig_type;
    __u32 taddr;
    __u8 plain[CRYPTINT_QOS_PLAINTEXT_SIZE];
};

struct cryptint_msg_qos_sign_rep_t {
    unsigned int type;
    __u32 taddr;
    size_t sig_length;
    __u8 plain[CRYPTINT_QOS_PLAINTEXT_SIZE];
    __u8 sig[MAX_SIG_LEN];
};

struct cryptint_msg_qos_trust_t {
    unsigned int type;
    unsigned int sig_type;
    __u32 addr;
    int qos;
    int trust;
};


/* The available message types */
#define CRYPTINT_MSG_QOS_SIGN 0
#define CRYPTINT_MSG_QOS_SIGN_REP 1
#define CRYPTINT_MSG_QOS_VERIFY 2
#define CRYPTINT_MSG_QOS_TRUST 3


#endif /* CRYPTINT_KERNEL_H */
