/* * 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 */ #include "stdlib.h" #include "errors.h" char * artp_error_str(enum artp_errors error_code) { switch (error_code) { case E_GENERIC_ERROR: return "Generic error happened (no other description is provided)."; break; case E_MEMORY_FAIL: return "Memory allocation error."; break; case E_EMPTY_BUFFER: return "Buffer is empty."; break; case E_FULL_BUFFER: return "Buffer is full."; break; case E_DEAD_SESSION: return "Connection lost. Session is dead."; break; case E_START_THREADS: return "Error in starting threads."; break; case E_BUF_INIT_ERROR: return "Error in buffers' initialization."; break; case E_OPENING_FILE: return "Cannot open config file."; break; case E_SYNTAX_ERROR: return "Syntax error in config file detected."; break; case E_BAD_VALUE: return "Bad parameter's value in config file."; break; case E_INVALID_BUFFER_ID: return "Invalid buffer's identification detected."; break; case E_NO_AVAIL_SID: return "No available session ident. number for given receiver"; break; case E_NONEST_SESSION: return "Refering to non-established session!"; break; case E_SESSION_EXISTS: return "Session already exists."; break; case E_PACKET_NOT_FOUND: return "Given packet wasn't found."; break; case E_DUPLICITY_PACKET: return "Incoming packet is a duplicity."; break; case E_INVALID_OPTION: return "Badly specified option."; break; case E_INVALID_OPT_SIZE: return "Received option's size is uncorrect."; break; case E_INVALID_OPT_VALUE: return "Invalid option's value."; break; case E_BAD_OPT_USE: return "Badly specified option's using."; break; case E_SENDING_ERROR: return "Error in sending packet."; break; case E_FULL_CWND: return "Congestion window is full."; break; case E_INVALID_PARAMETER: return "Given parameter is invalid."; break; case E_BAD_PARAM_VALUE: return "Parameter's value is uncorrect."; break; case E_NO_ACK: return "No acking packet available."; break; case E_NULL_PTR: return "Given pointer points to NULL."; break; case E_UNSUPPORTED_AF: return "Unsupported address family."; break; case E_DIFF_ADDR: return "Given addresses are different."; break; case E_BAD_DGRAM: return "Given datagram is bad."; break; case E_BIG_DGRAM: return "Given datagram is too big (our partner wishes smaller one)."; break; case E_SMALL_MSS: return "Set maximum segment size is too small."; break; case E_PARTNER_MSS: return "Cannot set greater MSS than our partner wishes."; break; case E_BAD_PACKET_TYPE: return "Packet's type is invalid."; break; default: return "Badly specified error code!"; } } /* vim: set ts=4 : */