aboutsummaryrefslogtreecommitdiff
path: root/src/include/opcodes.h
blob: ff8400f2e6208a649ed84f95dc71289ff54f9a9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef OPCODES_H
#define OPCODES_H

typedef enum {
  CO_NOP,
  CO_JN, /* join */
  CO_DM,
  CO_PST, /* post */
  CO_MSG,
  CO_REG,
  CO_NCK, /* nick */
  CO_PNG, /* pong */
  CO_LVE, /* leave */
  CO_QT,  /* quit*/

  CO_CLM, /* claim channel */
  CO_DESC,  /* change description */
  CO_TRSFR, /* ownership transfer of admin */
  CO_KCK,   /* kick */
  CO_BAN,
  CO_KNGT, /* knight */
  CO_DMT, /* demote */

  CO_LOGS, /* allows users to download log file from date specified in unix time */

  CO_UNRECOGNIZED
} copcode_t;

typedef enum {
  SO_SUCCESS,
  SO_FAIL_PARSE,
  SO_FAIL_NOPERM,
  SO_FAIL_USER_TAKEN,
  SO_FAIL_RATE, /* rate limit */
  SO_PNG, /* ping */
  SO_BYE,
} sopcode_t;

char *decode_client_opcode(int op);

char *decode_server_opcode(int op);

int encode_client_opcode(char *c);

int encode_server_opcode(char *c);

#endif