#include <stdio.h>#include <string.h>#include <stdint.h>#include <errno.h>#include <unistd.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/stat.h>#include <fcntl.h>#include <pwd.h>#include <sys/utsname.h>#include <ekg/commands.h>#include <ekg/debug.h>#include <ekg/dynstuff.h>#include <ekg/plugins.h>#include <ekg/protocol.h>#include <ekg/recode.h>#include <ekg/sessions.h>#include <ekg/stuff.h>#include <ekg/themes.h>#include <ekg/queries.h>#include <ekg/userlist.h>#include <ekg/vars.h>#include <ekg/windows.h>#include <ekg/xmalloc.h>#include "compat/strlcpy.h"#include "rivchat.h"Struktury danych | |
| struct | rivchat_private_t |
| struct | rivchat_userlist_private_t |
| struct | rivchat_place_t |
Definicje | |
| #define | _BSD_SOURCE 1 |
| #define | DEFQUITMSG "EKG2 - It's better than sex!" |
| #define | SGQUITMSG(x) session_get(x, "QUIT_MSG") |
| #define | QUITMSG(x) (SGQUITMSG(x)?SGQUITMSG(x):DEFQUITMSG) |
| #define | rivchat_fix32(x) x |
| #define | rivchat_userlist_priv_get(u) ((rivchat_userlist_private_t *) userlist_private_get(&rivchat_plugin, u)) |
| #define | MAX_BYTES_PER_LINE 16 |
| #define | RIVCHAT_VAR_HOSTNAME 3 |
| #define | RIVCHAT_VAR_NICKNAME 5 |
| #define | RIVCHAT_VAR_USERNAME 7 |
| #define | RIVCHAT_ONLY SESSION_MUSTBELONG | SESSION_MUSTHASPRIVATE |
| #define | RIVCHAT_FLAGS RIVCHAT_ONLY | SESSION_MUSTBECONNECTED |
Funkcje | |
| static int | rivchat_theme_init () |
| PLUGIN_DEFINE (rivchat, PLUGIN_PROTOCOL, rivchat_theme_init) | |
| static int | rivchat_send_packet (session_t *s, uint32_t type, userlist_t *user, const char *buf, size_t buflen) |
| static int | rivchat_send_packet_string (session_t *s, uint32_t type, userlist_t *user, const char *str) |
| static int | rivchat_validate_uid (void *data, va_list ap) |
| static int | rivchat_session_init (void *data, va_list ap) |
| static int | rivchat_session_deinit (void *data, va_list ap) |
| static int | rivchat_print_version (void *data, va_list ap) |
| static int | rivchat_userlist_info_handle (void *data, va_list ap) |
| static int | rivchat_userlist_priv_handler (void *data, va_list ap) |
| static int | rivchat_topic_header (void *data, va_list ap) |
| static void | rivchat_print_payload (unsigned char *payload, size_t len) |
| static char * | rivchat_packet_name (int type) |
| static char * | rivchat_make_window (unsigned int port) |
| static char * | rivchat_make_formatname (int type, int is_our, int is_priv) |
| static userlist_t * | rivchat_find_user (session_t *s, const char *target) |
| static void | rivchat_dcc_close (struct dcc_s *dcc) |
| static void | memncpy (char *dest, const char *src, size_t len) |
| static char * | rivchat_generate_data (session_t *s) |
| static void | rivchat_parse_packet (session_t *s, rivchat_header_t *_hdr, const char *ip) |
| static int | rivchat_handle_stream (int type, int fd, watch_type_t watch, session_t *s) |
| static int | rivchat_pingpong (int type, session_t *s) |
| static int | rivchat_command_connect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_disconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_reconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_inline_msg (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_me (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_nick (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_topic (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_command_dcc (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static int | rivchat_places_sort (rivchat_place_t *data1, rivchat_place_t *data2) |
| static int | rivchat_command_places (const char *name, const char **params, session_t *session, const char *target, int quiet) |
| static void | rivchat_changed_nick (session_t *s, const char *var) |
| static void | rivchat_notify_reconnect (session_t *s, const char *var) |
| static void | rivchat_resend_ping (session_t *s, const char *var) |
| EXPORT int | rivchat_plugin_init (int prio) |
| static int | rivchat_plugin_destroy () |
Zmienne | |
| static plugins_params_t | rivchat_plugin_vars [] |
| #define _BSD_SOURCE 1 |
| #define DEFQUITMSG "EKG2 - It's better than sex!" |
| #define MAX_BYTES_PER_LINE 16 |
| #define QUITMSG | ( | x | ) | (SGQUITMSG(x)?SGQUITMSG(x):DEFQUITMSG) |
| #define rivchat_fix32 | ( | x | ) | x |
| #define RIVCHAT_FLAGS RIVCHAT_ONLY | SESSION_MUSTBECONNECTED |
| #define RIVCHAT_ONLY SESSION_MUSTBELONG | SESSION_MUSTHASPRIVATE |
| #define rivchat_userlist_priv_get | ( | u | ) | ((rivchat_userlist_private_t *) userlist_private_get(&rivchat_plugin, u)) |
| #define RIVCHAT_VAR_HOSTNAME 3 |
| #define RIVCHAT_VAR_NICKNAME 5 |
| #define RIVCHAT_VAR_USERNAME 7 |
| #define SGQUITMSG | ( | x | ) | session_get(x, "QUIT_MSG") |
| static void memncpy | ( | char * | dest, | |
| const char * | src, | |||
| size_t | len | |||
| ) | [static] |
| PLUGIN_DEFINE | ( | rivchat | , | |
| PLUGIN_PROTOCOL | , | |||
| rivchat_theme_init | ||||
| ) |
| static void rivchat_changed_nick | ( | session_t * | s, | |
| const char * | var | |||
| ) | [static] |
| static int rivchat_command_connect | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_dcc | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_disconnect | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_inline_msg | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_me | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_nick | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_places | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_reconnect | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static int rivchat_command_topic | ( | const char * | name, | |
| const char ** | params, | |||
| session_t * | session, | |||
| const char * | target, | |||
| int | quiet | |||
| ) | [static] |
| static void rivchat_dcc_close | ( | struct dcc_s * | dcc | ) | [static] |
| static userlist_t* rivchat_find_user | ( | session_t * | s, | |
| const char * | target | |||
| ) | [static] |
| static char* rivchat_generate_data | ( | session_t * | s | ) | [static] |
| static int rivchat_handle_stream | ( | int | type, | |
| int | fd, | |||
| watch_type_t | watch, | |||
| session_t * | s | |||
| ) | [static] |
| static char* rivchat_make_formatname | ( | int | type, | |
| int | is_our, | |||
| int | is_priv | |||
| ) | [static] |
| static char* rivchat_make_window | ( | unsigned int | port | ) | [static] |
| static void rivchat_notify_reconnect | ( | session_t * | s, | |
| const char * | var | |||
| ) | [static] |
| static char* rivchat_packet_name | ( | int | type | ) | [static] |
| static void rivchat_parse_packet | ( | session_t * | s, | |
| rivchat_header_t * | _hdr, | |||
| const char * | ip | |||
| ) | [static] |
| static int rivchat_pingpong | ( | int | type, | |
| session_t * | s | |||
| ) | [static] |
| static int rivchat_places_sort | ( | rivchat_place_t * | data1, | |
| rivchat_place_t * | data2 | |||
| ) | [static] |
| static int rivchat_plugin_destroy | ( | ) | [static] |
| EXPORT int rivchat_plugin_init | ( | int | prio | ) |
| static void rivchat_print_payload | ( | unsigned char * | payload, | |
| size_t | len | |||
| ) | [static] |
| static int rivchat_print_version | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
| static void rivchat_resend_ping | ( | session_t * | s, | |
| const char * | var | |||
| ) | [static] |
| static int rivchat_send_packet | ( | session_t * | s, | |
| uint32_t | type, | |||
| userlist_t * | user, | |||
| const char * | buf, | |||
| size_t | buflen | |||
| ) | [static] |
| static int rivchat_send_packet_string | ( | session_t * | s, | |
| uint32_t | type, | |||
| userlist_t * | user, | |||
| const char * | str | |||
| ) | [static] |
| static int rivchat_session_deinit | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
| static int rivchat_session_init | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
| static int rivchat_theme_init | ( | ) | [static] |
| static int rivchat_topic_header | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
| static int rivchat_userlist_info_handle | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
| static int rivchat_userlist_priv_handler | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
| static int rivchat_validate_uid | ( | void * | data, | |
| va_list | ap | |||
| ) | [static] |
plugins_params_t rivchat_plugin_vars[] [static] |
{
PLUGIN_VAR_ADD("alias", VAR_STR, NULL, 0, NULL),
PLUGIN_VAR_ADD("auto_connect", VAR_BOOL, "0", 0, NULL),
PLUGIN_VAR_ADD("auto_reconnect", VAR_INT, "0", 0, NULL),
#define RIVCHAT_VAR_HOSTNAME
PLUGIN_VAR_ADD("hostname", VAR_STR, NULL, 0, rivchat_resend_ping),
PLUGIN_VAR_ADD("log_formats", VAR_STR, "irssi", 0, NULL),
#define RIVCHAT_VAR_NICKNAME
PLUGIN_VAR_ADD("nickname", VAR_STR, NULL, 0, rivchat_changed_nick),
PLUGIN_VAR_ADD("port", VAR_STR, "16127", 0, rivchat_notify_reconnect),
#define RIVCHAT_VAR_USERNAME
PLUGIN_VAR_ADD("username", VAR_STR, NULL, 0, rivchat_resend_ping),
PLUGIN_VAR_ADD("VERSION_NAME", VAR_STR, 0, 0, rivchat_resend_ping),
PLUGIN_VAR_ADD("VERSION_NO", VAR_STR, 0, 0, rivchat_resend_ping),
PLUGIN_VAR_ADD("VERSION_SYS", VAR_STR, 0, 0, rivchat_resend_ping),
}
1.7.1