| 36 |
#include <netinet/in.h> |
#include <netinet/in.h> |
| 37 |
#include <netinet/ip.h> |
#include <netinet/ip.h> |
| 38 |
#include <arpa/inet.h> |
#include <arpa/inet.h> |
| 39 |
|
#include <libssh/libssh.h> |
| 40 |
|
#include <libssh/server.h> |
| 41 |
|
#include <libssh/callbacks.h> |
| 42 |
|
|
| 43 |
#define MENU_CONF_DELIM " \t\r\n" |
#define MENU_CONF_DELIM " \t\r\n" |
| 44 |
|
|
| 60 |
{ |
{ |
| 61 |
FILE *fp; |
FILE *fp; |
| 62 |
MENU *p_menu; |
MENU *p_menu; |
| 63 |
MENU_ITEM *p_menuitem; |
MENU_ITEM *p_menu_item; |
| 64 |
|
MENU_ITEM_ID menu_item_id; |
| 65 |
char t[256], *t1, *t2, *t3, *t4, *saveptr; |
char t[256], *t1, *t2, *t3, *t4, *saveptr; |
|
int item_count = 0; |
|
| 66 |
|
|
| 67 |
fp = fopen(file_config, "r"); |
fp = fopen(file_config, "r"); |
| 68 |
if (fp == NULL) |
if (fp == NULL) |
| 70 |
return -1; |
return -1; |
| 71 |
} |
} |
| 72 |
|
|
| 73 |
p_menu = bbsnet_menu.p_menu[0] = malloc(sizeof(MENU)); |
bbsnet_menu.p_menu_pool = calloc(1, sizeof(MENU)); |
| 74 |
|
if (bbsnet_menu.p_menu_pool == NULL) |
| 75 |
|
{ |
| 76 |
|
log_error("calloc(p_menu_pool) error\n"); |
| 77 |
|
return -3; |
| 78 |
|
} |
| 79 |
|
bbsnet_menu.menu_count = 1; |
| 80 |
|
|
| 81 |
|
bbsnet_menu.p_menu_item_pool = calloc(MAXSTATION, sizeof(MENU_ITEM)); |
| 82 |
|
if (bbsnet_menu.p_menu_item_pool == NULL) |
| 83 |
|
{ |
| 84 |
|
log_error("calloc(p_menu_item_pool) error\n"); |
| 85 |
|
return -3; |
| 86 |
|
} |
| 87 |
|
bbsnet_menu.menu_item_count = MAXSTATION; |
| 88 |
|
|
| 89 |
|
p_menu = (MENU *)get_menu_by_id(&bbsnet_menu, 0); |
| 90 |
|
|
| 91 |
strncpy(p_menu->name, "BBSNET", sizeof(p_menu->name) - 1); |
strncpy(p_menu->name, "BBSNET", sizeof(p_menu->name) - 1); |
| 92 |
p_menu->name[sizeof(p_menu->name) - 1] = '\0'; |
p_menu->name[sizeof(p_menu->name) - 1] = '\0'; |
| 93 |
p_menu->title.show = 0; |
p_menu->title.show = 0; |
| 94 |
p_menu->screen.show = 0; |
p_menu->screen_show = 0; |
| 95 |
|
|
| 96 |
while (fgets(t, 255, fp) && item_count < MAXSTATION) |
menu_item_id = 0; |
| 97 |
|
while (fgets(t, 255, fp) && menu_item_id < MAXSTATION) |
| 98 |
{ |
{ |
| 99 |
t1 = strtok_r(t, MENU_CONF_DELIM, &saveptr); |
t1 = strtok_r(t, MENU_CONF_DELIM, &saveptr); |
| 100 |
t2 = strtok_r(NULL, MENU_CONF_DELIM, &saveptr); |
t2 = strtok_r(NULL, MENU_CONF_DELIM, &saveptr); |
| 106 |
continue; |
continue; |
| 107 |
} |
} |
| 108 |
|
|
| 109 |
strncpy(bbsnet_conf[item_count].host1, t2, sizeof(bbsnet_conf[item_count].host1) - 1); |
strncpy(bbsnet_conf[menu_item_id].host1, t2, sizeof(bbsnet_conf[menu_item_id].host1) - 1); |
| 110 |
bbsnet_conf[item_count].host1[sizeof(bbsnet_conf[item_count].host1) - 1] = '\0'; |
bbsnet_conf[menu_item_id].host1[sizeof(bbsnet_conf[menu_item_id].host1) - 1] = '\0'; |
| 111 |
strncpy(bbsnet_conf[item_count].host2, t1, sizeof(bbsnet_conf[item_count].host2) - 1); |
strncpy(bbsnet_conf[menu_item_id].host2, t1, sizeof(bbsnet_conf[menu_item_id].host2) - 1); |
| 112 |
bbsnet_conf[item_count].host2[sizeof(bbsnet_conf[item_count].host2) - 1] = '\0'; |
bbsnet_conf[menu_item_id].host2[sizeof(bbsnet_conf[menu_item_id].host2) - 1] = '\0'; |
| 113 |
strncpy(bbsnet_conf[item_count].ip, t3, sizeof(bbsnet_conf[item_count].ip) - 1); |
strncpy(bbsnet_conf[menu_item_id].ip, t3, sizeof(bbsnet_conf[menu_item_id].ip) - 1); |
| 114 |
bbsnet_conf[item_count].ip[sizeof(bbsnet_conf[item_count].ip) - 1] = '\0'; |
bbsnet_conf[menu_item_id].ip[sizeof(bbsnet_conf[menu_item_id].ip) - 1] = '\0'; |
| 115 |
bbsnet_conf[item_count].port = (in_port_t)(t4 ? atoi(t4) : 23); |
bbsnet_conf[menu_item_id].port = (in_port_t)(t4 ? atoi(t4) : 23); |
|
|
|
|
p_menuitem = p_menu->items[item_count] = malloc(sizeof(MENU_ITEM)); |
|
|
p_menuitem->row = 2 + item_count / STATION_PER_LINE; |
|
|
p_menuitem->col = 5 + item_count % STATION_PER_LINE * 20; |
|
|
snprintf(p_menuitem->action, sizeof(p_menuitem->action), "%d", item_count); |
|
|
p_menuitem->submenu = 0; |
|
|
p_menuitem->priv = 0; |
|
|
p_menuitem->level = 0; |
|
|
p_menuitem->display = 0; |
|
|
p_menuitem->name[0] = |
|
|
(char)(item_count < MAXSTATION / 2 ? 'A' + item_count : 'a' + item_count); |
|
|
p_menuitem->name[1] = '\0'; |
|
|
snprintf(p_menuitem->text, sizeof(p_menuitem->text), "[1;36m%c.[m %s", |
|
|
p_menuitem->name[0], bbsnet_conf[item_count].host1); |
|
| 116 |
|
|
| 117 |
item_count++; |
p_menu_item = get_menu_item_by_id(&bbsnet_menu, menu_item_id); |
| 118 |
} |
if (p_menu_item == NULL) |
| 119 |
fclose(fp); |
{ |
| 120 |
|
log_error("get_menu_item_by_id(%d) return NULL pointer\n", menu_item_id); |
| 121 |
|
return -1; |
| 122 |
|
} |
| 123 |
|
|
| 124 |
p_menu->item_count = item_count; |
p_menu_item->row = (int16_t)(2 + menu_item_id / STATION_PER_LINE); |
| 125 |
p_menu->item_cur_pos = 0; |
p_menu_item->col = (int16_t)(5 + menu_item_id % STATION_PER_LINE * 20); |
| 126 |
|
snprintf(p_menu_item->action, sizeof(p_menu_item->action), "%d", (int16_t)menu_item_id); |
| 127 |
|
p_menu_item->submenu = 0; |
| 128 |
|
p_menu_item->priv = 0; |
| 129 |
|
p_menu_item->level = 0; |
| 130 |
|
p_menu_item->name[0] = |
| 131 |
|
(char)(menu_item_id < MAXSTATION / 2 ? 'A' + menu_item_id : 'a' + menu_item_id); |
| 132 |
|
p_menu_item->name[1] = '\0'; |
| 133 |
|
snprintf(p_menu_item->text, sizeof(p_menu_item->text), "[1;36m%c.[m %s", |
| 134 |
|
p_menu_item->name[0], bbsnet_conf[menu_item_id].host1); |
| 135 |
|
|
| 136 |
|
p_menu->items[p_menu->item_count] = menu_item_id; |
| 137 |
|
p_menu->item_count++; |
| 138 |
|
menu_item_id++; |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
bbsnet_menu.menu_item_count = (int16_t)menu_item_id; |
| 142 |
|
bbsnet_menu.menu_id_path[0] = 0; |
| 143 |
|
bbsnet_menu.menu_item_pos[0] = 0; |
| 144 |
|
bbsnet_menu.choose_step = 0; |
| 145 |
|
|
| 146 |
bbsnet_menu.menu_count = 1; |
fclose(fp); |
|
bbsnet_menu.menu_select_depth = 0; |
|
|
bbsnet_menu.p_menu_select[0] = bbsnet_menu.p_menu[0]; |
|
| 147 |
|
|
| 148 |
return 0; |
return 0; |
| 149 |
} |
} |
| 150 |
|
|
| 151 |
static void process_bar(int n, int len) |
void unload_bbsnet_conf(void) |
| 152 |
|
{ |
| 153 |
|
bbsnet_menu.menu_count = 0; |
| 154 |
|
bbsnet_menu.menu_item_count = 0; |
| 155 |
|
|
| 156 |
|
free(bbsnet_menu.p_menu_pool); |
| 157 |
|
bbsnet_menu.p_menu_pool = NULL; |
| 158 |
|
free(bbsnet_menu.p_menu_item_pool); |
| 159 |
|
bbsnet_menu.p_menu_item_pool = NULL; |
| 160 |
|
} |
| 161 |
|
|
| 162 |
|
void process_bar(int n, int len) |
| 163 |
{ |
{ |
| 164 |
char buf[LINE_BUFFER_LEN]; |
char buf[LINE_BUFFER_LEN]; |
| 165 |
char buf2[LINE_BUFFER_LEN]; |
char buf2[LINE_BUFFER_LEN]; |
| 242 |
} |
} |
| 243 |
|
|
| 244 |
sin.sin_family = AF_INET; |
sin.sin_family = AF_INET; |
| 245 |
sin.sin_addr.s_addr = (hostaddr_server[0] != '\0' ? inet_addr(hostaddr_server) : INADDR_ANY); |
sin.sin_addr.s_addr = (BBS_address[0] != '\0' ? inet_addr(BBS_address) : INADDR_ANY); |
| 246 |
sin.sin_port = 0; |
sin.sin_port = 0; |
| 247 |
|
|
| 248 |
if (bind(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) |
if (bind(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) |
| 360 |
else if (events[i].data.fd == STDIN_FILENO) |
else if (events[i].data.fd == STDIN_FILENO) |
| 361 |
{ |
{ |
| 362 |
ch = igetch(0); |
ch = igetch(0); |
| 363 |
if (ch == Ctrl('C')) |
if (ch == Ctrl('C') || ch == KEY_ESC) |
| 364 |
{ |
{ |
| 365 |
goto cleanup; |
goto cleanup; |
| 366 |
} |
} |
| 388 |
|
|
| 389 |
prints("\033[1;31m连接成功!\033[m\r\n"); |
prints("\033[1;31m连接成功!\033[m\r\n"); |
| 390 |
iflush(); |
iflush(); |
| 391 |
log_std("BBSNET connect to %s:%d\n", remote_addr, remote_port); |
log_common("BBSNET connect to %s:%d\n", remote_addr, remote_port); |
| 392 |
|
|
| 393 |
ev.events = EPOLLIN | EPOLLOUT | EPOLLET; |
ev.events = EPOLLIN | EPOLLOUT | EPOLLET; |
| 394 |
ev.data.fd = sock; |
ev.data.fd = sock; |
| 411 |
|
|
| 412 |
while (loop && !SYS_server_exit) |
while (loop && !SYS_server_exit) |
| 413 |
{ |
{ |
| 414 |
|
if (SSH_v2 && ssh_channel_is_closed(SSH_channel)) |
| 415 |
|
{ |
| 416 |
|
log_error("SSH channel is closed\n"); |
| 417 |
|
loop = 0; |
| 418 |
|
break; |
| 419 |
|
} |
| 420 |
|
|
| 421 |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |
| 422 |
|
|
| 423 |
if (nfds < 0) |
if (nfds < 0) |
| 445 |
stdin_read_wait = 1; |
stdin_read_wait = 1; |
| 446 |
while (input_buf_len < sizeof(input_buf) && !SYS_server_exit) |
while (input_buf_len < sizeof(input_buf) && !SYS_server_exit) |
| 447 |
{ |
{ |
| 448 |
ret = (int)read(STDIN_FILENO, input_buf + input_buf_len, sizeof(input_buf) - (size_t)input_buf_len); |
if (SSH_v2) |
| 449 |
|
{ |
| 450 |
|
ret = ssh_channel_read_nonblocking(SSH_channel, input_buf + input_buf_len, sizeof(input_buf) - (uint32_t)input_buf_len, 0); |
| 451 |
|
if (ret == SSH_ERROR) |
| 452 |
|
{ |
| 453 |
|
log_error("ssh_channel_read_nonblocking() error: %s\n", ssh_get_error(SSH_session)); |
| 454 |
|
loop = 0; |
| 455 |
|
break; |
| 456 |
|
} |
| 457 |
|
else if (ret == SSH_EOF) |
| 458 |
|
{ |
| 459 |
|
stdin_read_wait = 0; |
| 460 |
|
loop = 0; |
| 461 |
|
break; |
| 462 |
|
} |
| 463 |
|
else if (ret == 0) |
| 464 |
|
{ |
| 465 |
|
stdin_read_wait = 0; |
| 466 |
|
break; // Check whether channel is still open |
| 467 |
|
} |
| 468 |
|
} |
| 469 |
|
else |
| 470 |
|
{ |
| 471 |
|
ret = (int)read(STDIN_FILENO, input_buf + input_buf_len, sizeof(input_buf) - (size_t)input_buf_len); |
| 472 |
|
} |
| 473 |
if (ret < 0) |
if (ret < 0) |
| 474 |
{ |
{ |
| 475 |
if (errno == EAGAIN || errno == EWOULDBLOCK) |
if (errno == EAGAIN || errno == EWOULDBLOCK) |
| 490 |
} |
} |
| 491 |
else if (ret == 0) // broken pipe |
else if (ret == 0) // broken pipe |
| 492 |
{ |
{ |
| 493 |
log_std("read(STDIN) EOF\n"); |
log_common("read(STDIN) EOF\n"); |
| 494 |
stdin_read_wait = 0; |
stdin_read_wait = 0; |
| 495 |
loop = 0; |
loop = 0; |
| 496 |
break; |
break; |
| 530 |
} |
} |
| 531 |
else if (ret == 0) // broken pipe |
else if (ret == 0) // broken pipe |
| 532 |
{ |
{ |
| 533 |
log_std("write(socket) EOF\n"); |
log_common("write(socket) EOF\n"); |
| 534 |
sock_write_wait = 0; |
sock_write_wait = 0; |
| 535 |
loop = 0; |
loop = 0; |
| 536 |
break; |
break; |
| 575 |
} |
} |
| 576 |
else if (ret == 0) // broken pipe |
else if (ret == 0) // broken pipe |
| 577 |
{ |
{ |
| 578 |
log_std("read(socket) EOF\n"); |
log_common("read(socket) EOF\n"); |
| 579 |
sock_read_wait = 0; |
sock_read_wait = 0; |
| 580 |
loop = 0; |
loop = 0; |
| 581 |
break; |
break; |
| 593 |
stdout_write_wait = 1; |
stdout_write_wait = 1; |
| 594 |
while (output_buf_offset < output_buf_len && !SYS_server_exit) |
while (output_buf_offset < output_buf_len && !SYS_server_exit) |
| 595 |
{ |
{ |
| 596 |
ret = (int)write(STDOUT_FILENO, output_buf + output_buf_offset, (size_t)(output_buf_len - output_buf_offset)); |
if (SSH_v2) |
| 597 |
|
{ |
| 598 |
|
ret = ssh_channel_write(SSH_channel, output_buf + output_buf_offset, (uint32_t)(output_buf_len - output_buf_offset)); |
| 599 |
|
if (ret == SSH_ERROR) |
| 600 |
|
{ |
| 601 |
|
log_error("ssh_channel_write() error: %s\n", ssh_get_error(SSH_session)); |
| 602 |
|
loop = 0; |
| 603 |
|
break; |
| 604 |
|
} |
| 605 |
|
} |
| 606 |
|
else |
| 607 |
|
{ |
| 608 |
|
ret = (int)write(STDOUT_FILENO, output_buf + output_buf_offset, (size_t)(output_buf_len - output_buf_offset)); |
| 609 |
|
} |
| 610 |
if (ret < 0) |
if (ret < 0) |
| 611 |
{ |
{ |
| 612 |
if (errno == EAGAIN || errno == EWOULDBLOCK) |
if (errno == EAGAIN || errno == EWOULDBLOCK) |
| 627 |
} |
} |
| 628 |
else if (ret == 0) // broken pipe |
else if (ret == 0) // broken pipe |
| 629 |
{ |
{ |
| 630 |
log_std("write(STDOUT) EOF\n"); |
log_common("write(STDOUT) EOF\n"); |
| 631 |
stdout_write_wait = 0; |
stdout_write_wait = 0; |
| 632 |
loop = 0; |
loop = 0; |
| 633 |
break; |
break; |
| 669 |
t_used = time(0) - t_used; |
t_used = time(0) - t_used; |
| 670 |
tm_used = gmtime(&t_used); |
tm_used = gmtime(&t_used); |
| 671 |
|
|
| 672 |
log_std("BBSNET disconnect, %d days %d hours %d minutes %d seconds used\n", |
log_common("BBSNET disconnect, %d days %d hours %d minutes %d seconds used\n", |
| 673 |
tm_used->tm_mday - 1, tm_used->tm_hour, tm_used->tm_min, |
tm_used->tm_mday - 1, tm_used->tm_hour, tm_used->tm_min, |
| 674 |
tm_used->tm_sec); |
tm_used->tm_sec); |
| 675 |
|
|
| 676 |
return 0; |
return 0; |
| 677 |
} |
} |
| 701 |
return 0; |
return 0; |
| 702 |
} |
} |
| 703 |
|
|
| 704 |
int bbsnet_selchange(int new_pos) |
int bbsnet_selchange() |
| 705 |
{ |
{ |
| 706 |
|
int i = bbsnet_menu.menu_item_pos[0]; |
| 707 |
|
|
| 708 |
moveto(20, 0); |
moveto(20, 0); |
| 709 |
clrtoeol(); |
clrtoeol(); |
| 710 |
prints("|\x1b[1m单位:\x1b[1;33m%-18s\x1b[m 站名:\x1b[1;33m%s\x1b[m", |
prints("|\x1b[1m单位:\x1b[1;33m%-18s\x1b[m 站名:\x1b[1;33m%s\x1b[m", |
| 711 |
bbsnet_conf[new_pos].host2, bbsnet_conf[new_pos].host1); |
bbsnet_conf[i].host2, bbsnet_conf[i].host1); |
| 712 |
moveto(20, 79); |
moveto(20, 79); |
| 713 |
prints("|"); |
prints("|"); |
| 714 |
moveto(21, 0); |
moveto(21, 0); |
| 715 |
clrtoeol(); |
clrtoeol(); |
| 716 |
prints("|\x1b[1m连往:\x1b[1;33m%-20s", bbsnet_conf[new_pos].ip); |
prints("|\x1b[1m连往:\x1b[1;33m%-20s", bbsnet_conf[i].ip); |
| 717 |
if (bbsnet_conf[new_pos].port != 23) |
if (bbsnet_conf[i].port != 23) |
| 718 |
{ |
{ |
| 719 |
prints(" %d", bbsnet_conf[new_pos].port); |
prints(" %d", bbsnet_conf[i].port); |
| 720 |
} |
} |
| 721 |
prints("\x1b[m"); |
prints("\x1b[m"); |
| 722 |
moveto(21, 79); |
moveto(21, 79); |
| 728 |
|
|
| 729 |
int bbs_net() |
int bbs_net() |
| 730 |
{ |
{ |
| 731 |
int ch, pos, i; |
int ch, i; |
| 732 |
|
|
| 733 |
load_bbsnet_conf(CONF_BBSNET); |
load_bbsnet_conf(CONF_BBSNET); |
| 734 |
|
|
| 736 |
|
|
| 737 |
clearscr(); |
clearscr(); |
| 738 |
bbsnet_refresh(); |
bbsnet_refresh(); |
| 739 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
display_menu(&bbsnet_menu); |
| 740 |
display_menu(get_menu(&bbsnet_menu, "BBSNET")); |
bbsnet_selchange(); |
|
bbsnet_selchange(pos); |
|
| 741 |
|
|
| 742 |
while (!SYS_server_exit) |
while (!SYS_server_exit) |
| 743 |
{ |
{ |
| 744 |
ch = igetch(100); |
ch = igetch(100); |
| 745 |
switch (ch) |
switch (ch) |
| 746 |
{ |
{ |
| 747 |
case KEY_NULL: // broken pipe |
case KEY_NULL: // broken pipe |
| 748 |
|
case KEY_ESC: |
| 749 |
case Ctrl('C'): // user cancel |
case Ctrl('C'): // user cancel |
| 750 |
return 0; |
goto cleanup; |
| 751 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 752 |
if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) |
if (time(0) - BBS_last_access_tm >= MAX_DELAY_TIME) |
| 753 |
{ |
{ |
| 754 |
return 0; |
goto cleanup; |
| 755 |
} |
} |
| 756 |
continue; |
continue; |
| 757 |
case CR: |
case CR: |
| 758 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
igetch_reset(); |
| 759 |
bbsnet_connect(pos); |
bbsnet_connect(bbsnet_menu.menu_item_pos[0]); |
| 760 |
bbsnet_refresh(); |
bbsnet_refresh(); |
| 761 |
display_current_menu(&bbsnet_menu); |
display_menu(&bbsnet_menu); |
| 762 |
bbsnet_selchange(pos); |
bbsnet_selchange(); |
| 763 |
break; |
break; |
| 764 |
case KEY_UP: |
case KEY_UP: |
| 765 |
for (i = 0; i < STATION_PER_LINE; i++) |
for (i = 0; i < STATION_PER_LINE; i++) |
| 766 |
{ |
{ |
| 767 |
menu_control(&bbsnet_menu, KEY_UP); |
menu_control(&bbsnet_menu, KEY_UP); |
| 768 |
} |
} |
| 769 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
bbsnet_selchange(); |
|
bbsnet_selchange(pos); |
|
| 770 |
break; |
break; |
| 771 |
case KEY_DOWN: |
case KEY_DOWN: |
| 772 |
for (i = 0; i < STATION_PER_LINE; i++) |
for (i = 0; i < STATION_PER_LINE; i++) |
| 773 |
{ |
{ |
| 774 |
menu_control(&bbsnet_menu, KEY_DOWN); |
menu_control(&bbsnet_menu, KEY_DOWN); |
| 775 |
} |
} |
| 776 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
bbsnet_selchange(); |
|
bbsnet_selchange(pos); |
|
| 777 |
break; |
break; |
| 778 |
case KEY_LEFT: |
case KEY_LEFT: |
| 779 |
menu_control(&bbsnet_menu, KEY_UP); |
menu_control(&bbsnet_menu, KEY_UP); |
| 780 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
bbsnet_selchange(); |
|
bbsnet_selchange(pos); |
|
| 781 |
break; |
break; |
| 782 |
case KEY_RIGHT: |
case KEY_RIGHT: |
| 783 |
menu_control(&bbsnet_menu, KEY_DOWN); |
menu_control(&bbsnet_menu, KEY_DOWN); |
| 784 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
bbsnet_selchange(); |
| 785 |
bbsnet_selchange(pos); |
break; |
| 786 |
|
case KEY_HOME: |
| 787 |
|
case KEY_PGUP: |
| 788 |
|
menu_control(&bbsnet_menu, KEY_PGUP); |
| 789 |
|
bbsnet_selchange(); |
| 790 |
|
break; |
| 791 |
|
case KEY_END: |
| 792 |
|
case KEY_PGDN: |
| 793 |
|
menu_control(&bbsnet_menu, KEY_PGDN); |
| 794 |
|
bbsnet_selchange(); |
| 795 |
break; |
break; |
| 796 |
default: |
default: |
| 797 |
menu_control(&bbsnet_menu, ch); |
menu_control(&bbsnet_menu, ch); |
| 798 |
pos = bbsnet_menu.p_menu[0]->item_cur_pos; |
bbsnet_selchange(); |
|
bbsnet_selchange(pos); |
|
| 799 |
break; |
break; |
| 800 |
} |
} |
| 801 |
BBS_last_access_tm = time(0); |
BBS_last_access_tm = time(0); |
| 802 |
} |
} |
| 803 |
|
|
| 804 |
|
cleanup: |
| 805 |
|
unload_bbsnet_conf(); |
| 806 |
|
|
| 807 |
return 0; |
return 0; |
| 808 |
} |
} |