IRC_SERVER
By @hyunjunk (hyunjun2372@gmail.com)
Loading...
Searching...
No Matches
IRC Namespace Reference

Classes

class  ChannelControlBlock
 
class  ClientControlBlock
 Control block for management of a client connection and its information. More...
 
struct  MsgBlock
 Message block for managing the fixed Constants::MESSAGE_LEN_MAX size message data. More...
 
class  Server
 

Enumerations

enum  Constants {
  SVR_PASS_MIN = 4 ,
  SVR_PASS_MAX = 32 ,
  CLIENT_MAX = 65535 ,
  CLIENT_TIMEOUT = 60 ,
  KEVENT_OBSERVE_MAX = 1024 ,
  CLIENT_RESERVE_MIN = 1024 ,
  MESSAGE_LEN_MAX = 512 ,
  MAX_NICKNAME_LENGTH = 9 ,
  MAX_CHANNEL_NAME_LENGTH = 200 ,
  CRLF_LEN_2 = 2 ,
  NUM_CLIENT_MSGBLOCK_RECV_IGNORE_THRESHOLD = 8
}
 
enum  EIrcErrorCode {
  IRC_SUCCESS = 0 ,
  IRC_FAILED_UNREACHABLE_CODE = 5 ,
  IRC_SHUTDOWN = 6 ,
  IRC_INVALID_PORT = 100 ,
  IRC_PASSWORD_TOO_SHORT = 101 ,
  IRC_PASSWORD_TOO_LONG = 102 ,
  IRC_INVALID_PASSWORD = 103 ,
  IRC_FAILED_TO_CREATE_SOCKET = 200 ,
  IRC_FAILED_TO_BIND_SOCKET = 201 ,
  IRC_FAILED_TO_LISTEN_SOCKET = 202 ,
  IRC_FAILED_TO_ACCEPT_SOCKET = 203 ,
  IRC_FAILED_TO_CONNECT_SOCKET = 204 ,
  IRC_FAILED_TO_SEND_SOCKET = 205 ,
  IRC_FAILED_TO_RECV_SOCKET = 206 ,
  IRC_FAILED_TO_CLOSE_SOCKET = 207 ,
  IRC_FAILED_TO_SHUTDOWN_SOCKET = 208 ,
  IRC_FAILED_TO_SETSOCKOPT_SOCKET = 209 ,
  IRC_ERROR_LISTEN_SOCKET = 210 ,
  IRC_FAILED_TO_CREATE_KQUEUE = 300 ,
  IRC_FAILED_TO_ADD_KEVENT = 301 ,
  IRC_FAILED_TO_DEL_KEVENT = 302 ,
  IRC_FAILED_TO_WAIT_KEVENT = 303 ,
  IRC_FAILED_TO_OBSERVE_KEVENT = 304 ,
  IRC_ERROR_LISTEN_SOCKET_EVENT = 305 ,
  IRC_ERROR_CLIENT_SOCKET_EVENT = 306 ,
  IRC_ERROR_CODE_MAX
}
 Error Codes Enum. More...
 
enum  EIrcReplyCode {
  RPL_WELCOME = 001 ,
  ERR_NOSUCHNICK = 401 ,
  ERR_NOSUCHSERVER = 402 ,
  ERR_NOSUCHCHANNEL = 403 ,
  ERR_CANNOTSENDTOCHAN = 404 ,
  ERR_TOOMANYCHANNELS = 405 ,
  ERR_WASNOSUCHNICK = 406 ,
  ERR_TOOMANYTARGETS = 407 ,
  ERR_UNKNOWNCOMMAND = 421 ,
  ERR_NONICKNAMEGIVEN = 431 ,
  ERR_NICKNAMEINUSE = 433 ,
  ERR_ERRONEUSNICKNAME = 432 ,
  ERR_NOTREGISTED = 451 ,
  ERR_NEEDMOREPARAMS = 461 ,
  ERR_ALREADYREGISTRED = 462 ,
  ERR_BANNEDFROMCHAN = 474 ,
  ERR_INVITEONLYCHAN = 473 ,
  ERR_BADCHANNELKEY = 475 ,
  ERR_CHANNELISFULL = 471 ,
  ERR_BADCHANMASK = 476 ,
  ERR_UNKNOWNMODE = 472 ,
  ERR_CHANOPRIVSNEEDED = 482 ,
  ERR_NORECIPIENT = 411 ,
  ERR_NOTEXTTOSEND = 412 ,
  ERR_NOTONCHANNEL = 442 ,
  ERR_USERNOTINCHANNEL = 441 ,
  ERR_USERONCHANNEL = 443 ,
  RPL_NOTOPIC = 331 ,
  RPL_TOPIC = 332 ,
  RPL_LISTSTART = 321 ,
  RPL_LIST = 322 ,
  RPL_LISTEND = 323 ,
  RPL_NAMREPLY = 353 ,
  RPL_ENDOFNAMES = 366 ,
  RPL_CHANNELMODEIS = 324 ,
  RPL_INVITING = 341 ,
  IRC_REPLY_ENUM_MAX
}
 Enum of the IRC reply codes. More...
 

