#ifndef DSR_CRYPT_H
#define DSR_CRYPT_H

#include <linux/proc_fs.h>
#include <linux/skbuff.h>
#include <cryptint_kernel.h>


/* defines the maximum length of the message queue (mqueue). 
 * TODO: find reasonable value, we don't want the kernel mem full of waiting messages! */
#define MSG_QUEUE_MAXLEN 40


/* message queue */
struct dsr_mqueue_t {
    struct cryptint_msg_t *msg;
    size_t msg_length;
    struct dsr_mqueue_t *next;
};
unsigned int dsrcrypt_calc_metric(unsigned int src_qos, 
				  unsigned int src_trust, 
				  unsigned int dst_qos, 
				  unsigned int dst_trust);

__u8 dsrcrypt_get_qos();
void enqueue_msg(struct cryptint_msg_t *msg, size_t length);
struct cryptint_msg_t *dequeue_msg();

int dsrcrypt_init();
void dsrcrypt_cleanup();

int dsrcrypt_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data);
int dsrcrypt_proc_write(struct file* file, const char* buffer, unsigned long count, void* data);


#endif /* DSR_CRYPT_H */
