FreeCalypso > hg > freecalypso-sw
comparison rvinterf/lowlevel/clientcmd.c @ 180:59ee5817b194
rvinterf: packet sending implemented
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 23 Nov 2013 22:42:19 +0000 |
parents | 7ab6b29e76bb |
children | ec040f521cc2 |
comparison
equal
deleted
inserted
replaced
179:ebfa9657d03d | 180:59ee5817b194 |
---|---|
7 #include <string.h> | 7 #include <string.h> |
8 #include <strings.h> | 8 #include <strings.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
11 #include "../pktmux.h" | 11 #include "../pktmux.h" |
12 #include "../limits.h" | |
12 #include "../localsock.h" | 13 #include "../localsock.h" |
13 #include "client.h" | 14 #include "client.h" |
14 | 15 |
15 void | 16 void |
16 process_msg_from_client(cli) | 17 process_msg_from_client(cli) |
51 } | 52 } |
52 cli->int_proto[cli->rx_buf[1] - 0x12] = 1; | 53 cli->int_proto[cli->rx_buf[1] - 0x12] = 1; |
53 send_local_msg_to_client(cli, "+OK"); | 54 send_local_msg_to_client(cli, "+OK"); |
54 return; | 55 return; |
55 case CLI2RVI_PKT_TO_TARGET: | 56 case CLI2RVI_PKT_TO_TARGET: |
57 c = cli->rx_msglen - 1; | |
58 if (c < 1 || c > MAX_PKT_TO_TARGET) { | |
59 send_local_msg_to_client(cli, | |
60 "-Invalid Tx packet length"); | |
61 return; | |
62 } | |
63 send_pkt_to_target(cli->rx_buf + 1, c); | |
64 log_sent_packet(cli->rx_buf + 1, c); | |
65 return; | |
56 case CLI2RVI_RAWBYTES_TO_TARGET: | 66 case CLI2RVI_RAWBYTES_TO_TARGET: |
57 /* To be implemented */ | 67 /* To be implemented */ |
58 default: | 68 default: |
59 send_local_msg_to_client(cli, "-Unimplemented command"); | 69 send_local_msg_to_client(cli, "-Unimplemented command"); |
60 } | 70 } |