changeset 256:2f285f20d617

rvinterf: *.h moved into include subdir
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 04 Feb 2014 05:03:57 +0000
parents c33fb341faeb
children c413e791595a
files rvinterf/etm/abb.c rvinterf/etm/etmbasic.c rvinterf/etm/init.c rvinterf/etm/interf.c rvinterf/etm/pktsort.c rvinterf/etm/tmcore.c rvinterf/include/limits.h rvinterf/include/localsock.h rvinterf/include/pktmux.h rvinterf/limits.h rvinterf/localsock.h rvinterf/lowlevel/clientcmd.c rvinterf/lowlevel/format.c rvinterf/lowlevel/format_g23.c rvinterf/lowlevel/localsock.c rvinterf/lowlevel/logsent.c rvinterf/lowlevel/packetrx.c rvinterf/lowlevel/packettx.c rvinterf/lowlevel/pktfwd.c rvinterf/lowlevel/rvifmain.c rvinterf/lowlevel/rvtdump.c rvinterf/pktmux.h
diffstat 22 files changed, 149 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/etm/abb.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/etm/abb.c	Tue Feb 04 05:03:57 2014 +0000
@@ -7,8 +7,8 @@
 #include <string.h>
 #include <strings.h>
 #include <stdlib.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 #include "localtypes.h"
 #include "etm.h"
 
--- a/rvinterf/etm/etmbasic.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/etm/etmbasic.c	Tue Feb 04 05:03:57 2014 +0000
@@ -7,8 +7,8 @@
 #include <string.h>
 #include <strings.h>
 #include <stdlib.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 #include "etm.h"
 
 extern u_char rvi_msg[];
--- a/rvinterf/etm/init.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/etm/init.c	Tue Feb 04 05:03:57 2014 +0000
@@ -10,8 +10,8 @@
 #include <strings.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../pktmux.h"
-#include "../localsock.h"
+#include "../include/pktmux.h"
+#include "../include/localsock.h"
 
 extern char *socket_pathname;
 extern int sock;
--- a/rvinterf/etm/interf.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/etm/interf.c	Tue Feb 04 05:03:57 2014 +0000
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../localsock.h"
+#include "../include/localsock.h"
 
 extern int sock;
 
--- a/rvinterf/etm/pktsort.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/etm/pktsort.c	Tue Feb 04 05:03:57 2014 +0000
@@ -7,9 +7,9 @@
 #include <string.h>
 #include <strings.h>
 #include <stdlib.h>
-#include "../pktmux.h"
-#include "../limits.h"
-#include "../localsock.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
+#include "../include/localsock.h"
 #include "localtypes.h"
 #include "etm.h"
 
--- a/rvinterf/etm/tmcore.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/etm/tmcore.c	Tue Feb 04 05:03:57 2014 +0000
@@ -8,8 +8,8 @@
 #include <string.h>
 #include <strings.h>
 #include <stdlib.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 #include "localtypes.h"
 #include "etm.h"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/include/limits.h	Tue Feb 04 05:03:57 2014 +0000
