2005-11-03 08:22:10 +00:00
|
|
|
/**
|
|
|
|
* @file types.h
|
|
|
|
*
|
|
|
|
* @brief Generic type definitions
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2005 Jan Hutter, Martin Willi
|
|
|
|
* Hochschule fuer Technik Rapperswil
|
|
|
|
*
|
|
|
|
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef TYPES_H_
|
|
|
|
#define TYPES_H_
|
|
|
|
|
2005-11-17 17:22:08 +00:00
|
|
|
#include <gmp.h>
|
2005-11-10 09:12:37 +00:00
|
|
|
#include <sys/types.h>
|
2005-11-14 07:15:43 +00:00
|
|
|
#include <stdlib.h>
|
2005-11-08 08:43:33 +00:00
|
|
|
|
2005-11-17 09:05:55 +00:00
|
|
|
#include "definitions.h"
|
|
|
|
|
2005-11-03 08:22:10 +00:00
|
|
|
typedef enum status_e {
|
|
|
|
SUCCESS,
|
2005-11-03 08:56:01 +00:00
|
|
|
FAILED,
|
2005-11-03 09:46:08 +00:00
|
|
|
OUT_OF_RES,
|
2005-11-07 08:23:52 +00:00
|
|
|
ALREADY_DONE,
|
2005-11-08 12:47:44 +00:00
|
|
|
NOT_SUPPORTED,
|
|
|
|
INVALID_ARG,
|
2005-11-10 17:17:46 +00:00
|
|
|
NOT_FOUND,
|
2005-11-10 19:20:13 +00:00
|
|
|
PARSE_ERROR,
|
2005-11-16 17:20:03 +00:00
|
|
|
VERIFY_ERROR,
|
2005-11-16 16:08:44 +00:00
|
|
|
INVALID_STATE
|
2005-11-03 08:22:10 +00:00
|
|
|
} status_t;
|
|
|
|
|
2005-11-17 09:05:55 +00:00
|
|
|
extern mapping_t status_m[];
|
|
|
|
|
2005-11-08 08:43:33 +00:00
|
|
|
|
2005-11-04 13:21:25 +00:00
|
|
|
typedef struct timeval timeval_t;
|
|
|
|
|
|
|
|
typedef struct timespec timespec_t;
|
|
|
|
|
2005-11-16 16:08:44 +00:00
|
|
|
typedef struct sockaddr sockaddr_t;
|
|
|
|
|
2005-11-10 09:12:37 +00:00
|
|
|
/**
|
|
|
|
* General purpose pointer/length abstraction
|
|
|
|
*/
|
|
|
|
typedef struct chunk_s chunk_t;
|
|
|
|
struct chunk_s {
|
|
|
|
u_char *ptr;
|
|
|
|
size_t len;
|
|
|
|
};
|
|
|
|
|
2005-11-23 07:16:55 +00:00
|
|
|
extern chunk_t CHUNK_INITIALIZER;
|
|
|
|
|
2005-11-10 09:12:37 +00:00
|
|
|
/**
|
|
|
|
* General purpose boolean type
|
|
|
|
*/
|
|
|
|
typedef int bool;
|
|
|
|
#define FALSE 0
|
2005-11-11 10:29:32 +00:00
|
|
|
#define TRUE 1
|
2005-11-10 09:12:37 +00:00
|
|
|
|
|
|
|
|
2005-11-17 17:22:08 +00:00
|
|
|
|
2005-11-03 08:22:10 +00:00
|
|
|
#endif /*TYPES_H_*/
|