/* * Active Router Transport Protocol (ARTP) implementation * Copyright (c) 2004, Tomas Rebok * All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the "BSD License" which is * distributed with the software in the file LICENSE. * * 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 BSD * License for more details. */ /** @file * @c ARTP possible error codes. * @author Tomas Rebok * @date 2004 */ #ifndef ARTP_ERRORS_H #define ARTP_ERRORS_H 1 /** Enumeration of possible @c ARTP functions error codes */ enum artp_errors { /** Generic error (not specified) */ E_GENERIC_ERROR = -1, /** Memory error (error in allocation or something else */ E_MEMORY_FAIL = -2, /** Empty buffer */ E_EMPTY_BUFFER = -3, /** Full buffer */ E_FULL_BUFFER = -4, /** Session is dead (connection lost) */ E_DEAD_SESSION = -5, /** Error in starting @c ARTP necessary threads */ E_START_THREADS = -6, /** Error in buffer initialization */ E_BUF_INIT_ERROR = -7, /** Error in opening config file */ E_OPENING_FILE = -8, /** Syntax error in config file */ E_SYNTAX_ERROR = -9, /** Bad value in config file */ E_BAD_VALUE = -10, /** Invalid buffer identification number */ E_INVALID_BUFFER_ID = -11, /** There's no available session identification for that receiver */ E_NO_AVAIL_SID = -12, /** Refering to non-established session */ E_NONEST_SESSION = -13, /** Wanted session already exists */ E_SESSION_EXISTS = -14, /** Refering packet wasn't found */ E_PACKET_NOT_FOUND = -15, /** Duplicity packet */ E_DUPLICITY_PACKET = -16, /** Invalid option */ E_INVALID_OPTION = -17, /** Invalid option size */ E_INVALID_OPT_SIZE = -18, /** Invalid option value */ E_INVALID_OPT_VALUE = -19, /** Badly specified option using */ E_BAD_OPT_USE = -20, /** Error in packet sending */ E_SENDING_ERROR = -21, /** Full congestion window */ E_FULL_CWND = -22, /** Invalid parameter */ E_INVALID_PARAMETER = -23, /** Invalid parameter value */ E_BAD_PARAM_VALUE = -24, /** No acknowledgement packet to send */ E_NO_ACK = -25, /** Given pointer points to NULL */ E_NULL_PTR = -26, /** Unsupported address family */ E_UNSUPPORTED_AF = -27, /** Different addresses */ E_DIFF_ADDR = -28, /** Given datagram is bad */ E_BAD_DGRAM = -29, /** Given datagram is too big */ E_BIG_DGRAM = -30, /** Set MSS is too small - packet cannot be sent */ E_SMALL_MSS = -31, /** Our partner wishes smaller MSS than we want */ E_PARTNER_MSS = -32, /** Badly specified packet type */ E_BAD_PACKET_TYPE = -33 }; /** Returns string describing given error. * This function finds out relevant description for given ARTP error code and * returns it as a string. * * @param error_code * relevant error code * * @return NULL * given error code is bad * * @return string * error description */ extern char * artp_error_str(enum artp_errors error_code); #endif /* vim: set ts=4 : */