@@ -0,0 +1,32 @@
+/*
+ * For sizing our buffers etc in the rvinterf suite, including the local
+ * UNIX domain socket protocol between rvinterf and fc-tmsh etc, we need
+ * to have some limits on the message sizes in both host->target and
+ * target->host directions.
+ *
+ * For the host->target direction, the choice of message size limit is
+ * easy: the packet Rx code in RVT on the target side also has a limit
+ * (quite naturally, as it needs to use a static buffer to reassemble
+ * incoming packets as they arrive at the UART in unpredictable interrupt-
+ * sized chunks), so we set our limit to match that in RVT.
+ */
+
+#define	MAX_PKT_TO_TARGET	255
+
+/*
+ * In the other direction (target->host), there is no fixed limit
+ * definition easily visible in the target fw code: any fw component
+ * can call rvt_send_trace_cpy() or rvt_mem_alloc() followed by
+ * rvt_send_trace_no_cpy(), or some higher-level API that reduces to
+ * these functions, with a message of any size, subject only to memory
+ * limits, which obviously aren't as strict as a #define'd maximum
+ * message size.  Hence in this direction we use our own arbitrary
+ * choice of size limit.
+ */
+
+#define	MAX_PKT_FROM_TARGET	512
+
+/*
+ * Both limit definitions above counts all bytes between the opening and
+ * closing STX flags, but not DLEs inserted for binary transparency.
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/include/localsock.h	Tue Feb 04 05:03:57 2014 +0000
@@ -0,0 +1,71 @@
+/*
+ * This header defines and describes (through comments) the local UNIX domain
+ * socket interface implemented between rvinterf and its clients like fc-tmsh.
+ *
+ * The UNIX domain sockets used for this ad hoc interface are of the
+ * SOCK_STREAM kind, but the true nature of the communication is message-based.
+ * We use the same trick that is used for DNS over TCP: every message in each
+ * direction is preceded by a 2-byte length.  This length is sent MSB first
+ * just like in DNS over TCP.  The limit on the size of these messages
+ * (for sizing buffers etc) is:
+ */
+
+#define	LOCALSOCK_MAX_MSG	1024
+
+/*
+ * Each message in the client->rvinterf direction (can be seen as command)
+ * begins (after the length) with an opcode byte as follows:
+ */
+
+#define	CLI2RVI_WANT_RVTRACE		0x00
+#define	CLI2RVI_WANT_MUXPROTO		0x01
+#define	CLI2RVI_PKT_TO_TARGET		0x02
+#define	CLI2RVI_RAWBYTES_TO_TARGET	0x03
+
+/*
+ * The first two commands (CLI2RVI_WANT_RVTRACE and CLI2RVI_WANT_MUXPROTO)
+ * are the means by which client programs inform rvinterf that they are
+ * interested in receiving copies of certain packets coming from the target.
+ *
+ * The CLI2RVI_WANT_RVTRACE opcode needs to be followed by a USEID mask value
+ * and a USEID match value, both in the network byte order, i.e., MSB first,
+ * for a total message length of 9 bytes.  For every RV trace message received
+ * from the target, rvinterf will iterate through all active clients to see who
+ * is interested: if the received USEID ANDed with the mask equals the match
+ * value, the message will be forwarded to that client.
+ *
+ * The CLI2RVI_WANT_MUXPROTO opcode needs to be followed by one byte
+ * identifying the RVTMUX protocol of interest, i.e., the first byte of the
+ * packets exchanged between the host and the target, e.g., 0x12 for L1 traces
+ * as defined in pktmux.h, for a total message length of 2 bytes.
+ *
+ * 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
+ * CLI2RVI_PKT_TO_TARGET (must not exceed MAX_PKT_TO_TARGET) is sent with the
+ * proper packet encapsulation per TI; bytes following
+ * CLI2RVI_RAWBYTES_TO_TARGET are sent raw.
+ */
+
+/*
+ * Each message in the rvinterf->client direction begins (after the length)
+ * with a message type byte as follows:
+ */
+
+#define	RVI2CLI_PKT_FROM_TARGET		0x00
+#define	RVI2CLI_LOCAL_CMD_RESP		0x01
+
+/*
+ * Messages beginning with RVI2CLI_PKT_FROM_TARGET are packets received
+ * from the target GSM device; the byte following this type code is the
+ * first byte of the packet from the target, e.g., 0x11 for RV traces or
+ * 0x12 for L1 traces.  Rvinterf will only start sending these messages
+ * to a client after that client has expressed interest in receiving
+ * target->host packets of a particular type.
+ *
+ * Messages beginning with RVI2CLI_LOCAL_CMD_RESP are generated locally
+ * by rvinterf itself as responses to commands, currently as responses to
+ * CLI2RVI_WANT_{RVTRACE,MUXPROTO}.  The byte following the
+ * RVT2CLI_LOCAL_CMD_RESP type code is ASCII '+' or ASCII '-', indicating
+ * success or error, respectively.  Any remaining bytes form a message
+ * for the user.
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/include/pktmux.h	Tue Feb 04 05:03:57 2014 +0000
@@ -0,0 +1,16 @@
+/*
+ * Definitions for the RVT MUX over-the-wire protocol
+ */
+
+#define	STX	0x02
+#define	DLE	0x10
+
+#define RVT_RV_HEADER        0x11
+#define RVT_L1_HEADER        0x12
+#define RVT_L23_HEADER       0x13
+#define RVT_TM_HEADER        0x14
+#define RVT_RNET_HEADER      0x15
+#define RVT_PROF_HEADER      0x16
+#define RVT_GTTBACK_HEADER   0x17
+#define RVT_OTHER_HEADER     0x18
+#define RVT_INVALID_HEADER   0xFF
--- a/rvinterf/limits.h	Mon Feb 03 06:35:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * For sizing our buffers etc in the rvinterf suite, including the local
- * UNIX domain socket protocol between rvinterf and fc-tmsh etc, we need
- * to have some limits on the message sizes in both host->target and
- * target->host directions.
- *
- * For the host->target direction, the choice of message size limit is
- * easy: the packet Rx code in RVT on the target side also has a limit
- * (quite naturally, as it needs to use a static buffer to reassemble
- * incoming packets as they arrive at the UART in unpredictable interrupt-
- * sized chunks), so we set our limit to match that in RVT.
- */
-
-#define	MAX_PKT_TO_TARGET	255
-
-/*
- * In the other direction (target->host), there is no fixed limit
- * definition easily visible in the target fw code: any fw component
- * can call rvt_send_trace_cpy() or rvt_mem_alloc() followed by
- * rvt_send_trace_no_cpy(), or some higher-level API that reduces to
- * these functions, with a message of any size, subject only to memory
- * limits, which obviously aren't as strict as a #define'd maximum
- * message size.  Hence in this direction we use our own arbitrary
- * choice of size limit.
- */
-
-#define	MAX_PKT_FROM_TARGET	512
-
-/*
- * Both limit definitions above counts all bytes between the opening and
- * closing STX flags, but not DLEs inserted for binary transparency.
- */
--- a/rvinterf/localsock.h	Mon Feb 03 06:35:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * This header defines and describes (through comments) the local UNIX domain
- * socket interface implemented between rvinterf and its clients like fc-tmsh.
- *
- * The UNIX domain sockets used for this ad hoc interface are of the
- * SOCK_STREAM kind, but the true nature of the communication is message-based.
- * We use the same trick that is used for DNS over TCP: every message in each
- * direction is preceded by a 2-byte length.  This length is sent MSB first
- * just like in DNS over TCP.  The limit on the size of these messages
- * (for sizing buffers etc) is:
- */
-
-#define	LOCALSOCK_MAX_MSG	1024
-
-/*
- * Each message in the client->rvinterf direction (can be seen as command)
- * begins (after the length) with an opcode byte as follows:
- */
-
-#define	CLI2RVI_WANT_RVTRACE		0x00
-#define	CLI2RVI_WANT_MUXPROTO		0x01
-#define	CLI2RVI_PKT_TO_TARGET		0x02
-#define	CLI2RVI_RAWBYTES_TO_TARGET	0x03
-
-/*
- * The first two commands (CLI2RVI_WANT_RVTRACE and CLI2RVI_WANT_MUXPROTO)
- * are the means by which client programs inform rvinterf that they are
- * interested in receiving copies of certain packets coming from the target.
- *
- * The CLI2RVI_WANT_RVTRACE opcode needs to be followed by a USEID mask value
- * and a USEID match value, both in the network byte order, i.e., MSB first,
- * for a total message length of 9 bytes.  For every RV trace message received
- * from the target, rvinterf will iterate through all active clients to see who
- * is interested: if the received USEID ANDed with the mask equals the match
- * value, the message will be forwarded to that client.
- *
- * The CLI2RVI_WANT_MUXPROTO opcode needs to be followed by one byte
- * identifying the RVTMUX protocol of interest, i.e., the first byte of the
- * packets exchanged between the host and the target, e.g., 0x12 for L1 traces
- * as defined in pktmux.h, for a total message length of 2 bytes.
- *
- * 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
- * CLI2RVI_PKT_TO_TARGET (must not exceed MAX_PKT_TO_TARGET) is sent with the
- * proper packet encapsulation per TI; bytes following
- * CLI2RVI_RAWBYTES_TO_TARGET are sent raw.
- */
-
-/*
- * Each message in the rvinterf->client direction begins (after the length)
- * with a message type byte as follows:
- */
-
-#define	RVI2CLI_PKT_FROM_TARGET		0x00
-#define	RVI2CLI_LOCAL_CMD_RESP		0x01
-
-/*
- * Messages beginning with RVI2CLI_PKT_FROM_TARGET are packets received
- * from the target GSM device; the byte following this type code is the
- * first byte of the packet from the target, e.g., 0x11 for RV traces or
- * 0x12 for L1 traces.  Rvinterf will only start sending these messages
- * to a client after that client has expressed interest in receiving
- * target->host packets of a particular type.
- *
- * Messages beginning with RVI2CLI_LOCAL_CMD_RESP are generated locally
- * by rvinterf itself as responses to commands, currently as responses to
- * CLI2RVI_WANT_{RVTRACE,MUXPROTO}.  The byte following the
- * RVT2CLI_LOCAL_CMD_RESP type code is ASCII '+' or ASCII '-', indicating
- * success or error, respectively.  Any remaining bytes form a message
- * for the user.
- */
--- a/rvinterf/lowlevel/clientcmd.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/clientcmd.c	Tue Feb 04 05:03:57 2014 +0000
@@ -8,9 +8,9 @@
 #include <strings.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../pktmux.h"