Functions

const char * GetIrcErrorMessage (const EIrcErrorCode errorCode)
 Get the error message from the error code.
 
std::string MakeReplyMsg_RPL_WELCOME (PARM_X, const std::string nickname)
 Make an IRC reply message.
 
std::string MakeReplyMsg_ERR_NOSUCHNICK (PARM_X, const std::string nickname)
 
std::string MakeReplyMsg_ERR_NOSUCHSERVER (PARM_X, const std::string server_name)
 
std::string MakeReplyMsg_ERR_NOSUCHCHANNEL (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_CANNOTSENDTOCHAN (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_TOOMANYCHANNELS (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_WASNOSUCHNICK (PARM_X, const std::string nickname)
 
std::string MakeReplyMsg_ERR_TOOMANYTARGETS (PARM_X, const std::string target)
 
std::string MakeReplyMsg_ERR_UNKNOWNCOMMAND (PARM_X, const std::string command)
 
std::string MakeReplyMsg_ERR_NONICKNAMEGIVEN (PARM_X)
 
std::string MakeReplyMsg_ERR_NICKNAMEINUSE (PARM_X, const std::string nickname)
 
std::string MakeReplyMsg_ERR_ERRONEUSNICKNAME (PARM_X, const std::string nickname)
 
std::string MakeReplyMsg_ERR_NOTREGISTED (PARM_X)
 
std::string MakeReplyMsg_ERR_NEEDMOREPARAMS (PARM_X, const std::string command)
 
std::string MakeReplyMsg_ERR_ALREADYREGISTRED (PARM_X)
 
std::string MakeReplyMsg_ERR_BANNEDFROMCHAN (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_INVITEONLYCHAN (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_BADCHANNELKEY (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_CHANNELISFULL (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_BADCHANMASK (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_UNKNOWNMODE (PARM_X, const char mode)
 
std::string MakeReplyMsg_ERR_CHANOPRIVSNEEDED (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_NORECIPIENT (PARM_X, const std::string command)
 
std::string MakeReplyMsg_ERR_NOTEXTTOSEND (PARM_X)
 
std::string MakeReplyMsg_ERR_NOTONCHANNEL (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_USERNOTINCHANNEL (PARM_X, const std::string nickname, const std::string channel_name)
 
std::string MakeReplyMsg_ERR_USERONCHANNEL (PARM_X, const std::string nickname, const std::string channel_name)
 
std::string MakeReplyMsg_RPL_NOTOPIC (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_RPL_TOPIC (PARM_X, const std::string channel_name, const std::string topic)
 
std::string MakeReplyMsg_RPL_LISTSTART (PARM_X)
 
std::string MakeReplyMsg_RPL_LIST (PARM_X, const std::string channel_name, const std::string visible_user_count, const std::string topic)
 
std::string MakeReplyMsg_RPL_LISTEND (PARM_X)
 
std::string MakeReplyMsg_RPL_NAMREPLY (PARM_X, const std::string channel_name, const std::string nicknames)
 
std::string MakeReplyMsg_RPL_ENDOFNAMES (PARM_X, const std::string channel_name)
 
std::string MakeReplyMsg_RPL_CHANNELMODEIS (PARM_X, const std::string channel_name, const std::string mode)
 
std::string MakeReplyMsg_RPL_INVITING (PARM_X, const std::string nickname, const std::string channel_name)
 

Enumeration Type Documentation

◆ Constants

Enumerator
SVR_PASS_MIN 
SVR_PASS_MAX 
CLIENT_MAX 
CLIENT_TIMEOUT 
KEVENT_OBSERVE_MAX 
CLIENT_RESERVE_MIN 
MESSAGE_LEN_MAX 
MAX_NICKNAME_LENGTH 
MAX_CHANNEL_NAME_LENGTH 
CRLF_LEN_2 
NUM_CLIENT_MSGBLOCK_RECV_IGNORE_THRESHOLD 

◆ EIrcErrorCode

Error Codes Enum.

Enumerator
IRC_SUCCESS 
IRC_FAILED_UNREACHABLE_CODE 
IRC_SHUTDOWN 
IRC_INVALID_PORT 
IRC_PASSWORD_TOO_SHORT 
IRC_PASSWORD_TOO_LONG 
IRC_INVALID_PASSWORD 
IRC_FAILED_TO_CREATE_SOCKET 
IRC_FAILED_TO_BIND_SOCKET 
IRC_FAILED_TO_LISTEN_SOCKET 
IRC_FAILED_TO_ACCEPT_SOCKET 
IRC_FAILED_TO_CONNECT_SOCKET 
IRC_FAILED_TO_SEND_SOCKET 
IRC_FAILED_TO_RECV_SOCKET 
IRC_FAILED_TO_CLOSE_SOCKET 
IRC_FAILED_TO_SHUTDOWN_SOCKET 
IRC_FAILED_TO_SETSOCKOPT_SOCKET 
IRC_ERROR_LISTEN_SOCKET 
IRC_FAILED_TO_CREATE_KQUEUE 
IRC_FAILED_TO_ADD_KEVENT 
IRC_FAILED_TO_DEL_KEVENT 
IRC_FAILED_TO_WAIT_KEVENT 
IRC_FAILED_TO_OBSERVE_KEVENT 
IRC_ERROR_LISTEN_SOCKET_EVENT 
IRC_ERROR_CLIENT_SOCKET_EVENT 
IRC_ERROR_CODE_MAX 

◆ EIrcReplyCode

Enum of the IRC reply codes.

Enumerator
RPL_WELCOME 
ERR_NOSUCHNICK 
ERR_NOSUCHSERVER 
ERR_NOSUCHCHANNEL 
ERR_CANNOTSENDTOCHAN 
ERR_TOOMANYCHANNELS 
ERR_WASNOSUCHNICK 
ERR_TOOMANYTARGETS 
ERR_UNKNOWNCOMMAND 
ERR_NONICKNAMEGIVEN 
ERR_NICKNAMEINUSE 
ERR_ERRONEUSNICKNAME 
ERR_NOTREGISTED 
ERR_NEEDMOREPARAMS 
ERR_ALREADYREGISTRED 
ERR_BANNEDFROMCHAN 
ERR_INVITEONLYCHAN 
ERR_BADCHANNELKEY 
ERR_CHANNELISFULL 
ERR_BADCHANMASK 
ERR_UNKNOWNMODE 
ERR_CHANOPRIVSNEEDED 
ERR_NORECIPIENT 
ERR_NOTEXTTOSEND 
ERR_NOTONCHANNEL 
ERR_USERNOTINCHANNEL 
ERR_USERONCHANNEL 
RPL_NOTOPIC 
RPL_TOPIC 
RPL_LISTSTART 
RPL_LIST 
RPL_LISTEND 
RPL_NAMREPLY 
RPL_ENDOFNAMES 
RPL_CHANNELMODEIS 
RPL_INVITING 
IRC_REPLY_ENUM_MAX 

Function Documentation

◆ GetIrcErrorMessage()

const char * IRC::GetIrcErrorMessage ( const EIrcErrorCode errorCode)

Get the error message from the error code.

Parameters
errorCodeError code.
Returns
const char* Error message.