comparison rvinterf/lowlevel/clientcmd.c @ 185:ec040f521cc2

rvinterf works after fixing max_fd
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 24 Nov 2013 20:27:21 +0000
parents 59ee5817b194
children 2f285f20d617
comparison
equal deleted inserted replaced
184:4714fdfca39c 185:ec040f521cc2
16 void 16 void
17 process_msg_from_client(cli) 17 process_msg_from_client(cli)
18 struct client *cli; 18 struct client *cli;
19 { 19 {
20 int c; 20 int c;
21 char logmsg[128];
21 22
22 switch (cli->rx_buf[0]) { 23 switch (cli->rx_buf[0]) {
23 case CLI2RVI_WANT_RVTRACE: 24 case CLI2RVI_WANT_RVTRACE:
24 if (cli->rx_msglen != 9) { 25 if (cli->rx_msglen != 9) {
25 send_local_msg_to_client(cli, "-Bad command length"); 26 send_local_msg_to_client(cli, "-Bad command length");
35 cli->rx_buf[2] << 16 | 36 cli->rx_buf[2] << 16 |
36 cli->rx_buf[3] << 8 | cli->rx_buf[4]; 37 cli->rx_buf[3] << 8 | cli->rx_buf[4];
37 cli->int_rvt_match[c] = cli->rx_buf[5] << 24 | 38 cli->int_rvt_match[c] = cli->rx_buf[5] << 24 |
38 cli->rx_buf[6] << 16 | 39 cli->rx_buf[6] << 16 |
39 cli->rx_buf[7] << 8 | cli->rx_buf[8]; 40 cli->rx_buf[7] << 8 | cli->rx_buf[8];
41 sprintf(logmsg,
42 "*** Client program interested in RVT mask %08X match %08X",
43 cli->int_rvt_mask[c], cli->int_rvt_match[c]);
44 output_line(logmsg);
40 cli->int_rvt_count++; 45 cli->int_rvt_count++;
41 send_local_msg_to_client(cli, "+OK"); 46 send_local_msg_to_client(cli, "+OK");
42 return; 47 return;
43 case CLI2RVI_WANT_MUXPROTO: 48 case CLI2RVI_WANT_MUXPROTO:
44 if (cli->rx_msglen != 2) { 49 if (cli->rx_msglen != 2) {
48 if (cli->rx_buf[1] < 0x12 || cli->rx_buf[1] > 0x18) { 53 if (cli->rx_buf[1] < 0x12 || cli->rx_buf[1] > 0x18) {
49 send_local_msg_to_client(cli, 54 send_local_msg_to_client(cli,
50 "-Unsupported protocol MUX value"); 55 "-Unsupported protocol MUX value");
51 return; 56 return;
52 } 57 }
58 sprintf(logmsg,
59 "*** Client program interested in MUX proto %02X",
60 cli->rx_buf[1]);
61 output_line(logmsg);
53 cli->int_proto[cli->rx_buf[1] - 0x12] = 1; 62 cli->int_proto[cli->rx_buf[1] - 0x12] = 1;
54 send_local_msg_to_client(cli, "+OK"); 63 send_local_msg_to_client(cli, "+OK");
55 return; 64 return;
56 case CLI2RVI_PKT_TO_TARGET: 65 case CLI2RVI_PKT_TO_TARGET:
57 c = cli->rx_msglen - 1; 66 c = cli->rx_msglen - 1;