Go to the source code of this file.
Data Structures | |
| struct | MessageBuffer |
| struct | Socket |
| struct | sendq |
Defines | |
| #define | MAXLEN 2048 |
| #define | MAXREADBUFFER MAXLEN*120+5 |
| #define | SOCK_UPLINK 0x00000001 |
| #define | SOCK_DCC 0x00000002 |
| #define | SOCK_DCCCONN 0x00000004 |
| #define | SOCK_WRITE 0x00000008 |
| #define | SOCK_READ 0x00000010 |
| #define | SOCK_NOREAD 0x00000020 |
| #define | SOCK_DEAD 0x00000040 |
| #define | SOCK_CONNECTING 0x00000080 |
| #define | SOCK_DCCIN 0x00000100 |
| #define | SOCK_DCCOUT 0x00000200 |
| #define | SOCK_LISTEN 0x00000400 |
| #define | SOCK_ERR_OK 0 |
Functions | |
| Socket * | add_new_socket (void(*read)(Socket *, int), void(*write)(void *)) |
| Socket * | se_init () |
| Socket * | new_socket () |
| Socket * | find_socket (char *) |
| int | receive (Socket *) |
| int | send_line (char *,...) |
| int | handle_msg (char *) |
| int | Connect (Socket *, char *, char *, int) |
| char * | GetLine (Socket *) |
| void | socket_cleanup () |
| void | se_HandleEvent (void *) |
| struct in_addr * | GetHost (char *address) |
| char * | SendToken (char *, char *) |
| void | send_cmd (char *, char *, char *,...) |
| void | sendto_one (User *, User *, char *,...) |
| void | sendto_one_privmsg (User *, User *, char *,...) |
| void | sendto_one_notice (User *, User *, char *,...) |
| void | sendto_one_numeric (char *, User *, int, char *,...) |
| void | sendto_ircops (User *, char *,...) |
| void | sendto_channel (User *, Channel *, char *,...) |
| void | sendto_server (User *, char *,...) |
| int | sendto_socket (Socket *, char *,...) |
| void | uplink_cleanup (void *, int) |
| struct hostent * | get_hostname (char *) |
| struct addrinfo * | gethostinfo (char const *, int) |
Variables | |
| dlink_list | connected_sockets |
| dlink_list | sockets |
| time_t | rawtime |
| struct tm * | timeinfo |
| fd_set | wfdset |
| fd_set | rfdset |
| fd_set | errfdset |
| Socket * | servsock |
| dlink_list | sendq |
| #define MAXLEN 2048 |
Definition at line 6 of file socketengine.h.
Referenced by GetLine(), sock_getbyte(), and sock_readline().
| #define MAXREADBUFFER MAXLEN*120+5 |
Definition at line 7 of file socketengine.h.
Referenced by create_mod_temp().
| #define SOCK_CONNECTING 0x00000080 |
Definition at line 17 of file socketengine.h.
Referenced by receive(), and socket_flags_to_string().
| #define SOCK_DCC 0x00000002 |
Definition at line 10 of file socketengine.h.
| #define SOCK_DCCCONN 0x00000004 |
Definition at line 11 of file socketengine.h.
| #define SOCK_DCCIN 0x00000100 |
Definition at line 18 of file socketengine.h.
Referenced by receive().
| #define SOCK_DCCOUT 0x00000200 |
Definition at line 19 of file socketengine.h.
Referenced by receive().
| #define SOCK_DEAD 0x00000040 |
Definition at line 15 of file socketengine.h.
Referenced by receive(), send_line(), sendto_socket(), sock_getbyte(), sock_readline(), socket_flags_to_string(), and uplink_cleanup().
| #define SOCK_ERR_OK 0 |
Definition at line 24 of file socketengine.h.
Referenced by OneTimeAround().
| #define SOCK_LISTEN 0x00000400 |
Definition at line 21 of file socketengine.h.
Referenced by Listen(), receive(), and socket_flags_to_string().
| #define SOCK_NOREAD 0x00000020 |
Definition at line 14 of file socketengine.h.
| #define SOCK_READ 0x00000010 |
Definition at line 13 of file socketengine.h.
Referenced by Listen(), receive(), and socket_flags_to_string().
| #define SOCK_UPLINK 0x00000001 |
Definition at line 9 of file socketengine.h.
Referenced by receive(), Run(), sock_getbyte(), and socket_flags_to_string().
| #define SOCK_WRITE 0x00000008 |
Definition at line 12 of file socketengine.h.
Referenced by receive(), and socket_flags_to_string().
Definition at line 45 of file socketengine.c.
References new_socket(), Socket::read_callback, and Socket::write_callback.
Referenced by Run().
| int Connect | ( | Socket * | , | |
| char * | , | |||
| char * | , | |||
| int | ||||
| ) |
Definition at line 287 of file socketengine.c.
References CfgSettings, Socket::sd, and Conf::uplink.
Referenced by ev_connectuplink(), and Run().
| Socket* find_socket | ( | char * | ) |
Definition at line 104 of file socketengine.c.
References DLINK_FOREACH, Socket::name, and sockets.
| struct hostent* get_hostname | ( | char * | ) | [read] |
| struct in_addr* GetHost | ( | char * | address | ) | [read] |
Definition at line 441 of file socketengine.c.
| struct addrinfo* gethostinfo | ( | char const * | , | |
| int | ||||
| ) | [read] |
| char* GetLine | ( | Socket * | s | ) |
Return a pointer to our buffered lines
block loss prevention -.- some how were spitting out WAY to many blocks here
==21769== 49,428 bytes in 96 blocks are definately lost in loss record 40 of 41 ==21769== at 0x40053C0 malloc (vg_replace_malloc.c:149) ==21769== by 0x804D3FF GetLine (socketengine.c:433)
This occurse on the malloc below - Twitch
Definition at line 1034 of file socketengine.c.
References alog(), dlink_delete(), DLINK_FOREACH_SAFE, dlink_free(), Socket::fullLines, MAXLEN, Socket::mbuffer, and MessageBuffer::message.
Referenced by psr_HandleEvent().
| int handle_msg | ( | char * | ) |
| Socket* new_socket | ( | ) |
Definition at line 62 of file socketengine.c.
References Socket::connected, dlink_add_tail(), dlink_create(), Socket::error_callback, Socket::flags, Socket::fullLines, Socket::mbuffer, Socket::name, Socket::read_buffer, Socket::read_callback, Socket::sd, Socket::sendq, sockets, Socket::timeout, Socket::user, and Socket::write_callback.
Referenced by add_new_socket().
| int receive | ( | Socket * | ) |
Definition at line 449 of file socketengine.c.
References alog(), Socket::connected, connected_sockets, Socket::dead, dlink_find_delete(), DLINK_FOREACH, DLINK_FOREACH_SAFE, dlink_free(), errfdset, Socket::error_callback, EVENT_READ, Socket::flags, ident, LOG_DEBUG2, LOG_DEBUG3, maxfds, Socket::name, Socket::read_callback, rfdset, Socket::sd, servsock, SOCK_CONNECTING, SOCK_DCCIN, SOCK_DCCOUT, SOCK_DEAD, SOCK_LISTEN, SOCK_READ, sock_readline(), SOCK_UPLINK, SOCK_WRITE, socket_flags_to_string(), sockets, Socket::timeout, wfdset, and Socket::write_callback.
Referenced by OneTimeAround().
| void se_HandleEvent | ( | void * | ) |
| Socket* se_init | ( | ) |
| void send_cmd | ( | char * | source, | |
| char * | cmd, | |||
| char * | arg, | |||
| ... | ||||
| ) |
send_cmd() Sends a command from source to the server.
| u | The source of of the command if this is null we will use the servername. | |
| cmd | The command to send this takes veradic arguments | |
| arg | Aguments to the command | |
| ... | Varatic arguments for CMD |
Note this is perfered to be used because it assumes a sender and makes proper format :)
Definition at line 1235 of file socketengine.c.
References CfgSettings, send_line(), and Conf::servername.
| int send_line | ( | char * | , | |
| ... | ||||
| ) |
Definition at line 735 of file socketengine.c.
References AddTimedEvent(), alog(), ev_connectuplink(), Socket::flags, LOG_DEBUG2, LOG_ERROR, Socket::name, Socket::sd, sendq_add(), sendq_flush(), sentbytes, servsock, SOCK_DEAD, and uplink_cleanup().
Referenced by exit_one_user(), exit_user(), send_cmd(), sendto_channel(), sendto_logchan(), sendto_one(), sendto_one_notice(), sendto_one_numeric(), sendto_one_privmsg(), sendto_server(), and uplink_cleanup().
| void sendto_channel | ( | User * | , | |
| Channel * | , | |||
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1356 of file socketengine.c.
References BURSTING, IRCd, Channel::name, send_line(), sync_state, and IRCDProto::ts6.
Referenced by sendto_socket().
| void sendto_ircops | ( | User * | , | |
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1328 of file socketengine.c.
References DLINK_FOREACH, sendto_one_notice(), and userlist.
| void sendto_one | ( | User * | , | |
| User * | , | |||
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1261 of file socketengine.c.
References CfgSettings, HasId, IRCd, Conf::privmsg, send_line(), and IRCDProto::ts6.
Referenced by cmd_foo(), do_cmd(), HandleClientCmds(), help_foo_ext(), and help_m_foo().
| void sendto_one_notice | ( | User * | , | |
| User * | , | |||
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1305 of file socketengine.c.
References HasId, IRCd, send_line(), and IRCDProto::ts6.
Referenced by sendto_ircops().
| void sendto_one_numeric | ( | char * | , | |
| User * | , | |||
| int | , | |||
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1378 of file socketengine.c.
References CfgSettings, HasId, IRCd, Core::me, Link::name, Omega, Conf::protocol, send_line(), Link::sid, and IRCDProto::ts6.
| void sendto_one_privmsg | ( | User * | , | |
| User * | , | |||
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1283 of file socketengine.c.
References HasId, IRCd, send_line(), and IRCDProto::ts6.
| void sendto_server | ( | User * | , | |
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1398 of file socketengine.c.
References CfgSettings, HasId, send_line(), and Conf::servername.
| int sendto_socket | ( | Socket * | , | |
| char * | , | |||
| ... | ||||
| ) |
Definition at line 1412 of file socketengine.c.
References alog(), find_channel(), find_user(), Socket::flags, LOG_DEBUG2, LOG_ERROR, Socket::name, Socket::sd, sendq_add(), sendq_flush(), sendto_channel(), sentbytes, SOCK_DEAD, and strlcat().
| char* SendToken | ( | char * | reg, | |
| char * | tok | |||
| ) |
SendToken() - This function checks wether or not we have specified to use tokens if we have it returns the tokens if not then it returns reg
| reg | - Non token command. IE NICK | |
| tok | - Tokenized version of the command IE & return char* the correct version we are using |
Definition at line 1206 of file socketengine.c.
References UseTokens.
| void socket_cleanup | ( | ) |
Definition at line 1586 of file socketengine.c.
References dlink_delete(), DLINK_FOREACH_SAFE, dlink_free(), Socket::sd, sendq_flush(), and sockets.
Referenced by AtExit().
| void uplink_cleanup | ( | void * | , | |
| int | ||||
| ) |
Definition at line 1504 of file socketengine.c.
References CfgSettings, CONNECTING, exit_all_servs(), exit_local_users(), exit_remote_users(), Socket::flags, IRCd, Core::me, Link::name, Omega, Socket::sd, send_line(), servsock, Conf::sid, SOCK_DEAD, sync_state, IRCDProto::ts6, Link::uplink, Uplink, and uselogchan.
Referenced by AtExit(), do_restart(), ev_ping(), send_line(), and sock_getbyte().
| dlink_list connected_sockets |
Definition at line 32 of file socketengine.h.
Referenced by init_lists(), and receive().
| fd_set errfdset |
Definition at line 38 of file socketengine.h.
Referenced by receive().
| time_t rawtime |
Definition at line 35 of file socketengine.h.
| fd_set rfdset |
Definition at line 38 of file socketengine.h.
Referenced by receive().
| dlink_list sendq |
Definition at line 129 of file socketengine.h.
Definition at line 85 of file socketengine.h.
Referenced by ev_connectuplink(), ev_ping(), receive(), Run(), send_line(), and uplink_cleanup().
| dlink_list sockets |
Definition at line 33 of file socketengine.h.
Referenced by find_socket(), init_lists(), new_socket(), receive(), and socket_cleanup().
| struct tm* timeinfo |
Definition at line 36 of file socketengine.h.
| fd_set wfdset |
Definition at line 38 of file socketengine.h.
Referenced by receive().
1.6.3