# HG changeset patch # User Space Falcon # Date 1432880978 0 # Node ID a5c8f48003cdab2c9bfa3ba26940c771cad6f81f # Parent 2682003dcba701e98c9173d68ed7c48703c9eb6f rvinterf: client programs can now selectively stop receiving packets of a particular RVTMUX type diff -r 2682003dcba7 -r a5c8f48003cd rvinterf/include/localsock.h --- a/rvinterf/include/localsock.h Fri May 29 06:16:02 2015 +0000 +++ b/rvinterf/include/localsock.h Fri May 29 06:29:38 2015 +0000 @@ -22,6 +22,7 @@ #define CLI2RVI_PKT_TO_TARGET 0x02 #define CLI2RVI_RAWBYTES_TO_TARGET 0x03 #define CLI2RVI_RESET_PACKET_RX 0x04 +#define CLI2RVI_DROP_MUXPROTO 0x05 /* * The first two commands (CLI2RVI_WANT_RVTRACE and CLI2RVI_WANT_MUXPROTO) @@ -42,7 +43,10 @@ * * The CLI2RVI_RESET_PACKET_RX opcode resets the "interests" previously set * with CLI2RVI_WANT_RVTRACE and/or CLI2RVI_WANT_MUXPROTO. It is a "blanket" - * reset; the command message consists of just the opcode. + * reset; the command message consists of just the opcode. The + * CLI2RVI_DROP_MUXPROTO command is more specific and undoes the effect of a + * previous CLI2RVI_WANT_MUXPROTO; it needs to be followed by one byte + * identifying the RVTMUX protocol in question, just like CLI2RVI_WANT_MUXPROTO. * * The last two commands (CLI2RVI_PKT_TO_TARGET and CLI2RVI_RAWBYTES_TO_TARGET) * cause data payload to be sent to the target serial port. Payload following diff -r 2682003dcba7 -r a5c8f48003cd rvinterf/lowlevel/clientcmd.c --- a/rvinterf/lowlevel/clientcmd.c Fri May 29 06:16:02 2015 +0000 +++ b/rvinterf/lowlevel/clientcmd.c Fri May 29 06:29:38 2015 +0000 @@ -53,6 +53,19 @@ cli->int_proto[cli->rx_buf[1] - 0x12] = 1; send_local_msg_to_client(cli, "+OK"); return; + case CLI2RVI_DROP_MUXPROTO: + if (cli->rx_msglen != 2) { + send_local_msg_to_client(cli, "-Bad command length"); + return; + } + if (cli->rx_buf[1] < 0x12 || cli->rx_buf[1] > 0x1B) { + send_local_msg_to_client(cli, + "-Unsupported protocol MUX value"); + return; + } + cli->int_proto[cli->rx_buf[1] - 0x12] = 0; + send_local_msg_to_client(cli, "+OK"); + return; case CLI2RVI_RESET_PACKET_RX: cli->int_rvt_count = 0; bzero(cli->int_proto, sizeof(cli->int_proto));