| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- /* vccd/include/vcc/vccd.h
- *
- * This file is part of vccd.
- *
- * vccd is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * vccd is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with vccd. If not, see <https://www.gnu.org/licenses/>
- */
- #ifndef __VCC_VCCD_H
- #define __VCC_VCCD_H
- #include <stdio.h>
- #include <arpa/inet.h>
- #include <vcc/vcc.h>
- #include <sys/times.h>
- #include <klist.h>
- #define vcc_log(msg, ...) fprintf(stderr, "[%ld] " msg, times(NULL), ##__VA_ARGS__)
- int vcc_new_connection(int fd, struct in_addr *addr);
- int vcc_close_connection(int fd);
- int vcc_write_packages(int fd);
- int vcc_new_msg(int fd, struct vcc_request *buf);
- int vcc_send_req(struct klist_node *, void *);
- int vcc_message_broadcast(char *msg, char *usr, int except_fd);
- int do_user_login(int fd, struct vcc_request *buf);
- int do_user_logout(int fd);
- struct klist_node *find_connection(int fd);
- #define LJEST_LEVEL 16
- #define NBEST_LEVEL 0
- #define MIN_LEVEL LJEST_LEVEL
- #define BEST_LEVEL NBEST_LEVEL
- struct user {
- /* they're interesting, aren't them? :-) */
- int score;
- int level;
- char username[USRNAME_SIZE];
- char passwd[PASSWD_SIZE];
- }
- /* we don't need __attribute__((packed)), this struct is local.*/
- ;
- #endif
|