-#include "../limits.h"
-#include "../localsock.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
+#include "../include/localsock.h"
 #include "client.h"
 
 void
--- a/rvinterf/lowlevel/format.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/format.c	Tue Feb 04 05:03:57 2014 +0000
@@ -7,8 +7,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <strings.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 
 extern u_char rxpkt[];
 extern size_t rxpkt_len;
--- a/rvinterf/lowlevel/format_g23.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/format_g23.c	Tue Feb 04 05:03:57 2014 +0000
@@ -12,8 +12,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <strings.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 
 extern u_char rxpkt[];
 extern size_t rxpkt_len;
--- a/rvinterf/lowlevel/localsock.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/localsock.c	Tue Feb 04 05:03:57 2014 +0000
@@ -10,7 +10,7 @@
 #include <strings.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../localsock.h"
+#include "../include/localsock.h"
 #include "client.h"
 
 int listener;
--- a/rvinterf/lowlevel/logsent.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/logsent.c	Tue Feb 04 05:03:57 2014 +0000
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <strings.h>
-#include "../limits.h"
+#include "../include/limits.h"
 
 log_sent_packet(pkt, pktlen)
 	u_char *pkt;
--- a/rvinterf/lowlevel/packetrx.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/packetrx.c	Tue Feb 04 05:03:57 2014 +0000
@@ -6,8 +6,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 
 extern int target_fd;
 
