|
@@ -43,6 +43,7 @@
|
|
|
|
|
|
|
|
extern struct klist_node banned_people;
|
|
extern struct klist_node banned_people;
|
|
|
extern int fd;
|
|
extern int fd;
|
|
|
|
|
+extern char usrname[];
|
|
|
|
|
|
|
|
int current_sid = 0;
|
|
int current_sid = 0;
|
|
|
|
|
|
|
@@ -263,13 +264,15 @@ int do_bh(struct vcc_request *req) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-int vcc_login(char *usrname, char *passwd) {
|
|
|
|
|
|
|
+int __login(char *usrname, char *passwd, int type) {
|
|
|
struct vcc_request req;
|
|
struct vcc_request req;
|
|
|
|
|
|
|
|
clear_req(&req);
|
|
clear_req(&req);
|
|
|
|
|
|
|
|
req.magic = htonl(VCC_MAGIC);
|
|
req.magic = htonl(VCC_MAGIC);
|
|
|
- req.reqtype = htonl(REQ_CTL_LOGIN);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /* REQ_CTL_LOGIN or REQ_CTL_IALOG */
|
|
|
|
|
+ req.reqtype = htonl(type);
|
|
|
|
|
|
|
|
strncpy(req.usrname, usrname, USRNAME_SIZE);
|
|
strncpy(req.usrname, usrname, USRNAME_SIZE);
|
|
|
strncpy(req.msg, passwd, MSG_SIZE);
|
|
strncpy(req.msg, passwd, MSG_SIZE);
|
|
@@ -279,6 +282,14 @@ int vcc_login(char *usrname, char *passwd) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+int vcc_login(char *usrname, char *passwd) {
|
|
|
|
|
+ return __login(usrname, passwd, REQ_CTL_LOGIN);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+int ia_login(char *session) {
|
|
|
|
|
+ return __login(usrname, session, REQ_CTL_IALOG);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
int vcc_login_bh(struct vcc_request *req) {
|
|
int vcc_login_bh(struct vcc_request *req) {
|
|
|
if (ntohl(req->reqtype) != REQ_CTL_LOGIN) {
|
|
if (ntohl(req->reqtype) != REQ_CTL_LOGIN) {
|