--- a/rvinterf/lowlevel/packettx.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/packettx.c	Tue Feb 04 05:03:57 2014 +0000
@@ -9,8 +9,8 @@
 #include <strings.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../pktmux.h"
-#include "../limits.h"
+#include "../include/pktmux.h"
+#include "../include/limits.h"
 
 extern int target_fd;
 extern int wakeup_after_sec;
--- a/rvinterf/lowlevel/pktfwd.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/pktfwd.c	Tue Feb 04 05:03:57 2014 +0000
@@ -9,8 +9,8 @@
 #include <strings.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include "../pktmux.h"
-#include "../localsock.h"
+#include "../include/pktmux.h"
+#include "../include/localsock.h"
 #include "client.h"
 
 extern u_char rxpkt[];
--- a/rvinterf/lowlevel/rvifmain.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/rvifmain.c	Tue Feb 04 05:03:57 2014 +0000
@@ -11,8 +11,8 @@
 #include <unistd.h>
 #include <signal.h>
 #include <time.h>
-#include "../pktmux.h"
-#include "../localsock.h"
+#include "../include/pktmux.h"
+#include "../include/localsock.h"
 #include "client.h"
 
 extern int target_fd, listener;
--- a/rvinterf/lowlevel/rvtdump.c	Mon Feb 03 06:35:29 2014 +0000
+++ b/rvinterf/lowlevel/rvtdump.c	Tue Feb 04 05:03:57 2014 +0000
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <time.h>
-#include "../pktmux.h"
+#include "../include/pktmux.h"
 
 extern int target_fd;
 extern char *baudrate_name;
--- a/rvinterf/pktmux.h	Mon Feb 03 06:35:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-/*
- * Definitions for the RVT MUX over-the-wire protocol
- */
-
-#define	STX	0x02
-#define	DLE	0x10
-
-#define RVT_RV_HEADER        0x11
-#define RVT_L1_HEADER        0x12
-#define RVT_L23_HEADER       0x13
-#define RVT_TM_HEADER        0x14
-#define RVT_RNET_HEADER      0x15
-#define RVT_PROF_HEADER      0x16
-#define RVT_GTTBACK_HEADER   0x17
-#define RVT_OTHER_HEADER     0x18
-#define RVT_INVALID_HEADER   0xFF